[[7,1,3]] Steane code

Essence

The object. Number seven qubits from 0 through 6 and form

H = [0 0 0 1 1 1 1
     0 1 1 0 0 1 1
     1 0 1 0 1 0 1].

The columns are the seven nonzero three-bit strings. Use each row once as an X-check and once as a Z-check. Because H H^T=0 over F_2, all six checks commute. They have independent rank three in each Pauli sector, so seven physical qubits minus six stabilizer constraints leave one logical qubit. The smallest nontrivial logical Pauli has weight three. The result is the [[7,1,3]] Steane code.

The shipped n7 instance recomputes n=7, k=1, CSS structure, and d=3 exactly. The same reproduction also checks the displayed matrix, its weight enumerators, every one-qubit syndrome, a logical Pauli pair, and the triangular lattice export; see the Hamming-to-CSS derivation. The executable transcript is shipped as pedagogy/reproduce.py.

The idea. The classical [7,4,3] Hamming code spends every nonzero three-bit syndrome on the address of one bit. Its dual is the [7,3,4] simplex code, and the simplex code lies inside Hamming. That containment is exactly the CSS commutation condition. Using the same nested pair for both Pauli directions gives symmetric X/Z correction and, unusually, makes the whole logical Clifford group available through pairwise transversal layers.

One sentence. Steane is the perfect seven-position Hamming syndrome table used twice—once for X and once for Z—with self-duality turning that economy into transversal Clifford symmetry.

Design problem

Shor's nine-qubit code protects the two Pauli directions by concatenating two different repetition ideas. Steane instead asks whether one classical code can do both jobs in the CSS construction. If H_X=H_Z=H, CSS commutation requires

H_X H_Z^T = H H^T = 0.

Equivalently, with C=ker H, the dual code C^perp=row(H) must be contained in C. The Hamming/simplex pair has exactly this property. The six checks are all weight four, the X and Z presentations are identical, and a perfect single-fault syndrome is only three bits per Pauli sector. The construction page pays the full linear-algebra argument rather than treating “dual-containing” as a label.

This compactness solves a block-code problem, not a scaling problem. There is no size parameter in constructor.py: distance stays three. Repeated suppression therefore requires concatenation, a move to a larger color-code family, or a different family altogether. Likewise, a lookup table turns a perfect syndrome into a correction, but the physically difficult part is extracting that syndrome without letting one ancilla fault spread into an uncorrectable data error. The syndrome and extraction page separates those two jobs.

The design bargain is consequently sharp:

Derivation chain

1. Turn syndromes into addresses. The columns of H, read from top row to bottom row, are 001, 010, 011, 100, 101, 110, 111. A Z error on qubit j anticommutes with exactly the X-checks selected by column j; hence its syndrome is that column. The same statement with X and Z exchanged locates an X error. No optimizer is needed for one perfect syndrome—only the seven-row address table.

2. Use the simplex rows as both check families. Every nonzero linear combination of the three rows has weight four. Any two rows overlap on two positions, so every X/Z generator pair commutes. In matrix language this is H H^T=0; in coding language it is C^perp subset C.

3. Read the logical qubit from the quotient. rank(H)=3, so dim C=7-3=4 and dim C^perp=3. The quotient C/C^perp has dimension one. A representative such as 1110000 lies in C but not in C^perp, giving X_L=XXX____ and Z_L=ZZZ____ in the shipped convention. They cross on three qubits and anticommute.

4. Read distance from the same two classical codes. The representative above proves d<=3. Conversely, every Pauli that commutes with all checks has its X and Z support vectors in C; the Hamming code has no nonzero word below weight three. A Pauli of weight one or two therefore cannot be a nontrivial normalizer element. This proves d>=3. The verifier independently exhausts the CSS normalizer and returns d=3.

5. Fold the algebra into a triangle. Put the seven qubits at the vertices of the smallest triangular 6.6.6 color-code patch. Each of its three faces supports one row of H, with paired X and Z checks. Pairwise face overlap is two vertices, and all three faces meet at the center vertex. The first fact shows commutation; the second is the visible obstruction to triorthogonality and hence to a bare transversal T. The guided Steane lattice tour lets the reader inspect those supports directly from constructor data.

Multiple pictures

Why these parameters

Why seven. Three syndrome bits have seven nonzero values. The Hamming construction uses all seven as distinct qubit addresses, so n=2^3-1=7. This is a statement about the displayed perfect Hamming construction; it does not silently claim that every distance-three quantum code must be CSS—the non-CSS five-qubit code is the immediate counterexample.

Why one logical qubit. There are three independent X checks and three independent Z checks. Their symplectic row spaces are independent, giving k=7-3-3=1. In the classical quotient the same count is dim(C/C^perp)=4-3=1.

Why distance three. 1110000 is a weight-three Hamming word outside the simplex row space, so it is a logical witness. The Hamming minimum distance excludes nonzero commuting support vectors of weights one and two. Thus the upper and lower arguments meet at three; this is an exact proof, not a seeded bound or literature-only claim. instances.yaml marks all four structured claims—n, k, d, and CSS—as verified.

Why the face checks have weight four. Every nonzero simplex word has weight four. That double-even weight is precisely what removes the stabilizer phase under bitwise S. The three rows also have a one-site triple overlap, which is invisible to ordinary commutation but detected by the Atlas triorthogonality check. The same small matrix therefore explains both the available Clifford phase gate and the missing T gate.

Failure modes

Operations story

Hadamard. Physical H exchanges X and Z on each qubit. Because the two check spaces are literally identical, H^⊗7 swaps every X stabilizer with its Z partner and preserves the stabilizer group. It also swaps the chosen X_L and Z_L, so the induced gate is logical H.

Phase. For a binary support h,

S X(h) S^dagger = i^|h| X(h) Z(h).

Every nonzero X stabilizer support has weight four, making the phase +1; Z(h) is the paired Z stabilizer. Thus physical S on every qubit preserves the code. For the weight-three logical representative, the same conjugation maps X_L to -Y_L, so this physical layer implements logical S^dagger; applying physical S^dagger implements logical S. Stating the inverse convention is necessary—the phrase “transversal S” alone hides it.

CNOT. Pair corresponding qubits in two blocks. CNOT maps a control X-check to the product of the control and target X-checks, and maps a target Z-check to the product of the control and target Z-checks. The stabilizer group is preserved and the same conjugation on logical Paulis is logical CNOT. A single physical fault can spread to at most one location in each block, which is the blockwise fault-containment benefit of transversality.

Non-Clifford completion. The card records fault-tolerant switching to the fifteen-qubit quantum Reed–Muller block: Steane supplies transversal Cliffords, the partner supplies a transversal non-Clifford phase, and conversion returns the state. Other literature-backed routes—magic-state injection, pieceable CCZ, and divisible-code concatenation—use distinct fault containment and resource contracts. They are compared, without pretending they are native Steane transversality, on the non-Clifford routes page.

Litmus questions

Q1: The X-check syndrome is 101. Which error does it locate? A: In the constructor's top-to-bottom row convention, 101 is column 4, so it locates a Z component on zero-indexed qubit 4. Apply the corresponding Z correction only after the extraction protocol has made that syndrome trustworthy.

Q2: Why is bitwise H a logical H here but not on an arbitrary CSS code? A: Bitwise H exchanges the X- and Z-check row spaces. Steane uses the same row space for both, so the stabilizer group is unchanged and the logical Paulis swap. A generic CSS code with unequal row spaces is mapped to a different code presentation instead.

Q3: Does physical S on every qubit implement logical S or logical S^dagger? A: With X_L=XXX____, Z_L=ZZZ____, and Y_L=i X_L Z_L, physical S maps X_L to i^3 X_L Z_L=-Y_L. That is logical S^dagger. Physical S^dagger gives logical S. A different logical-Pauli phase convention may rename the statement, but the displayed conjugation fixes this entry's convention.

Q4: Why does transversal T fail even though every X stabilizer has even weight? A: T needs finer phase divisibility than S. The simplex words have weights zero and four, so bitwise T assigns phases +1 and -1 inside the support of |0_L> instead of a common phase. In overlap language, the three X-check generators meet on one qubit and violate triorthogonality.

Q5: What is wrong with quoting an “intrinsic Steane threshold”? A: The fixed block has no distance-scaling parameter. A threshold belongs to a named concatenated or geometric family together with its extraction circuit, decoder, and noise normalization; a one-block pseudo-threshold or an experimental cycle error is a different quantity.