Documentation

CsdLean4.Empirical.QM.QEC.Steane

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:

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
    def CSD.Empirical.QM.QEC.Steane.rowComb (c : Fin 3 β†’ Fin 2) :
    Fin 7 β†’ Fin 2

    An 𝔽₂ combination of the Hamming rows β€” the row space Cβ‚‚ (eight elements), the support of the logical states.

    Equations
    Instances For

      The all-ones vector: the logical-X/Z label, a Hamming codeword outside the row space.

      Equations
      Instances For
        def CSD.Empirical.QM.QEC.Steane.steaneA (x : Fin 6 β†’ Fin 2) :
        Fin 7 β†’ Fin 2

        The X-labels of the stabiliser family: the first three bits of x combine the rows.

        Equations
        Instances For
          def CSD.Empirical.QM.QEC.Steane.steaneB (x : Fin 6 β†’ Fin 2) :
          Fin 7 β†’ Fin 2

          The Z-labels: the last three bits of x combine the rows.

          Equations
          Instances For

            The 𝔽₂ facts about the Hamming rows (kernel-checked) #

            theorem CSD.Empirical.QM.QEC.Steane.rowComb_add (c d : Fin 3 β†’ Fin 2) :

            Row combinations are additive.

            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).

            theorem CSD.Empirical.QM.QEC.Steane.rowComb_eq_zero (c : Fin 3 β†’ Fin 2) (h : rowComb c = 0) :
            c = 0

            The rows are independent: only the trivial combination vanishes.

            The all-ones vector is not in the row space: the two logical supports are disjoint cosets.

            theorem CSD.Empirical.QM.QEC.Steane.rowComb_injective (c d : Fin 3 β†’ Fin 2) (h : rowComb c = rowComb d) :
            c = d

            The row-combination map is injective (the eight support strings are distinct).

            The stabiliser-family axioms, and the GK-3 instantiation #

            theorem CSD.Empirical.QM.QEC.Steane.steane_sigma_coherent (x y : Fin 6 β†’ Fin 2) :
            (fun (x : Fin 6 β†’ Fin 2) => 0) (x + y) = (fun (x : Fin 6 β†’ Fin 2) => 0) x + (fun (x : Fin 6 β†’ Fin 2) => 0) y + QuantumInfo.bdot (steaneB x) (steaneA y)

            The trivial sign function is coherent: the CSS condition kills the pairing.

            theorem CSD.Empirical.QM.QEC.Steane.steane_labels_injective (x : Fin 6 β†’ Fin 2) (hA : steaneA x = 0) (hB : steaneB x = 0) :
            x = 0

            The six generators are independent.

            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
            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Μ„ 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 normalisation constant: (1/√8)·(1/√8)·8 = 1.

                The logical zero is a unit vector: the eight support strings are distinct.

                The logical one is a unit vector: the coset strings are distinct.

                The distance mechanism: single-error syndromes #

                def CSD.Empirical.QM.QEC.Steane.syndrome (e : Fin 7 β†’ Fin 2) :
                Fin 3 β†’ Fin 2

                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

                  The single-bit error at position j.

                  Equations
                  Instances For

                    β˜… Every single-qubit error is detected: its syndrome is nonzero (every Hamming column is nonzero). By CSS symmetry the same statement covers both X- and Z-type single-qubit errors.

                    β˜… 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.