A quantum state cannot be protected by measuring its unknown amplitudes and then preparing another copy. A useful code instead embeds a two-dimensional logical state space into a larger physical space. Carefully chosen measurements reveal which error subspace contains the state while leaving its logical coefficients undistinguished. This section develops that idea from a phase-flip code to a nine-qubit code. Throughout, tensor factors are ordered from left to right, and or acts on physical qubit and as the identity elsewhere.
Turning a phase error into a bit error
For , we have and . The three-qubit phase-flip code is
This code is obtained by applying a Hadamard to every qubit of the three-qubit bit-flip encoding . Since , a physical error in the phase code becomes an error after those Hadamards. One can therefore decode into the bit-flip basis, measure the two parity checks and , correct the indicated bit, and apply the Hadamards again.
Equivalently, remain in the phase basis and measure and . The syndrome pairs for no error, are respectively .
Worked example 3.1.1
(Syndrome and recovery for a phase flip on the middle qubit)
We have . Using , the check has eigenvalue on and on , and likewise gives on both. Hence the syndrome is . Applying recovers exactly. Neither check distinguishes the logical basis states, since both have check eigenvalue before an error, so and are never read.
This code alone does not correct all single-qubit errors. but , so changes the relative sign of an arbitrary logical superposition while producing the same two positive syndrome values as no error. It implements a nontrivial logical operation rather than a detected error.
Stabilizers and what a syndrome reveals
An -qubit Pauli operator is a tensor product of with a phase; .
Definition 3.1.2
(Stabilizer code)
A stabilizer code is the common eigenspace of a commuting group of Hermitian Pauli operators with phases that does not contain . Generators of the group are independent when no nonempty product of them is the identity.
Proposition 3.1.3
(Dimension of a stabilizer code)
If are independent commuting Hermitian Pauli operators on qubits whose group does not contain , then their common eigenspace has dimension . In particular, independent generators encode one logical qubit.
Proof
(The trace of the projector)
The dimension formula can be checked from the projector . Expanding it gives an average over the stabilizer products. Independence says that no nonempty product is , and is excluded by hypothesis, so each nonempty product is a nonidentity Pauli tensor up to a sign. Every nonidentity Pauli tensor has trace zero; the identity has trace . Thus , and a projection's trace equals its rank.
Definition 3.1.4
(Syndrome of a Pauli error)
For a fixed list of generators and a Pauli error , the syndrome of is the string of signs with .
If a Pauli error commutes with a generator , it preserves that check's eigenvalue; if it anticommutes, it flips the eigenvalue. Indeed, for a code state , the identity gives . Measuring all commuting checks therefore yields a string of signs, called the syndrome. This statement depends on a definite Pauli error; a superposition of errors can lead to different syndromes with corresponding probabilities.
Two errors need not have distinct syndromes to be correctable. If is a stabilizer up to phase, then and act identically on the code up to phase, so the same correction can restore both. Conversely, a nontrivial logical Pauli can commute with every stabilizer and therefore have the same syndrome as the identity; an undetected error need not be harmless.
A nine-qubit code
Let
and encode one logical qubit by
The eight generators can be chosen as the six within-block checks
and the two between-block checks
They commute: a pair and an check overlap in either zero or two positions, giving an even number of anticommutations. The six checks stabilize each block. The operator has eigenvalue on and on , so the products of adjacent block operators stabilize both logical basis states. The generators are independent: the two six-qubit checks have distinct nonempty block supports, and the six checks are independent within their blocks. A product of an -type and a -type element can be proportional to the identity only when both parts are trivial. Therefore the common space has dimension . Both displayed logical states lie in it and are orthogonal, so they form a basis.
The six checks locate a single bit flip: within each block their two signs are the same pattern as in the three-qubit repetition code. For example gives for and positive signs for the other four. It commutes with both checks. A error instead leaves all six checks positive. Any single on the first, second or third block flips the two check signs respectively as , or . Within one block, on any physical position swaps and ; for example and have the same action on the code because their product is a stabilizer. Thus the phase syndrome need identify the block, not the position.
A gives the bit-flip syndrome for its position and the phase-flip syndrome for its block. For a single Pauli error, measure all eight checks, apply the identified if needed and a on the identified block if needed. For the recovery may differ from the original state by an overall phase, which has no observable effect. This corrects and all single-qubit errors on an arbitrary encoded superposition, not only on the two basis states.
Worked example 3.1.5
(Two different errors, one syndrome, one correction)
Take and in the second block. Both anticommute with and and commute with every check, so both have syndrome . This is a degenerate situation: the syndrome does not say which of the three positions was hit. It does not need to. The product is a product of two stabilizer generators, so and therefore . Applying after either error returns exactly.
Worked example 3.1.6
(Reading the syndrome of a error)
Since , it combines the bit-flip part and the phase-flip part . Against the checks , the factor anticommutes only with and , so the signs are . Against the checks, the factor anticommutes with and with , so the signs are . The phase does not change any sign. The recovery applies and then a on the second block, for example ; this returns the encoded state up to an overall phase.
Concept lensStructural
The nine-qubit code as two concatenated three-qubit codes
Replace each qubit of the phase-flip code of the opening section by the three-qubit bit-flip encoding , . Then becomes , and the result is exactly , . In this reading the six checks are the bit-flip parity checks inside each inner code. The inner logical is on a block, so the two checks are the phase-code checks written on the inner logical qubits. An inner code absorbs bit flips; the outer code absorbs the phase flips that the inner code turns into logical errors.
From Pauli errors to a general single-qubit error
Theorem 3.1.7
(Single-qubit error correction for the nine-qubit code)
Let be any operator acting on one physical qubit of the nine-qubit code. Measure the eight checks and apply the Pauli correction for the observed syndrome described in the nine-qubit-code section. Then for every encoded state and every outcome of nonzero probability, the corrected state equals up to normalization and an overall phase.
Proof
(Expand in Paulis, then group by syndrome)
The four matrices form a basis for complex matrices. Hence any operator on one physical qubit can be written . For an encoded state, is a linear combination of the corresponding Pauli-error states. Syndrome measurement projects that combination onto the associated error subspaces. For the set consisting of the identity and every single-qubit Pauli error, the checks of the nine-qubit-code section show that two errors with the same syndrome are equivalent on the code up to phase: nonzero bit syndromes identify the physical position, and a nonzero phase syndrome identifies the block; pure errors in the same block differ by a stabilizer. Thus for each such pair , the product is a stabilizer up to phase. The same recovery works for the whole projected component, so measurement and recovery restore the logical state, up to the appropriate probability and normalization.
Proof X-ray
What the single-qubit argument uses, and what it cannot use
The argument has one non-obvious move: it does not ask the syndromes of the 28 error operators to be distinct, only that errors sharing a syndrome have equal to a stabilizer up to phase. The only coincidences in the table are and their analogues in the other blocks, and these differ by the stabilizers and . Linearity is used twice: to reduce an arbitrary operator to the four-term expansion on one qubit, and to let one recovery act on a whole sum of equivalent error terms. The hypothesis that is supported on one qubit is what keeps the error list inside the table. Sharing a syndrome alone would not suffice for an arbitrary pair; the next example shows an error of weight two that already breaks the criterion.
More generally, a physical noise channel with Kraus operators each supported on at most one physical qubit is corrected by linearity on density operators, provided the code corrects the terms in their Pauli expansions. The Kraus operators may describe a probabilistic mixture or coherent errors; they need not themselves be Pauli matrices. This assertion depends on the stated support restriction. An arbitrary error acting jointly on two or more physical qubits is not covered. In particular, independent noise acting on every physical qubit generally has product Kraus operators of higher weight and is not an exact single-error channel.
Counterexample mode
A code that corrects one error does not correct two
Plausible claim: since the code corrects and separately, it corrects the double error . Check the syndrome. anticommutes with (through ) and commutes with (it anticommutes with both and ) and with all other checks, so its syndrome is on only. The error has the same syndrome. The recovery therefore applies , leaving . This operator commutes with every check, and it has eigenvalue on and on , so it maps to . For this is a different state, so the correction fails. The claim holds only under the one-qubit support hypothesis.
Common mistake
(Reading a trivial syndrome as no error)
All eight signs positive means only that the error commutes with every stabilizer. The operator above has the trivial syndrome and yet acts as the logical operator, which changes the encoded state. Syndrome information tells you which error subspace the state is in; it does not certify that the state is unchanged.
Error correction is not yet fault tolerance
The calculations above assume ideal encoding, syndrome measurement and correction. A real check circuit can itself suffer faults, and a single fault can propagate to several physical qubits. Fault-tolerant design must control that propagation, use reliable syndrome extraction and account for noisy operations, often with repeated measurements and further encoding. A correctable single-error model alone gives no threshold or quantitative guarantee for a particular device.
Practice with solutions
Quick check
(For the three-qubit phase code, find the syndrome of under and , and identify a correction.)
Decide which check contains .
Solution · Answer
anticommutes with and commutes with , giving ; applying again corrects it.
Quick check
(In the nine-qubit code, compare the syndromes and effects on encoded states of and .)
Look at the product .
Solution · Answer
Both have positive -check signs and -check signs . Their product is a stabilizer, so they act identically on the code. Both take the code into a detectable error subspace; either or corrects it.
Quick check
(Find the six -check signs and the two -check signs for a single error, and give the correction.)
List which checks contain position .
Solution · Answer
Only contains among the checks, so the signs in the order are . An error commutes with both checks, giving . The correction is .
Quick check
(Why does applying the code's single-error correction to not in general recover the original logical state?)
Compare the syndrome of with that of a single error.
Solution · Answer
Its first-block bit syndrome matches ; the correction leaves , which applies logical in the displayed code basis. It changes, for example, into the orthogonal minus superposition.