Steane Seven-Qubit Code

The Steane seven-qubit code is the moment quantum error correction stops looking like a bag of clever tricks and starts looking like a theory. Andrew Steane's 1996 construction takes a single object from classical coding — the venerable [7,4,3][7,4,3] Hamming code, the smallest perfect single-error-correcting linear code — and uses it twice: once to catch bit-flip (XX) errors in the computational basis, and once, through the same parity-check matrix, to catch phase-flip (ZZ) errors in the conjugate basis. Because the discretization-of-errors principle says an arbitrary single-qubit fault is a linear combination of I,X,Y,ZI,X,Y,Z, catching independent XX and ZZ errors catches everything. The result is a [[7,1,3]][[7,1,3]] code: seven physical qubits, one protected logical qubit, distance three, one corrected error. What makes the code the flagship of the Calderbank–Shor–Steane (CSS) family is not economy — it beats Shor's nine-qubit code by two qubits — but symmetry. Both error sectors are built from the same matrix HH, and the algebraic miracle that lets this work is that the Hamming code contains its own dual, C⊥⊆CC^{\perp}\subseteq C, equivalently HHT=0(mod2)HH^{T}=0\pmod 2. That single relation forces every XX-type stabilizer to overlap every ZZ-type stabilizer on an even number of qubits, so all six generators commute and define a legitimate Abelian stabilizer group. The same symmetry pays a spectacular dividend: the Clifford gates HH, SS, and CNOT are all transversal — realized by applying the bare physical gate to each qubit independently, so no fault can spread inside a block. This article develops the code from that one matrix: how it stores a qubit, how it decodes an error by Hamming's classical rule read in a quantum syndrome, and why its transversality is both its greatest strength and, by Eastin–Knill, the source of its one famous limitation.

Key takeaways
  • The Steane code is the [[7,1,3]][[7,1,3]] CSS code built from the classical [7,4,3][7,4,3] Hamming code: seven physical qubits protect one logical qubit against any single-qubit error.
  • Three XX-type and three ZZ-type stabilizer generators are read straight off the rows of the Hamming parity-check matrix HH; because HHT=0(mod2)HH^{T}=0\pmod 2 the two sectors commute, satisfying the CSS recipe.
  • Distance d=3d=3 means it corrects one error, t=⌊(d−1)/2⌋=1t=\lfloor(d-1)/2\rfloor=1; a single XX error produces a ZZ-syndrome equal to the binary address of the faulty qubit — Hamming decoding, run quantum-mechanically.
  • Because both sectors share one matrix, the logical Clifford gates Hˉ\bar H, Sˉ\bar S, CNOT‾\overline{\text{CNOT}} are transversal (bitwise), making Steane a cornerstone of fault-tolerant architecture.
  • It is not perfect: with n−k=6n-k=6 and t=1t=1, the quantum Hamming bound 26=64≥222^{6}=64\ge 22 holds with slack, and no transversal TT gate exists (Eastin–Knill), so universality needs magic states or code switching.
  • Key idea: use the Hamming parity-check matrix HH to define BOTH the XX- and ZZ-type stabilizers; because the Hamming code contains its dual (HHT=0HH^{T}=0 mod 2) the sectors commute, giving a CSS code that corrects a bit-flip and a phase-flip independently and admits transversal Clifford gates.
The core insight

Use the classical [7,4,3][7,4,3] Hamming parity-check matrix HH to define both the XX-type and the ZZ-type stabilizer generators. Because the Hamming code contains its dual (HHT=0HH^{T}=0 mod 2), the two sectors commute, giving the [[7,1,3]][[7,1,3]] CSS code that corrects one bit-flip and one phase-flip independently and admits transversal Clifford gates.

Where this lives today

The Steane code is no museum piece — it is one of the most-implemented codes in experimental fault tolerance, precisely because its transversal Clifford gates map cleanly onto real hardware. It is identical to the smallest two-dimensional colour code, so trapped-ion and superconducting groups building topological codes get it almost for free. In 2014 the Innsbruck ion-trap group encoded a logical qubit in the seven-qubit colour code and demonstrated a full set of transversal Clifford gates on it (Nigg et al., Science 345, 302). More decisively, in 2021 the Quantinuum team ran real-time, fault-tolerant quantum error correction on the [[7,1,3]][[7,1,3]] Steane code, extracting syndromes with encoded ancillas and applying corrections mid-circuit fast enough to keep pace with the errors (Ryan-Anderson et al., Phys. Rev. X 11, 041058) — a milestone demonstration that a logically-encoded qubit could be repeatedly corrected and still come out ahead. The code's one structural gap, its lack of a transversal TT, is exactly what drives two of the field's central research programs: magic-state distillation, which purifies noisy ∣T⟩|T\rangle ancillas to inject non-Clifford gates, and code switching, which shuttles a qubit between the Steane code and the [[15,1,3]][[15,1,3]] Reed–Muller code (transversal TT but no transversal HH) so that each supplies what the other lacks. And the concatenation idea for which Steane's code is a favourite building block — nesting the code inside itself to drive the logical error rate down as (p/pth)2ℓ(p/p_{\text{th}})^{2^{\ell}} over ℓ\ell levels — is one of the original routes to the threshold theorem that underwrites the whole enterprise of scalable quantum computing.

The physical picture

Think of the Steane code as two classical Hamming codes running at once in complementary bases. One Hamming code watches the seven qubits for bit-flips in the standard {∣0⟩,∣1⟩}\{|0\rangle,|1\rangle\} basis; the other watches for phase-flips, which are just bit-flips seen through a Hadamard, in the conjugate {∣+⟩,∣−⟩}\{|+\rangle,|-\rangle\} basis. A single classical Hamming code is perfect: its 23=82^{3}=8 syndromes account for exactly the no-error case plus the seven single-bit-error locations, with nothing wasted. The Steane code inherits that perfection in both bases simultaneously — three ZZ-parity checks locate any single XX error, three independent XX-parity checks locate any single ZZ error, and a YY error trips both. The whole scheme is a quantum "majority vote in two bases at once," and it only closes because the same matrix serves both bases without the two sets of checks fighting each other. The most economical way to see the structure is geometric: the Steane code is the smallest two-dimensional colour code, seven qubits arranged on a triangle whose three faces are exactly the three rows of HH.

Figure
The seven-qubit Steane code drawn as the smallest 2D colour code. Seven qubits sit on the corners, edge-midpoints and centre of a triangle; each of the three faces carries one weight-4 X-stabilizer XXXX and the identical-support weight-4 Z-stabilizer ZZZZ. The three faces are the three rows of the Hamming matrix H, and because every two faces share exactly two qubits, H Hᵀ = 0 mod 2 and all six stabilizers commute
One triangle, three faces = three rows of H: each face is a weight-4 XXXX and ZZZZ face 1 face 2 face 3 4 2 1 6 5 3 7 face 1 = qubits 4,5,6,7 face 2 = qubits 2,3,6,7 face 3 = qubits 1,3,5,7 centre qubit 7 in all faces Faces overlap in 2 qubits each (even) ⇒ every X-face commutes with every Z-face ⇒ valid stabilizer group

The geometry makes two facts visible at a glance. First, each face touches four qubits, so every stabilizer has weight four; the corner qubits (1, 2, 4) sit in one face each, the edge qubits (3, 5, 6) in two, and the centre qubit (7) in all three. Second — and this is the whole game — any two faces share exactly two qubits, an even overlap, which is the geometric face of HHT=0HH^{T}=0 and the reason the XX-checks and ZZ-checks commute. Once the checks commute, correcting an error is nothing but reading their outcomes. The second figure shows that read-out in action: a single bit-flip announces itself as a three-bit number that is the address of the qubit it struck.

Figure
Locating a single bit-flip by Hamming decoding. An X error on qubit 5 anticommutes with exactly the Z-checks whose support contains qubit 5, namely checks 1 and 3. Measuring the three Z-checks returns the syndrome 1,0,1, which read as a binary number is 5 — the address of the faulty qubit. Three syndrome bits resolve all seven single-qubit locations because 2³ = 8 = 7 + 1
Syndrome = binary address of the error: X on qubit 5 → (1,0,1) → 5 1234567 q q q q X q q error here Z-check 1qubits 4 5 6 7 contains 5 →s₁ = 1 Z-check 2qubits 2 3 6 7 no 5 →s₂ = 0 Z-check 3qubits 1 3 5 7 contains 5 →s₃ = 1 syndrome (1, 0, 1) read top-to-bottom as binary 101₂ = 5 : flip qubit 5 apply X₅ to undo the error

The core equations

Everything begins with one classical object. The Hamming parity-check matrix HH is a 3×73\times 7 binary matrix whose columns are, by deliberate construction, the binary numerals 11 through 77 — so column jj literally spells out the address jj.

H=(000111101100111010101)(1)H=\begin{pmatrix}0&0&0&1&1&1&1\\0&1&1&0&0&1&1\\1&0&1&0&1&0&1\end{pmatrix} \qquad (1)

where: HH — the 3×73\times 7 parity-check matrix of the classical [7,4,3][7,4,3] Hamming code over F2\mathbb{F}_2; column jj is the 3-bit binary representation of the integer jj. Reading it: qubit 55 has column (1,0,1)T=1012(1,0,1)^{T}=101_2, which is exactly the syndrome a bit-flip on qubit 55 will produce. The quantum code is defined by promoting each row of HH to two stabilizer generators — an all-XX version and an all-ZZ version — supported on the qubits that row selects. Three rows give three XX-type and three ZZ-type generators, six in all.

SX(i)=∏j: Hij=1Xj,SZ(i)=∏j: Hij=1Zj,i=1,2,3(2)S_X^{(i)}=\prod_{j:\,H_{ij}=1}X_j,\qquad S_Z^{(i)}=\prod_{j:\,H_{ij}=1}Z_j,\qquad i=1,2,3 \qquad (2)

where: SX(i),SZ(i)S_X^{(i)},S_Z^{(i)} — the XX-type and ZZ-type generators from row ii; Xj,ZjX_j,Z_j — Pauli operators on physical qubit jj; HijH_{ij} — the matrix entry selecting the support. The codespace is the simultaneous +1+1 eigenspace of all six operators; a logical state is one that "agrees" with every parity check. Written out on all seven tensor slots, the six generators are the concrete objects a decoder measures. Note that SX(i)S_X^{(i)} and SZ(i)S_Z^{(i)} share the same support — this is the defining feature of the Steane code and the source of its transversality.

SX(1)=IIIXXXX,SX(2)=IXXIIXX,SX(3)=XIXIXIX,SZ(1)=IIIZZZZ,SZ(2)=IZZIIZZ,SZ(3)=ZIZIZIZ(3)\begin{aligned} S_X^{(1)}&=IIIXXXX, & S_X^{(2)}&=IXXIIXX, & S_X^{(3)}&=XIXIXIX,\\ S_Z^{(1)}&=IIIZZZZ, & S_Z^{(2)}&=IZZIIZZ, & S_Z^{(3)}&=ZIZIZIZ \end{aligned} \qquad (3)

where: II — identity on that slot; the seven symbols list qubits 11–77 left to right. Each generator has weight four, matching the four qubits on each face of the colour-code triangle. For these six generators to define a valid code they must all commute — a stabilizer group must be Abelian and must not contain −I-I. Two Pauli products fail to commute only if their supports overlap in an odd number of slots carrying different Paulis (one XX, one ZZ). The overlap parity of row ii and row i′i' is precisely the (i,i′)(i,i') entry of HHTHH^{T}.

SX(i) SZ(i′)=(−1)(HHT)ii′ SZ(i′) SX(i),HHT=0(mod2)(4)S_X^{(i)}\,S_Z^{(i')}=(-1)^{(HH^{T})_{ii'}}\,S_Z^{(i')}\,S_X^{(i)},\qquad HH^{T}=0 \pmod 2 \qquad (4)

where: (HHT)ii′=∑jHijHi′j  2(HH^{T})_{ii'}=\sum_j H_{ij}H_{i'j}\bmod 2 counts shared qubits mod two. Because HHT=0HH^{T}=0 — the Hamming code is dual-containing — every sign is +1+1: all six generators commute. This is the CSS commutation condition, and it is the single algebraic fact the whole construction rests on. The two logical basis states are uniform superpositions over cosets of the dual code C⊥C^{\perp} (the [7,3][7,3] code spanned by the rows of HH). C⊥C^{\perp} has 23=82^{3}=8 codewords, all of even weight; ∣0ˉ⟩|\bar 0\rangle superposes them, and ∣1ˉ⟩|\bar 1\rangle superposes the same set shifted by the all-ones string.

∣0ˉ⟩=18∑x∈C⊥∣x⟩,∣1ˉ⟩=18∑x∈C⊥∣x⊕1⟩(5)|\bar 0\rangle=\frac{1}{\sqrt{8}}\sum_{x\in C^{\perp}}|x\rangle,\qquad |\bar 1\rangle=\frac{1}{\sqrt{8}}\sum_{x\in C^{\perp}}|x\oplus \mathbf{1}\rangle \qquad (5)

where: C⊥C^{\perp} — the 88-word dual Hamming code; 1=(1111111)\mathbf{1}=(1111111) — the all-ones vector representing the nontrivial coset C/C⊥C/C^{\perp}; ∣0ˉ⟩,∣1ˉ⟩|\bar 0\rangle,|\bar 1\rangle — the encoded basis states. Reading it: ∣0ˉ⟩|\bar 0\rangle is supported on even-weight strings, ∣1ˉ⟩|\bar 1\rangle on odd-weight strings, a fact that will explain the transversal phase gate. The logical Pauli operators are the lowest-weight operators that commute with every stabilizer but lie outside the stabilizer group. Weight-seven representatives are obvious; reducing them modulo the stabilizer gives weight-three representatives, and that minimum weight is the code distance.

Xˉ=X⊗7,Zˉ=Z⊗7,d=min⁡P∈N(S)∖Swt(P)=3(6)\bar X=X^{\otimes 7},\quad \bar Z=Z^{\otimes 7},\qquad d=\min_{P\in N(S)\setminus S}\mathrm{wt}(P)=3 \qquad (6)

where: N(S)N(S) — the normalizer of the stabilizer in the Pauli group (logical operators times stabilizers); wt(P)\mathrm{wt}(P) — the number of non-identity factors; d=3d=3 — the distance, so t=⌊(d−1)/2⌋=1t=\lfloor(d-1)/2\rfloor=1 error is correctable. The [[7,1,3]][[7,1,3]] label reads off directly: n=7n=7, k=1k=1, d=3d=3. Finally, the payoff. Because both sectors are built from one matrix, applying a bare Clifford gate to every qubit simultaneously permutes the stabilizer group onto itself and enacts the corresponding logical Clifford — no qubit ever touches another qubit of the same block.

Hˉ=H⊗7,Sˉ=(S†)⊗7,CNOT‾=CNOT⊗7(7)\bar H=H^{\otimes 7},\qquad \bar S=(S^{\dagger})^{\otimes 7},\qquad \overline{\mathrm{CNOT}}=\mathrm{CNOT}^{\otimes 7} \qquad (7)

where: Hˉ,Sˉ\bar H,\bar S — logical Hadamard and phase gate from bitwise physical gates (Sˉ\bar S needs the inverse physical gate, as Worked Example 3 shows); CNOT‾\overline{\mathrm{CNOT}} — logical CNOT applied qubit-by-qubit between two code blocks. Transversality is what makes these gates fault-tolerant: a single faulty gate corrupts at most one qubit per block.

Derivation AWhy all six generators commute: the dual-containing condition

The goal of this derivation is to prove that the six operators of equation (3) actually form a legitimate stabilizer group — that they mutually commute — and to trace that fact to a purely classical statement about the Hamming code, namely that it contains its own dual. This is the load-bearing step of the entire CSS construction: without commutation there is no shared +1+1 eigenspace, no codespace, and no code. We reduce the quantum commutation question to a mod-2 inner product of rows of HH, then compute that inner product and show it vanishes for the Hamming matrix.

Step 1. Two Pauli products commute or anticommute depending only on how their supports interleave. A single XjX_j and a single ZjZ_j on the same qubit anticommute; on different qubits they commute. So the product SX(i)SZ(i′)S_X^{(i)}S_Z^{(i')} picks up a factor (−1)c(-1)^{c} where cc is the number of qubits carried by both generators — the size of the overlap of row ii and row i′i' of HH. Why: the only source of a sign is an XX and a ZZ meeting on one qubit, and each such meeting contributes one factor of −1-1.

Step 2. Write that overlap count as a matrix entry. Summing the shared qubits is exactly a row-row inner product over F2\mathbb{F}_2,

(HHT)ii′=∑j=17HijHi′j(mod2),(HH^{T})_{ii'}=\sum_{j=1}^{7}H_{ij}H_{i'j}\pmod 2,

so SX(i)S_X^{(i)} and SZ(i′)S_Z^{(i')} commute precisely when (HHT)ii′=0(HH^{T})_{ii'}=0. Why: this converts a statement about seven-qubit operators into a statement about a 3×33\times 3 classical matrix — the quantum problem is now linear algebra over F2\mathbb{F}_2.

Step 3. Compute HHTHH^{T} for the Hamming matrix. Every row of HH has weight four, so each diagonal entry is 4≡04\equiv 0. Every distinct pair of rows shares exactly two qubits (rows 1,21,2 share {6,7}\{6,7\}; rows 1,31,3 share {5,7}\{5,7\}; rows 2,32,3 share {3,7}\{3,7\}), so each off-diagonal entry is 2≡02\equiv 0. Hence

HHT=0(mod2),HH^{T}=0\pmod 2,

which is the statement that C⊥⊆CC^{\perp}\subseteq C: the dual code is contained in the code. Why: a code whose parity checks are mutually orthogonal mod 2 is dual-containing, and this is exactly the property the CSS recipe demands of its single classical ingredient.

Step 4. Conclude. Every sign in equation (4) is +1+1, so all three XX-generators commute with all three ZZ-generators; the same-type generators trivially commute. The group S=⟨SX(i),SZ(i)⟩S=\langle S_X^{(i)},S_Z^{(i)}\rangle is therefore Abelian, and since no product of these even-weight, real generators equals −I-I, it is a valid stabilizer group defining a nonempty codespace. Why: Abelian plus −I∉S-I\notin S is exactly the criterion for a well-defined stabilizer code, and the six independent generators on seven qubits leave 7−6=17-6=1 logical qubit.

Go deeper · Derivation B · 2 minTransversal Hadamard implements the logical Hadamard
Derivation BTransversal Hadamard implements the logical Hadamard

The aim here is to show that the physically trivial operation of applying a Hadamard gate independently to each of the seven qubits — an operation that could not be simpler to implement fault-tolerantly, since it never couples two qubits — realizes the logical Hadamard Hˉ\bar H on the encoded qubit. The proof works entirely at the level of the stabilizer: we show that bitwise Hadamard conjugation maps the stabilizer group to itself (so the codespace is preserved) and swaps the logical operators exactly as a Hadamard should. This is the concrete reason the X/ZX/Z symmetry of the code matters.

Step 1. Recall the single-qubit action of the Hadamard by conjugation,

HXH=Z,HZH=X,HXH=Z,\qquad HZH=X,

which simply exchanges the XX and ZZ axes of the Bloch sphere. Why: the Hadamard is its own inverse and is precisely the Clifford that interchanges the two Pauli axes, so it turns XX-type operators into ZZ-type ones and vice versa.

Step 2. Apply H⊗7H^{\otimes 7} to an XX-stabilizer. Each XjX_j in the product becomes ZjZ_j, and the support — the set of qubits touched — does not move,

H⊗7( ⁣ ⁣∏j:Hij=1 ⁣ ⁣Xj)H⊗7= ⁣ ⁣∏j:Hij=1 ⁣ ⁣Zj=SZ(i).H^{\otimes 7}\Big(\!\!\prod_{j:H_{ij}=1}\!\!X_j\Big)H^{\otimes 7}=\!\!\prod_{j:H_{ij}=1}\!\!Z_j=S_Z^{(i)}.

Crucially SX(i)S_X^{(i)} and SZ(i)S_Z^{(i)} have the same support because both come from row ii of the one matrix HH, so the image is exactly another generator of the code. Why: for a code whose XX- and ZZ-sectors used different matrices this would produce an operator outside the stabilizer, and transversal HH would fail — the shared support is what saves it.

Step 3. Conclude that the stabilizer group is preserved. Since {SX(i)}→{SZ(i)}\{S_X^{(i)}\}\to\{S_Z^{(i)}\} and {SZ(i)}→{SX(i)}\{S_Z^{(i)}\}\to\{S_X^{(i)}\}, bitwise Hadamard merely permutes the six generators among themselves, so H⊗7 S H⊗7=SH^{\otimes 7}\,S\,H^{\otimes 7}=S and the codespace is mapped to itself — the operation is a legal logical gate. Why: any physical unitary that normalizes the stabilizer group acts as some logical operation; we have shown H⊗7H^{\otimes 7} does.

Step 4. Identify which logical gate. On the logical operators,

H⊗7 Xˉ H⊗7=Zˉ,H⊗7 Zˉ H⊗7=Xˉ,H^{\otimes 7}\,\bar X\,H^{\otimes 7}=\bar Z,\qquad H^{\otimes 7}\,\bar Z\,H^{\otimes 7}=\bar X,

the exact exchange a Hadamard performs, so H⊗7=HˉH^{\otimes 7}=\bar H on the codespace. Why: a Clifford is fixed (up to stabilizer) by its action on the logical Paulis, and Xˉ↔Zˉ\bar X\leftrightarrow\bar Z is the signature of the Hadamard.

Go deeper · Derivation C · 2 minSingle-qubit error correction as quantum Hamming decoding
Derivation CSingle-qubit error correction as quantum Hamming decoding

This derivation shows that the Steane code corrects an arbitrary single-qubit error by measuring its six stabilizers and reading the outcomes as two classical Hamming syndromes — and that, thanks to error discretization, correcting the discrete Pauli set is enough to correct a fully continuous single-qubit fault. The goal is to make explicit the bridge from a continuous physical error channel to a finite classical decoding problem, which is the conceptual heart of why quantum error correction is possible at all.

Step 1. Suppose a single bit-flip strikes qubit mm, so the error operator is E=XmE=X_m with m∈{1,…,7}m\in\{1,\dots,7\}. We detect it with the ZZ-type checks, which are diagonal in the computational basis and so measure bit-parities. Why: an XX error is a bit-flip, and bit-flips are exactly what ZZ-parity checks are built to see, just as in the classical Hamming code.

Step 2. Compute the commutation of XmX_m with each ZZ-check,

SZ(i) Xm=(−1)Him Xm SZ(i),S_Z^{(i)}\,X_m=(-1)^{H_{im}}\,X_m\,S_Z^{(i)},

so XmX_m anticommutes with SZ(i)S_Z^{(i)} exactly when ZmZ_m appears in that generator, i.e. when Him=1H_{im}=1. Why: the error flips the measured ±1\pm1 value of precisely those checks whose support contains the damaged qubit.

Step 3. Collect the three outcomes into a syndrome. The measured bits are

(s1,s2,s3)=(H1m,H2m,H3m)=column m of H=binary(m).(s_1,s_2,s_3)=(H_{1m},H_{2m},H_{3m})=\text{column } m \text{ of } H=\text{binary}(m).

Because the columns of HH are the binary numerals 11–77, the syndrome is literally the address of the faulty qubit — classical Hamming decoding executed by quantum measurement. Applying XmX_m undoes the error. Why: the perfectness of the Hamming code (23=8=7+12^3=8=7+1) means the three-bit syndrome resolves the seven single-error locations plus the trivial case with no ambiguity.

Step 4. The phase sector is independent and symmetric. Measuring the three XX-type checks SX(i)S_X^{(i)} yields a second, independent three-bit syndrome that locates any single ZZ error the same way; a Ym=iXmZmY_m=iX_mZ_m error trips both syndromes and is repaired by applying both XmX_m and ZmZ_m. Why: the XX and ZZ sectors commute and share no logical information, so the two decoding problems run in parallel without interference.

Step 5. Extend to a continuous error by discretization. An arbitrary single-qubit operation on qubit mm can be expanded as E=αI+βXm+γYm+δZmE=\alpha I+\beta X_m+\gamma Y_m+\delta Z_m; syndrome measurement projects the corrupted state onto one of these four Pauli branches, after which the branch is corrected as above. Why: measuring the stabilizers digitizes the continuum of possible errors into four discrete outcomes, so the ability to correct {I,X,Y,Z}\{I,X,Y,Z\} on each qubit is the ability to correct any single-qubit channel — the discretization-of-errors principle in action.

Limiting cases

How the Steane code sits among its neighbours and against the fundamental bounds:

CaseResultMeaning
vs Shor code[[7,1,3]][[7,1,3]] vs [[9,1,3]][[9,1,3]]Same distance, two fewer qubits. Shor concatenates a phase code with a bit code; Steane derives both sectors from one Hamming code, saving qubits and gaining transversal Cliffords.
Quantum Hamming bound2n−k≥∑j=0t(nj)3j=1+3⋅7=222^{n-k}\ge\sum_{j=0}^{t}\binom{n}{j}3^{j}=1+3\cdot 7=22With n−k=6n-k=6, 26=64≥222^{6}=64\ge 22 holds with slack — the Steane code is not perfect. The unique perfect d=3d=3 code is [[5,1,3]][[5,1,3]].
Quantum Singleton boundk≤n−2(d−1)=7−4=3k\le n-2(d-1)=7-4=3k=1≤3k=1\le 3: comfortable slack. Steane is far from an MDS code — the price of CSS structure and transversality.
Non-Clifford TT gateT=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}) not transversalBy Eastin–Knill no code has a transversal universal set; a logical TT needs magic states or code switching to the [[15,1,3]][[15,1,3]] Reed–Muller code.
Classical limitignore the ZZ-sectorThe three ZZ-checks alone reduce to the ordinary classical [7,4,3][7,4,3] Hamming code — Steane is literally "Hamming, twice."

Worked examples

1 · Decoding a bit-flip, then a YY error (fully worked)

A Steane-encoded qubit suffers a single bit-flip on qubit 6. Compute the ZZ-syndrome and the correction. Then repeat for a YY error on qubit 3.

Step 1. For the X6X_6 error, evaluate each ZZ-check on whether its support contains qubit 66. From equation (3): SZ(1)S_Z^{(1)} acts on {4,5,6,7}\{4,5,6,7\} — contains 66, so s1=1s_1=1. SZ(2)S_Z^{(2)} acts on {2,3,6,7}\{2,3,6,7\} — contains 66, so s2=1s_2=1. SZ(3)S_Z^{(3)} acts on {1,3,5,7}\{1,3,5,7\} — does not contain 66, so s3=0s_3=0.

Step 2. Assemble the syndrome (s1,s2,s3)=(1,1,0)(s_1,s_2,s_3)=(1,1,0). Read as a binary numeral this is 1102=6110_2=6 — exactly column 66 of HH and the address of the flipped qubit. The decoder applies X6X_6, undoing the error. The three XX-checks all return +1+1 (s′=000s'=000), confirming there was no phase error.

Step 3. Now the Y3=iX3Z3Y_3=iX_3Z_3 error carries both a bit-flip and a phase-flip on qubit 33. The X3X_3 part is seen by the ZZ-checks: SZ(1)S_Z^{(1)} on {4,5,6,7}\{4,5,6,7\} excludes 33 (s1=0s_1=0); SZ(2)S_Z^{(2)} on {2,3,6,7}\{2,3,6,7\} includes 33 (s2=1s_2=1); SZ(3)S_Z^{(3)} on {1,3,5,7}\{1,3,5,7\} includes 33 (s3=1s_3=1). So the ZZ-syndrome is (0,1,1)=0112=3(0,1,1)=011_2=3.

Step 4. The Z3Z_3 part is seen symmetrically by the three XX-checks, whose supports are identical to the ZZ-checks; the same arithmetic gives the XX-syndrome (0,1,1)=3(0,1,1)=3. Both syndromes point to qubit 3, so the decoder applies X3Z3X_3Z_3, correcting the YY error up to an irrelevant global phase. A single-qubit continuous error would first be projected by the measurements onto one of these Pauli branches (Derivation 3, Step 5) and then corrected identically.

2 · Building the logical zero and checking distance

Write ∣0ˉ⟩|\bar 0\rangle explicitly and verify that no nonzero logical operator has weight below 3.

Step 1. The dual code C⊥C^{\perp} is the row-span of HH over F2\mathbb{F}_2. Its eight codewords are 00000000000000, 00011110001111, 01100110110011, 01111000111100, 10101011010101, 10110101011010, 11001101100110, 11010011101001 — the zero word plus seven weight-44 words.

Step 2. Therefore

∣0ˉ⟩=18(∣0000000⟩+∣0001111⟩+∣0110011⟩+∣0111100⟩+∣1010101⟩+∣1011010⟩+∣1100110⟩+∣1101001⟩),|\bar 0\rangle=\tfrac{1}{\sqrt 8}\big(|0000000\rangle+|0001111\rangle+|0110011\rangle+|0111100\rangle+|1010101\rangle+|1011010\rangle+|1100110\rangle+|1101001\rangle\big),

a uniform superposition of eight computational basis states, all of even weight. Flipping every bit (⊕ 1\oplus\,\mathbf 1) turns each into an odd-weight string and gives ∣1ˉ⟩|\bar 1\rangle.

Step 3. For the distance, a logical operator must commute with all stabilizers (lie in N(S)N(S)) but not be a stabilizer. The weight-77 representatives Xˉ=X⊗7\bar X=X^{\otimes7}, Zˉ=Z⊗7\bar Z=Z^{\otimes7} can be multiplied by stabilizers to lower their weight: e.g. Zˉ⋅SZ(1)\bar Z\cdot S_Z^{(1)} removes the ZZ's on qubits 4,5,6,74,5,6,7, leaving a weight-33 operator Z1Z2Z3Z_1Z_2Z_3. No representative has weight below 3, because a weight-11 or weight-22 Pauli would either fail to commute with some check or already lie in the stabilizer.

Step 4. Hence d=3d=3, giving t=1t=1 correctable error and the label [[7,1,3]][[7,1,3]]. The code detects up to d−1=2d-1=2 errors and corrects up to 11.

3 · The transversal phase gate needs the inverse

Show that applying the physical phase gate S=diag(1,i)S=\mathrm{diag}(1,i) to all seven qubits implements Sˉ†\bar S^{\dagger}, not Sˉ\bar S — so the logical SS requires the bitwise S†S^{\dagger}.

Step 1. On a computational basis string ∣x⟩|x\rangle of Hamming weight ww, the bitwise gate acts as S⊗7∣x⟩=i w∣x⟩S^{\otimes 7}|x\rangle=i^{\,w}|x\rangle, since each ∣1⟩|1\rangle contributes a factor ii and each ∣0⟩|0\rangle contributes 11.

Step 2. In ∣0ˉ⟩|\bar 0\rangle every basis string has weight 00 or 44 (Example 2), so w≡0(mod4)w\equiv 0\pmod 4 and iw=1i^{w}=1: thus S⊗7∣0ˉ⟩=∣0ˉ⟩S^{\otimes 7}|\bar 0\rangle=|\bar 0\rangle.

Step 3. In ∣1ˉ⟩|\bar 1\rangle every basis string has weight 77 or 33, so w≡3(mod4)w\equiv 3\pmod 4 and iw=i3=−ii^{w}=i^{3}=-i: thus S⊗7∣1ˉ⟩=−i ∣1ˉ⟩S^{\otimes 7}|\bar 1\rangle=-i\,|\bar 1\rangle. Collecting both, S⊗7=diag(1,−i)S^{\otimes 7}=\mathrm{diag}(1,-i) on the logical qubit.

Step 4. But diag(1,−i)=S†\mathrm{diag}(1,-i)=S^{\dagger} as a logical operator (the physical SS is diag(1,i)\mathrm{diag}(1,i)). Hence S⊗7=Sˉ†S^{\otimes 7}=\bar S^{\dagger}, and to realize the logical Sˉ\bar S one applies the physical inverse (S†)⊗7(S^{\dagger})^{\otimes 7} — exactly the form in equation (7). The overall −i-i is not a global phase to be ignored: it is the relative logical phase that makes the gate a genuine S†S^{\dagger}.

Physics of the portrait

The Steane code is where an Oxford atomic physicist, thinking about trapped ions, wrote down the construction that turned quantum error correction from Shor's proof-of-concept into a systematic theory borrowed wholesale from classical coding.

Origins · 1 minAndrew Steane and how this was discovered
AS
Andrew Steane
born 1965, British physicist · quantum error correction and ion-trap quantum computing

Andrew Martin Steane (born 1965) is a physicist at the University of Oxford whose 1996 paper "Error Correcting Codes in Quantum Theory" (Phys. Rev. Lett. 77, 793) reframed the young subject of quantum error correction as an application of classical linear coding. Where Peter Shor had exhibited a single nine-qubit code the year before, Steane showed how to manufacture quantum codes from classical ones: take a classical linear code that contains its dual, and its parity-check matrix simultaneously defines the bit-flip and phase-flip stabilizers of a quantum code. Fed the smallest interesting example, the [7,4,3][7,4,3] Hamming code, the recipe produces the seven-qubit code that bears his name — more economical than Shor's and, because both sectors share one matrix, endowed with transversal Clifford gates. Working in parallel, Robert Calderbank and Shor arrived at the same general construction, and the family is now universally called CSS. Steane's contributions to fault tolerance did not stop there: the "Steane method" of syndrome extraction, which uses an encoded ancilla block prepared in ∣0ˉ⟩|\bar 0\rangle or ∣+ˉ⟩|\bar +\rangle and a round of transversal CNOTs to read a syndrome without collapsing the data, is one of the two standard fault-tolerant measurement techniques. Much of his career has been devoted to the experimental side — trapped-ion quantum computing, laser cooling, and sober estimates of the resources a real fault-tolerant machine will demand — and he has written widely on the foundations and philosophy of physics. The seven-qubit code remains the single example through which most students first meet stabilizers, CSS structure, and transversality all at once.

History
1950
— Hamming publishes the classical [7,4,3] single-error-correcting code
1995
— Shor's nine-qubit code proves quantum information can be protected
1996
— Steane introduces the seven-qubit code and the classical-to-quantum recipe
1996
— Calderbank and Shor give the general CSS construction independently
1997
— Gottesman's stabilizer formalism reveals the six generators as one Abelian group
2014
— the seven-qubit colour code is realized on trapped ions

Going further

Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, §10.4.2 (the Steane code) and §10.5 (CSS codes) · Preskill, Lecture Notes on Quantum Computation, Ch. 7 · Wilde, Quantum Information Theory, 2nd ed., Ch. 24 (CSS codes) · Gottesman, Stabilizer Codes and Quantum Error Correction (PhD thesis, Caltech, 1997) · Kitaev, Shen & Vyalyi, Classical and Quantum Computation, Ch. 15 · Lidar & Brun (eds.), Quantum Error Correction (2013). The following internal consistencies hold throughout the article and serve as useful cross-checks: the columns of HH are the binary numerals 11–77; HHT=0(mod2)HH^{T}=0\pmod 2, i.e. every pair of rows overlaps in an even number of 11s; the explicit generators IIIXXXXIIIXXXX, IXXIIXXIXXIIXX, XIXIXIXXIXIXIX (and their ZZ-partners) come directly from the rows of HH; the eight dual codewords of Example 2 are the row-span of HH, all of even weight; the syndrome of XmX_m equals column mm; the transversal-SS phase computation gives i0=1i^{0}=1 on ∣0ˉ⟩|\bar 0\rangle and i3=−ii^{3}=-i on ∣1ˉ⟩|\bar 1\rangle, yielding Sˉ†\bar S^{\dagger}; and the bounds 26=64≥222^{6}=64\ge 22 and k≤n−2(d−1)=3k\le n-2(d-1)=3 both hold with slack. The values [[7,1,3]][[7,1,3]], d=3d=3, t=1t=1, and six generators are standard results.

Prerequisites. CSS Codes · Stabilizer Formalism · Discretization of Errors · Knill–Laflamme Conditions. Leads to. Syndrome Measurement and Decoding · Pauli Group and Clifford Group · Quantum Hamming and Singleton Bounds · Code Distance and Logical Operators.

Ask the tutor: Ask me to walk you through decoding any single-qubit error on the Steane code, or to show exactly how HHT=0HH^{T}=0 turns one Hamming matrix into a full fault-tolerant quantum code.

Why exactly one logical qubit — where does the number come from?

Count degrees of freedom. Seven physical qubits give a 272^{7}-dimensional Hilbert space. Each independent stabilizer generator you impose is one binary constraint that halves the surviving space, and the Steane code has six independent generators (three XX-type and three ZZ-type, because the parity-check matrix HH has rank three). Six halvings cut 272^{7} down to 27−6=212^{7-6}=2^{1}, a two-dimensional space — one qubit. In the general formula, a stabilizer code on nn qubits with n−kn-k independent generators encodes k=n−(n−k)k=n-(n-k) logical qubits; here k=7−6=1k=7-6=1. The seven qubits are physical resources, not checks, and conflating the two is the most common beginner's error.

How is the Steane code related to the classical Hamming code?

It is the Hamming code, used twice in complementary bases. The classical [7,4,3][7,4,3] Hamming code corrects a single bit error among seven bits using a three-bit syndrome. Steane's recipe takes that code's parity-check matrix HH and builds two sets of stabilizers from it: the ZZ-type set catches bit-flip (XX) errors exactly as classical Hamming decoding does, and the XX-type set catches phase-flip (ZZ) errors by running the identical decoding in the Hadamard-rotated basis. The only extra ingredient quantum mechanics demands is that the two sets commute, which holds because the Hamming code contains its dual (HHT=0HH^{T}=0). So the quantum code is not an analogy to the classical one — it is literally two interleaved copies of it, glued by a dual-containment condition.

What does "transversal" mean, and why does it matter so much?

A gate is transversal on a code block if it is realized by acting on each physical qubit independently — either a single-qubit gate applied to every qubit, or, for two-qubit gates, coupling the jj-th qubit of one block only to the jj-th qubit of another block. The reason this is the gold standard for fault tolerance is error containment: if each physical gate can fail independently, a transversal logical gate lets a single component failure damage at most one qubit per block, which the distance-3 code can still correct. A non-transversal gate that coupled two qubits inside the same block could turn one fault into two, overwhelming the code. The Steane code's X/ZX/Z symmetry is precisely what makes its Clifford gates transversal, which is why it appears so often in fault-tolerant designs.

If the Clifford gates are transversal, why can't I do everything transversally?

Because the Eastin–Knill theorem forbids it: no quantum error-detecting code has a transversal set of gates that is universal for quantum computation. The transversal gates of any code always form a finite group, and a finite group of gates can never approximate every unitary. For the Steane code that finite group is (essentially) the Clifford group — HH, SS, CNOT — which is powerful but not universal; by the Gottesman–Knill theorem, Clifford-only circuits are efficiently simulable classically. The missing ingredient is one non-Clifford gate such as T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}), and that is exactly the gate the Steane code cannot do transversally. Supplying it — via distilled magic states or by switching to a code with transversal TT — is the unavoidable extra cost of universal fault-tolerant computation.

Is the Steane code better than the Shor code?

By most measures, yes — but "better" hides a trade. Both are distance-3 codes correcting one arbitrary single-qubit error, but Steane uses seven qubits to Shor's nine, and Steane's shared-matrix structure gives it transversal HH, SS, and CNOT, whereas Shor's code has a more limited transversal gate set. That efficiency and symmetry are why Steane, not Shor, is the workhorse of many fault-tolerant schemes. Shor's code, however, is conceptually simpler — a phase code concatenated with a bit code — and its degeneracy (many distinct errors sharing a syndrome) makes it a cleaner first example and more robust to certain biased noise. Neither is used at scale today; both have been superseded by surface and colour codes with only local checks, but the ideas in both remain the shared vocabulary of the field.

Why does the phase gate need the inverse in the transversal formula?

It comes from a weight-mod-4 accounting. Applying the physical S=diag(1,i)S=\mathrm{diag}(1,i) to all seven qubits multiplies a computational basis string of Hamming weight ww by iwi^{w}. The logical ∣0ˉ⟩|\bar 0\rangle is a superposition of strings with weight ≡0(mod4)\equiv 0\pmod 4, so every term picks up i0=1i^{0}=1 and ∣0ˉ⟩|\bar 0\rangle is unchanged. The logical ∣1ˉ⟩|\bar 1\rangle is built from strings with weight ≡3(mod4)\equiv 3\pmod 4, so every term picks up i3=−ii^{3}=-i. The net logical operation is therefore diag(1,−i)=S†\mathrm{diag}(1,-i)=S^{\dagger}, not SS. So bitwise SS gives logical S†S^{\dagger}, and to get logical SS you apply bitwise S†S^{\dagger}. This is a genuine feature of the code's codewords, not a sign convention, and it is a favourite exam question because it rewards actually knowing what the logical states are.

Before this

Where this leads