Quantum Link Research
QEC lab Ā· learn 01/15 Ā· the surface code

Catch the errors without looking at the data.

A surface code spreads one logical qubit over a grid of physical ones and measures only parities of neighbours. Bit flips light up the parity checks around them; a decoder pairs the lit checks along the shortest paths and flips those qubits back. If the pairing guesses wrong in a way that crosses the whole grid, the logical qubit is lost. Every shot below was sampled and decoded by PyMatching in the tested Python (qll/circuits/surface_code_capacity.py); the page re-checks each one.

the lattice Ā· data qubits (dots), Z checks (amber, they catch bit flips), X checks (violet, idle in this model)

1 Ā· errorsbit flips hit random qubits
2 Ā· syndromechecks with odd parity light up
3 Ā· matchingpair the lit checks, shortest total path
4 Ā· correctionflip the qubits on those paths

controls

code distance
bit-flip probability
shot—
physical qubits
—
errors this shot
—
lit checks
—
logical errors, these 16 shots
—
logical error rate (20 000 shots)
—
page's own check
—

Corrects any ⌊(dāˆ’1)/2āŒ‹ errors: 1 for d = 3, 2 for d = 5, 3 for d = 7. More errors may still be caught, or may form a string the decoder closes the wrong way, which is a logical error.

logical error rate vs physical bit-flip rate Ā· below the threshold, bigger codes win

Code capacity: independent bit flips, perfect parity measurements, minimum-weight perfect matching. The curves cross near 10 %, the threshold (about 10.3 % for very large codes; small planar codes cross a little lower). With noisy measurements the threshold drops to about 1 % (learn 01/15, qll/circuits/decoders.py), which is why the hardware race is to get physical errors well below it: Google's 2024 processors did, and each step from d = 3 to 5 to 7 halved the logical error.