Stabilizer codes: a compact way to describe a code
How a short list of Pauli checks defines a code, and how an error’s syndrome is computed.
9 min read · reviewed December 2026
Checks as Pauli strings
A stabilizer code is defined by a list of checks, each a string of I, X, Y and Z, one letter per qubit. The code space is the set of states that every check leaves unchanged. The 3-qubit bit-flip code has the checks ZZI and IZZ. The table lists the checks of each code in the lab.
| Code | Generators |
|---|---|
| 3-qubit repetition | ZZI IZZ |
| 5-qubit code | XZZXI IXZZX XIXZZ ZXIXZ |
| Steane 7-qubit code | IIIXXXX IXXIIXX XIXIXIX IIIZZZZ IZZIIZZ ZIZIZIZ |
| Shor 9-qubit code | ZZIIIIIII IZZIIIIII IIIZZIIII IIIIZZIII IIIIIIZZI IIIIIIIZZ XXXXXXIII IIIXXXXXX |
How an error trips an alarm
Two Pauli operators either commute or anticommute. If an error anticommutes with a check, that check’s measurement flips from 0 to 1. The list of 0s and 1s over all checks is the syndrome. It depends only on the error, not on the encoded state, which is why measuring it is safe.
syndrome bit i = 1 if the error anticommutes with check i
Counting
A code on n qubits with n − k checks has 2^(n−k) syndromes. The Steane code has 6 checks and so 64 syndromes. A single-qubit error can be X, Y or Z on one of seven qubits, which is 21 errors, and with the identity that is 22 situations that need their own syndrome. The code has room to spare. The 5-qubit code has exactly 16 syndromes for 1 + 15 cases: it is a perfect code, with no spare syndromes.
What the lab does
For every code, the lab computes the syndrome of every one of the 4^n Pauli errors, builds a table that maps each syndrome to the lowest-weight error having it, and then checks whether applying that correction restores the state. This gives exact failure counts, not estimates.
Try it
Questions
Why do checks have to commute with each other?
So that all of them can be measured at once without disturbing each other.
What is the [[n,k]] notation?
n physical qubits encode k logical qubits. All codes in the lab have k = 1.
Do errors outside the Pauli set matter?
Any small error can be written as a mix of Paulis, and measuring the syndrome collapses it to one of them. That is why Pauli errors suffice.
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.