The Steane seven-qubit code as a stabiliser family (CSS from Hamming [7,4]) #
Category: 3-Local (QM-validity).
Glossary: https://glossary.constraintsurfacedynamics.com/steane-code/
Plain-language, CSD-role and formal statements of the Steane code, with this module as its
Lean anchor. Kept symmetric by scripts/check-glossary.sh.
The Steane [[7,1,3]] code, built as the first genuine CSS instance of the Cat-1
stabiliser layer (Mathlib/QuantumInfo/Stabilizer.lean, GK-3; plan specs/steane-plan.md):
the parity-check rows of the classical Hamming [7,4] code give three X-type and three
Z-type stabiliser generators, and the CSS condition β every row orthogonal to every row,
H Hα΅ = 0 over π½β β makes the trivial sign function coherent, so the whole GK-3 layer
instantiates:
steane_code_dimensionβ the stabiliser-family trace is2β·/2βΆ = 2: a one-logical-qubit code space, by the generalstabProjector_trace.- β
The logical states:
steaneZero β β_{c β Cβ} |cβ©(the row space ofH) andsteaneOne β β_{c β Cβ} |c + 1ββ©, each stabilised by all sixty-four group elements (steaneZero_stabilised/steaneOne_stabilised), and orthonormal (inner_steaneZero_steaneOne,inner_steaneZero_self,inner_steaneOne_self) β the two-dimensional code space exhibited concretely, matching the trace count. - β
The logical operators:
XΜ = X^{1β}swaps the logical states (logicalX_steaneZero/logicalX_steaneOne),ZΜ = Z^{1β}fixes|0Μβ©and negates|1Μβ©(logicalZ_steaneZero/logicalZ_steaneOne) β a genuine encoded qubit. - β
The distance mechanism: single-qubit errors have nonzero, pairwise-distinct
syndromes (
steane_syndrome_single_ne_zero,steane_syndrome_single_injective) β the classical Hamming distance-3 property, which viapauliOp_comm(the symplectic commutation criterion) is exactly the statement that every single-qubitX- orZ-error anticommutes with a generator identified by its syndrome. Both error types use the same matrix: the code is CSS-self-dual.
Honest scope. The code space is exhibited (two orthonormal stabilised states) and the
error-detection mechanism is stated in syndrome form; the full recovery map, the
KnillβLaflamme conditions, and fault-tolerance claims are not attempted
(β οΈ RESIDUE(R-003)) β the same posture
as the three-qubit modules. The π½β facts about the concrete Hamming rows (orthogonality,
independence, column distinctness) are closed by decide β kernel-checked finite
computation, the right tool for a fixed 7 Γ 3 matrix.
The parity-check rows of the Hamming [7,4] code: column j is the binary expansion of
j + 1.
Equations
Instances For
An π½β combination of the Hamming rows β the row space Cβ (eight elements), the
support of the logical states.
Equations
- CSD.Empirical.QM.QEC.Steane.rowComb c j = β i : Fin 3, c i * CSD.Empirical.QM.QEC.Steane.hammingRow i j
Instances For
The all-ones vector: the logical-X/Z label, a Hamming codeword outside the row
space.
Equations
Instances For
The X-labels of the stabiliser family: the first three bits of x combine the rows.
Equations
- CSD.Empirical.QM.QEC.Steane.steaneA x = CSD.Empirical.QM.QEC.Steane.rowComb fun (i : Fin 3) => x (Fin.castAdd 3 i)
Instances For
The Z-labels: the last three bits of x combine the rows.
Equations
- CSD.Empirical.QM.QEC.Steane.steaneB x = CSD.Empirical.QM.QEC.Steane.rowComb fun (i : Fin 3) => x (Fin.natAdd 3 i)
Instances For
The π½β facts about the Hamming rows (kernel-checked) #
The CSS condition: every row combination is orthogonal to every row combination
(H Hα΅ = 0 over π½β).
Every row combination is orthogonal to the all-ones vector (rows have even weight).
The all-ones vector pairs to 1 with itself (seven is odd).
The stabiliser-family axioms, and the GK-3 instantiation #
The trivial sign function is coherent: the CSS condition kills the pairing.
The code space is one logical qubit: the stabiliser-family trace is 2β·/2βΆ = 2 β
the general GK-3 dimension count at the Steane labels.
The logical states #
The logical zero: the uniform superposition over the row space Cβ.
Equations
- CSD.Empirical.QM.QEC.Steane.steaneZero = (ββ8)β»ΒΉ β’ β c : Fin 3 β Fin 2, QuantumInfo.basisState (CSD.Empirical.QM.QEC.Steane.rowComb c)
Instances For
The logical one: the uniform superposition over the coset Cβ + 1β.
Equations
Instances For
β
The logical zero is stabilised by every element of the sixty-four-element stabiliser
group. Z-type parts act trivially by the CSS orthogonality; X-type parts permute the
row space.
β The logical one is stabilised by every element β the coset shifts through.
The logical operators: a genuine encoded qubit #
β
XΜ = X^{1β} maps |0Μβ© to |1Μβ©.
β
XΜ maps |1Μβ© back to |0Μβ©.
β
ZΜ = Z^{1β} fixes |0Μβ©.
β
ZΜ negates |1Μβ©: the encoded qubit's phase degree of freedom is real.
Orthogonality: the code space is two-dimensional as exhibited #
The two logical states are orthogonal: their supports are disjoint cosets.
Basis states are orthonormal (local form).
The logical zero is a unit vector: the eight support strings are distinct.
The distance mechanism: single-error syndromes #
The syndrome of an error pattern: its pairing against each Hamming row. Via
pauliOp_comm, a nonzero syndrome is exactly anticommutation with the corresponding
generator.
Equations
Instances For
β Distinct single-qubit errors are distinguished: the seven columns of the Hamming matrix are pairwise distinct β the distance-3 property that makes single errors correctable, not merely detectable.