Shor Code
The Shor code encodes one logical qubit into nine physical qubits and exactly corrects every error in the linear span of the identity and all single-qubit Pauli operators. It was the first explicit quantum error-correcting code and remains the clearest example of how protection against bit- and phase-flip components can be combined without measuring an unknown logical state. In modern notation it is a degenerate CSS stabilizer code with parameters .
Its construction is deliberately redundant. Three blocks of three qubits first expose the two classical repetition mechanisms: parity checks within each block locate a bit-flip component, while comparisons between block phases locate a phase-flip component. The stabilizer formulation then turns that picture into an exact quantum statement. Eight independent commuting checks define a two-dimensional code space, weight-three normalizer elements act as logical Paulis, and the Knill–Laflamme condition proves correction of arbitrary coherent one-qubit noise, including noise entangled with an external environment.
The code is degenerate in a concrete and useful sense. The three phase flips within the first block have the same syndrome and the same action on every code state; similarly for the other two blocks. Consequently, the identity and twenty-seven weight-one Paulis occupy twenty-two, not twenty-eight, distinguishable error sectors. Recovery needs to identify an equivalence class that reverses the damage, not reconstruct a microscopic story about which indistinguishable phase flip occurred.
This page treats the ideal finite code exactly: its codewords, stabilizers, logical representatives, occupied syndrome ledger, recovery map, distance, degeneracy, and a fixed-decoder depolarizing calculation. It does not turn a bare check circuit into a fault-tolerant gadget, assign a hardware threshold, or count nine data qubits as the total implementation cost.
Required background. Stabilizer Formalism supplies stabilizer groups, code projectors, normalizers, logical cosets, distance, and syndrome algebra. Three-Qubit Codes supplies the targeted bit- and phase-repetition encodings, their ideal lookup recoveries, and the distinction between restricted repetition distance and full Pauli distance.
Helpful background. Why Quantum Error Correction Is Possible develops the encoding-isometry and operator-span viewpoints. Pauli Noise and Depolarizing Channels fixes the channel convention used in the final finite-block calculation.
The Nine-Qubit Logical Subspace
Section titled “The Nine-Qubit Logical Subspace”One declared block and tensor convention
Section titled “One declared block and tensor convention”Number the physical qubits from one through nine and divide them into three ordered blocks,
Tensor strings are read from qubit one on the left to qubit nine on the right. An omitted tensor factor is the identity. For example, means , and means . Operators act on kets from right to left, and global phases of state vectors or recovery Paulis have no operational effect. Relative signs inside a codeword are not global phases and must be retained.
Define the normalized three-qubit cat states
They obey
with the qubit labels shifted appropriately for blocks and . A single on any site of a block exchanges and . A single takes the block out of the span of those two cat states, but the two adjacent -parity checks record which site changed. These two elementary facts underlie the entire nine-qubit construction.
Normalized codewords and logical amplitudes
Section titled “Normalized codewords and logical amplitudes”Choose the logical computational basis
Each tensor product contains eight mutually orthogonal computational-basis terms with amplitudes of magnitude . The states are normalized, and they are orthogonal because in every block. The minus sign in occurs inside each of the three cat factors. Replacing it by one overall minus sign would merely change the global phase of and would not define the second logical basis state.
For example, expanding the first codeword in the declared tensor order gives
The eight equal amplitudes make and explicit. The corresponding expansion of carries a sign when exactly of its three blocks equal .
The encoding isometry is therefore
Linearity preserves an unknown logical superposition:
No amplitude or is measured or copied. The encoder moves the two-dimensional input into a particular entangled subspace of nine qubits. The redundancy lies in correlations that checks can interrogate without distinguishing the logical basis amplitudes.
Historical scope and name boundary
Section titled “Historical scope and name boundary”Shor’s 1995 construction described the code directly in terms of the three cat-state blocks and showed how an arbitrary interaction affecting one qubit could be reversed without destroying an existing superposition. The paper predates the now-standard stabilizer vocabulary. Gottesman’s later group-theoretic formulation makes the code’s checks, logical operators, degeneracy, and distance transparent, while Preskill and Nielsen and Chuang develop the code as a central bridge from repetition to general quantum error-correction conditions.
The historical achievement is an exact code-level theorem. It assumes that encoding, syndrome processing, and recovery can be implemented as specified. Shor already emphasized that imperfect restoration operations introduce new errors; the separate problem of making those operations fault tolerant is not solved merely by writing the codewords.
Four related names must stay separate. This page owns Shor’s nine-qubit code. Shor-style verified-cat-state extraction is a broader circuit family and does not follow merely from drawing the code’s checks. The Shor Algorithm is the canonical owner of factoring and period finding, not an error-correcting code. Bacon–Shor codes are subsystem constructions and must not be imported into this page.
Stabilizers and Logical Paulis
Section titled “Stabilizers and Logical Paulis”Eight independent CSS checks
Section titled “Eight independent CSS checks”The code is the simultaneous eigenspace of six -type checks and two -type checks. The following table also freezes the logical and projector conventions used throughout the page.
| Field | Frozen value |
|---|---|
| Physical qubits | |
| Logical qubits | |
| Full distance | |
| Block partition | , , |
| Six -type checks | , , , , , |
| Two -type checks | , |
| Code projector | |
| Logical basis | , |
| Convenient | |
| Convenient | |
| Correctable Pauli basis | |
| Structural status | Concatenated CSS stabilizer code; degenerate; not perfect |
In the fixed generator order used below, the eight checks are
The -type generators commute because they are diagonal. Each six-body check overlaps an included two-body check on either zero or two sites. Two Pauli strings anticommute only when the number of local anticommutations is odd, so every -type generator commutes with every -type generator. The two checks commute with one another as well.
Independence can be seen without multiplying all products. Within each block the two adjacent checks are independent, giving six independent binary constraints. A product involving or has nonzero support, so it cannot equal a product of the first six generators. Their -support rows, and , are themselves independent. Thus the stabilizer has eight independent generators and contains neither nor a hidden relation among the displayed checks.
Each codeword has eigenvalue under all eight generators. The inner checks stabilize both and in their block. For , the eigenvalues of blocks and multiply to both for and for . The same argument applies to and blocks .
Projector and code dimension
Section titled “Projector and code dimension”Because every is a commuting Hermitian involution, its projector is . Their product is the code projector
It is Hermitian and idempotent. Expanding the product gives one term for each stabilizer element. Every nonidentity Pauli has zero trace, so only the identity contributes to :
The simultaneous eigenspace therefore encodes exactly one logical qubit. The two orthonormal codewords already lie in it, so they form a complete basis for . Equivalently,
The dimension argument matters because satisfying a collection of checks is not by itself enough to establish which code has been defined. Generator signs, commutation, independence, and the resulting rank must all agree. A minus sign on one generator would select a different syndrome sector, while an unnoticed relation would change the encoded dimension.
Logical Pauli representatives and equivalences
Section titled “Logical Pauli representatives and equivalences”The physical operator reads the cat-state sign in block :
It is therefore logical , despite being composed of physical operators. Multiplication by the outer stabilizers gives equivalent representatives,
Here means , so the two operators act identically on the code space.
A physical on one site exchanges and in its block. Applying one in each block therefore exchanges the logical basis states:
Within a block, any two choices differ by a weight-two stabilizer. Hence all strings with , , and represent logical . The declared is only a convenient member of that coset.
The representatives commute with every stabilizer but anticommute with one another because their supports meet at qubit one with physical factors and . They are in the normalizer but not in . Their physical letters must not be used to rename their logical actions: with the codeword convention fixed above, is and is . The third logical Pauli is fixed by
Nested Bit- and Phase-Repetition Structure
Section titled “Nested Bit- and Phase-Repetition Structure”Outer phase and inner bit encoders
Section titled “Outer phase and inner bit encoders”Let first denote three outer qubits. The phase-repetition encoder is
Its checks are and . Each outer qubit is then encoded by a bit-repetition encoder,
By linearity, an outer becomes and an outer becomes . The nested encoder thus reproduces the two Shor codewords exactly.
For the inner bit code, logical may be represented by the product of three physical operators in block , while logical may be represented by any one physical in that block. Substituting these representatives into the outer checks gives
and
The inner encoders contribute their six adjacent checks. This substitution derives the complete stabilizer rather than guessing it from the final codewords.
Stabilizer-support schematic for the Shor code. The six within-block checks locate bit-flip components, while the two overlapping six-qubit checks locate phase-flip components by block. This support diagram is not a syndrome-extraction circuit and does not by itself establish fault tolerance.
CSS substitution and the targeted-distance caveat
Section titled “CSS substitution and the targeted-distance caveat”The stabilizer is CSS because every displayed generator is purely type or purely type. In binary form, the -check and -check support matrices may be written
and
Their rows have even overlaps, equivalently over . Calderbank and Shor and, independently, Steane developed the classical-code structures now called CSS codes. The Shor code can be understood retrospectively in that language even though Shor’s original presentation preceded the standard terminology. The general CSS construction and Steane’s seven-qubit code require their own canonical treatments; this page uses only the finite matrices needed here.
The phrase “concatenated repetition” must be interpreted with care. The three-qubit bit-repetition code corrects a declared span of single errors, and its Hadamard-conjugate phase code corrects a declared span of single errors. Each has full-Pauli parameters , because a complementary weight-one Pauli is already logical. It is therefore incorrect to call the nine-qubit construction a concatenation of two full quantum codes or to infer its distance by multiplying two nonexistent full-Pauli distances.
What the nested picture does establish is an error-component workflow. The inner checks diagnose the component of a Pauli, while the outer checks diagnose the block parity of its component. Since , a single activates both records. The full stabilizer and normalizer analysis below is what upgrades that intuition to the exact claim.
Twenty-Two Single-Error Syndromes and Ideal Recovery
Section titled “Twenty-Two Single-Error Syndromes and Ideal Recovery”Ordered eight-bit syndrome convention
Section titled “Ordered eight-bit syndrome convention”For a phase-free Pauli , define the syndrome bit of generator by
Thus corresponds to a check outcome on , and corresponds to a outcome. Store the bits in the fixed order
The first six bits are the three within-block pairs; the last two compare block phases. Syndrome addition is binary:
This is why the syndrome of , up to its irrelevant scalar phase, is the XOR of the syndromes of and .
For each block, the adjacent inner pair has location patterns
The outer pair uses the same three patterns for blocks , respectively. This repeated convention makes the ledger readable, but the six inner positions and two outer positions must never be interchanged.
Complete one-error syndrome ledger
Section titled “Complete one-error syndrome ledger”The following table lists every syndrome occupied by the identity or a weight-one Pauli. A grouped row denotes three physically distinct errors with identical code-space action.
| Error class | Members | Syndrome | Chosen phase-free correction |
|---|---|---|---|
00000000 | |||
10000000 | |||
11000000 | |||
01000000 | |||
00100000 | |||
00110000 | |||
00010000 | |||
00001000 | |||
00001100 | |||
00000100 | |||
00000010 | |||
00000011 | |||
00000001 | |||
10000010 | |||
11000010 | |||
01000010 | |||
00100011 | |||
00110011 | |||
00010011 | |||
00001001 | |||
00001101 | |||
00000101 |
There are exactly twenty-two occupied classes:
The other of the possible eight-bit strings are not produced by the promised set of identity and weight-one Pauli errors. They can be produced by higher-weight errors. A real decoder may still assign corrections to them, but those assignments are outside the exact one-error guarantee.
Each syndrome projector has the form
and has rank two. Under correctable errors, only twenty-two such sectors are reached, for a total reached dimension of inside the -dimensional physical Hilbert space. The unused sectors are another reminder that the Shor code is not a perfect packing code.
Separated recovery and Pauli frames
Section titled “Separated recovery and Pauli frames”An ideal lookup recovery may be specified by one representative correction for each occupied syndrome. For a nonzero inner pair, apply at the indicated physical site. For a nonzero outer pair, apply at a fixed site of the indicated block, for example site one of that block. When both records are nonzero, combine those two corrections. The order changes at most a global Pauli phase and therefore not the recovered density operator.
For example, has outer pattern . Choosing gives
which acts trivially on the code. For , the syndrome is
00110011. A separated choice gives, up to a scalar phase,
Applying itself would also recover that particular error. The separated choice emphasizes that the phase record identifies only a block, not a site.
The ideal channel can be written
where the displayed sum covers the occupied correctable sectors and completes the map on their orthogonal complement. Its action on that complement does not affect the exact promised-input theorem.
A device need not physically apply every Pauli correction. It may update a Pauli frame and reinterpret later operations or readout. That operational choice does not change which error class the syndrome identifies. Physical check circuits, repeated noisy outcomes, detector records, and measurement sign conventions belong to Syndrome Measurement, not to this ideal ledger.
Exact Correction of Arbitrary One-Qubit Noise
Section titled “Exact Correction of Arbitrary One-Qubit Noise”The degenerate Knill–Laflamme matrix
Section titled “The degenerate Knill–Laflamme matrix”Consider the ordered phase-free error basis
Knill and Laflamme’s necessary and sufficient condition for exact recovery is
for a Hermitian matrix independent of the encoded state. For the declared Shor convention, direct Pauli algebra gives
where is the all-ones matrix. The block belongs to , the nine errors, and the nine errors. Each block belongs to the three errors within one physical block.
The off-diagonal entry for , for example, is nonzero because
By contrast, if anticommutes with any stabilizer generator, then
The matrix has eigenvalues with multiplicity nineteen, with multiplicity three, and with multiplicity six. Hence
This rank equals the number of occupied syndrome classes. Combinations such as annihilate every codeword and correspond to zero modes of . A recovery does not need, and cannot obtain, information that distinguishes such equivalent actions. Replacing by a Kronecker delta would falsely declare the Shor code nondegenerate.
Coherent one-qubit noise
Section titled “Coherent one-qubit noise”Every operator acting on a fixed physical qubit has a Pauli expansion
More generally, every Kraus operator of a channel supported on that qubit has this form. The Knill–Laflamme condition is stable under linear combinations: if
then
Thus correcting the finite Pauli basis corrects the complete operator span. The theorem covers a small coherent rotation such as
for arbitrary angle and axis, not only a classical mixture in which one Pauli is secretly chosen. Nielsen and Chuang use this discretization of continuous errors to explain why a finite syndrome record can reverse a continuum of one-qubit disturbances.
If the syndrome is measured, coherent components associated with distinct syndrome sectors become different recorded branches. Equivalent components, such as the three errors in one block, need not be separated because they already have the same action on the code. Alternatively, the entire recovery can be implemented coherently with an ancilla and no readout. Measurement is a convenient realization, not the mathematical reason the operator span is correctable.
The phrase “arbitrary one-qubit noise” specifies support, not a distribution. It allows the affected site to be unknown and even permits coherent linear combinations across the listed correctable operators. It does not include a generic correlated operator with simultaneous support on two or more physical qubits.
Reference-entangled one-qubit noise
Section titled “Reference-entangled one-qubit noise”Let be an external reference and let denote the encoded logical subsystem. Exact quantum error correction must preserve correlations with , not merely recover isolated pure codewords. A one-qubit system–environment isometry can be expanded as
where the environment vectors need not be normalized or orthogonal. The Knill–Laflamme matrix being independent of means that the environment obtains no information that distinguishes logical states.
For every density operator supported on the logical code space, there is a recovery such that
on the restored logical output, with syndrome or recovery ancillas discarded as specified. In a dilation, the auxiliary output may remain correlated with the environment, but its state is independent of the logical amplitudes. The recovery transfers error entropy away from the logical subsystem rather than undoing the inaccessible environment’s microscopic evolution.
Knill and Laflamme explicitly connect their conditions to preservation of a maximally entangled state, which is why reference-system fidelity is the right exact test. Shor’s original system–environment argument already contains this essential insight: corresponding environment states must be the same for the two logical basis components. Testing only and as classical alternatives would miss the coherence requirement.
Distance Three, Degeneracy, and Errors Outside the Promise
Section titled “Distance Three, Degeneracy, and Errors Outside the Promise”No logical operator below weight three
Section titled “No logical operator below weight three”Write a phase-free Pauli as a binary symplectic vector in . Commutation with and requires
The other inner checks similarly require
If a normalizer element has physical weight at most two, none of these three-bit blocks can be nonzero. It must therefore contain only and factors.
Let be the parity of its support in blocks . Commutation with and gives
so . Weight at most two excludes the odd possibility . Every block must have even parity. A nonidentity operator of weight at most two is consequently a pair of operators in one block, and every such pair lies in the stabilizer generated by that block’s adjacent checks.
Therefore there is no member of below weight three. The declared and are weight-three members of , proving both inequalities
Distance three implies exact correction of all weight-one errors because a product has weight at most two and is either a stabilizer on the code or anticommutes with a check. It also means every weight-two Pauli satisfies the error-detection condition . When is a weight-two stabilizer, : it has zero syndrome because it is harmless, not because the distance proof failed.
Weight-two stabilizers and code degeneracy
Section titled “Weight-two stabilizers and code degeneracy”Each block contributes three weight-two stabilizers,
with shifted labels for blocks and . Hence the stabilizer contains nine weight-two elements. Exhaustive multiplication of its elements gives the weight enumerator
The coefficients sum to , as required for an eight-generator stabilizer. The weight-two coefficient supplies a finite algebraic diagnostic of degeneracy. For example,
for every code state, because each pairwise product is in .
Preskill uses precisely these within-block phase errors to distinguish the general Knill–Laflamme matrix from the stronger nondegenerate condition. The same fact should not be described as a decoder defect. Microscopic indistinguishability is acceptable when the alternatives require the same logical recovery.
The code does not saturate the nondegenerate one-error quantum Hamming count:
It is therefore not a perfect code. The quantum Singleton inequality is also loose here, since . The nine-qubit code is historically and pedagogically important, not length minimal; the Five-Qubit Code owns the distinct perfect-packing and minimum-length results.
Two explicit higher-weight aliases
Section titled “Two explicit higher-weight aliases”A distance-three code promises correction through weight one, not through weight two. The ideal lookup can misidentify a higher-weight syndrome as a correctable one. For example,
The one-error lookup applies , leaving
The state returns to the code space with a logical phase error. The syndrome did not contain enough information to distinguish one flip at site three from two flips at sites one and two.
A complementary example uses phase components in two blocks:
Choosing as the block- correction leaves
Some weight-two errors are nevertheless harmless stabilizers, and some may be corrected accidentally by a particular decoder. Distance specifies the uniform guarantee; it does not say that every error just outside the promise must fail.
Independent depolarizing fixture
Section titled “Independent depolarizing fixture”To audit a decoder beyond its exact promise, fix the separated recovery for all syndromes: correct each block’s inner repetition pattern and then correct the outer block-phase repetition pattern. Let every physical qubit undergo the independent depolarizing channel
Exhaustive classification of all phase-free Pauli strings by physical weight and residual logical class gives the following finite ledger. The Total column is the required check .
| Physical Pauli weight | Total | ||||
|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 27 | 27 | 0 | 0 | 0 |
| 2 | 324 | 180 | 108 | 0 | 36 |
| 3 | 2268 | 804 | 756 | 216 | 492 |
| 4 | 10206 | 2502 | 2628 | 2520 | 2556 |
| 5 | 30618 | 6858 | 6876 | 8928 | 7956 |
| 6 | 61236 | 14580 | 15252 | 15792 | 15612 |
| 7 | 78732 | 20916 | 20556 | 18072 | 19188 |
| 8 | 59049 | 15633 | 14652 | 14328 | 14436 |
| 9 | 19683 | 4035 | 4708 | 5680 | 5260 |
Each row sums to , and all rows sum to .
Summing the three nonidentity logical columns with probability gives
The leading coefficient has a direct count. At weight two, strings have two or components within one block and leave ; another have or components in two different blocks and leave . Therefore
Useful global checks are and . At every nine-qubit Pauli string is equally likely, and each residual logical coset has elements. This calculation is an exact ideal-block result for this recovery and this independent channel. It is not a code-capacity threshold, circuit-level forecast, decoder optimum, device prediction, or result for correlated or leakage noise.
Extraction, resources, and historical scope
Section titled “Extraction, resources, and historical scope”The parameter counts data qubits in one code block. It omits state preparation, ancillas, verified cat states, entangling gates, check repetition, measurement, reset, routing, connectivity, classical inference, latency, discarded trials, logical operations, and spare resources. Even an ideal measurement of the six-body checks is a physical operation whose implementation must be specified.
A bare circuit that couples one ancilla sequentially to six data qubits can spread one ancilla fault to several data sites. DiVincenzo and Shor’s fault-tolerant error-correction analysis made dangerous ancilla-fault fanout explicit and developed systematic protected procedures. A high-weight stabilizer equation therefore licenses an ideal observable, not a claim that the most obvious circuit measuring it is fault tolerant.
Shor’s original memory calculation showed quadratic suppression under a small, independent-error idealization and warned that imperfect restoration operations compete with storage noise. The exact polynomial above is a modern, fully enumerated version for a specifically declared Pauli channel and hard decoder, not a replacement for a noisy syndrome-extraction study. Fault-Tolerant Gates owns bounded fault propagation and protected logical gadgets. Error Correction Case Studies owns dated experimental records and evidence dispositions.
Canonical Owners and Boundaries
Section titled “Canonical Owners and Boundaries”What this page owns and where to continue
Section titled “What this page owns and where to continue”This page is the canonical home of the nine-qubit Shor code in the declared convention: the cat-product logical basis, eight stabilizer generators, projector and encoded dimension, logical Pauli representatives, concatenated repetition interpretation, twenty-two occupied one-error syndrome classes, ideal recovery, degenerate Knill–Laflamme matrix, full-Pauli distance proof, weight enumerator, two explicit aliases, and fixed-decoder depolarizing fixture.
The surrounding owners separate those finite results from broader claims:
- The Quantum Error Correction and Fault Tolerance guide routes among code algebra, extraction, inference, gadgets, thresholds, resources, and evidence classes.
- Why Quantum Error Correction Is Possible owns the general encoding-isometry, information-leakage, operator-span, and Knill–Laflamme explanations.
- Stabilizer Formalism owns general Pauli symplectic algebra, normalizers, logical cosets, projectors, Clifford updates, and tableaus.
- Three-Qubit Codes owns the individual targeted repetition codes and why their restricted distance is not full Pauli distance.
- The Five-Qubit Code owns the nondegenerate cyclic perfect code, complete sixteen-sector lookup, Hamming saturation, and minimum-length proof.
- Syndrome Measurement owns signed physical check instruments, ordered fault propagation, repeated outcomes, and detector records.
- Decoders owns probabilistic inference among equivalence classes when the noise model and syndrome history go beyond this promised lookup.
- Fault-Tolerant Gates owns gadget correctness, controlled fault spread, protected logical operations, and code-switching boundaries.
- Pauli Noise and Depolarizing Channels owns channel parametrizations, Pauli transfer descriptions, composition, twirling boundaries, and noise-model qualifications.
- Error Correction Case Studies owns dated experimental records, matched demonstrations, and evidence dispositions.
Steane Code owns the seven-qubit Hamming-derived, weakly self-dual, nondegenerate CSS construction and its code-specific transversal Clifford action. CSS Codes owns the general matrix, nesting, logical-quotient, and distance construction; this page retains its exact concatenated, degenerate nine-qubit code, syndrome ledger, recovery, distance proof, and depolarizing polynomial. Likewise, an encoding demonstration, a syndrome experiment, and repeated logical-memory operation are different evidence classes. None follows merely from the existence of the ideal code.
Exercises
Section titled “Exercises”1. Codeword and logical-action audit
Section titled “1. Codeword and logical-action audit”Using the declared block order, prove that and are normalized and orthogonal. Verify that all eight generators stabilize both codewords. Then compute the action of and on the logical basis and identify their logical Pauli names.
Solution
Each cat factor is normalized, so each three-factor product is normalized. Their overlap factorizes as
Within each block, and give eigenvalue on both and ; the shifted checks work identically. The eigenvalue of is , while that of is . Each outer check multiplies two block eigenvalues, giving on both logical codewords.
On the logical basis,
so this physical triple is . A in one block exchanges and . Therefore one in every block exchanges all three signs,
and is . Their one-site anticommuting overlap confirms the logical Pauli algebra.
2. Construct the concatenated stabilizer
Section titled “2. Construct the concatenated stabilizer”Start from the outer phase-repetition code with codewords and encode each outer qubit with the three-qubit bit-repetition code. Derive the eight physical stabilizer generators and the declared logical and . Explain why this construction does not justify multiplying two full-Pauli distances of three.
Solution
The outer phase code has checks and . Each inner bit code has two checks and . These give the six adjacent generators after assigning physical labels to blocks .
For an inner bit code, logical is the three-body product of physical operators. Substituting into the outer checks gives
and
Outer logical may be represented by , which becomes . Outer logical is . An inner logical may be any one physical in block , giving as one choice.
The component repetition codes correct only a declared Pauli axis. In the full Pauli group each is , not . The nested encoder explains the checks and component workflow, but the separate normalizer proof is required to establish full distance three for the nine-qubit code.
3. Reconstruct the syndrome ledger
Section titled “3. Reconstruct the syndrome ledger”Derive the inner location patterns and the outer block patterns . Use them to compute the full syndromes of , , and . Give one valid recovery for each and identify any stabilizer left after recovery.
Solution
In one block, an or at the first site anticommutes only with the first adjacent check, giving . At the second site it anticommutes with both, giving ; at the third it anticommutes only with the second, giving . A or in block anticommutes with only, in block with both outer checks, and in block with only.
Therefore
and
For , choose correction ; the residual is . For , choose and the residual is the identity. For , applying directly gives the identity. A separated decoder may instead apply , leaving up to a scalar phase. Both recoveries act identically on the code space.
4. Build the degenerate Knill–Laflamme matrix
Section titled “4. Build the degenerate Knill–Laflamme matrix”For the ordered basis
determine every nonzero block of in . Find the rank and eigenvalues, and explain why a diagonal identity matrix would be wrong.
Solution
Every diagonal entry is one because each phase-free Pauli is unitary. Products between distinct or representatives, or between those errors and any other class, anticommute with at least one generator and therefore project to zero. The exception is a pair of errors in the same block. Their product is one of the nine weight-two stabilizers, so the projected product is .
Consequently
Each all-ones block has eigenvalues . Thus the full spectrum contains nineteen eigenvalues equal to one, three equal to three, and six equal to zero, giving rank twenty-two.
The zero modes include combinations such as , which annihilate the code space. A diagonal identity would assign orthogonal sectors to and , even though for every code state. The general Knill–Laflamme condition allows this degeneracy; it requires logical-state independence, not microscopic error distinguishability.
5. Prove distance three
Section titled “5. Prove distance three”Use binary symplectic variables to prove that every normalizer element of weight at most two is a stabilizer. Then exhibit a weight-three nontrivial logical operator. State separately what this proves about error detection and one-error correction.
Solution
Commutation with the two inner checks in each block forces the three components in that block to be equal. Weight at most two therefore forces all components to vanish. The candidate normalizer element contains only factors.
Let be the -support parity in the three blocks. Commutation with the two outer checks gives and , hence . At weight at most two they cannot all be odd, so each is even. The only nonidentity possibility is two factors in one block, which is a stabilizer.
Thus has no element of weight one or two. The operator is a weight-three member, as is , so .
Every Pauli of weight below three satisfies , which is the detection condition; a weight-two stabilizer has and is harmless. For two weight-one errors , the product has weight at most two, establishing the Knill–Laflamme condition and exact correction through one arbitrary physical-qubit error.
6. Recover coherent and reference-entangled noise
Section titled “6. Recover coherent and reference-entangled noise”Let one physical qubit undergo an arbitrary system–environment isometry. Expand it in the Pauli basis and explain why the same recovery works without knowing the coefficients or environment vectors. Then state the required result when the encoded qubit is entangled with a reference.
Solution
For an affected site , write
The environment vectors may overlap and need not be normalized. Exact correctability of the Pauli span means a recovery can coherently map each occupied error sector back to the code while transferring the sector label to an ancilla. Degenerate components need not be separated because their actions already agree on the code. No coefficient or environment state enters the recovery lookup.
If is an untouched reference, linearity and the logical-state-independent Knill–Laflamme matrix imply
on the restored logical subsystem for every encoded . The environment and recovery ancilla may remain correlated with each other, but their joint state cannot depend on the logical amplitudes. Recovering only the two basis states without their coherence would not suffice.
7. Diagnose two explicit aliases
Section titled “7. Diagnose two explicit aliases”Under the promised one-error lookup, analyze and . For each, compute the syndrome, the selected correction, and the residual logical class. Explain why these examples do not imply that every weight-two error fails.
Solution
Binary syndrome addition gives
The lookup applies , and the residual is .
Similarly,
With as the block- representative correction, the residual is . In both cases the correction returns the state to the code space but changes the encoded qubit.
These are decoder-relative logical aliases outside the promised error set, not examples of degeneracy. They witness that the one-error lookup does not uniformly correct weight two, but they do not classify all weight-two errors. For instance, is a stabilizer and has no logical effect. Other errors can be corrected accidentally depending on the decoder. Distance three states the uniform correction radius and the minimum logical weight, not that every error outside the radius must cause failure.
8. Audit the ideal depolarizing decoder
Section titled “8. Audit the ideal depolarizing decoder”For independent depolarizing noise, count the weight-two Pauli strings that produce logical or logical under the separated repetition decoder. Derive the leading term of . Then explain the checks and and the limits of the result. As a computational extension, enumerate all phase-free Pauli strings to reproduce the full residual enumerator or logical-failure polynomial.
Solution
A logical occurs when two physical errors in one block both have an component. Choose the block in three ways, the pair of sites in three ways, and choose or independently on the two sites in four ways:
A logical occurs when two errors in different blocks both have a component. Choose the two blocks in three ways, one site in each in nine ways, and choose or independently in four ways:
Each particular weight-two Pauli has leading probability , so
At only the identity occurs, so failure vanishes. At , each one-qubit Pauli is equally likely and therefore all strings are equally likely. The recovery partitions them equally among four residual logical classes, giving failure probability .
For the computational extension, encode each phase-free Pauli string as nine base-four digits, compute its eight-bit syndrome, apply the fixed separated recovery, and reduce the residual modulo the stabilizer. Accumulating by physical weight and residual logical class reproduces the full table above; substitution into
reproduces the displayed degree-nine logical-failure polynomial.
The full polynomial requires the fixed recovery on all syndromes and the declared independent Pauli channel. It says nothing by itself about faulty extraction, correlated noise, leakage, decoding latency, thresholds, or a device implementation.
References
Section titled “References”- A. R. Calderbank and P. W. Shor, “Good quantum error-correcting codes exist,” Physical Review A 54, 1098–1105, 1996, doi:10.1103/PhysRevA.54.1098.
- D. P. DiVincenzo and P. W. Shor, “Fault-tolerant error correction with efficient quantum codes,” Physical Review Letters 77, 3260–3263, 1996, doi:10.1103/PhysRevLett.77.3260.
- D. Gottesman, Stabilizer Codes and Quantum Error Correction, Ph.D. thesis, California Institute of Technology, 1997, doi:10.7907/rzr7-dt72, arXiv:quant-ph/9705052.
- E. Knill and R. Laflamme, “Theory of quantum error-correcting codes,” Physical Review A 55, 900–911, 1997, doi:10.1103/PhysRevA.55.900.
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary edition, Cambridge University Press, 2010, doi:10.1017/CBO9780511976667.
- J. Preskill, Quantum Information, Chapter 7, “Quantum Error Correction,” working draft updated March 2026, pre-publication chapter.
- P. W. Shor, “Scheme for reducing decoherence in quantum computer memory,” Physical Review A 52, R2493–R2496, 1995, doi:10.1103/PhysRevA.52.R2493.
- A. M. Steane, “Error correcting codes in quantum theory,” Physical Review Letters 77, 793–797, 1996, doi:10.1103/PhysRevLett.77.793.