Documentation

QEC1.Remarks.Rem_19_BivariateBicycleCodeNotation

Remark 19: Bivariate Bicycle Code Notation #

Statement #

The Bivariate Bicycle (BB) code construction uses cyclic permutation matrices and their tensor products to define CSS codes on 2ℓm qubits.

Main Results #

Corollaries #

The monomial group and group algebra #

@[reducible, inline]

The monomial group M = Z_ℓ × Z_m, representing monomials x^a y^b with a ∈ {0,...,ℓ-1} and b ∈ {0,...,m-1}. We use ZMod for the additive group structure (addition corresponds to monomial multiplication).

Equations
Instances For
    @[reducible, inline]

    The group algebra F₂[x,y]/(x^ℓ-1, y^m-1). An element is a function M → ZMod 2, where the value at (a,b) is the coefficient of x^a y^b.

    Equations
    Instances For
      def BivariateBicycle.bbMonomial {m : } (a : ZMod ) (b : ZMod m) :

      The monomial x^a y^b as an element of the group algebra: the indicator function of the single element (a, b).

      Equations
      Instances For

        The zero polynomial.

        Equations
        Instances For
          def BivariateBicycle.bbOne {m : } [NeZero ] [NeZero m] :

          The unit polynomial 1 = x^0 y^0.

          Equations
          Instances For
            def BivariateBicycle.bbAdd {m : } (p q : BBGroupAlgebra m) :

            Addition in the group algebra (pointwise XOR, since coefficients are in ZMod 2).

            Equations
            Instances For
              noncomputable def BivariateBicycle.bbConvolve {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (p q : BBGroupAlgebra m) :

              Convolution (polynomial multiplication) in F₂[x,y]/(x^ℓ-1, y^m-1). (p * q)(γ) = Σ_{α} p(α) · q(γ - α) where subtraction is in Z_ℓ × Z_m. This corresponds to matrix multiplication of the associated circulant-like matrices.

              Equations
              Instances For
                def BivariateBicycle.bbSupport {m : } (p : BBGroupAlgebra m) :
                Set (BBMonomial m)

                The support of a polynomial: the set of monomials with nonzero coefficient.

                Equations
                Instances For
                  noncomputable def BivariateBicycle.bbSupportFinset {m : } [Fintype (ZMod )] [Fintype (ZMod m)] [DecidableEq (ZMod )] [DecidableEq (ZMod m)] (p : BBGroupAlgebra m) :

                  The support as a finset (decidable).

                  Equations
                  Instances For

                    The transpose operation: A^T(x,y) = A(x⁻¹, y⁻¹). Since x^{-1} = x^{ℓ-1} and y^{-1} = y^{m-1} in the quotient ring, this maps the coefficient of x^a y^b to x^{-a} y^{-b}.

                    Equations
                    Instances For

                      Transpose properties #

                      theorem BivariateBicycle.bbTranspose_bbMonomial {m : } [NeZero ] [NeZero m] (a : ZMod ) (b : ZMod m) :

                      Convolution properties #

                      The BB qubit type #

                      @[reducible, inline]

                      The qubit type for a BB code: Left (L) qubits and Right (R) qubits, each indexed by the monomial group M = Z_ℓ × Z_m.

                      Equations
                      Instances For
                        theorem BivariateBicycle.bbCode_numQubits {m : } [NeZero ] [NeZero m] :
                        Fintype.card (BBQubit m) = 2 * ( * m)

                        The number of physical qubits in a BB code is 2ℓm.

                        Pauli operators on BB codes #

                        def BivariateBicycle.pauliXBB {m : } (p q : BBGroupAlgebra m) :

                        The X-type Pauli operator X(p, q) on a BB code. Acts with X on L qubit γ iff p(γ) = 1, and on R qubit δ iff q(δ) = 1. This is a pure X-type operator (zVec = 0).

                        Equations
                        Instances For
                          def BivariateBicycle.pauliZBB {m : } (p q : BBGroupAlgebra m) :

                          The Z-type Pauli operator Z(p, q) on a BB code. Acts with Z on L qubit γ iff p(γ) = 1, and on R qubit δ iff q(δ) = 1. This is a pure Z-type operator (xVec = 0).

                          Equations
                          Instances For
                            @[simp]
                            theorem BivariateBicycle.pauliXBB_xVec_left {m : } (p q : BBGroupAlgebra m) (γ : BBMonomial m) :
                            (pauliXBB p q).xVec (Sum.inl γ) = p γ
                            @[simp]
                            theorem BivariateBicycle.pauliXBB_xVec_right {m : } (p q : BBGroupAlgebra m) (δ : BBMonomial m) :
                            (pauliXBB p q).xVec (Sum.inr δ) = q δ
                            @[simp]
                            theorem BivariateBicycle.pauliXBB_zVec {m : } (p q : BBGroupAlgebra m) :
                            (pauliXBB p q).zVec = 0
                            @[simp]
                            theorem BivariateBicycle.pauliZBB_xVec {m : } (p q : BBGroupAlgebra m) :
                            (pauliZBB p q).xVec = 0
                            @[simp]
                            theorem BivariateBicycle.pauliZBB_zVec_left {m : } (p q : BBGroupAlgebra m) (γ : BBMonomial m) :
                            (pauliZBB p q).zVec (Sum.inl γ) = p γ
                            @[simp]
                            theorem BivariateBicycle.pauliZBB_zVec_right {m : } (p q : BBGroupAlgebra m) (δ : BBMonomial m) :
                            (pauliZBB p q).zVec (Sum.inr δ) = q δ

                            The shifted polynomial: α-shift of p is p(· - α), i.e., convolution with δ_α #

                            def BivariateBicycle.bbShift {m : } (α : BBMonomial m) (p : BBGroupAlgebra m) :

                            Left-shift a polynomial by monomial α: (shift_α p)(γ) = p(γ - α). This corresponds to multiplication by x^a y^b in the group algebra.

                            Equations
                            Instances For
                              theorem BivariateBicycle.bbShift_zero {m : } (p : BBGroupAlgebra m) [NeZero ] [NeZero m] :
                              bbShift 0 p = p
                              theorem BivariateBicycle.bbShift_add {m : } (α β : BBMonomial m) (p : BBGroupAlgebra m) :
                              bbShift α (bbShift β p) = bbShift (α + β) p

                              X-type and Z-type checks of the BB code #

                              def BivariateBicycle.bbCheckX {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α : BBMonomial m) :

                              The X-type check indexed by α ∈ M. Its X-support on L qubits is the support of αA, and on R qubits is the support of αB. Using the shift representation: check (α, X) = X(shift_α A, shift_α B).

                              Equations
                              Instances For
                                def BivariateBicycle.bbCheckZ {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β : BBMonomial m) :

                                The Z-type check indexed by β ∈ M. Its Z-support on L qubits is the support of βB^T, and on R qubits is the support of βA^T. Using the shift representation: check (β, Z) = Z(shift_β B^T, shift_β A^T).

                                Equations
                                Instances For
                                  @[simp]
                                  theorem BivariateBicycle.bbCheckX_xVec_left {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α γ : BBMonomial m) :
                                  (bbCheckX A B α).xVec (Sum.inl γ) = A (γ - α)
                                  @[simp]
                                  theorem BivariateBicycle.bbCheckX_xVec_right {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α δ : BBMonomial m) :
                                  (bbCheckX A B α).xVec (Sum.inr δ) = B (δ - α)
                                  @[simp]
                                  theorem BivariateBicycle.bbCheckX_zVec {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α : BBMonomial m) :
                                  (bbCheckX A B α).zVec = 0
                                  @[simp]
                                  theorem BivariateBicycle.bbCheckZ_xVec {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β : BBMonomial m) :
                                  (bbCheckZ A B β).xVec = 0
                                  @[simp]
                                  theorem BivariateBicycle.bbCheckZ_zVec_left {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β γ : BBMonomial m) :
                                  (bbCheckZ A B β).zVec (Sum.inl γ) = B (-(γ - β))
                                  @[simp]
                                  theorem BivariateBicycle.bbCheckZ_zVec_right {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β δ : BBMonomial m) :
                                  (bbCheckZ A B β).zVec (Sum.inr δ) = A (-(δ - β))

                                  X checks are pure X-type, Z checks are pure Z-type #

                                  theorem BivariateBicycle.bbCheckX_pure_X {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α : BBMonomial m) :
                                  (bbCheckX A B α).zVec = 0
                                  theorem BivariateBicycle.bbCheckZ_pure_Z {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β : BBMonomial m) :
                                  (bbCheckZ A B β).xVec = 0

                                  CSS commutation: X checks commute with Z checks #

                                  theorem BivariateBicycle.bbCheckX_commute {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α₁ α₂ : BBMonomial m) :
                                  (bbCheckX A B α₁).PauliCommute (bbCheckX A B α₂)

                                  X checks commute with each other (both pure X, so symplectic inner product = 0).

                                  theorem BivariateBicycle.bbCheckZ_commute {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β₁ β₂ : BBMonomial m) :
                                  (bbCheckZ A B β₁).PauliCommute (bbCheckZ A B β₂)

                                  Z checks commute with each other (both pure Z, so symplectic inner product = 0).

                                  theorem BivariateBicycle.bbCheckXZ_commute_iff {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α β : BBMonomial m) :
                                  (bbCheckX A B α).PauliCommute (bbCheckZ A B β) γ : BBMonomial m, A (γ - α) * B (-(γ - β)) + δ : BBMonomial m, B (δ - α) * A (-(δ - β)) = 0

                                  The CSS commutation condition: X check α commutes with Z check β iff Σ_γ A(γ-α)·B(-γ+β) + Σ_δ B(δ-α)·A(-δ+β) = 0 in ZMod 2. This is the condition H_X · H_Z^T = 0, equivalently A·B^T = B·A^T.

                                  The CSS condition: AB^T = BA^T (in the group algebra) #

                                  def BivariateBicycle.BBCSSCondition {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) :

                                  The CSS condition for a BB code: A * B^T = B * A^T as convolutions. This is the necessary and sufficient condition for all X and Z checks to commute.

                                  Equations
                                  Instances For
                                    theorem BivariateBicycle.bbChecksXZ_commute_of_css {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (_hcss : BBCSSCondition A B) (α β : BBMonomial m) :
                                    (bbCheckX A B α).PauliCommute (bbCheckZ A B β)

                                    Under the CSS condition, all X and Z checks commute. In fact, for BB codes over abelian groups the commutation is automatic: each sum equals the convolution bbConvolve evaluated at β-α, and by commutativity of convolution their sum vanishes in characteristic 2.

                                    The BB code check index and the full stabilizer code #

                                    @[reducible, inline]

                                    Check index for a BB code: X checks indexed by M, Z checks indexed by M.

                                    Equations
                                    Instances For
                                      theorem BivariateBicycle.bbCode_numChecks {m : } [NeZero ] [NeZero m] :
                                      Fintype.card (BBCheckIndex m) = 2 * ( * m)

                                      The number of checks in a BB code is 2ℓm.

                                      def BivariateBicycle.bbCheck {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) :
                                      BBCheckIndex mPauliOp (BBQubit m)

                                      The check map for a BB code: X checks on the left, Z checks on the right.

                                      Equations
                                      Instances For
                                        theorem BivariateBicycle.bbChecks_commute {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (hcss : BBCSSCondition A B) (i j : BBCheckIndex m) :
                                        (bbCheck A B i).PauliCommute (bbCheck A B j)

                                        Under the CSS condition, all checks in a BB code pairwise commute.

                                        noncomputable def BivariateBicycle.BBCode {m : } [Fintype (ZMod )] [Fintype (ZMod m)] [DecidableEq (ZMod )] [DecidableEq (ZMod m)] (A B : BBGroupAlgebra m) (hcss : BBCSSCondition A B) :

                                        A BB code forms a valid stabilizer code under the CSS condition.

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

                                          Properties of the cyclic shift operators x and y #

                                          def BivariateBicycle.xShift {m : } [NeZero ] [NeZero m] :

                                          The x-shift operator: multiplication by x = x^1 y^0 in the group algebra. Maps coefficient at (a, b) to (a-1, b), i.e., shifts the first coordinate.

                                          Equations
                                          Instances For
                                            def BivariateBicycle.yShift {m : } [NeZero ] [NeZero m] :

                                            The y-shift operator: multiplication by y = x^0 y^1 in the group algebra. Maps coefficient at (a, b) to (a, b-1), i.e., shifts the second coordinate.

                                            Equations
                                            Instances For
                                              @[simp]
                                              theorem BivariateBicycle.xShift_pow_ℓ {m : } [NeZero ] [NeZero m] :
                                              xShift = 0

                                              x^ℓ = 1: shifting by ℓ in the first coordinate is the identity (mod ℓ).

                                              @[simp]
                                              theorem BivariateBicycle.yShift_pow_m {m : } [NeZero ] [NeZero m] :

                                              y^m = 1: shifting by m in the second coordinate is the identity (mod m).

                                              x and y commute: the monomial group is abelian.

                                              Transpose as variable inversion #

                                              theorem BivariateBicycle.bbTranspose_eq_neg {m : } (p : BBGroupAlgebra m) (γ : BBMonomial m) :
                                              bbTranspose p γ = p (-γ)

                                              The transpose satisfies A^T(γ) = A(-γ), which corresponds to substituting x → x⁻¹ = x^{ℓ-1} and y → y⁻¹ = y^{m-1}.

                                              theorem BivariateBicycle.bbTranspose_monomial_neg {m : } [NeZero ] [NeZero m] (a : ZMod ) (b : ZMod m) (γ : BBMonomial m) :
                                              bbTranspose (bbMonomial a b) γ = bbMonomial (-a) (-b) γ

                                              Transpose of a monomial: (x^a y^b)^T = x^{-a} y^{-b}.

                                              Convolution distributes over transposition #

                                              The labeling convention #

                                              @[reducible, inline]
                                              abbrev BivariateBicycle.leftQubit {m : } (γ : BBMonomial m) :
                                              BBQubit m

                                              Left qubit labeled by γ ∈ M.

                                              Equations
                                              Instances For
                                                @[reducible, inline]
                                                abbrev BivariateBicycle.rightQubit {m : } (δ : BBMonomial m) :
                                                BBQubit m

                                                Right qubit labeled by δ ∈ M.

                                                Equations
                                                Instances For
                                                  @[reducible, inline]
                                                  abbrev BivariateBicycle.xCheckIndex {m : } (α : BBMonomial m) :

                                                  X check labeled by α ∈ M.

                                                  Equations
                                                  Instances For
                                                    @[reducible, inline]
                                                    abbrev BivariateBicycle.zCheckIndex {m : } (β : BBMonomial m) :

                                                    Z check labeled by β ∈ M.

                                                    Equations
                                                    Instances For
                                                      @[simp]
                                                      theorem BivariateBicycle.bbCheck_xCheck {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α : BBMonomial m) :
                                                      bbCheck A B (xCheckIndex α) = bbCheckX A B α

                                                      The check at index (α, X) is the X check for α.

                                                      @[simp]
                                                      theorem BivariateBicycle.bbCheck_zCheck {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β : BBMonomial m) :
                                                      bbCheck A B (zCheckIndex β) = bbCheckZ A B β

                                                      The check at index (β, Z) is the Z check for β.

                                                      The CSS condition is equivalent to AB^T = BA^T #

                                                      theorem BivariateBicycle.bbCSSCondition_iff {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) :
                                                      BBCSSCondition A B ∀ (γ : BBMonomial m), α : BBMonomial m, A α * B (α - γ) = α : BBMonomial m, B α * A (α - γ)

                                                      The CSS condition states that A * B^T = B * A^T in the group algebra. This ensures the parity check matrices H_X and H_Z satisfy H_X · H_Z^T = 0. Equivalently: for every γ ∈ M, Σ_α A(α) · B(α - γ) = Σ_α B(α) · A(α - γ).

                                                      Pauli notation properties #

                                                      theorem BivariateBicycle.pauliXBB_pure_X {m : } (p q : BBGroupAlgebra m) :
                                                      (pauliXBB p q).zVec = 0

                                                      X(p, q) is pure X-type.

                                                      theorem BivariateBicycle.pauliZBB_pure_Z {m : } (p q : BBGroupAlgebra m) :
                                                      (pauliZBB p q).xVec = 0

                                                      Z(p, q) is pure Z-type.

                                                      @[simp]
                                                      theorem BivariateBicycle.pauliXBB_zero {m : } :
                                                      pauliXBB 0 0 = 1

                                                      X(0, 0) is the identity operator.

                                                      @[simp]
                                                      theorem BivariateBicycle.pauliZBB_zero {m : } :
                                                      pauliZBB 0 0 = 1

                                                      Z(0, 0) is the identity operator.

                                                      theorem BivariateBicycle.pauliXBB_mul {m : } (p₁ q₁ p₂ q₂ : BBGroupAlgebra m) :
                                                      pauliXBB p₁ q₁ * pauliXBB p₂ q₂ = pauliXBB (p₁ + p₂) (q₁ + q₂)

                                                      X(p₁, q₁) · X(p₂, q₂) = X(p₁ + p₂, q₁ + q₂) as Pauli operators (since X-type operators multiply by adding their binary vectors).

                                                      theorem BivariateBicycle.pauliZBB_mul {m : } (p₁ q₁ p₂ q₂ : BBGroupAlgebra m) :
                                                      pauliZBB p₁ q₁ * pauliZBB p₂ q₂ = pauliZBB (p₁ + p₂) (q₁ + q₂)

                                                      Z(p₁, q₁) · Z(p₂, q₂) = Z(p₁ + p₂, q₁ + q₂).

                                                      theorem BivariateBicycle.pauliXBB_pauliXBB_commute {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (p₁ q₁ p₂ q₂ : BBGroupAlgebra m) :
                                                      (pauliXBB p₁ q₁).PauliCommute (pauliXBB p₂ q₂)

                                                      Two X-type Pauli operators always commute.

                                                      theorem BivariateBicycle.pauliZBB_pauliZBB_commute {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (p₁ q₁ p₂ q₂ : BBGroupAlgebra m) :
                                                      (pauliZBB p₁ q₁).PauliCommute (pauliZBB p₂ q₂)

                                                      Two Z-type Pauli operators always commute.

                                                      theorem BivariateBicycle.symplecticInner_pauliXBB_pauliZBB {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (p₁ q₁ p₂ q₂ : BBGroupAlgebra m) :
                                                      (pauliXBB p₁ q₁).symplecticInner (pauliZBB p₂ q₂) = γ : BBMonomial m, p₁ γ * p₂ γ + δ : BBMonomial m, q₁ δ * q₂ δ

                                                      The symplectic inner product of X(p₁,q₁) and Z(p₂,q₂) equals Σ_γ p₁(γ)·p₂(γ) + Σ_δ q₁(δ)·q₂(δ), which is ⟨p₁,p₂⟩ + ⟨q₁,q₂⟩ where ⟨·,·⟩ is the standard inner product in ZMod 2.

                                                      X check is exactly X(shift_α A, shift_α B) #

                                                      theorem BivariateBicycle.bbCheckX_eq_pauliXBB {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α : BBMonomial m) :
                                                      bbCheckX A B α = pauliXBB (bbShift α A) (bbShift α B)
                                                      theorem BivariateBicycle.bbCheckZ_eq_pauliZBB {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β : BBMonomial m) :

                                                      Z check is exactly Z(shift_β B^T, shift_β A^T).

                                                      Monomial group cardinality #

                                                      theorem BivariateBicycle.bbMonomial_card {m : } [NeZero ] [NeZero m] :
                                                      Fintype.card (BBMonomial m) = * m

                                                      The monomial group has ℓm elements.

                                                      Check acts on qubit characterization #

                                                      theorem BivariateBicycle.bbCheckX_acts_on_left {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α γ : BBMonomial m) :
                                                      (bbCheckX A B α).xVec (Sum.inl γ) = A (γ - α)

                                                      X check (α, X) acts on L qubit γ iff A(γ - α) = 1, i.e., γ is in the support of the shifted polynomial αA.

                                                      theorem BivariateBicycle.bbCheckX_acts_on_right {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α δ : BBMonomial m) :
                                                      (bbCheckX A B α).xVec (Sum.inr δ) = B (δ - α)

                                                      X check (α, X) acts on R qubit δ iff B(δ - α) = 1, i.e., δ is in the support of the shifted polynomial αB.

                                                      theorem BivariateBicycle.bbCheckZ_acts_on_left {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β γ : BBMonomial m) :
                                                      (bbCheckZ A B β).zVec (Sum.inl γ) = B (β - γ)

                                                      Z check (β, Z) acts on L qubit γ iff B^T(γ - β) = B(β - γ) = 1, i.e., γ is in the support of the shifted polynomial β B^T.

                                                      theorem BivariateBicycle.bbCheckZ_acts_on_right {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β δ : BBMonomial m) :
                                                      (bbCheckZ A B β).zVec (Sum.inr δ) = A (β - δ)

                                                      Z check (β, Z) acts on R qubit δ iff A^T(δ - β) = A(β - δ) = 1, i.e., δ is in the support of the shifted polynomial β A^T.

                                                      Self-inverse properties #

                                                      theorem BivariateBicycle.bbCheckX_mul_self {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (α : BBMonomial m) :
                                                      bbCheckX A B α * bbCheckX A B α = 1

                                                      X checks are self-inverse: (α, X) · (α, X) = I.

                                                      theorem BivariateBicycle.bbCheckZ_mul_self {m : } [Fintype (ZMod )] [Fintype (ZMod m)] (A B : BBGroupAlgebra m) (β : BBMonomial m) :
                                                      bbCheckZ A B β * bbCheckZ A B β = 1

                                                      Z checks are self-inverse: (β, Z) · (β, Z) = I.