Question. Why do the six displayed checks commute, encode exactly one qubit, and have distance exactly three?
Everything follows from one binary matrix. The reproduction script checks every matrix statement below against constructor.py.
The constructor uses
H = [0 0 0 1 1 1 1
0 1 1 0 0 1 1
1 0 1 0 1 0 1].
Rows are ordered from the most significant syndrome bit to the least significant bit. Column j is the binary label of zero-indexed qubit j+1 in the sequence 001 through 111; thus syndrome 101 points to qubit 4. Changing the column order only permutes physical qubits, but fixing it is essential for a reproducible syndrome table and lattice.
Let
C = ker H and C^perp = row(H).
H has rank three, so C is the [7,4,3] Hamming code and C^perp is the [7,3,4] simplex code. The row-space weight enumerator is
1 + 7 y^4,
while the Hamming weight enumerator is
1 + 7 y^3 + 7 y^4 + y^7.
These enumerators are recomputed rather than imported from a table. They show that every nonzero simplex word has weight four, while Hamming has weight-three words outside the simplex subcode.
Direct multiplication gives
H H^T =
[0 0 0
0 0 0
0 0 0] mod 2.
The diagonal entries vanish because each row has even weight four. The off-diagonal entries vanish because each pair of rows overlaps on two positions. Therefore every row of H lies in ker H, which is the containment
C^perp subset C.
Build a CSS stabilizer with
S_X = {X(h): h in row(H)} and S_Z = {Z(h): h in row(H)}.
The symplectic product of X(h) and Z(g) is h dot g, so H H^T=0 proves that every X generator commutes with every Z generator. Generators of the same Pauli type commute automatically.
The X and Z sectors each contribute three independent stabilizer generators. Their binary symplectic rows are independent because one sector occupies the X half and the other the Z half. Hence
k = n - rank(S) = 7 - 3 - 3 = 1.
The classical version of the same count is
dim(C/C^perp) = dim(C) - dim(C^perp) = 4 - 3 = 1.
The quotient is not decorative notation: two Hamming words in the same simplex coset differ by an X or Z stabilizer and therefore induce the same logical action.
Choose the quotient representative
ell = 1110000.
It satisfies H ell^T=0 but is not in row(H). A logical basis is
X_L = X(ell) = XXX____,
Z_L = Z(ell) = ZZZ____.
Their support intersection has odd size three, so they anticommute. Multiplying either by a stabilizer produces other representatives of the same logical coset, including the familiar all-seven-qubit representatives.
The computational-basis codewords can be written
|0_L> = (1/sqrt(8)) sum_{u in C^perp} |u>,
|1_L> = (1/sqrt(8)) sum_{u in C^perp} |u + ell>.
An X-check translates the summation variable inside C^perp; a Z-check contributes phase (-1)^(h dot u)=+1. This pays both stabilizer eigenvalue checks directly. The two supports are disjoint cosets, so the states are orthogonal.
The weight-three operator X(ell) is a nontrivial logical, proving d<=3. The same witness exists in the Z sector.
For the lower bound, write any Pauli up to phase as X(x)Z(z). Commutation with all Z-checks requires x in C; commutation with all X-checks requires z in C. If the Pauli has weight below three, then each of the support vectors x and z has weight below three. The Hamming minimum distance says the only such codeword is zero, so the Pauli is the identity. No weight-one or weight-two normalizer element exists, proving d>=3.
Thus d=3. The Atlas exact CSS enumerator independently searches normalizer representatives in increasing weight and reaches the same value. The upper witness and lower exclusion are both exact; no literature-only distance claim is needed.
The lattice export uses the three row supports
f0 = {3,4,5,6}
f1 = {1,2,5,6}
f2 = {0,2,4,6}.
Each support appears once as an X face and once as a Z face. Each pair of faces intersects in two qubits, reproducing the off-diagonal zeros in H H^T. All three intersect at qubit 6, a fact ordinary commutation ignores but the transversal-T analysis detects. The geometry therefore displays two different algebraic invariants: even pair overlap and odd triple overlap.
The Hamming/CSS origin is due to Steane's original construction (PRL; companion treatment). The triangular color-code interpretation follows the 2D color-code construction of Bombín and Martín-Delgado.