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.

Number of failing Pauli errors of each weight. Weight is the number of qubits hit.
CodeWeight 1Weight 2Weight 3Weight 4
3-qubit repetition6 of 918 of 2724 of 27 of 0
5-qubit code0 of 1590 of 90210 of 270270 of 405
Steane 7-qubit code0 of 21147 of 189693 of 9452226 of 2835
Shor 9-qubit code0 of 27117 of 3241437 of 22687677 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

Check the original sources for exact citations.