Steane Code
The Steane code uses seven physical qubits to protect one logical qubit against an arbitrary error on any one of them. Its central idea is to use the same classical Hamming checks twice: once to diagnose bit flips and once to diagnose phase flips. The resulting code also supports simple physical implementations of logical Clifford gates.
We will build the code from a small binary matrix, decode its syndromes, and derive those logical gates—including the easily missed direction of the phase gate. Encoding, measurements, and gates are assumed ideal. The construction originates in Steane’s 1996 work; his longer treatment develops the classical-code connection.
Required background. Stabilizer Formalism explains commuting Pauli checks, code projectors, logical operators, and error syndromes. Binary addition below is modulo two.
A Hamming matrix for both kinds of error
Section titled “A Hamming matrix for both kinds of error”Number the qubits , with qubit 1 on the left in written strings. Use the classical check matrix
The subscript distinguishes this binary matrix from the quantum Hadamard gate . Its columns are the binary representations of the integers , written with the most significant bit first. Thus a classical single-bit error at location 5 has syndrome .
Define
The three independent rows give and . Each row has weight four, and distinct rows overlap twice. Therefore
This inclusion is the crucial compatibility condition. The classical code is dual-containing, not literally self-dual: and have different dimensions. The quantum code is often called weakly self-dual because its X and Z checks have identical supports.
No nonzero word of weight one or two belongs to : such a word would require a zero column or two equal columns of . But , so . Thus is the classical Hamming code. The eight words of consist of zero and seven words of weight four; is the simplex code.
From classical words to quantum superpositions
Section titled “From classical words to quantum superpositions”Let . Define
Each state has eight equal amplitudes. The two sets of strings are disjoint because , so the states are orthogonal. The first contains words of weights zero and four; the second contains their complements, of weights seven and three. An arbitrary logical state is their coherent superposition, not a classical choice of a codeword.
For a binary word , write and for products of X and Z on its nonzero positions. Each row of supplies a positive-signed check and another . For example,
An X check translates by a word in , merely permuting the sum in either logical state. A Z check contributes phase ; it also gives on the complement coset because has even weight. Thus all six checks stabilize both states. Their commutation follows from .
The six checks are independent, so their common eigenspace has dimension . They therefore define exactly the two-dimensional space above. This is a concrete instance of the CSS construction, rather than two independent classical copies of an unknown qubit.
Filled disks mark the qubits included in a check. The rows specify check supports; the columns locate errors. The highlighted fifth column is : an error flips the first and third Z checks, while a error flips the corresponding X checks. The connecting lines are table guides, not circuit wires.
Logical Paulis and distance three
Section titled “Logical Paulis and distance three”Choose
Bitwise X complements every string and exchanges the two logical states. Bitwise Z gives on the even-weight first coset and on the odd-weight second coset. These are the actions defining logical X and Z. Their seven anticommuting overlaps make them anticommute with one another, while even check weights make them commute with the stabilizer.
They are not minimum-weight representatives. Multiplication by the checks on sites gives equivalent logical operators
where means the same action on encoded states.
To prove that no lower-weight logical Pauli exists, represent a physical Pauli up to global phase by . Commutation with all Z checks requires , and commutation with all X checks requires . Any nonzero one of these words has weight at least three. Since the Pauli support is the union of their supports, every nonscalar Pauli commuting with all checks has weight at least three. The displayed logical triples attain this bound, proving . Ignoring scalar phases here is essential: does not perform a nontrivial logical operation.
The stabilizer itself has no nonidentity element below weight four. Its support-weight distribution is
Exercise 2 derives this distribution. In contrast to the Shor code, distinct errors from the one-qubit Pauli basis have distinct actions and distinct syndromes.
Read a syndrome as two binary addresses
Section titled “Read a syndrome as two binary addresses”Measure the three Z checks first in the written syndrome, followed by the three X checks. A zero bit means outcome , and a one means . For a Pauli with components ,
Consequently,
| Error | Z-check bits | X-check bits |
|---|---|---|
This rule gives all 22 syndromes for the identity and 21 single-qubit Paulis. They are distinct because the columns are distinct and nonzero, and the zero-half patterns distinguish X, Z, and Y.
The separated Hamming decoder reads as the site needing X correction and as the site needing Z correction. Interpret as no correction. For example,
If , the product acts as Y at that site up to an irrelevant phase. The rule specifies recovery on all 64 syndromes, although only 22 arise from the identity and single-qubit errors. Later error-rate calculations refer to this particular choice on the remaining syndromes.
Let project onto the code. The distinct single-error syndromes imply the Knill–Laflamme relation
for the 22 error operators. Their two-dimensional error spaces are mutually orthogonal, so correction is nondegenerate. The theorem also corrects their linear span, including coherent one-qubit rotations and arbitrary one-qubit channels coupled to an environment. It preserves entanglement with an untouched reference; it does not assume that physical noise first chooses a classical Pauli label.
The error spaces occupy dimensions out of 128. Thus the quantum code is not perfect, even though the classical Hamming code used in its construction is perfect for one classical bit error. Nondegeneracy and perfect packing are different properties.
The syndrome-measurement discussion explains how to measure checks without reading logical amplitudes. The present decoding calculation assumes perfect reported syndromes.
Transversal Clifford gates
Section titled “Transversal Clifford gates”A transversal gate acts separately at each coordinate: no gate couples two qubits of the same code block. This limits how a single gate fault spreads inside a block. It is especially useful here because the check supports match. The following actions can be obtained directly from the codewords, or from the stabilizer conjugation rules developed by Gottesman (1997).
Hadamard exchanges the two check groups
Section titled “Hadamard exchanges the two check groups”Since and , applying H to all seven qubits exchanges each X check with its matching Z check and preserves the code space. It also exchanges and , so
with the stated positive-amplitude logical basis. Here denotes the quantum code space. Exercise 5 verifies the logical state transformation through a binary Fourier sum.
The phase gate runs in the opposite direction
Section titled “The phase gate runs in the opposite direction”Take . A basis word of weight receives phase under . Every word in has weight zero or four, so its phase is one. Every word in has weight three or seven, so its phase is . Therefore
Physical bitwise S implements logical in this basis; physical bitwise implements logical S. This sign also follows from the logical conjugation: defining gives
An X check has weight four, so its corresponding phase is : it becomes the product of the matching X and Z checks. Thus the stabilizer is preserved even though the logical phase direction is reversed.
CNOT acts coordinate by coordinate
Section titled “CNOT acts coordinate by coordinate”Apply CNOT from each qubit of a control block to the matching qubit of a target block. Control X propagates to target X, and target Z propagates to control Z; the other two Pauli types stay in their blocks. Matching supports ensure that stabilizers transform to products of stabilizers. On logical operators,
These are exactly the logical CNOT rules. Equivalently, the underlying transformation maps logical cosets to .
These gates generate the logical Clifford group, which is not computationally universal. Applying the non-Clifford gate to every physical qubit does not even preserve this code space; Exercise 6 quantifies the leakage. More generally, Eastin and Knill (2009) rule out an entirely transversal universal set for a nontrivial finite-dimensional code that detects arbitrary errors on each subsystem. Fault-Tolerant Gates explains additional protected resources and complete gate constructions. Transversality of these ideal layers does not by itself establish fault tolerance of preparation, measurement, and repeated correction.
What happens when two qubits are affected?
Section titled “What happens when two qubits are affected?”Because , the error has the same syndrome as . The decoder applies and leaves the logical operation . Similarly, two Z errors on sites 1 and 2 leave logical Z. Distance three guarantees correction of all single-qubit errors, not all pairs.
Nevertheless, the separated decoder corrects for any distinct sites : the two syndrome addresses identify both components. There are such weight-two Pauli strings. This explains why a statement that “every two-qubit error fails” would be too strong.
For independent depolarizing noise with probabilities for , there are weight-two strings. Their residual classes are
| Residual class | Number | Leading probability |
|---|---|---|
| No logical error | ||
Thus
Even this symmetric CSS code produces unequal X, Y, and Z error rates under the separated decoder. Independent decoding of the two syndrome halves uses less information than a joint inference procedure might use about correlated X and Z components of Y errors. The quoted coefficient belongs to this decoder and this noise model. Exercise 7 derives it without a long enumeration table; general choices of inference rule are discussed in Decoders.
Exercises
Section titled “Exercises”1. Find the two classical spaces
Section titled “1. Find the two classical spaces”Compute and enumerate . Establish the dimensions, word weights, and orthogonality of the two logical cosets.
Solution
All row self-overlaps are four and all distinct overlaps are two, so over . The three independent rows and their binary sums give
There are eight words, so and . The nonzero D words all have weight four. Their complements have weight three, while the complement of zero has weight seven. Thus the two logical supports are disjoint and each contains eight basis states, proving normalization and orthogonality with amplitude .
2. Count stabilizers rather than only generators
Section titled “2. Count stabilizers rather than only generators”Show that the stabilizer has 21 elements of weight four and 42 of weight six, besides the identity. Explain what this says about degeneracy for single-qubit Pauli errors.
Solution
The stabilizers are products with , with their resulting Pauli signs retained. Seven nonzero pure-X words and seven nonzero pure-Z words have weight four. When , seven more products have that same support and are weight-four Y strings. For the remaining pairs, distinct weight-four supports overlap twice, so their union has size six.
Hence the distribution is . A product of two different one-qubit Paulis has weight at most two and cannot be a nonidentity stabilizer. Nor is it a nontrivial logical operator, since . It therefore has nonzero syndrome, giving orthogonal error spaces and nondegenerate correction.
3. Decode four examples
Section titled “3. Decode four examples”Find the syndromes and residual logical actions for , , , and .
Solution
Their syndrome pairs are, respectively,
The decoder selects , , , and . Multiplication by the error gives , respectively. Every result is identity on the logical density operator. The final example affects two sites but is still corrected because the separated syndrome halves identify both components.
4. Prove the full quantum distance
Section titled “4. Prove the full quantum distance”Explain why bounding only pure-X and pure-Z weights is insufficient without an argument about mixed Paulis. Supply that argument and exhibit a minimum-weight logical operator.
Solution
A general Pauli has binary components , including both components at a Y site. Zero syndrome requires both . If its total support had weight below three, each component would also have weight below three; the classical distance then forces both to vanish. This excludes every nonscalar mixed Pauli of weight one or two.
The word lies in but not in , so commutes with all checks and acts as logical X. Its weight three establishes the matching upper bound. Global Pauli phases are ignored in this distance statement.
5. Derive Hadamard and CNOT on the cosets
Section titled “5. Derive Hadamard and CNOT on the cosets”Use to derive the logical Hadamard action. Then explain CNOT directly on pairs of logical cosets.
Solution
Summing over gives eight when and zero otherwise. The surviving amplitude is on all 16 words of C, yielding
Starting from the complement coset introduces , which is on D and on . Thus the other input gives the minus combination.
For CNOT, write the two input strings as and , with . The target becomes . For fixed u, translation by u permutes D, so the uniform two-coset superposition maps to logical bits with unchanged positive amplitudes.
6. Distinguish bitwise S from bitwise T
Section titled “6. Distinguish bitwise S from bitwise T”Use word weights to find the logical action of . For , find the probability of projecting back onto the code space. Does bitwise T implement an exact logical unitary?
Solution
Under S, weights zero and four receive phase one, while weights three and seven receive . Thus bitwise S is logical .
Under T, the weight-zero term of receives phase one and its seven weight-four terms receive . The overlap with is therefore
The overlap with is zero because their computational supports remain disjoint. The probability of returning to the code space is , leaving outside it. Thus bitwise T does not preserve the code space and cannot be an exact logical gate, even though bitwise S is one.
7. Count errors on one pair of sites
Section titled “7. Count errors on one pair of sites”For fixed distinct sites j and k, classify the nine Pauli pairs. Use the result to derive the weight-two residual counts and leading logical error probability.
Solution
Let . Since the columns are distinct and nonzero, is different from j and k. The triple supported on is a weight-three word of C outside D. Hence an X triple is logical X, a Z triple is logical Z, and a Y triple is logical Y, up to phase.
Pairs and are corrected exactly. The pairs leave logical X; leave logical Z; and leaves logical Y. Multiplying each count by the 21 possible site pairs gives in the order .
The 147 failing strings each have probability . Higher weights contribute at order , so
For an optional exact extension, classify all strings with the same decoder. Each logical class contains 4,096 strings. Thus uniform physical Paulis at give , a useful check on the full calculation rather than on the small- approximation.
References
Section titled “References”- B. Eastin and E. Knill, “Restrictions on transversal encoded quantum gate sets,” Physical Review Letters 102, 110502, 2009, doi:10.1103/PhysRevLett.102.110502.
- 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.
- A. M. Steane, “Error correcting codes in quantum theory,” Physical Review Letters 77, 793–797, 1996, doi:10.1103/PhysRevLett.77.793.
- A. M. Steane, “Multiple-particle interference and quantum error correction,” Proceedings of the Royal Society A 452, 2551–2577, 1996, doi:10.1098/rspa.1996.0136, arXiv:quant-ph/9601029.