Documentation

CsdLean4.Mathlib.QuantumInfo.ReedMuller15

The combinatorics of the [[15, 1, 3]] quantum Reed–Muller code #

Category: 1-Mathlib (CSD-free; staged for upstream). BACKLOG #75, part (a) of R-004 (specs/magic-plan.md, "The split").

The X-stabilisers of the [[15, 1, 3]] code are the four rows of the 4 × 15 matrix H whose columns are the nonzero vectors of 𝔽₂⁴ (col j = the binary digits of j + 1): the punctured simplex code [15, 4]. A Z-error pattern e ∈ 𝔽₂¹⁵ is undetected by the X-checks iff H e = 0, i.e. e lies in the dual, the [15, 11] Hamming code.

Honest scope #

⚠️ Classical combinatorics only: the quantum statements (transversal T on the code, the projection of fifteen magic states, the 35 p³ bound) are BACKLOG #76–#78 and consume these facts.

References: S. Bravyi, A. Kitaev, PRA 71 (2005) 022316 §IV; E. Knill, R. Laflamme, W. Zurek, quant-ph/9610011 (the [[15, 1, 3]] code); F. J. MacWilliams, N. J. A. Sloane, The Theory of Error-Correcting Codes, Ch. 1 §9 (the Hamming code) and Ch. 13 (Reed–Muller codes); specs/magic-plan.md; specs/BACKLOG.md #75; specs/future-work.md.

The parity-check matrix #

def ReedMuller15.col (j : Fin 15) :
Fin 4 → ZMod 2

Column j of the parity-check matrix: the binary digits of j + 1, the j-th nonzero vector of 𝔽₂⁴.

Equations
Instances For
    def ReedMuller15.syndrome (e : Fin 15 → ZMod 2) :
    Fin 4 → ZMod 2

    The syndrome H e of a pattern e.

    Equations
    Instances For
      def ReedMuller15.support (e : Fin 15 → ZMod 2) :
      Finset (Fin 15)

      The support of a pattern.

      Equations
      Instances For
        def ReedMuller15.weight (e : Fin 15 → ZMod 2) :

        The weight of a pattern.

        Equations
        Instances For
          def ReedMuller15.ind (S : Finset (Fin 15)) :
          Fin 15 → ZMod 2

          The indicator pattern of a set of qubits.

          Equations
          Instances For
            theorem ReedMuller15.zmod_two_eq_of_add_eq_zero {a b : ZMod 2} (h : a + b = 0) :
            a = b
            theorem ReedMuller15.ind_support (e : Fin 15 → ZMod 2) :
            ind (support e) = e
            theorem ReedMuller15.syndrome_add (e f : Fin 15 → ZMod 2) :
            theorem ReedMuller15.syndrome_ind (S : Finset (Fin 15)) :
            syndrome (ind S) = ∑ j ∈ S, col j

            Weights one and two are detected #

            No undetected pattern of weight one: the columns are nonzero.

            No undetected pattern of weight two: the columns are distinct.

            Exactly 35 undetected patterns of weight three #

            The 3-subsets of qubits whose columns sum to zero: the lines of PG(3, 2).

            Equations
            Instances For

              ★ Exactly 35 undetected patterns of weight 3.

              Odd weight is the logical Z̄ #

              def ReedMuller15.dotp (e x : Fin 15 → ZMod 2) :

              The pairing e · x = ∑ eⱼ xⱼ in 𝔽₂.

              Equations
              Instances For
                theorem ReedMuller15.syndrome_apply_eq_dotp (e : Fin 15 → ZMod 2) (i : Fin 4) :
                syndrome e i = dotp e fun (j : Fin 15) => col j i
                theorem ReedMuller15.weight_cast (e : Fin 15 → ZMod 2) :
                ↑(weight e) = ∑ j : Fin 15, e j
                theorem ReedMuller15.dotp_add_one (e x : Fin 15 → ZMod 2) :
                dotp e (x + 1) = dotp e x + ↑(weight e)

                ★ The parity rule: e · (x + 𝟙) = e · x + |e|. An undetected Z-pattern (e · x = 0 on the X-stabiliser code) acts on the logical 1̄ = 0̄ + 𝟙 with the sign (−1)^{|e|}: it is the logical Z̄ exactly when its weight is odd.

                The Hamming code has 2¹¹ words #

                def ReedMuller15.Hmat :
                Matrix (Fin 4) (Fin 15) (ZMod 2)

                The parity-check matrix H, columns col j.

                Equations
                Instances For
                  def ReedMuller15.preimage (s : Fin 4 → ZMod 2) :
                  Fin 15 → ZMod 2

                  A preimage of a syndrome: the unit columns sit at j = 0, 1, 3, 7.

                  Equations
                  Instances For

                    The syndrome as a linear map.

                    Equations
                    Instances For
                      theorem ReedMuller15.card_undetected :
                      {e : Fin 15 → ZMod 2 | syndrome e = 0}.card = 2 ^ 11

                      ★ The Hamming code has 2¹¹ words: the undetected patterns number 2048.