|q⟩ Bad Qubits

advanced · Physics · Stabilizer Formalism & CSS Codes

The Steane Code as CSS

The Steane code is the prototypical CSS code: a [[7,1,3]][[7,1,3]] code that protects one logical qubit in seven physical qubits and corrects any single-qubit error. It is built entirely from the classical [7,4][7,4] Hamming code, and studying it concretely shows the CSS machinery in action.

The classical seed: the [7,4] Hamming code

The [7,4][7,4] Hamming code encodes 44 data bits in 77 bits and corrects one bit error. Its 3×73 \times 7 parity-check matrix can be written with columns equal to the binary numerals 11 through 77:

H=(000111101100111010101).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}.

The Hamming code is dual-containing: CCC^\perp \subseteq C, equivalently HHT=0(mod2)H H^{\mathsf T} = 0 \pmod 2. This is precisely the property that lets a single classical code seed a CSS code.

The Steane stabilizers

Taking HX=HZ=HH_X = H_Z = H, the Steane code has six stabilizer generators — three XX-type and three ZZ-type — one per row of HH:

g1=X4X5X6X7,g4=Z4Z5Z6Z7,g2=X2X3X6X7,g5=Z2Z3Z6Z7,g3=X1X3X5X7,g6=Z1Z3Z5Z7,\begin{aligned} g_1 &= X_4 X_5 X_6 X_7, & g_4 &= Z_4 Z_5 Z_6 Z_7, \\ g_2 &= X_2 X_3 X_6 X_7, & g_5 &= Z_2 Z_3 Z_6 Z_7, \\ g_3 &= X_1 X_3 X_5 X_7, & g_6 &= Z_1 Z_3 Z_5 Z_7, \end{aligned}

(using 11-indexed qubits to match the Hamming columns). The three XX-generators mutually commute, the three ZZ-generators mutually commute, and each XX-generator commutes with each ZZ-generator because the overlapping Hamming rows share an even number of qubits — the CSS condition. With n=7n = 7, rX=rZ=3r_X = r_Z = 3 independent generators, the code encodes

k=733=1k = 7 - 3 - 3 = 1

logical qubit.

Distance and error correction

The distance of the Steane code is d=3d = 3, inherited from the Hamming distance 33 of the classical code. A distance-33 code corrects any error of weight (d1)/2=1\lfloor (d-1)/2 \rfloor = 1. Because XX- and ZZ-errors are handled by separate syndromes:

So any single-qubit Pauli error is detected and corrected — the hallmark of a distance-3 code.

Logical operators and logical states

The logical operators can be taken as the weight-7 strings

Xˉ=X1X2X3X4X5X6X7,Zˉ=Z1Z2Z3Z4Z5Z6Z7,\bar{X} = X_1 X_2 X_3 X_4 X_5 X_6 X_7, \qquad \bar{Z} = Z_1 Z_2 Z_3 Z_4 Z_5 Z_6 Z_7,

(transversal Pauli strings) which commute with all stabilizers but are not themselves in the stabilizer group, and which anticommute with each other as logical XX and ZZ should. The logical 0L|0_L\rangle is the uniform superposition over the even-weight Hamming codewords, and 1L=Xˉ0L|1_L\rangle = \bar{X}|0_L\rangle over the complementary coset.

Why the Steane code is special

The takeaway

The Steane [[7,1,3]][[7,1,3]] code is the CSS construction applied to the dual-containing [7,4][7,4] Hamming code with HX=HZ=HH_X = H_Z = H. It uses three XX- and three ZZ-stabilizers to encode one logical qubit, corrects any single-qubit error via two independent classical Hamming decoders, and enjoys a fully transversal Clifford group — making it a cornerstone example of fault-tolerant code design.

Sign in on the full site to ask questions and join the discussion.