← Back

The Surface Code: How Big Is a Logical Qubit?

The leading recipe for error correction is a checkerboard of qubits that keep checking their neighbors. Its size is set by one number, the code distance, and that number decides both how well it protects and what it costs.

A grid that checks itself

The surface code lays qubits out on a flat square grid. Some, the data qubits, hold the protected information. Between them sit measure qubits, each asking one question of its nearest neighbors, four in the interior and fewer at the edges: do you still agree?1

The checks come in two kinds, alternating like the squares of a checkerboard.1 One kind catches bit flips, a 0 turning into a 1. The other catches the quantum kind of slip, the phase flipAn error that leaves 0 and 1 alone but flips the sign between them in a superposition, which classical bits never suffer.. Neither kind ever reads the stored value. All the checks repeat every round, and their answers go to a decoderThe classical algorithm that reads the pattern of error-correction alarms and bets on which errors most likely caused them., a classical program that works out what went wrong.

Why this design? Every qubit only ever talks to its nearest neighbors on a flat chip, which is about what real hardware can do. And it tolerates fairly noisy parts: its thresholdThe error rate below which making an error-correcting code bigger starts to help instead of hurt. in detailed models sits around half a percent to one percent per operation.1

Errors leave footprints

A single bit flip on a data qubit changes the answers of the bit-flip checks beside it, two of them away from the edges.1 Two neighboring flips cancel at the check they share, so a chain of flips lights up only its two ends.3 Those alarms are all the decoder ever sees.

Code distance: the shortest disguise

Now the dangerous case. Flip a whole line of data qubits, from one edge of the patch to the opposite edge. Every check along the way sees two flips, so it stays quiet, and the chain’s ends run off the edges, where there are no bit-flip checks to notice. No alarm rings anywhere, yet the stored value has flipped.3 That is a logical errorA failure of the protected information itself, which the code cannot detect from the inside..

The code distance, d, is the fewest physical errors that can do this.1 For the patch in the figure, it is the patch’s width: five.

The distance tells you what is guaranteed: a code of distance d can correct any (d − 1)/2 errors, so two at distance 5.2 Three errors can already fool it. Three flips on one side of a line give the same alarms as two flips on the other side; the decoder bets on the likelier two and completes the line. That is why, below threshold, the logical error rate falls roughly as the physical error rate raised to the power (d + 1)/2.1

Two copies of the same 5 by 5 grid of data qubits, drawn as circles, with small squares between them: filled squares are bit-flip checks and open squares are phase-flip checks, alternating like a checkerboard, plus extra checks along the edges. Panel A, two bit flips: two neighboring data qubits in the middle column are crossed out, joined by a short line, and the two bit-flip checks at the ends of that short chain are replaced by stars, labeled alarms at both ends: caught. Panel B, five flips edge to edge: all five data qubits in the middle column are crossed out in red, with a red line running from the top edge to the bottom edge; no check shows an alarm, labeled no alarm: logical error, distance = 5.
Figure 1: A distance-5 surface code. A: a short chain of bit flips lights up the checks at its two ends, so the decoder can find it. B: a chain that runs from one edge to the other trips no check at all and silently flips the stored value. The fewest flips that can do this, five here, is the code distance.

What it costs

In the common layout, a patch of distance d uses d × d data qubits plus one fewer measure qubits: 2d² − 1 in all.1 Distance 7 means 49 data and 48 measure qubits, 97 in total, and one recent experiment used exactly that plus 4 helper qubits.4 Distance 27 means 1,457.4 Doubling the distance roughly quadruples the qubits, and each patch holds a single logical qubitA reliable ‘qubit’ built by bundling many error-prone physical qubits together with error correction. These are the units that actually matter for useful computing..

That cost is why the surface code is the yardstick. When a report says a new code needs about one-tenth the physical qubits per logical qubit of a surface code, the comparison is with patches like this one, at the same target error rate. One such proposal stores 12 logical qubits in 288 physical qubits, where its authors estimate the surface code would need nearly 3,000.5 The catch is wiring: each qubit there must connect to six others, not just its four grid neighbors.5

Why it matters

The surface code is the reference design that most error-correction plans and cost estimates start from. It is very good at one thing, keeping stored information safe, but it cannot run every operation directly; the missing one is supplied by magic statesSpecial resource states that a fault-tolerant computer consumes to perform the operations it cannot do directly., at extra cost. When you read “a distance-7 logical qubit,” you can now translate: a 7-by-7 patch of data qubits, about a hundred physical qubits in all, that any three errors cannot defeat but four well-placed ones can.

Sources

  1. A. G. Fowler, M. Mariantoni, J. M. Martinis, and A. N. Cleland, “Surface codes: Towards practical large-scale quantum computation,” Physical Review A 86, 032324 (2012). arXiv:1208.0928. (Data and measure qubits; two check types; four neighbors, fewer at the boundaries; a flip changes the two neighboring checks; an edge-to-edge chain is an undetected logical operator; distance as the fewest flips that make one; (d + 1)/2 errors misread as (d − 1)/2; nearest-neighbor layout; threshold of 0.57% per step in their model, earlier estimates about 1%.) ↩
  2. B. M. Terhal, “Quantum error correction for quantum memories,” Reviews of Modern Physics 87, 307 (2015). arXiv:1302.3428. (A code of distance 2t + 1 corrects t errors.) ↩
  3. E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, “Topological quantum memory,” Journal of Mathematical Physics 43, 4452 (2002). arXiv:quant-ph/0110143. (Errors seen only at chain ends; chains spanning the code as logical errors.) ↩
  4. Google Quantum AI and Collaborators, “Quantum error correction below the surface code threshold,” Nature 638, 920 (2025). arXiv:2408.13687. (Distance-7 memory with 49 data, 48 measure and 4 leakage-removal qubits on a square grid; distance 27, 1,457 qubits.) ↩
  5. S. Bravyi, A. W. Cross, J. M. Gambetta, D. Maslov, P. Rall, and T. J. Yoder (IBM), “High-threshold and low-overhead fault-tolerant quantum memory,” Nature 627, 778 (2024). arXiv:2308.07915. (12 logical qubits in 288 physical qubits versus nearly 3,000 for the surface code, in simulation at 0.1% physical error; degree-6 connectivity; 0.8% threshold.) ↩