Documentation

CsdLean4.Empirical.QM.QEC.SteaneFaultyGate

Faulty gates: a transversal gadget on the Steane code, with one bad location #

Category: 3-Local (Empirical, QM twin). BACKLOG #62 (a) and (b): the noise sits on the gates now, not on resting qubits, and the transversal gadgets are the code's logical gates.

Glossary: https://glossary.constraintsurfacedynamics.com/transversal-gate/ Plain-language, CSD-role and formal statements of transversal gates, with this module as the Lean anchor. Kept symmetric by scripts/check-glossary.sh.

Code capacity (#51, #86) puts the errors on the seven qubits of a block and keeps every gate perfect. The circuit-level model of Aharonov–Ben-Or puts a fault at every location of the circuit — each gate of each gadget. This module does the first case of that: a transversal gadget, one single-qubit gate per qubit of the block, with one of its seven locations faulty.

Honest scope #

⚠️ Faulty gates, ideal recovery. The recovery channel here is the perfect one of #14(b): faults inside the recovery gadget — hence extended rectangles, and with them the simulation theorem that makes the levels compose — are not treated. That is what BACKLOG #62 (c) and (d) hold.

⚠️ One fault per gadget, level one. The quantum statement is for a single faulty location of a single transversal gadget on one block. The recursion over levels is the probabilistic one (circuitMeasure_circuitBad_le): what a level-k gadget does when its pattern is good is #86's theorem at code capacity, not a statement about faulty gates.

⚠️ A transversal gadget is not a universal gate set: blockKron A for arbitrary A need not preserve the code space, which is why the general theorem carries that as a hypothesis — discharged here for X̄, Z̄ and the Hadamard. The two-block transversal CNOT is not here because it needs a faulty-gadget theorem across two blocks, a different statement from (a)'s; that is SteaneTransversalCNOT.lean (#62 (f), landed 2026-09-28).

⚠️ The Hadamard's logical action is proved in the Heisenberg picture (where X̄ and Z̄ go) and through the projector, which is what fault tolerance needs. That H^{⊗ 7}|0̄⟩ = (|0̄⟩ + |1̄⟩)/√2 in the Schrödinger picture — the MacWilliams/coset computation — is not proved here.

References: D. Aharonov, M. Ben-Or, SIAM J. Comput. 38 (2008); P. Aliferis, D. Gottesman, J. Preskill, Quantum Inf. Comput. 6 (2006); A. Steane, PRL 77 (1996); Empirical/QM/QEC/SteaneArbitrary.lean (#61), Mathlib/Probability/CircuitThreshold.lean (#62); specs/BACKLOG.md #62; specs/steane-plan.md.

Error propagation through a transversal gadget #

★★ A fault at one location of a transversal gadget is a weight-one error. The gadget whose factor at i is E * A i — the ideal gate there, followed by the fault — is the ideal gadget followed by the single-qubit error E.

Conjugating a rank-one density operator by a matrix acts on the vector.

One faulty location is corrected #

theorem CSD.Empirical.QM.QEC.Steane.steane_faultyTransversal_recovery :
∃ (R : QuantumInfo.Channel (Fin 7 → Fin 2) (Fin 7 → Fin 2) (Option SingleErr)), ∀ (A : Fin 7 → Matrix (Fin 2) (Fin 2) ℂ) (ρ : Matrix (Fin 7 → Fin 2) (Fin 7 → Fin 2) ℂ), QuantumInfo.blockKron A * ρ * (QuantumInfo.blockKron A).conjTranspose = steaneProj * (QuantumInfo.blockKron A * ρ * (QuantumInfo.blockKron A).conjTranspose) * steaneProj → ∀ (i : Fin 7) (E : Matrix (Fin 2) (Fin 2) ℂ), R.apply ((QuantumInfo.blockKron fun (b : Fin 7) => if b = i then E * A i else A b) * ρ * (QuantumInfo.blockKron fun (b : Fin 7) => if b = i then E * A i else A b).conjTranspose) = ((star (E 0 0) * E 0 0 + star (E 0 1) * E 0 1 + star (E 1 0) * E 1 0 + star (E 1 1) * E 1 1) / 2) • (QuantumInfo.blockKron A * ρ * (QuantumInfo.blockKron A).conjTranspose)

★★★ A transversal gadget with one faulty location is corrected. For every transversal gadget whose ideal output on ρ is a code state, and every fault E at one of the seven locations, one channel returns that ideal output — up to the scalar tr(EᴴE)/2 of #61, since a non-unitary fault is trace-decreasing.

★★★ A unitary fault at one location is undone exactly: the scalar is 1.

The transversal X and Z are the logical X̄ and Z̄ #

The transversal X on the seven qubits is the all-ones Pauli, the code's logical X̄: a Pauli string factorises over the qubits (pauliMat_eq_blockKron) and X = onePauli 1 0.

The transversal Z is the other all-ones Pauli, the code's logical Z̄.

The all-ones Pauli flips the encoded qubit: a|0̄⟩ + b|1̄⟩ ↦ b|0̄⟩ + a|1̄⟩.

★ The transversal X flips the encoded qubit's density operator.

★★★ A faulty transversal logical X̄ is corrected. The gadget is the transversal X on the seven qubits — the code's logical X̄ — with an arbitrary unitary fault at one of its seven locations. One channel returns the ideal output: the encoded qubit with its amplitudes exchanged.

The all-ones Z Pauli signs the encoded qubit's second amplitude: Z̄ on a|0̄⟩ + b|1̄⟩.

★ The transversal Z signs the encoded qubit's density operator.

★★★ A faulty transversal logical Z̄ is corrected, with the ideal output the signed encoded qubit.

The transversal Hadamard preserves the code space #

Swapping the two halves of a stabiliser label: in Fin 6 that is k ↦ k + 3.

Equations
Instances For

    The swap exchanges the X-labels for the Z-labels of the stabiliser family.

    The CSS condition on the family's labels: every X-label is orthogonal to every Z-label, so the transversal Hadamard's sign is 1.

    ★★ The transversal Hadamard preserves the Steane code projector. The Hadamard exchanges the X- and Z-labels of every group element (hadTransversal_conj_pauliMat), the CSS condition kills the sign, and swapping the halves of the label is a bijection of the family — so the group average comes back to itself.

    ★ The transversal Hadamard maps code states to code states, which is what the faulty-gadget theorem needs of the ideal gadget.

    ★★ The transversal Hadamard exchanges the logical X̄ and Z̄ — the logical Hadamard in the Heisenberg picture.

    ★★★ A faulty transversal Hadamard is corrected. The gadget is the Hadamard on all seven qubits — a logical Hadamard, by hadTransversal_conj_logicalX/_logicalZ — with an arbitrary unitary fault at one of its seven locations; one channel returns the ideal output.

    The circuit-level accounting #

    theorem CSD.Empirical.QM.QEC.Steane.steane_circuit_threshold (N : ℕ) (ν : MeasureTheory.Measure Bool) [MeasureTheory.IsProbabilityMeasure ν] {p ε : ℝ} (hp : 0 ≤ p) (hν : ν {c : Bool | c = true} ≤ ENNReal.ofReal p) (hthr : p < 1 / 21) (hε : 0 < ε) :
    ∃ (k : ℕ), (circuitMeasure N 7 ν k) (circuitBad N 7 k) < ENNReal.ofReal ε

    ★★ The threshold for a circuit of transversal gadgets. Each of the N gadgets of the circuit has seven locations, faults are independent with rate at most p, and a gadget is bad when two or more of its locations are (which is the case steane_faultyTransversal_recovery excludes). Below p < 1/21 every accuracy is reached at some concatenation level.