Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2109.08158 · PRX Quantum

Quantum Lego: Building Quantum Error Correction Codes from Tensor Networks

ChunJun Cao, Brad Lackey

Published May 11, 2022• 36 citations
arXivHTMLPDF

Abstract

We introduce a flexible and graphically intuitive framework that constructs complex quantum error correction codes from simple codes or states, generalizing code concatenation.More specifically, we represent the complex code constructions as tensor networks built from the tensors of simple codes or states in a modular fashion.Using a set of local moves known as operator pushing, one can derive properties of the more complex codes, such as transversal non-Clifford gates, by tracing the flow of operators in the network.The framework endows a network geometry to any code it builds and is valid for constructing stabilizer codes as well as nonstabilizer codes over qubits and qudits.For a contractible tensor network, the sequence of contractions also constructs a decoding or encoding circuit.To highlight the framework's range of capabilities and to provide a tutorial, we lay out some examples where we glue together simple stabilizer codes to construct nontrivial codes.These examples include the toric code and its variants, a holographic code with transversal non-Clifford operators, a three-dimensional stabilizer code, and other stabilizer codes with interesting properties.Surprisingly, we find that the surface code is equivalent to the two-dimensional Bacon-Shor code after "dualizing" its tensor-network encoding map.

DOI
10.1103/prxquantum.3.020332

Related papers

Quantum Lego Expansion Pack: Enumerators from Tensor Networks

ChunJun Cao, Michael J. Gullans, Brad Lackey +1 more

We provide the first tensor-network method for computing quantum weight enumerator polynomials in the most general form. If a quantum code has a known tensor-network construction of its encoding map, our method is far more efficient, and in some cases exponentially faster than the existing approach. As a corollary, it produces decoders and an algorithm that computes the code distance. For non-(Pauli)-stabilizer codes, this constitutes the current best algorithm for computing the code distance. For degenerate stabilizer codes, it can be substantially faster compared to the current methods. We also introduce novel weight enumerators and their applications. In particular, we show that these enumerators can be used to compute logical error rates exactly and thus construct (optimal) decoders for any independent and identically distributed single qubit or qudit error channels. The enumerators also provide a more efficient method for computing nonstabilizerness in quantum many-body states. As the power for these speedups rely on a quantum Lego decomposition of quantum codes, we further provide systematic methods for decomposing quantum codes and graph states into a modular construction for which our technique applies. As a proof of principle, we perform exact analyses of the deformed surface codes, the holographic pentagon code, and the two-dimensional Bacon-Shor code under (biased) Pauli noise and limited instances of coherent error at sizes that are inaccessible by brute force. Published by the American Physical Society 2024

arXiv:2308.05152•PRX Quantum•Jul 22, 2024•18 citations

Quantum Lego Power-up: Designing Transversal Gates with Tensor Networks

ChunJun Cao, Brad Lackey

Transversal gates are the simplest form of fault-tolerant gates and are relatively easy to implement in practice. Yet designing codes that support useful transversal operations -- especially non-Clifford or addressable gates -- remains difficult within the stabilizer formalism or CSS constructions alone. We show that these limitations can be overcome using tensor-network frameworks such as the quantum lego formalism, where transversal gates naturally appear as global or localized symmetries. Within the quantum lego formalism, small codes carrying desirable symmetries can be "glued" into larger ones, with operator-flow rules guiding how logical symmetries are preserved. This approach enables the systematic construction of codes with addressable transversal single- and multi-qubit gates targeting specific logical qubits regardless of whether the gate is Clifford or not. As a proof of principle, we build new finite-rate code families that support strongly transversal $T$, $CCZ$, $SH$, and Gottesman's $K_3$ gates, structures that are challenging to realize with conventional methods. We further construct holographic and fractal-like codes that admit addressable transversal inter-, meso-, and intra-block $T$, $CS$, and $C^\ell Z$ gates. As a corollary, we demonstrate that the heterogeneous holographic Steane-Reed-Muller black hole code also supports fully addressable transversal inter- and intra-block $CZ$ gates, significantly lowering the overhead for universal fault-tolerant computation.

quant-pharXiv:2603.03542•Mar 5, 2026•0 citations

Quantum Lego and XP Stabilizer Codes

Ruohan Shen, Yixu Wang, ChunJun Cao

We apply the recent graphical framework of "Quantum Lego" to XP stabilizer codes where the stabilizer group is generally non-Abelian. We show that the idea of operator matching continues to hold for such codes and is sufficient for generating all their XP symmetries provided the resulting code is XP. We provide an efficient classical algorithm for tracking these symmetries under tensor contraction or conjoining. This constitutes a partial extension of the algorithm implied by the Gottesman-Knill theorem beyond Pauli stabilizer states and Clifford operations. Because conjoining transformations generate quantum operations that are universal, the XP symmetries obtained from these algorithms do not uniquely identify the resulting tensors in general. Using this extended framework, we provide examples of novel XP stabilizer codes with a higher distance than existing non-trivial XP regular codes and a [[8,1,2]] Pauli stabilizer code with a fault-tolerant T gate. For XP regular codes, we also construct a tensor-network-based maximum likelihood decoder for any independently and identically distributed single qubit error channel using weight enumerators.

arXiv:2310.19538•Quantum•Oct 6, 2025•3 citations

Quantum Logic Codes: Complete Transversal Logical Clifford Instruction Sets for High-Rate Stabilizer Quantum Error Correcting Codes

Adam Holmes

We study the structure and transversal logical capabilities of stabilizer quantum error correcting codes. Among our results, we identify universal lower bounds on circuit depth to generate a full logical Clifford algebra, and develop novel constructions of logical transversal gates including a new depth-one transversal phase $\mathrm{\overline{S}}$ gate in the rotated surface code and a depth-one intra-block $\mathrm{\overline{CZ}}$ gate in the 2D-toric code that generalizes to all odd distances and all lengths $L\ge3$, respectively. Finally, we construct a high-rate non-LDPC CSS code family with parameters $[[n,\sqrt{n},Θ({n^β})]]$ where $β\approx 0.2823$ in one demonstrated case, that provably possesses a constant-depth complete 2-local transversal logical Clifford basis instruction set architecture (ISA) composed of all individually targeted $\mathrm{\overline{S}}$, $\mathrm{\overline{SHS}} = \sqrt{X}$, and $\mathrm{\overline{CZ}}$ gates. This ISA is depth-one for certain subfamilies that we design and generally constant-depth under certain conditions. The code family is built from a small code with parameters $[[n_0, 2, d_0]]$, and is tunable in the standard way: it tiles out to form utility-scale logical qubit counts, and it scales up through concatenation to achieve higher distances and error suppression. We show that this construction preserves the depth-one complete transversal logical Clifford basis ISA when composed with these commuting construction actions, inheriting structure from the core codes so that at scale the complete logical Clifford basis ISA remains depth-one up to depth-two addressable operations between tiled cores. We call these Quantum Logic Codes.

quant-pharXiv:2606.13521•Jun 12, 2026•0 citations

Local tensor-network codes

Terry Farrelly, David K. Tuckett, Thomas M. Stace

Abstract Tensor-network codes enable the construction of large stabilizer codes out of tensors describing smaller stabilizer codes. An application of tensor-network codes was an efficient and exact decoder for holographic codes. Here, we show how to write some topological codes, including the surface code and colour code, as simple tensor-network codes. We also show how to calculate distances of stabilizer codes by contracting a tensor network. The algorithm actually gives more information, including a histogram of all logical coset weights. We prove that this method is efficient in the case of stabilizer codes encoded via local log-depth circuits in one dimension and holographic codes. Using our tensor-network distance calculator, we find a modification of the rotated surface code that has the same distance but fewer minimum-weight logical operators by ‘doping’ the tensor network, i.e., we break the homogeneity of the tensor network by locally replacing tensors. For this example, this corresponds to an improvement in successful error correction of almost 2% against depolarizing noise (in the perfect-measurement setting), but comes at the cost of introducing three higher-weight stabilizers. Our general construction lets us pick a network geometry (e.g., a Euclidean lattice in the case of the surface code), and, using only a small set of seed codes (constituent tensors), build extensive codes with the potential for optimisation.

arXiv:2109.11996•New Journal of Physics•Mar 16, 2022•11 citations

Approximate Bacon-Shor code and holography

ChunJun Cao

We explicitly construct a class of holographic quantum error correction codes with non-trivial centers in the code subalgebra. Specifically, we use the Bacon-Shor codes and perfect tensors to construct a gauge code (or a stabilizer code with gauge-fixing), which we call the holographic hybrid code. This code admits a local log-depth encoding/decoding circuit, and can be represented as a holographic tensor network which satisfies an analog of the Ryu-Takayanagi formula and reproduces features of the sub-region duality. We then construct approximate versions of the holographic hybrid codes by “skewing” the code subspace, where the size of skewing is analogous to the size of the gravitational constant in holography. These approximate hybrid codes are not necessarily stabilizer codes, but they can be expressed as the superposition of holographic tensor networks that are stabilizer codes. For such constructions, different logical states, representing different bulk matter content, can “back-react” on the emergent geometry, resembling a key feature of gravity. The locality of the bulk degrees of freedom becomes subspace-dependent and approximate. Such subspace-dependence is manifest from the point of view of the “entanglement wedge” and bulk operator reconstruction from the boundary. Exact complementary error correction breaks down for certain bipartition of the boundary degrees of freedom; however, a limited, state-dependent form is preserved for particular subspaces. We also construct an example where the connected two-point correlation functions can have a power-law decay. Coupled with known constraints from holography, a weakly back-reacting bulk also forces these skewed tensor network models to the “large N limit” where they are built by concatenating a large N number of copies.

•Jul 10, 2023•19 citations
We introduce a flexible and graphically intuitive framework that constructs complex quantum error correction codes from simple codes or states, generalizing code concatenation.More specifically, we represent the complex code constructions as tensor networks built from the tensors of simple codes or states in a modular fashion.Using a set of local moves known as operator pushing, one can derive properties of the more complex codes, such as transversal non-Clifford gates, by tracing the flow of operators in the network.The framework endows a network geometry to any code it builds and is valid for constructing stabilizer codes as well as nonstabilizer codes over qubits and qudits.For a contractible tensor network, the sequence of contractions also constructs a decoding or encoding circuit.To highlight the framework's range of capabilities and to provide a tutorial, we lay out some examples where we glue together simple stabilizer codes to construct nontrivial codes.These examples include the toric code and its variants, a holographic code with transversal non-Clifford operators, a three-dimensional stabilizer code, and other stabilizer codes with interesting properties.Surprisingly, we find that the surface code is equivalent to the two-dimensional Bacon-Shor code after "dualizing" its tensor-network encoding map.
We provide the first tensor-network method for computing quantum weight enumerator polynomials in the most general form. If a quantum code has a known tensor-network construction of its encoding map, our method is far more efficient, and in some cases exponentially faster than the existing approach. As a corollary, it produces decoders and an algorithm that computes the code distance. For non-(Pauli)-stabilizer codes, this constitutes the current best algorithm for computing the code distance. For degenerate stabilizer codes, it can be substantially faster compared to the current methods. We also introduce novel weight enumerators and their applications. In particular, we show that these enumerators can be used to compute logical error rates exactly and thus construct (optimal) decoders for any independent and identically distributed single qubit or qudit error channels. The enumerators also provide a more efficient method for computing nonstabilizerness in quantum many-body states. As the power for these speedups rely on a quantum Lego decomposition of quantum codes, we further provide systematic methods for decomposing quantum codes and graph states into a modular construction for which our technique applies. As a proof of principle, we perform exact analyses of the deformed surface codes, the holographic pentagon code, and the two-dimensional Bacon-Shor code under (biased) Pauli noise and limited instances of coherent error at sizes that are inaccessible by brute force. Published by the American Physical Society 2024
Transversal gates are the simplest form of fault-tolerant gates and are relatively easy to implement in practice. Yet designing codes that support useful transversal operations -- especially non-Clifford or addressable gates -- remains difficult within the stabilizer formalism or CSS constructions alone. We show that these limitations can be overcome using tensor-network frameworks such as the quantum lego formalism, where transversal gates naturally appear as global or localized symmetries. Within the quantum lego formalism, small codes carrying desirable symmetries can be "glued" into larger ones, with operator-flow rules guiding how logical symmetries are preserved. This approach enables the systematic construction of codes with addressable transversal single- and multi-qubit gates targeting specific logical qubits regardless of whether the gate is Clifford or not. As a proof of principle, we build new finite-rate code families that support strongly transversal TTT, CCZCCZCCZ, SHSHSH, and Gottesman's K3K_3K3​ gates, structures that are challenging to realize with conventional methods. We further construct holographic and fractal-like codes that admit addressable transversal inter-, meso-, and intra-block TTT, CSCSCS, and CℓZC^\ell ZCℓZ gates. As a corollary, we demonstrate that the heterogeneous holographic Steane-Reed-Muller black hole code also supports fully addressable transversal inter- and intra-block CZCZCZ gates, significantly lowering the overhead for universal fault-tolerant computation.
We apply the recent graphical framework of "Quantum Lego" to XP stabilizer codes where the stabilizer group is generally non-Abelian. We show that the idea of operator matching continues to hold for such codes and is sufficient for generating all their XP symmetries provided the resulting code is XP. We provide an efficient classical algorithm for tracking these symmetries under tensor contraction or conjoining. This constitutes a partial extension of the algorithm implied by the Gottesman-Knill theorem beyond Pauli stabilizer states and Clifford operations. Because conjoining transformations generate quantum operations that are universal, the XP symmetries obtained from these algorithms do not uniquely identify the resulting tensors in general. Using this extended framework, we provide examples of novel XP stabilizer codes with a higher distance than existing non-trivial XP regular codes and a [[8,1,2]] Pauli stabilizer code with a fault-tolerant T gate. For XP regular codes, we also construct a tensor-network-based maximum likelihood decoder for any independently and identically distributed single qubit error channel using weight enumerators.
We study the structure and transversal logical capabilities of stabilizer quantum error correcting codes. Among our results, we identify universal lower bounds on circuit depth to generate a full logical Clifford algebra, and develop novel constructions of logical transversal gates including a new depth-one transversal phase S‾\mathrm{\overline{S}}S gate in the rotated surface code and a depth-one intra-block CZ‾\mathrm{\overline{CZ}}CZ gate in the 2D-toric code that generalizes to all odd distances and all lengths L≥3L\ge3L≥3, respectively. Finally, we construct a high-rate non-LDPC CSS code family with parameters [[n,n,Θ(nβ)]][[n,\sqrt{n},Θ({n^β})]][[n,n​,Θ(nβ)]] where β≈0.2823β\approx 0.2823β≈0.2823 in one demonstrated case, that provably possesses a constant-depth complete 2-local transversal logical Clifford basis instruction set architecture (ISA) composed of all individually targeted S‾\mathrm{\overline{S}}S, SHS‾=X\mathrm{\overline{SHS}} = \sqrt{X}SHS=X​, and CZ‾\mathrm{\overline{CZ}}CZ gates. This ISA is depth-one for certain subfamilies that we design and generally constant-depth under certain conditions. The code family is built from a small code with parameters [[n0,2,d0]][[n_0, 2, d_0]][[n0​,2,d0​]], and is tunable in the standard way: it tiles out to form utility-scale logical qubit counts, and it scales up through concatenation to achieve higher distances and error suppression. We show that this construction preserves the depth-one complete transversal logical Clifford basis ISA when composed with these commuting construction actions, inheriting structure from the core codes so that at scale the complete logical Clifford basis ISA remains depth-one up to depth-two addressable operations between tiled cores. We call these Quantum Logic Codes.
Abstract Tensor-network codes enable the construction of large stabilizer codes out of tensors describing smaller stabilizer codes. An application of tensor-network codes was an efficient and exact decoder for holographic codes. Here, we show how to write some topological codes, including the surface code and colour code, as simple tensor-network codes. We also show how to calculate distances of stabilizer codes by contracting a tensor network. The algorithm actually gives more information, including a histogram of all logical coset weights. We prove that this method is efficient in the case of stabilizer codes encoded via local log-depth circuits in one dimension and holographic codes. Using our tensor-network distance calculator, we find a modification of the rotated surface code that has the same distance but fewer minimum-weight logical operators by ‘doping’ the tensor network, i.e., we break the homogeneity of the tensor network by locally replacing tensors. For this example, this corresponds to an improvement in successful error correction of almost 2% against depolarizing noise (in the perfect-measurement setting), but comes at the cost of introducing three higher-weight stabilizers. Our general construction lets us pick a network geometry (e.g., a Euclidean lattice in the case of the surface code), and, using only a small set of seed codes (constituent tensors), build extensive codes with the potential for optimisation.
We explicitly construct a class of holographic quantum error correction codes with non-trivial centers in the code subalgebra. Specifically, we use the Bacon-Shor codes and perfect tensors to construct a gauge code (or a stabilizer code with gauge-fixing), which we call the holographic hybrid code. This code admits a local log-depth encoding/decoding circuit, and can be represented as a holographic tensor network which satisfies an analog of the Ryu-Takayanagi formula and reproduces features of the sub-region duality. We then construct approximate versions of the holographic hybrid codes by “skewing” the code subspace, where the size of skewing is analogous to the size of the gravitational constant in holography. These approximate hybrid codes are not necessarily stabilizer codes, but they can be expressed as the superposition of holographic tensor networks that are stabilizer codes. For such constructions, different logical states, representing different bulk matter content, can “back-react” on the emergent geometry, resembling a key feature of gravity. The locality of the bulk degrees of freedom becomes subspace-dependent and approximate. Such subspace-dependence is manifest from the point of view of the “entanglement wedge” and bulk operator reconstruction from the boundary. Exact complementary error correction breaks down for certain bipartition of the boundary degrees of freedom; however, a limited, state-dependent form is preserved for particular subspaces. We also construct an example where the connected two-point correlation functions can have a power-law decay. Coupled with known constraints from holography, a weakly back-reacting bulk also forces these skewed tensor network models to the “large N limit” where they are built by concatenating a large N number of copies.