Documentation

MerLeanBpqc.Definitions.Def_4_CSSCode

Definition 4: CSS Code #

A CSS (Calderbank-Shor-Steane) quantum code is defined by a chain complex (Def_1) of length two over 𝔽₂: C₁ β†’[H_Z^T] Cβ‚€ β†’[H_X] C_{-1} where H_X ∘ H_Z^T = 0.

The matrices H_X ∈ 𝔽₂^{r_X Γ— n} and H_Z ∈ 𝔽₂^{r_Z Γ— n} are the X-type and Z-type parity check matrices, so that Cβ‚€ = 𝔽₂^n, C_{-1} = 𝔽₂^{r_X}, and C₁ = 𝔽₂^{r_Z}.

Code Parameters #

Main Definitions #

CSS Code Structure #

structure CSSCode (n rX rZ : β„•) :

A CSS (Calderbank-Shor-Steane) quantum code is defined by parity check matrices H_X : 𝔽₂^n β†’ 𝔽₂^{r_X} and H_Z : 𝔽₂^n β†’ 𝔽₂^{r_Z} satisfying the CSS condition H_X ∘ H_Z^T = 0. Here H_Z^T : 𝔽₂^{r_Z} β†’ 𝔽₂^n is the transpose of H_Z, which serves as the differential from degree 1 to degree 0 in the chain complex C₁ β†’[H_Z^T] Cβ‚€ β†’[H_X] C_{-1}.

Instances For

    Three-term chain complex #

    We construct the three-term chain complex C₁ β†’[H_Z^T] Cβ‚€ β†’[H_X] C_{-1} directly as a HomologicalComplex (ModuleCat 𝔽₂) (ComplexShape.down β„€).

    The objects are defined by an if-cascade on the degree:

    The differentials use eqToHom to transport between the if-defined objects and the concrete ModuleCat.of types, following the pattern of HomologicalComplex.double.

    noncomputable def CSSCode.complex {n rX rZ : β„•} (Q : CSSCode n rX rZ) :

    The three-term chain complex C₁ β†’[H_Z^T] Cβ‚€ β†’[H_X] C_{-1} associated to a CSS code. The objects are 𝔽₂^{r_Z} in degree 1, 𝔽₂^n in degree 0, 𝔽₂^{r_X} in degree -1, and 0 elsewhere. The differentials are H_Z^T from degree 1 to 0 and H_X from degree 0 to -1.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Code parameters #

      The number of physical qubits n = dim Cβ‚€.

      Equations
      Instances For
        noncomputable def CSSCode.logicalQubits {n rX rZ : β„•} (Q : CSSCode n rX rZ) :

        The number of logical qubits k = dim Hβ‚€(C) = dim(ker H_X / im H_Z^T). The homology at degree 0 of the chain complex is ker H_X / im H_Z^T, which counts the number of independent logical qubits.

        Equations
        Instances For
          noncomputable def CSSCode.dX {n rX rZ : β„•} (Q : CSSCode n rX rZ) :

          The X-distance d_X is the minimum Hamming weight of a representative of a non-trivial element of Hβ‚€(C) = ker H_X / im H_Z^T. Equivalently, this is the minimum Hamming weight of any vector in ker H_X that is not in im H_Z^T. By convention (following ClassicalCode.distance), d_X = 0 when the homology is trivial (i.e., ker H_X = im H_Z^T).

          Equations
          Instances For
            noncomputable def CSSCode.dZ {n rX rZ : β„•} (Q : CSSCode n rX rZ) :

            The Z-distance d_Z is the minimum Hamming weight of a representative of a non-trivial element of H⁰(C) = ker H_Z / im H_X^T (Def_2). Since H_Z = (H_Z^T)^T and H_X^T is the transpose of H_X, we define this using dualMap:

            • ker H_Z corresponds to ker (dualMap H_Z^T) in the dual of Cβ‚€
            • im H_X^T corresponds to range (dualMap H_X) in the dual of Cβ‚€

            Over 𝔽₂ with canonical bases, Dual(𝔽₂^n) β‰… 𝔽₂^n via dotProductEquiv. We use this identification to define the Hamming weight of dual functionals. By convention, d_Z = 0 when the cohomology is trivial.

            Equations
            Instances For
              noncomputable def CSSCode.distance {n rX rZ : β„•} (Q : CSSCode n rX rZ) :

              The overall distance d = min(d_X, d_Z).

              Equations
              Instances For

                Code parameter predicates #

                def CSSCode.IsNKDCode {n rX rZ : β„•} (Q : CSSCode n rX rZ) (k d : β„•) :

                A CSS code is an [[n, k, d]]-code if it has k logical qubits and distance d.

                Equations
                Instances For
                  def CSSCode.IsNKDXZCode {n rX rZ : β„•} (Q : CSSCode n rX rZ) (k dX_val dZ_val : β„•) :

                  A CSS code is an [[n, k, d_X, d_Z]]-code when X- and Z-distances differ.

                  Equations
                  Instances For