← Back

The Decoder: How a Quantum Computer Works Out What Went Wrong

Error correction never sees an error directly. It sees a pattern of alarms, and an ordinary classical computer has to guess, quickly and well, what caused them.

Alarms, not answers

Quantum error correctionTechniques that combine many shaky physical qubits into fewer reliable ones, so a long calculation stays correct. works under an awkward rule: you may not look at the data, because measuring the protected information directly would destroy it. So a quantum code checks something weaker, whether small groups of qubitsThe basic unit of a quantum computer. Like a 'bit' in a normal computer, but instead of being only 0 or 1 it can be 0, 1, or a blend of both at once. still agree, a parity checkA measurement of whether a small group of qubits agree, which reveals nothing about the value they jointly store..1 The checks repeat every round, and a check whose answer changes raises a flag called a detection event.6

Those flags are symptoms. The decoder is the classical algorithm that turns symptoms into a diagnosis: given this pattern of alarms, which errors most likely happened, and what correction follows?

The simplest decoder: majority vote

Start with the smallest case. Store one bit as three copies, 000 or 111, and ask two questions: do copies 1 and 2 agree, and do copies 2 and 3 agree? If only the first check fails, copy 1 is the odd one out. Flip it back. The checks never reveal whether the stored bit is 0 or 1, only which copy disagrees.1

Now the catch. Suppose copies 2 and 3 both flipped. The checks report exactly what they would report if copy 1 alone had flipped. The decoder, betting on the likelier story, “repairs” copy 1 and completes the damage. All three copies now agree on the wrong answer, and nothing inside notices. That silent wrong guess is a logical errorA failure of the protected information itself, which the code cannot detect from the inside..1

Different error patterns can raise the same alarms, so a decoder can only bet on the most probable explanation. When errors are rare, the bet usually wins.1

Majority vote on three copies of one bit, with two checks: copies 1 and 2, and copies 2 and 3. Panel A: stored 000, copy 1 flips, giving 100; check 1-2 raises an alarm star and check 2-3 passes with a check mark; the decoder flips copy 1, giving 000, labeled correct. Panel B: stored 000, copies 2 and 3 flip, giving 011; the checks show exactly the same pattern, an alarm on 1-2 and a pass on 2-3, marked same; the decoder again flips copy 1, giving 111 in red, labeled logical error.
Figure 1: The majority vote’s blind spot. One flip on copy 1 and two flips on copies 2 and 3 trip the same check. The decoder bets on the single flip and repairs copy 1: right in A, but in B all three copies end up agreeing on the wrong bit, a logical error.

Matching dots on a grid

Real codes like the surface codeA leading error-correcting code that spreads one protected qubit over a square grid of physical qubits checked by their neighbors. apply the same logic on a larger canvas. In the simplest picture, a chain of errors lights up alarms only at its two ends.2 The decoder must pair up the dots. A standard method, minimum-weight perfect matching, connects them with the shortest total set of links, because short error chains are the most probable.3 The checks themselves can misfire and create false alarms, so the matching runs across time as well as space, over many rounds.2

Pair the dots wrongly, and the correction plus the real errors can form a chain spanning the whole grid: the same silent logical error, now in two dimensions.3

A 7 by 7 grid of qubits labeled qubit grid. On one row, two x marks labeled hidden errors sit between two filled stars, and a second pair of stars sits two rows higher; the stars are labeled alarms. An arrow labeled detection events leads to a box labeled decoder, classical computer, with a clock labeled new alarms every round. Two copies of the same grid, with the same four stars, show the decoder's options. In the first, a short link joins each nearby pair of stars, labeled shortest links: likely story. In the second, the upper pair is linked, but a red line runs along the errors' row from the grid's left edge to one star and from the other star to the right edge, so together with the hidden errors it crosses the whole grid, labeled wrong pairing = logical error.
Figure 2: Same alarms, two stories. The decoder sees only the stars, never the errors that caused them. Linking each nearby pair is the likely explanation; linking the two lower stars to the grid’s edges instead completes a chain across the whole grid, a silent logical error.

Accurate and fast, at the same time

A decoder is judged on two things that pull against each other. One is accuracy: fewer wrong bets mean a more reliable 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. from the same hardware. In one experiment, a decoder built as a neural network outperformed leading algorithmic decoders on real data from a superconducting quantum processor.5

The other is speed, because the alarms keep coming. In one below-threshold experiment, a 72-qubit chip completed a round of checks every 1.1 microseconds, and a real-time decoder kept pace over up to a million rounds, with an average latency of 63 microseconds, slightly less accurately than slower offline decoding. The more accurate neural-network decoder needed about 24 microseconds per round, too slow to run live there. Those live answers were not yet fed back into a running computation.6

Why not decode later? For storage alone, you can. But certain operations needed for general-purpose computation require the decoder’s verdict before the next step can be chosen. If the decoder processes data more slowly than the hardware produces it, the backlog grows, and the computation slows down exponentially.4,6

Why it matters

The decoder is easy to overlook because it is not quantum; it runs on ordinary processors or dedicated classical chips. Yet a logical qubit’s reliability belongs to the hardware and its decoder together: the same raw measurements, decoded differently, give different logical error rates. And the burden grows with the machine: check measurements per round grow with the square of the code’s width.6

The quantum chip raises the alarms. The decoder has to read them, correctly and on time.

Sources

  1. Nielsen, M. A. & Chuang, I. L. Quantum Computation and Quantum Information, 10th Anniversary Edition, Section 10.1 (Cambridge University Press, 2010). DOI: 10.1017/CBO9780511976667. ↩
  2. Dennis, E., Kitaev, A., Landahl, A. & Preskill, J. “Topological Quantum Memory.” Journal of Mathematical Physics 43, 4452–4505 (2002). DOI: 10.1063/1.1499754. Preprint: arXiv:quant-ph/0110143. ↩
  3. Fowler, A. G., Mariantoni, M., Martinis, J. M. & Cleland, A. N. “Surface Codes: Towards Practical Large-Scale Quantum Computation.” Physical Review A 86, 032324 (2012). DOI: 10.1103/PhysRevA.86.032324. Preprint: arXiv:1208.0928. ↩
  4. Terhal, B. M. “Quantum Error Correction for Quantum Memories.” Reviews of Modern Physics 87, 307–346 (2015). DOI: 10.1103/RevModPhys.87.307. Preprint: arXiv:1302.3428. ↩
  5. Bausch, J. et al. (Google DeepMind and Google Quantum AI). “Learning High-Accuracy Error Decoding for Quantum Processors.” Nature 635, 834–840 (2024). DOI: 10.1038/s41586-024-08148-8. ↩
  6. Google Quantum AI and Collaborators. “Quantum Error Correction Below the Surface Code Threshold.” Nature 638, 920–926 (2025), including Supplementary Information. DOI: 10.1038/s41586-024-08449-y. Preprint: arXiv:2408.13687. ↩