|q⟩ Bad Qubits

advanced · Physics · Surface Codes & Topological Codes

Color Codes (Overview)

The surface code is not the only topological code. Color codes, introduced by Bombín and Martín-Delgado, are a different family that trades a slightly more demanding lattice for a much richer set of cheap, transversal logical gates. They sit on a trivalent, three-colorable lattice and place both an XX-type and a ZZ-type stabilizer on every face. This lesson surveys color codes and contrasts them with the surface code.

The lattice and stabilizers

A 2D color code lives on a trivalent lattice (three edges per vertex) whose faces are 3-colorable: the faces can be coloured red, green, blue so that adjacent faces never share a colour (the hexagonal/honeycomb lattice is the canonical example). Qubits sit on vertices. For each face ff there are two stabilizer generators,

BfX=vfXv,BfZ=vfZv,B_f^X = \prod_{v \in f} X_v , \qquad B_f^Z = \prod_{v \in f} Z_v ,

acting on all qubits around that face. The two generators on each face commute because every face shares an even number of vertices with every other face — the same even-overlap rule as the toric code, guaranteed here by the 3-colorability.

How it differs from the surface code

The payoff: transversal Clifford gates

The headline advantage is gate transversality. In a 2D color code the entire Clifford group — including the Hadamard HH, phase SS, and crucially the controlled-NOT\mathrm{NOT} between two code blocks — can be implemented transversally: as a product of single-physical-qubit gates (and qubit-wise pairs across blocks), with no interaction spreading errors within a block.

Hˉ=vHv,Sˉ=vSv(±),CNOT=vCNOTv,v.\bar H = \prod_v H_v , \qquad \bar S = \prod_v S_v^{(\pm)} , \qquad \overline{\mathrm{CNOT}} = \prod_v \mathrm{CNOT}_{v,v'} .

Transversal gates are automatically fault-tolerant: a single faulty physical gate produces at most a single error per block, which the code can then correct. The surface code, by contrast, gets a transversal CNOT but not a transversal HH or SS acting within one patch — it must implement those through lattice surgery or code deformation, which is more involved.

When to choose which

Both are topological in exactly the sense Module 8 has developed: local stabilizers, string-like logical operators, distance set by lattice size, and a positive threshold. The choice is an engineering trade between threshold and gate convenience.

Sign in on the full site to ask questions and join the discussion.