Decoding and degeneracy: why some two-qubit errors do no harm
The decoder chooses a correction for each syndrome. In some codes, different errors are secretly the same.
8 min read · reviewed December 2026
The decoder’s job
The syndrome says which checks fired. Many errors share the same syndrome, and the decoder must pick one to undo. The lab picks the lowest-weight error, meaning the one touching the fewest qubits. When two candidates tie, it takes the first found. This is the simplest sensible decoder, and real ones are more elaborate.
When it is wrong
If the real error differs from the chosen correction, the leftover is the product of the two. If that leftover is a product of checks, the state is untouched and nothing was lost. Otherwise it is a logical operator, and the encoded qubit has changed. The lab’s Quantum codes tab prints both outcomes.
Degeneracy
A code is degenerate when different errors differ only by a product of checks. Such errors are really the same error, so confusing them is harmless. The Shor code is strongly degenerate: its checks ZZ inside a block mean that Z on one qubit of a block is equivalent to Z on another. The 5-qubit code’s smallest checks have weight 4, so it has no such shortcut at weight 2, and degeneracy first shows at weight 3.
| Code | Weight 1 | Weight 2 | Weight 3 | Weight 4 |
|---|---|---|---|---|
| 3-qubit repetition | 6 of 9 | 18 of 27 | 24 of 27 | of 0 |
| 5-qubit code | 0 of 15 | 90 of 90 | 210 of 270 | 270 of 405 |
| Steane 7-qubit code | 0 of 21 | 147 of 189 | 693 of 945 | 2226 of 2835 |
| Shor 9-qubit code | 0 of 27 | 117 of 324 | 1437 of 2268 | 7677 of 10206 |
Reading the table
Every code fixes all weight-1 errors. At weight 2 the Shor code fails on 117 of 324, the Steane code on 147 of 189, and the 5-qubit code on all 90. The 5-qubit code fails on a larger share of its weight-2 errors, but it has only 90 of them, and in this model it still gives the lowest logical error at small p. At weight 3, 210 of its 270 errors fail, because products with weight-4 checks turn some of them into harmless equivalents.
Try it
Questions
Is lowest-weight decoding optimal?
Not always. The best decoder weighs the likelihood of whole classes of equivalent errors, which is harder to compute. Real surface-code decoders are a research topic in their own right.
Does the tie-break matter?
It can change which weight-2 errors count as failures in some codes. The lab’s choice is fixed and documented, so the numbers are reproducible.
Why does degeneracy help?
It reduces the number of distinct errors the decoder has to tell apart.
Read next
Sources and further reading
- P. W. Shor, “Scheme for reducing decoherence in quantum computer memory” (1995)
- A. M. Steane, “Error correcting codes in quantum theory” (1996)
- D. Gottesman, “Stabilizer codes and quantum error correction” (PhD thesis, 1997)
- Google Quantum AI, “Quantum error correction below the surface code threshold”
- M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, chapter 10
Check the original sources for exact citations.