Overview
Color codes are topological codes built on lattices whose faces can be coloured with three colours. Their distinguishing feature is symmetry between the two kinds of check: every face carries an check and a check on the same qubits. As a consequence the whole Clifford group can be applied to a logical qubit by acting on each physical qubit separately, which the surface code cannot do. In three dimensions a color code also has a transversal gate. The price is paid in decoding and in the weight of the checks.
The codes were introduced by Bombin and Martin-Delgado. The smallest example, on seven qubits, is the code of Steane.
Intuition
In the toric code a single error creates a pair of excitations, and decoding means pairing them up. In a color code a qubit sits where three faces of three different colours meet, and a single error lights up all three. Excitations therefore carry a colour, and three of them, one of each colour, can be created or removed together at a point. A string of errors still produces excitations only at its ends, but strings may branch. The decoder has to group excitations into pairs and triples, and that is a harder combinatorial problem than pairing.
The same three-fold structure is the source of the transversal gates. Because the and checks coincide, swapping and on every qubit maps the code to itself, and so does the phase gate once signs are arranged to cancel on every face.
Prerequisites
CSS codes, the toric code, the Clifford group and the notion of a transversal gate. For the three-dimensional codes, subsystem codes and gauge fixing.
Mathematical Definitions
Lattice. A cellulation of a surface in which every vertex has exactly three edges and the faces can be coloured red, green and blue so that faces sharing an edge have different colours. Every face then has an even number of vertices, because the faces around it alternate between the two other colours, and two distinct faces share an even number of vertices. One qubit sits on each vertex.
Checks. For every face , with running over its vertices,
and overlap on an even number of qubits for all , so all checks commute. The -type and -type checks have identical supports: the code is a self-dual CSS code.
Parameters on a closed surface. On a closed surface of Euler characteristic the code encodes qubits: none on the sphere and four on the torus, twice as many as the toric code on the same surface (Bombin and Martin-Delgado).
Triangular codes. Removing one vertex of a lattice on the sphere, together with the three faces and three edges that meet there, leaves a planar triangular patch with three sides, one of each colour, that encodes qubit in an odd number of qubits with faces. Two standard families, with odd distance , are
| Lattice | Faces | ||
|---|---|---|---|
| hexagonal (6.6.6) | hexagons, weight-4 faces on the sides | ||
| square-octagon (4.8.8) | squares and octagons, weight-4 faces on the sides |
with qubit counts as given by Landahl, Anderson and Rice. Both begin with the Steane code, whose three weight-4 checks of each type are the three faces of the smallest triangle.
Logical operators. In a triangular code and : each commutes with all checks because faces are even, and they anticommute because is odd. Multiplying by checks reduces them to strings of weight running along one side of the triangle. On a closed surface the logical operators are strings of a given colour, which run along the edges joining faces of that colour and may branch at a vertex into strings of the other two colours.
Properties. Every qubit lies on three faces, so a single-qubit error flips up to three checks (three in the bulk, fewer at the sides and corners). The transversal gates are stated in the transversal Clifford theorem. Bombin and Martin-Delgado compare the qubit cost with surface codes: the best planar color-code lattice in their study has , against for the best planar surface code, both counted in data qubits only.
Three-dimensional and gauge color codes
In three dimensions the lattice is four-valent with four-colourable cells. Qubits sit on vertices, checks on the three-dimensional cells and checks on the faces. The code is no longer self-dual, so the Hadamard is not transversal, but the gate is: applying and to the two sublattices implements a logical gate up to inversion (Bombin and Martin-Delgado). The smallest instance is a code on a tetrahedron.
The gauge color code of Bombin is a subsystem code on the same lattice. Fixing its gauge in one way gives a stabilizer code with transversal ; fixing it in the other way gives one with transversal . Switching between the two by measuring gauge operators and applying a correction yields the universal set without distilling magic states; the measured operators act on only 4 or 6 qubits. Kubica and Beverland give a self-contained construction in any dimension , where the transversal gate is .
Theorems
Let be a code satisfying the assumptions, for instance a triangular two-dimensional color code. Then each of the following unitaries maps the code space to itself and acts on the encoded qubit as stated.
- Hadamard. acts as the logical Hadamard gate.
- Phase gate. acts as the logical gate if and as the logical if .
- Uniform phase gate. If every face has a number of qubits divisible by 4, then acts as the logical if and as the logical if .
- Controlled-NOT. For two copies of , the product of controlled-NOT gates from each qubit of the first block to the matching qubit of the second acts as the logical controlled-NOT.
Since , and the controlled-NOT generate the Clifford group, every logical Clifford gate on blocks of such a code is a product of transversal gates.
That color codes implement the Clifford group transversally is due to Bombin and Martin-Delgado; the alternating pattern for phase gates, which also works when faces are not divisible by 4, follows the presentation of Kubica and Beverland.
- A CSS code on an odd number of qubits with checks and for every in a family of even-size subsets ("faces") of the qubits, any two of which share an even number of qubits, encoding qubit with and .
- For the phase gate, the qubits are split into two classes and so that every face has equally many qubits in each. Triangular color codes satisfy all of these conditions.
Proof · Proof of the transversal Clifford gates of two-dimensional color codes
Principle. A unitary that maps the stabilizer group to itself under conjugation maps the code space to itself. Its action on the encoded qubit is then fixed, up to a phase, by the images of and , because these two operators generate all operators on the encoded qubit.
Preliminaries. commutes with every because is even, and because is odd. The single-qubit identities used are , , , and .
1. Hadamard. and , so the set of generators is mapped to itself. Also and conversely, which is the action of a logical Hadamard.
2. Alternating phase gate. commutes with every . For an check,
where the last step uses that Pauli operators on different qubits commute, so . By assumption , so the prefactor is and , a product of generators. Hence preserves the stabilizer group. On the logical operators, and
The exponent is odd because is odd. A logical gate maps and a logical maps ; both fix . So is the logical when and the logical when it is .
3. Uniform phase gate. The same computation with the set of all qubits gives , which is exactly when , and .
4. Controlled-NOT. A controlled-NOT with control and target maps , and fixes and . Applied qubit-wise to two blocks it maps , and fixes and , so the stabilizer group of the pair of blocks is preserved. The same rule applied to the logical operators gives and , the action of a logical controlled-NOT. This step holds for every CSS code.
The assumptions hold for triangular color codes. Faces are even and overlap evenly by the definition of the lattice, is odd and . The lattice of a triangular code is a subgraph of a three-valent lattice on the sphere all of whose faces are even; a graph drawn on the sphere with all faces even is bipartite, so its vertices split into two classes with every edge joining different classes. Going around a face, the vertices alternate between the classes, so every face is split evenly.
Check on the Steane code. Label the qubits so that the faces are , , . The two classes are and , each face having two qubits in each. Then , so on qubits and on is the logical . All faces have 4 qubits and , so by item 3 the uniform is the logical . The two statements agree: , and times the three checks is , while .
Limits on transversal gates
Two general results explain why the gate set stops where it does. No code that detects single-qubit errors has a universal set of transversal gates (Eastin and Knill), which is why the three-dimensional construction switches between two codes. And a gate implemented by a constant-depth circuit on a local stabilizer code in dimensions lies in the -th level of the Clifford hierarchy (Bravyi and König): Clifford gates in two dimensions, and gates such as in three. Color codes attain this bound in every dimension (Bombin).
Relation to the toric code
A two-dimensional color code on a closed surface is equivalent to two copies of the toric code on that surface, under a local unitary circuit and the addition or removal of ancilla qubits. This follows from the classification of Bombin, Duclos-Cianci and Poulin and is made explicit, in any dimension, by Kubica, Yoshida and Pastawski; it accounts for being twice the toric-code value . A triangular color code is equivalent in the same sense to a toric code with boundaries folded along a diagonal. The equivalence does not make the codes interchangeable: a transversal gate of the color code becomes, after the mapping, a gate that acts between the two layers.
Thresholds
With perfect measurements and independent bit-flip noise, optimal decoding of the color code maps to a random three-body Ising model, and Monte Carlo simulation gives a threshold , the same within errors as the toric code (Katzgraber, Bombin and Martin-Delgado). The loss relative to surface codes therefore comes from practical decoders and from circuits, not from the code itself. Published thresholds, each for its own noise model and decoder:
| Source | Setting | Decoder | Threshold |
|---|---|---|---|
| Delfosse | hexagonal lattice, phase-flip noise, perfect measurement | projection onto three surface codes, each decoded by matching | about |
| Kubica and Delfosse | square-octagon lattice, bit-flip or phase-flip noise, perfect measurement | restriction decoder | about |
| Lee, Li and Bartlett | bit-flip noise, perfect measurement | concatenated matching | |
| Landahl, Anderson and Rice (preprint) | 4.8.8 lattice, circuit-level noise | integer program | |
| Chamberland, Kubica, Yoder and Zhu | triangular code with flag qubits, circuit-level depolarizing noise | restriction decoder using flag information | |
| Beverland, Kubica and Svore | triangular code, circuit-level noise | restriction decoder, optimised | |
| Lee, Li and Bartlett | triangular code, circuit-level noise | concatenated matching |
Worked Examples
The Steane code as the smallest color code
Draw a triangle divided into three quadrilateral faces that meet at a central vertex. There are seven vertices: the centre (qubit 7), the three corners (qubits 1, 2, 4) and the three midpoints of the sides (qubits 3, 5, 6). With this labelling the faces are
which are the supports of the three parity checks of the Hamming code. Each face gives an check and a check, six in all, so . Any two faces share exactly two qubits, so all checks commute.
Syndromes. A bit flip on the centre qubit 7 flips all three checks; a bit flip on a midpoint, say qubit 3, flips two ( and ); a bit flip on a corner, say qubit 1, flips one (). The seven single-qubit errors produce the seven distinct non-zero syndromes, so each is identified uniquely: .
A minimum-weight logical operator. lies along one side of the triangle. It meets in , in and in no qubit, so it commutes with every check, and it anticommutes with . It has weight .
The phase gate. All faces have four qubits and , so by the theorem is the logical . Explicitly, , whereas a logical would give . The logical is obtained from , or from on qubits and on .
Qubit counts at distance 5
For the hexagonal family has data qubits and faces, hence checks; the square-octagon family has data qubits. A rotated surface code of the same distance has data qubits and checks. The color code uses fewer data qubits per logical qubit, but its bulk checks have weight 6 (or 8) instead of 4, which makes the measurement circuits longer.
Algorithms and Implementations
Decoding a color code is not a matching problem on a graph, because an error can flip three checks. Practical decoders reduce it to matching in different ways.
- Projection and restriction. Deleting all faces of one colour leaves a lattice on which the remaining excitations do come in pairs. One runs a toric-code decoder such as minimum-weight perfect matching on two or three of these restricted lattices and then lifts the result to a correction on the color code (Delfosse; Kubica and Delfosse).
- Matching on a Möbius strip. For a triangular code the restricted lattices can be joined along the boundary into one manifold on which a single matching problem is solved (Sahay and Brown). An open-source implementation for circuit-level noise is described by Gidney and Jones (preprint).
- Concatenated matching. Two rounds of matching per colour, the second using the output of the first, bring the logical failure rate close to the best-possible scaling with distance (Lee, Li and Bartlett).
Syndrome extraction is also harder than for the surface code: checks of weight 6 or 8 need more gates and more connectivity, and faults on the ancilla spread to more data qubits. Flag qubits are one remedy (Chamberland and co-authors).
Limitations and Common Pitfalls
- Equal optimal thresholds do not mean equal performance. The figure assumes perfect measurements and an optimal decoder. At circuit level the best published thresholds in the table are below those of the surface code under comparable assumptions.
- Fewer data qubits is not lower overhead. Gidney and Jones estimate, for uniform depolarizing circuit noise of strength , that a logical error rate of one in a trillion needs about 1250 qubits with their best color-code circuit and about 650 with a surface code decoded by correlated matching.
- Transversal in three dimensions is not free universality. A simulation of code switching between two- and three-dimensional color codes found a circuit-noise threshold of for the resulting gate and no substantial saving over magic-state distillation (Beverland, Kubica and Svore).
- The uniform phase gate is not always logical. preserves the code only when every face has a multiple of four qubits, as on the square-octagon lattice. On the hexagonal lattice the alternating pattern of the theorem is required, and in either case the result may be rather than .
State of the Art
These statements summarise the cited publications, as checked in 2026-11; they are not a complete survey.
- Trapped ions. A seven-qubit color code was first implemented by Nigg and co-authors in 2014, with logical Clifford gates. Repeated real-time error correction on the code was reported by Ryan-Anderson and co-authors in 2021, and a fault-tolerant universal gate set on two such logical qubits, including a gate by magic-state injection, by Postler and co-authors in 2022.
- Neutral atoms. Bluvstein and co-authors prepared color-code logical qubits with break-even fidelity and operated 40 of them in one processor (published 2024).
- Superconducting qubits. Lacroix and co-authors (published 2025) measured a suppression of logical error by a factor when going from distance 3 to distance 5, transversal Clifford gates adding an error of , magic-state injection with fidelity above after post-selection that keeps about of the runs, and lattice-surgery teleportation between distance-3 codes with fidelities between and .