Documentation

CsdLean4.Empirical.QM.QEC.SyndromeRecovery

Empirical/QM: syndrome-conditioned recovery as one channel #

Category: 3-Local. QM-validity layer (matrix algebra over the K2 Channel layer, no CSD content); companion of ThreeQubit.lean and BitFlipChannel.lean.

ThreeQubit.lean proves the bit-flip code corrects each single error branch by branch: the syndrome identifies Xⱼ, and Xⱼ undoes it. The operational statement of error correction is stronger: a single CPTP map — measure the syndrome, then apply the correction the outcome names — returns every code state, mixed or pure, from the mixed post-error state. This file builds that channel and proves it.

The proof is the Knill–Laflamme mechanism in its simplest instance: Pⱼ Eₖ P₀ = δⱼₖ Pₖ Eₖ (the error Eₖ carries the code onto the k-th syndrome subspace and nowhere else), so the double Kraus sum collapses to its diagonal, and on the diagonal Eₖ Pₖ Eₖ = P₀.

What is not here: errors outside the single-flip set (two flips are miscorrected — the code's distance is 3). The independent-noise channel (bit-flip_p)^{⊗3}, whose double- and triple-flip branches the code mis-corrects into the logical flip, is IndependentNoise.lean (recoveryChannel_apply_indepFlipChannel_apply: the 3p² − 2p³ residual); singleFlipChannel is its correctable part with free weights.

Source #

Shor 1995, Phys. Rev. A 52, R2493; Knill–Laflamme 1997, Phys. Rev. A 55, 900 (the correction conditions; the recovery channel ∑ₖ Eₖ Pₖ · Pₖ Eₖᴴ).

The qubit projectors, the code projector, the errors #

|0⟩⟨0|.

Equations
Instances For

    |1⟩⟨1|.

    Equations
    Instances For
      @[simp]
      theorem CSD.Empirical.QM.QEC.kron3_zero_left (N P : Matrix (Fin 2) (Fin 2) ℂ) :
      kron3 0 N P = 0
      @[simp]
      theorem CSD.Empirical.QM.QEC.kron3_zero_mid (M P : Matrix (Fin 2) (Fin 2) ℂ) :
      kron3 M 0 P = 0
      @[simp]
      theorem CSD.Empirical.QM.QEC.kron3_zero_right (M N : Matrix (Fin 2) (Fin 2) ℂ) :
      kron3 M N 0 = 0

      The code projector P₀ = |000⟩⟨000| + |111⟩⟨111| onto the codespace span{|000⟩, |111⟩}.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def CSD.Empirical.QM.QEC.errorOp :
        Fin 4 → Matrix (Fin 2 × Fin 2 × Fin 2) (Fin 2 × Fin 2 × Fin 2) ℂ

        The four errors {I, X₁, X₂, X₃} as operators on the three-qubit register.

        Equations
        Instances For
          theorem CSD.Empirical.QM.QEC.errorOp_conj_conj (k : Fin 4) (A : Matrix (Fin 2 × Fin 2 × Fin 2) (Fin 2 × Fin 2 × Fin 2) ℂ) :
          errorOp k * (errorOp k * A * errorOp k) * errorOp k = A

          Eₖ (Eₖ A Eₖ) Eₖ = A: conjugating twice by a self-inverse error is the identity.

          The syndrome projectors: a projective measurement on the register #

          noncomputable def CSD.Empirical.QM.QEC.syndromeProj (k : Fin 4) :
          Matrix (Fin 2 × Fin 2 × Fin 2) (Fin 2 × Fin 2 × Fin 2) ℂ

          The k-th syndrome projector Pₖ = Eₖ P₀ Eₖ, the projector onto the error subspace Eₖ · C.

          Equations
          Instances For

            The four syndrome projectors in closed form: each is the sum of two computational-basis projectors, and the four pairs partition the eight basis states.

            ★ The syndrome projectors are pairwise orthogonal projectors.

            ★ The syndrome projectors sum to the identity: the syndrome is a complete projective measurement on the register.

            The errored codewords lie in their syndrome subspaces #

            P₀ ψ_L = ψ_L: the code projector fixes the logical states.

            The errored codeword Eₖ ψ_L lies in the k-th syndrome subspace.

            The errored codeword Eₖ ψ_L lies in no other syndrome subspace.

            The recovery channel and the single-error channel #

            The syndrome-conditioned recovery, as one channel: Kraus operators Eₖ Pₖ — project onto the k-th syndrome subspace, then apply the correction Eₖ the syndrome names. Trace preservation is ∑ₖ Pₖ Eₖ Eₖ Pₖ = ∑ₖ Pₖ = 1.

            Equations
            Instances For
              noncomputable def CSD.Empirical.QM.QEC.singleFlipChannel (q : Fin 4 → ℝ) (hq0 : ∀ (k : Fin 4), 0 ≤ q k) (hq1 : ∑ k : Fin 4, q k = 1) :

              The mixed single-error channel ρ ↦ ∑ₖ qₖ Eₖ ρ Eₖ: the four discretised error branches at once, with any weights qₖ ≥ 0, ∑ₖ qₖ = 1.

              Equations
              Instances For
                theorem CSD.Empirical.QM.QEC.singleFlipChannel_apply (q : Fin 4 → ℝ) (hq0 : ∀ (k : Fin 4), 0 ≤ q k) (hq1 : ∑ k : Fin 4, q k = 1) (ρ : Matrix (Fin 2 × Fin 2 × Fin 2) (Fin 2 × Fin 2 × Fin 2) ℂ) :
                (singleFlipChannel q hq0 hq1).apply ρ = ∑ k : Fin 4, ↑(q k) • (errorOp k * ρ * errorOp k)

                The Knill–Laflamme collapse #

                Eₖ P₀ = Pₖ Eₖ: the error carries the code projector onto the k-th syndrome projector.

                The Kraus term of R ∘ N_q indexed by (j, k), on a code-supported operator: it is the identity for j = k and vanishes otherwise (Pⱼ Eₖ P₀ = δⱼₖ Pₖ Eₖ).

                theorem CSD.Empirical.QM.QEC.recoveryChannel_apply_singleFlipChannel_apply (q : Fin 4 → ℝ) (hq0 : ∀ (k : Fin 4), 0 ≤ q k) (hq1 : ∑ k : Fin 4, q k = 1) (ρ : Matrix (Fin 2 × Fin 2 × Fin 2) (Fin 2 × Fin 2 × Fin 2) ℂ) (hρ : codeProj * ρ * codeProj = ρ) :

                ★★ Syndrome-conditioned recovery is exact on the code, as one channel on the mixed state. For every operator ρ supported on the codespace (P₀ ρ P₀ = ρ — every code state, pure or mixed) and every single-error mixture N_q, the recovery channel returns ρ from the mixed post-error state: R (N_q ρ) = ρ.

                theorem CSD.Empirical.QM.QEC.comp_recoveryChannel_singleFlipChannel_apply (q : Fin 4 → ℝ) (hq0 : ∀ (k : Fin 4), 0 ≤ q k) (hq1 : ∑ k : Fin 4, q k = 1) (ρ : Matrix (Fin 2 × Fin 2 × Fin 2) (Fin 2 × Fin 2 × Fin 2) ℂ) (hρ : codeProj * ρ * codeProj = ρ) :

                The composite channel R ∘ N_q (Channel.comp) is the identity on the code.