The four commuting independent stabilizer generators define a two-dimensional stabilizer code. The identity and fifteen single-site Pauli errors have sixteen distinct four-bit error syndromes, so their two-dimensional images form an orthogonal direct sum of the physical space. This proves nondegenerate single-site correction and the perfect quantum error-correcting code property. The operators and commute with the stabilizer and anticommute with each other. Multiplying by gives, up to phase, , a nontrivial weight-three logical operator, proving distance exactly three.
Use the normalized three-qubit states . The Shor code has logical basis
It encodes as , preserving the unknown amplitudes by a linear isometry. It concatenates a three-block phase-flip repetition code with the three-qubit bit-flip repetition code inside each block. Six stabilizer generators, , test bit errors inside the blocks. The other two stabilizer generators are
All eight commute and have eigenvalue on both logical basis states. They define the stabilizer code. The inner checks identify single bit flips, and the outer checks identify a block phase flip; combined they also correct a Pauli Y gate error, since .
For the requested phase flip, a on any one qubit interchanges and in its block. It commutes with the six -pair checks. It anticommutes with or exactly when its block is contained in that check. The Shor-code phase-flip syndrome is therefore
A projective measurement of the two commuting checks yields the displayed error syndrome without learning or : both logical components have the same check eigenvalues after the error. Applying the indicated Pauli Z gate restores every encoded quantum state.
The correction is genuinely degenerate. For in the same block, fixes both and , so and consequently . In particular and are distinct physical errors but have identical action on every code state; their image subspaces coincide, not merely their observed syndrome labels. In the Knill--Laflamme condition for , the error Gram matrix has , , and
The zero overlaps between different blocks follow because a phase flip changes a different pattern of orthogonal factors; cross-logical overlaps also vanish. Thus consists of one block and three all-ones blocks and has rank four, not ten. This both proves correctability of the entire single-phase-error span and exhibits its degeneracy. A coherent sum of phase errors in one block has the same logical action with its coefficients summed, so inability to locate the individual qubit loses no logical information. The two block checks suffice to correct every single phase flip, even though the within-block errors are indistinguishable.
For an -qubit quantum code with projector , the quantum code distance is
Here the weight counts nonidentity tensor factors. Thus every error supported on fewer than qubits is detectable, by the Pauli expansion of a quantum error. A scalar action on the code, including a nonidentity stabilizer, is harmless and does not reduce this distance. For a stabilizer code, the equivalent definition minimizes weight among Pauli operators which commute with every stabilizer generator but act nontrivially on the logical information. The Knill--Laflamme condition then guarantees correction of all errors of weight at most , since each pairwise product has weight at most .
Suppose the code encodes logical qubits and is nondegenerate for all errors through weight . There are
distinct Pauli errors modulo phase: choose the affected positions and choose or at each. Each error is unitary, so its image of the code has dimension . Nondegeneracy makes these images mutually orthogonal, equivalently the combined vectors are orthonormal. They all lie in the physical Hilbert space of dimension . Counting dimensions proves the quantum Hamming bound
This dimension argument requires nondegeneracy. For a degenerate code, different errors can share an image, as in the Shor code, and this counting proof cannot be applied unchanged.
For a binary classical code of words, the Hamming bound is : disjoint Hamming balls around the words must fit into all binary strings. The quantum factor is needed because at each erroneous qubit there are three linearly independent nonidentity Pauli operators, not just a classical bit flip. A phase flip is invisible to a computational-basis classical record but changes a quantum superposition. A error combines bit and phase effects, and the identity with spans every one-qubit operator. Quantum correction must protect amplitudes and coherences, and consequently count whole orthogonal logical subspaces rather than just classical words.
For parameters , , and
Thus a nondegenerate such code saturates the bound: the sixteen two-dimensional error images exhaust the physical space. It is a perfect quantum error-correcting code for single-qubit errors. It also has the smallest possible length for nondegenerate single-error protection of one logical qubit: for , the required inequality fails.
Here is an explicit realization and its five-qubit stabilizer syndrome table. Write tensor products without multiplication symbols and use
Each pair has an even number of anticommuting single-site factors, so the four stabilizer generators commute. Their binary Pauli labels are independent: no nonempty product has identity label. For example, the -support at site three fixes the exponent of in such a product to zero, site five then fixes that of , site one fixes that of , and site two fixes that of . Thus their group has sixteen elements and excludes . The common eigenspace has projector and dimension , since all nonidentity Pauli strings have zero trace.
Record a syndrome bit as one when an error anticommutes with the corresponding generator, in order . Direct local commutation gives
These are all fifteen nonzero four-bit error syndromes; the identity has . Distinct errors in this list have a product with nonzero syndrome, so it anticommutes with some . Inserting on both sides gives . The diagonal product is the identity. Hence the Knill--Laflamme condition is exactly , proving nondegenerate correction. Measure the four commuting checks, apply the unique indicated Pauli error again, and every logical state is recovered. The Pauli expansion of a quantum error extends this recovery to an arbitrary one-qubit noise channel, not just the fifteen discrete errors.
The table also proves that every Pauli operator of weight one or two has nonzero syndrome: a weight-two operator is the product of distinct single-site errors, whose syndromes differ. Therefore the distance is at least three. The operators and commute with all four generators and anticommute with each other. They are nontrivial logical Pauli operators. Multiplication of by gives , a weight-three operator with the same logical action; it cannot be scalar on the code because it anticommutes with the invertible logical operator . This proves exactly.
The code consequently detects every two-qubit error and corrects two known-location erasures by the quantum erasure correction criterion, but it cannot correct all two-qubit errors of unknown location. A nontrivial weight-three logical operator can be split into a weight-one and a weight-two error, whose pairwise product violates the correction condition. It also saturates the quantum Singleton bound, since . These properties distinguish single-error perfectness from unrestricted protection against larger errors.
The Pauli group includes scalar phases . For a nonzero stabilizer code, its Abelian subgroup must satisfy . Otherwise a common positive eigenvector would satisfy and vanish; for example is Abelian but yields no nonzero stabilizer code. We impose this standard admissibility condition.
Every element of such a stabilizer group is Hermitian and squares to : an imaginary-phase Pauli with square is excluded. The associated stabilizer code and its orthogonal projector are
The group multiplication proves , Hermiticity gives , and its range is exactly the common positive eigenspace. If has independent generators, . Every nonidentity element has trace zero, while , so
Thus it encodes logical qubits.
For the symplectic representation of a stabilizer code, label by , ignoring scalar phase. Products add labels, and
This is the nondegenerate alternating form on the binary symplectic space of Pauli labels. The image of is an r-dimensional isotropic subspace of a binary symplectic space, since the generators commute and no nontrivial scalar lies in . Consequently and . A binary generator matrix satisfies . Conversely an isotropic subspace can be lifted by choosing commuting Hermitian generators with independent labels; their products cannot equal , and the orthogonal projector formula supplies the stabilizer code. The labels of the centralizer of a stabilizer group are , with nontrivial logical actions represented by .
For an example, the three-qubit bit-flip repetition code has and . Its two binary rows have zero X part and Z parts . The errors have respective error syndromes , so all single bit flips can be corrected. This is not a stabilizer code correcting every single-qubit error: acts as a nontrivial logical phase error.
Let denote the Pauli centralizer. The exact Pauli error criterion for a stabilizer code is
Equivalently, no difference of error labels lies in . The scalar phases in are essential: an error product is harmless even though it is not in .
We prove the criterion. For outside , some anticommutes with . Since , we have , hence . If , then . If , it restricts to a unitary operator on the stabilizer code, but
no is scalar. A scalar restriction would have scalar coefficient zero by this trace equation, contradicting unitarity. Thus this third case is not scalar.
To justify why scalar compressions are exactly what correction requires, suppose one recovery corrects every . Dilate that recovery to an isometry including its auxiliary system. Correct recovery of every pure stabilizer code state gives . The auxiliary state is independent of : linearity on basis states and their superpositions forces their auxiliary vectors to coincide. Preservation of inner products then gives
which is the Knill--Laflamme condition . The three cases above prove necessity of the boxed criterion.
For sufficiency, put errors in the same class when . They act identically on the stabilizer code up to scalar phase, so give the same error-image subspace. Under the criterion, different classes give mutually orthogonal subspaces , because their cross-compressions vanish. Measure which of these subspaces is occupied and apply the inverse of a representative error. This returns every stabilizer code state unchanged; extend the recovery on the orthogonal complement by preparing any fixed stabilizer code state. Linearity also corrects any valid noise channel whose Kraus operators are linear combinations of the specified errors: within each syndrome all amplitudes multiply the same logical state, and trace preservation normalizes the recovered state. This proves sufficiency, including degenerate error classes.
The -qubit Pauli group is
A stabilizer group is an abelian subgroup of excluding . Its associated stabilizer code is the common positive eigenspace
The exclusion of is necessary for a nonzero code, since no nonzero vector has eigenvalue under .
Every is a signed Hermitian tensor product of Pauli matrices. An imaginary-phase Pauli element would have , contradicting closure of and exclusion of ; hence and . If , it cannot be a nontrivial scalar Pauli element, and at least one of its local factors is or . Each of these has trace zero. Using gives .
The spectral theorem for Hermitian operators and show that all eigenvalues are or . If their multiplicities are and , then
Thus the balanced spectrum of a nonidentity stabilizer is
This concerns a nonidentity stabilizer acting on the entire physical space; on the code every stabilizer acts with eigenvalue .
Because all elements commute and square to , is a vector space over under multiplication. Its independent stabilizer generators satisfy that no nonempty product is ; all products are distinct. The stabilizer-projector formula is
To verify it, group multiplication gives , Hermiticity gives , and for every . Conversely every code vector is fixed by this average, so its range is exactly . All nonidentity stabilizers have trace zero by the preceding proof. Therefore
For a code of dimension , the number of independent generators is consequently . One can list additional redundant generators, but an independent generating set has exactly this size.
For a correctable Pauli error , define the syndrome bit to be zero when commutes with and one when it anticommutes. On an encoded state,
Measure the commuting stabilizer generators; their eigenvalues reveal the error syndrome without revealing logical amplitudes. In a nondegenerate quantum code, the distinct specified correctable errors have orthogonal images of the code and distinct syndromes. A syndrome therefore identifies the error representative, and applying the inverse Pauli operator restores the encoded state.
If an actual error operator is a coherent linear combination of the specified errors, its state is a sum of these orthogonal syndrome components. Syndrome measurement selects one component, followed by the same inverse operation. The linearity of coherent quantum error correction ensures the logical state is recovered in every outcome. The same procedure handles noise Kraus operators in that error span; it does not require a probabilistic Pauli-noise assumption.
A Pauli error commuting with every stabilizer has the all-zero syndrome and preserves the code space. If it is a stabilizer up to global phase, this silent action is harmless. If it lies in the centralizer of a stabilizer group but is not a stabilizer up to phase, it acts as a nontrivial logical operator, and syndrome measurements cannot detect it. More generally, a non-scalar component of an error is an undetectable logical action. This distinguishes harmful undetected errors from scalar actions that satisfy quantum error detection algebraically.
The three-qubit bit-flip repetition code has basis and generators
A single phase flip commutes with both and has zero syndrome, but
It is a nontrivial logical phase operation. In particular, is not scalar, so the error set violates the Knill--Laflamme condition and cannot be corrected. Thus the code corrects single bit flips but not single phase flips; its distance against arbitrary quantum errors is one.
Interpret as the largest guaranteed radius for correcting all unknown-location Pauli operators of weight at most together. Products of two such errors have weight at most , so the Knill--Laflamme condition holds when . Conversely, let be a minimum-weight Pauli operator with nonscalar compression . If , split its support into two sets of size at most and write , up to an irrelevant phase. These two admissible errors violate the Knill--Laflamme condition. Thus the correctable Pauli error radius is
In particular, requires the additional assumption that is odd. Distance is not uniquely determined by alone. Nor does the weight of a particular correctable error characterize this radius: particular higher-weight errors can also be correctable.
For a concrete even-distance example, the stabilizer code generated by and has parameters . Every single-qubit nonidentity Pauli operator anticommutes with a generator, so it has zero compression. But commutes with both generators and acts nonscalarly on the code: it is unitary there and its code trace is zero. Hence the distance is two and its guaranteed radius is zero. This shows why an unconditional odd-distance formula would be incorrect.
Ignoring overall phases, an error of weight has choices of support and three choices, , at each affected qubit. The identity is the weight-zero term, so
For a nondegenerate quantum code, distinct correctable Pauli errors have orthogonal error-image subspaces. Each has dimension , since a Pauli operator is unitary. All subspaces lie in the physical Hilbert space of dimension . Counting dimensions proves the quantum Hamming bound
Degeneracy would allow distinct errors to share an error-image subspace, so this particular counting argument would then fail.
Every element of the -qubit Pauli group squares to either or . If a stabilizer generator had , closure of the group would put in , contrary to the definition. Thus . Since Pauli operators are unitary,
and proves .
If two stabilizers anticommute and a nonzero vector belonged to the codespace, then
a contradiction. Hence a nonzero stabilizer code requires to be Abelian. Its centralizer of a stabilizer group is
Quantum error correction Created 2026-09-24 Updated 2026-10-13
Quantum error correction protects a logical qubit by encoding its quantum state into a larger Hilbert space, where a specified family of physical errors can be diagnosed and reversed by a common recovery quantum channel. The requirement is to restore every encoded quantum superposition, including its relative phase, rather than only the computational basis states. A quantum error-correcting code specifies which errors have this protection; it does not promise recovery from every possible disturbance.
The beautiful idea is to measure relations between physical qubits that reveal an error syndrome while revealing nothing about the protected logical qubit. For example, the bit-flip repetition code compares neighboring qubits without reading their individual values. Its parity checks can locate one Pauli X gate error while leaving the unknown coefficients intact. Encoding is a linear isometry, consistent with the no-cloning theorem: redundancy in a shared quantum state supplies protection without making independent copies of the unknown input.
Peter W. Shor's 1995 paper [ref], published on 1 October, introduced the nine-qubit Shor code to reduce quantum decoherence in memory. Andrew M. Steane's [ref], published on 29 July 1996 and [ref], connected quantum error correction to classical linear codes; the seven-qubit Steane code protects against arbitrary errors on one physical qubit. These constructions protect relative phase as well as computational basis values, going beyond the elementary bit-flip repetition code.
For an authored account of the mechanism, see John Preskill's [ref], especially section 7.1 on collective parity measurements and section 7.9 on stabilizer codes. Andrew Steane's A tutorial on quantum error correction develops the distinction between correcting a stored quantum state and operating with imperfect quantum gates.
Stabilizer code Created 2026-09-24 Updated 2026-10-14
A stabilizer code is the common eigenspace of a stabilizer group , an abelian subgroup of the Pauli group excluding . Choose independent stabilizer generators on physical qubits. They are commuting Hermitian operators, each squaring to . The stabilizer subspace and its orthogonal projector are
The stabilizer-projector formula gives , so logical qubits remain. Independent here means that no nonempty product of the chosen stabilizer generators is . Excluding is necessary: a vector cannot simultaneously be fixed by and unless it is zero.
For the three-qubit bit-flip repetition code, take and , with the Pauli Z gate on site and identities elsewhere. The stabilizer group is . Both stabilizer generators have eigenvalue exactly on the span of and , giving dimensions for one logical qubit. A projective measurement of these checks distinguishes four orthogonal two-dimensional sectors rather than eight individual computational basis states.
A Pauli error that anticommutes with a stabilizer generator changes that check's sign, producing an error syndrome. A Pauli operator commuting with every check can still act on the logical qubits; the centralizer of a stabilizer group describes these possibilities. Thus the number of checks determines the encoded dimension, while the quantum code distance determines protection against arbitrary local errors. The five-qubit error correcting code, for instance, has four stabilizer generators and quantum code distance three; the three-qubit bit-flip repetition code has two checks but quantum code distance one because a single phase flip is unflagged. [ref].