Color Codes
A two-dimensional color code puts a qubit at each vertex of a suitable three-colored lattice and measures both an check and a check on each face. The geometry makes logical operators deformable, while the matched check supports permit useful transversal Clifford gates. A seven-qubit triangular patch makes these ideas concrete: it is the Steane code drawn so that its faces, boundaries, and phase-gate pattern become visible.
We develop this small patch first, then explain which features extend to larger patches and closed surfaces. Throughout, checks have eigenvalue in the code space. Claims about distance refer to ideal Pauli errors on data qubits; noisy measurement circuits require an additional analysis.
Required background. Stabilizer Formalism explains signed checks and logical Pauli operators. CSS Codes supplies binary check matrices and their row spaces.
Helpful background. Steane Code develops the same seven-qubit code from classical coding theory. Surface Code gives a comparison with another local two-dimensional family.
Face Checks on a Seven-Qubit Triangle
Section titled “Face Checks on a Seven-Qubit Triangle”Each face in the diagram supplies two observables. For example, the face labeled supplies and . The labels stand for red, green, and blue, but are combinatorial names: they distinguish faces, not physical Pauli axes. Grayscale shading makes the same distinction in the figure.
Every face supplies an check and a check. The bold side supports or , a logical operator of weight three. Filled vertices receive and open vertices receive in the phase-gate construction below. Face labels and vertex numbers fix the geometry without requiring color vision.
The three supports are
Write and . The six generators are . Opposite Pauli types anticommute once for each shared vertex, so
A face overlaps itself on four vertices; distinct faces overlap on two. Every sign is therefore positive. This even-overlap calculation is the reason the measurements are compatible.
Let be the face–vertex incidence matrix, with columns numbered from one to seven:
The binary relation expresses the same commutation property. Its three rows are independent, giving six independent stabilizer constraints and
Thus the common eigenspace has dimension two. The seven physical qubits store one logical qubit, not seven copies of its unknown state.
Choose the logical representatives
Both commute with every weight-four face check. They anticommute with each other because their common support has odd size. Multiplying either by a same-type face check removes that face from its support. For instance,
On a code state, acts as the identity, so the short side and the all-seven product perform the same logical operation. The other two faces produce the sides and . The corresponding products behave identically.
This is exactly the Steane stabilizer after a coordinate permutation: color-code vertices correspond respectively to Steane-page positions . The normalized basis states can therefore be used after that relabeling. Bombín and Martín-Delgado’s color-code construction supplies the geometric interpretation and scalable families.
Syndromes, Logical Deformations, and Distance
Section titled “Syndromes, Logical Deformations, and Distance”Use the binary error label , ignoring its scalar phase for syndrome calculations. List the -check bits first and the -check bits second:
A bit is one when the corresponding outcome is . If denotes column of , then produces , produces , and produces .
| Vertex | Column in face order |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 |
For example, flips all three -face outcomes, whereas flips only the outcome. These patterns reflect the central vertex and boundary corner in the drawing. The seven columns are distinct and nonzero, so all 21 single-qubit Pauli errors have distinct nonzero syndromes.
The same observation proves the lower bound on distance. A weight-one binary vector cannot be in because no column vanishes. A weight-two vector cannot be in because no two columns are equal. For a Pauli of total weight at most two to commute with all checks, both and would have to be such kernel vectors. Both must therefore vanish.
The boundary product is a nontrivial commuting Pauli of weight three, establishing
It is nontrivial because it anticommutes with . The proof concerns the full Pauli distance, including mixed errors; it does not just count the length of a drawn side.
Same syndrome can mean different logical action
Section titled “Same syndrome can mean different logical action”Consider and . Their syndromes agree because over . A decoder choosing the single-error correction succeeds on the first error but leaves on the code after the second. No measurement of these checks can distinguish the two errors by itself.
By contrast, multiplying any error by a stabilizer leaves both its syndrome and its action on encoded information unchanged. Decoding should therefore choose a logical class, accounting for the probabilities of all errors in that class. Selecting one most likely microscopic error and selecting the most likely class are different optimization problems.
What the colored boundaries mean
Section titled “What the colored boundaries mean”In a larger color-code lattice, a colored string is defined on a corresponding shrunk lattice: faces of one color become vertices, and suitable connections join them. Such a string may end on the boundary of that color. The boundary label specifies an allowed endpoint, not a Pauli axis. Multiplying face checks moves strings through the lattice without changing their logical action.
Color codes also admit branching string nets, in which three colored pieces join. Their local intersections must still satisfy the stabilizer commutation conditions. The three sides of this small patch are equivalent logical representatives; they are not three separate logical qubits. More generally, boundary conditions decide which deformations are allowed and which extended operators are nontrivial. An arbitrary cut through a closed lattice need not retain commuting checks or the intended encoded dimension.
Larger Lattices and the Closed-Surface Count
Section titled “Larger Lattices and the Closed-Surface Count”The usual closed construction uses a connected trivalent lattice on an orientable surface, with faces properly three-colored. “Trivalent” means that three edges meet at each vertex. One face of each color meets there. Face boundaries have even length, and the standard cellulations have even overlap between every pair of face supports. Putting paired and checks on those supports again gives a CSS code.
For a regular growing family, face sizes and the number of checks touching a qubit stay bounded. This is the sparse-check property of a quantum LDPC code. Bounded check weight is useful for measurement circuits, but says nothing by itself about the encoding rate or physical gate error rate.
Let count vertices, edges, and faces on a closed surface of genus . Trivalence and Euler’s relation give
and hence . There is an important dependency among checks: the product of all red faces equals the product of all green faces and also the product of all blue faces. Each is the all-vertex operator, since every vertex belongs to exactly one face of each color. There are two independent relations per Pauli sector.
For the standard connected closed construction, these are the only dependencies, so each sector has rank . Therefore
A sphere encodes no logical qubit; a torus encodes four. This closed-surface formula cannot be applied to a triangular patch by setting : removing checks and introducing colored boundaries changes the rank relations. The seven-qubit patch’s direct calculation already gave .
On familiar planar triangular families, grows proportionally to area and grows proportionally to linear size, while . Thus and tends to zero. Precise qubit counts depend on the tiling and boundary construction. The smallest triangle alone does not establish an asymptotic scaling law.
Color-code and surface-code structures are closely related. Kubica, Yoshida, and Pastawski prove local Clifford equivalences; in two dimensions a closed color code unfolds into two toric-code copies. Bounded versions require their prescribed boundaries and gluing. These transformations preserve encoded information, but do not identify every physical noise model or measurement circuit. A local Clifford can turn an independent physical error into a correlated error on the transformed qubits.
Transversal Clifford Gates and Their Signs
Section titled “Transversal Clifford Gates and Their Signs”The equal - and -check supports make bitwise Hadamard particularly simple: exchanges with , and exchanges with . It implements logical Hadamard. A generic CSS code with unequal check spaces need not have this property.
Between two identically labeled blocks, coordinatewise CNOT also implements logical CNOT. Physical propagation sends a control to the product of that check on both blocks and sends a target to the analogous product. The logical representatives transform in the same way. These operations are transversal: no elementary gate couples two qubits within one block. This restricts error spread, although preparation, check extraction, and recovery still need their own fault-tolerant circuits.
Alternating phase gates
Section titled “Alternating phase gates”For the figure’s filled and open vertices, set
and apply on , with on :
The two single-qubit conjugations are
Each face has two filled and two open vertices. The resulting phase is , so
The positive stabilizer group is preserved. On the all-seven logical , however, there are four filled and three open vertices. Consequently,
Thus implements logical . The factor matters: is Hermitian, whereas is not. Uniform preserves this particular code but implements logical , because .
For a general face of even weight , uniform produces a sign . It preserves a positive face check in this way only when is divisible by four. A weight-six face gives a minus sign. On a bipartite patch where every face alternates between equal numbers of and vertices, the alternating operation cancels the phases for every face. The global logical phase must still be calculated for the chosen logical representatives.
Why Clifford gates are not a universal set
Section titled “Why Clifford gates are not a universal set”Hadamard, phase, CNOT, and Pauli gates generate the Clifford group. A non-Clifford resource is still required for universal computation, for example through state injection and protected gates.
For growing two-dimensional local stabilizer codes with sufficiently large distance, the Bravyi–König theorem restricts code-preserving constant-depth circuits of bounded geometric range to logical Clifford operations. “Constant depth” means bounded independently of code size; it does not mean any finite circuit on seven qubits. Higher-dimensional color codes and gauge fixing use different constructions and assumptions. They do not add a universal transversal gate set to the unchanged two-dimensional patch.
Decoding with Correlated Face Outcomes
Section titled “Decoding with Correlated Face Outcomes”At an interior vertex, one error can flip three -face checks. This differs from the two endpoints of a bulk surface-code error chain. Three clicks need not mean three independent faults. Our central vertex gives the smallest exact illustration: simultaneously produces .
Delfosse’s projection decoder relates color-code decoding to surface-code problems. The projected corrections must be combined and lifted to a valid correction on the original vertices. Their correlations and possible logical classes matter; independently choosing corrections in several projections does not automatically solve the original maximum-likelihood problem.
With perfect checks, this is a data-error decoding problem. With repeated faulty measurements, a decoder instead receives changes in reported check outcomes over time. A phenomenological model assigns noise directly to data and reports. A circuit model specifies faults in the gates, ancillas, measurements, and resets that generate those reports. An ancilla fault can spread through a multi-qubit face measurement and create a correlated data error. The syndrome-measurement discussion explains why the measurement schedule is part of this analysis.
Neither ideal transversal gates nor a finite code distance establishes a threshold or ranks hardware architectures. Larger face checks can increase extraction cost; favorable logical gates can reduce other costs. Comparisons must use the same task, noise assumptions, retained measurement rounds, and total qubit resources. Repeated active correction also differs from passive protection by a Hamiltonian: a commuting-check energy gap alone does not establish a self-correcting memory at nonzero temperature. See Topological Codes for that distinction, and Error-Correction Case Studies for experimental comparisons.
Exercises
Section titled “Exercises”1. Establish the small patch’s parameters
Section titled “1. Establish the small patch’s parameters”Use to prove and , including errors with mixed Pauli types.
Solution
The first row is isolated by column one; after removing it, column two isolates the second, and the third is nonzero. Hence the rank is three. Even row weights and even pairwise overlaps give , so . Distinct nonzero columns exclude every nonzero kernel vector of weight one or two. A normalizing Pauli of total weight below three would require both binary components to be such vectors, so it is the identity up to phase. The commuting anticommutes with , proving that it is a nontrivial weight-three logical operator. Therefore .
2. Deform a logical operator and distinguish an error
Section titled “2. Deform a logical operator and distinguish an error”Show that and implement the same logical action. Then compare errors and .
Solution
The first logical representative is and the second is . Their product is , a stabilizer. The two errors have the same syndrome because over , but their product is the logical . Thus the first comparison differs by a harmless stabilizer, while the second differs by a logical operation. Recovery corrects the single error and converts the double error into a logical bit flip.
3. Put a color code on a cube
Section titled “3. Put a color code on a cube”Put qubits on the eight vertices of a cube and paired checks on its six faces. Give opposite faces the same color. Determine the encoded dimension, and compare it with a torus.
Solution
Every face has four vertices and adjacent faces share two; opposite faces share none. The six face rows have rank four: the products of each opposite pair all equal the all-eight support, giving two independent relations. Thus . The cube is a cellulation of a sphere, consistent with . For a standard closed toroidal color code the same general counting gives . A planar triangular patch has boundary checks and must be counted separately.
4. Track phase signs on four and six vertices
Section titled “4. Track phase signs on four and six vertices”Compute the action of uniform on an face of weight four and of weight six. Explain how an alternating bipartite pattern changes the result. Determine the logical phase direction for the seven-qubit patch.
Solution
Uniform gives . The sign is for weight four and for weight six. The latter sends the positive constraint to the opposite signed product and does not preserve that positive code space. With vertices in each part, the alternating phase is . In the seven-qubit patch, four and three gates give phase on , hence logical . Seven uniform gates give , hence logical .
5. Three clicks from one physical error
Section titled “5. Three clicks from one physical error”Suppose the only noise is with probability . Find each -face click probability and the probability of all three clicks. Compare with a model treating the three clicks as independent while keeping their marginal probabilities.
Solution
The only outcomes are with probability and with probability . Each marginal click probability is , and the joint probability is also . The independent model instead gives , smaller by a factor of 2500. It also assigns positive probability to isolated clicks that are impossible in the stated model. A decoder must retain the common physical cause of the outcomes.
6. Read a logical bit destructively
Section titled “6. Read a logical bit destructively”Measure all seven data qubits in the basis. Explain how one flipped classical measurement bit can be corrected before reporting the logical outcome.
Solution
Without readout errors, the measured binary word satisfies because all -face checks are positive. A bit flip at produces syndrome , whose distinct nonzero column identifies the location. Correct that bit. The parity of the corrected seven-bit word gives the eigenvalue of . This is a destructive measurement: the individual outcomes reveal a computational-basis word, so they do not preserve an arbitrary logical superposition. Two readout errors can imitate one and give the wrong logical parity, just as in the earlier error collision.
7. What local equivalence preserves
Section titled “7. What local equivalence preserves”Let a Clifford circuit map one code space to another. Under the two-qubit CNOT conjugation , what happens to a stochastic error of probability ? Does preservation of encoded information imply preservation of an independent-error model?
Solution
The transformed channel is
The two transformed qubits flip together with probability ; each marginal flip probability is . Independent flips with those marginals would instead have joint probability and would introduce single-flip events. A code equivalence transforms both the logical states and the noise channel. Comparing performance after the map requires the transformed noise, not a newly assumed independent model.
References
Section titled “References”- H. Bombín, “Gauge color codes: optimal transversal gates and gauge fixing in topological stabilizer codes,” New Journal of Physics 17, 083002 (2015), doi:10.1088/1367-2630/17/8/083002, arXiv:1311.0879.
- H. Bombín and M. A. Martín-Delgado, “Topological quantum distillation,” Physical Review Letters 97, 180501 (2006), doi:10.1103/PhysRevLett.97.180501, arXiv:quant-ph/0605138.
- S. Bravyi and R. König, “Classification of topologically protected gates for local stabilizer codes,” Physical Review Letters 110, 170503 (2013), doi:10.1103/PhysRevLett.110.170503, arXiv:1206.1609.
- N. Delfosse, “Decoding color codes by projection onto surface codes,” Physical Review A 89, 012317 (2014), doi:10.1103/PhysRevA.89.012317, arXiv:1308.6207.
- A. Kubica, B. Yoshida, and F. Pastawski, “Unfolding the color code,” New Journal of Physics 17, 083026 (2015), doi:10.1088/1367-2630/17/8/083026, arXiv:1503.02065.