The Steane code corrects every single-qubit Pauli error #
Category: 3-Local (QM-validity). BACKLOG #14(b).
Steane.lean exhibits the code space and the distance mechanism (single-qubit errors have
nonzero, pairwise-distinct syndromes); Mathlib/QuantumInfo/StabilizerRecovery.lean turns a
detected Pauli error family on a stabiliser code into a recovery channel through the
Knill–Laflamme theorem. This file instantiates it:
SingleErr— the twenty-two single-qubit Paulis (I, andX,Z,XZon each of the seven qubits), with labelserrA,errB;steaneProj— the code projector as a matrix;- ★
syndrome_pair_ne_zero— the distance-3 mechanism for pairs: two distinct single-qubit Paulis have a product whoseX-part orZ-part carries a nonzero syndrome (a𝔽₂computation over the22 × 22pairs, kernel-checked bydecide);steane_detects_pairreads it as anticommutation with one of the six generators (steaneX,steaneZ); - ★★
steane_knillLaflamme— the Steane code satisfies Knill–Laflamme withc = 1for the single-qubit Paulis:P Eᵢᴴ Eⱼ P = δᵢⱼ P; - ★★★
exists_steane_recovery— the recovery channel: one channelRwithR (E ρ Eᴴ) = ρfor every single-qubit PauliEand every code stateρ = P ρ P; steaneProj_mulVec_steaneZero/_steaneOne— the logical states are code states, and ★★★steane_recovery_logical— every single-qubit Pauli error on an encoded qubita|0̄⟩ + b|1̄⟩is undone:R (E |ψ̄⟩⟨ψ̄| Eᴴ) = |ψ̄⟩⟨ψ̄|.
Honest scope #
⚠️ Pauli errors here; the extension to an arbitrary operator on one qubit (its Pauli expansion,
ErrorDiscretization.lean's three-qubit pattern on seven qubits) is SteaneArbitrary.lean
(BACKLOG #61, 2026-09-26). No two-qubit error is corrected, at any level (the Steane code does not
correct them). The recovery is the channel the
Knill–Laflamme construction produces, not the syndrome-measurement circuit; the Σ-side twin
(a Σ-flow whose environment marginal is the single-qubit Pauli channel, as
Empirical/CSD/QEC/RegisterFlow.lean does for three qubits) is
Empirical/CSD/QEC/SteaneFlow.lean (BACKLOG #53, 2026-09-27).
References: A. Steane, Error correcting codes in quantum theory, PRL 77 (1996) 793;
Nielsen–Chuang §10.4.2; Empirical/QM/QEC/Steane.lean;
Mathlib/QuantumInfo/StabilizerRecovery.lean; specs/steane-plan.md; specs/BACKLOG.md #14.
The single-qubit Paulis and the code projector #
The single-qubit Pauli errors on seven qubits: none is the identity, some (j, 0) the X
on qubit j, some (j, 1) the Z, some (j, 2) the XZ (proportional to Y).
Instances For
The X-label of a single-qubit Pauli.
Equations
Instances For
The Z-label of a single-qubit Pauli.
Equations
Instances For
The Steane code projector as a matrix on the register's coordinates.
Equations
Instances For
The distance mechanism for pairs #
★ Two distinct single-qubit Paulis are told apart by the syndromes: the product's X-part
or its Z-part has a nonzero syndrome. A 𝔽₂ computation over the 22 × 22 pairs.
A nonzero syndrome names a row pairing to 1.
Detection as anticommutation: for distinct single-qubit Paulis, some generator pairs to
1 with the product's labels — the hypothesis of stabMat_knillLaflamme.
Knill–Laflamme and the recovery #
★★ The Steane code satisfies Knill–Laflamme with c = 1 for the single-qubit Paulis:
P Eᵢᴴ Eⱼ P = δᵢⱼ P.
★★★ The Steane code corrects every single-qubit Pauli error: one recovery channel R
undoes each of the twenty-two errors on every code state.
The logical states are code states #
The group average fixes a state fixed by every generator.
The encoded qubit a|0̄⟩ + b|1̄⟩, as a coordinate vector.
Equations
Instances For
The density operator of the encoded qubit is a code state: ρ = P ρ P.
★★★ Every single-qubit Pauli error on an encoded qubit is undone: for
|ψ̄⟩ = a|0̄⟩ + b|1̄⟩ and every single-qubit Pauli E, the recovery channel returns
|ψ̄⟩⟨ψ̄| from E |ψ̄⟩⟨ψ̄| Eᴴ.