Based tensor differentials and the selected CSS subsystems
DefinitionQuantumCupGates644_ConstantWeight_Supplement_complexesFor r local systems, form the r one-dimensional Tanner cochain factors, dualizing only the final local system. A tensor basis is a tuple of factor basis elements, graded by the number of degree-one factors. In block i the factors have the cyclic order on p.18. The differential is
The chain differential is its transpose. The CSS spaces are the level-one cycle and cocycle kernels. The protected spaces are the full preimages of Equation (12): the span of the indicated pure homology or cohomology tensors, plus boundaries or coboundaries respectively. A common finite relabelling identifies these actual spaces with the published CSSSubsystem carrier.
Source locality bounds row and column weights separately. It does not combine X and Z participation. Validity and all parameter inequalities remain propositions to be proved; no desired conclusion is a field of the data.
import Definitions.Def_QuantumCupGates644_ConstantWeight_Supplement_tanner
import Definitions.Def_QuantumCupGates644_ConstantWeight_css_subsystems
noncomputable section
namespace QuantumCupGates644.ConstantWeight.Supplement
open scoped BigOperators
open Classical
variable {F : Type} [Field F] {G : Graph} {r : ℕ}
abbrev FactorBasis (S : Fin r → LocalSystem F G) (j : Fin r) :=
(factors S j).ZeroBasis ⊕ Fin G.ne
def basisDegree {A B : Type} : A ⊕ B → ℕ
| .inl _ => 0
| .inr _ => 1
/-- Tensor bases, with the direct sum grading retained. -/
abbrev TensorBasis (S : Fin r → LocalSystem F G) (k : ℕ) :=
{b : (j : Fin r) → FactorBasis S j // ∑ j, basisDegree (b j) = k}
/-- The zero-based block i is the source block i+1. In block r, this
permutation is the identity; in block 1 the dual factor moves to position 0. -/
def position (i j : Fin r) : ℕ := (j.val + i.val + 1) % r
def factorDelta (S : LocalSystem F G) :
(S.ZeroBasis ⊕ Fin G.ne) → (S.ZeroBasis ⊕ Fin G.ne) → F
| .inr e, .inl a => S.delta e a
| _, _ => 0
/-- Definition 2.16 in the paper's cyclic order, including every Koszul sign.
The common basis labels identify the cyclic factor permutations, without
changing their individual generator bases. -/
def tensorDelta (S : Fin r → LocalSystem F G) (i : Fin r) (k : ℕ) :
Matrix (TensorBasis S (k+1)) (TensorBasis S k) F :=
fun b a => ∑ j : Fin r,
(-1 : F) ^ (∑ l ∈ Finset.univ.filter (fun l => position i l < position i j),
basisDegree (a.val l)) * factorDelta (factors S j) (b.val j) (a.val j) *
∏ l ∈ Finset.univ.erase j, if b.val l = a.val l then 1 else 0
def cocycles (S : Fin r → LocalSystem F G) (i : Fin r) (k : ℕ) :
Code F (TensorBasis S k) := LinearMap.ker (tensorDelta S i k).toLin'
def cyclesOne (S : Fin r → LocalSystem F G) (i : Fin r) :
Code F (TensorBasis S 1) := LinearMap.ker (tensorDelta S i 0).transpose.toLin'
def coboundariesOne (S : Fin r → LocalSystem F G) (i : Fin r) :
Code F (TensorBasis S 1) := LinearMap.range (tensorDelta S i 0).toLin'
def boundariesOne (S : Fin r → LocalSystem F G) (i : Fin r) :
Code F (TensorBasis S 1) := LinearMap.range (tensorDelta S i 1).transpose.toLin'
/-- Pure tensors in the degree-(0,...,0,1) sector of A^(r).
Cyclic blocks use the same labels, in the permuted order. -/
def pureOne (S : Fin r → LocalSystem F G)
(u : (j : Fin r) → (factors S j).ZeroBasis → F) (e : Fin G.ne → F) :
TensorBasis S 1 → F :=
fun b => ∏ j, match b.val j with
| .inl a => u j a
| .inr a => if j.val + 1 = r then e a else 0
/-- Full preimages of the homological subspaces of Equation (12).
H_0 representatives are arbitrary; H_1 representatives are cycles. -/
def selectedX (S : Fin r → LocalSystem F G) (i : Fin r) : Code F (TensorBasis S 1) :=
boundariesOne S i ⊔ Submodule.span F {x | ∃ u e,
(∀ j : Fin r, j.val + 1 = r →
e ∈ LinearMap.ker (factors S j).delta.transpose.toLin') ∧ x = pureOne S u e}
/-- H^0 representatives are cocycles; every top-degree edge cochain is
an H^1 representative. Coboundaries restore the full quotient preimage. -/
def selectedZ (S : Fin r → LocalSystem F G) (i : Fin r) : Code F (TensorBasis S 1) :=
coboundariesOne S i ⊔ Submodule.span F {x | ∃ u e,
(∀ j : Fin r, j.val + 1 < r →
u j ∈ LinearMap.ker (factors S j).delta.toLin') ∧ x = pureOne S u e}
abbrev blockLength (S : Fin r → LocalSystem F G) := Fintype.card (TensorBasis S 1)
def label (S : Fin r → LocalSystem F G) : TensorBasis S 1 ≃ Fin (blockLength S) :=
Fintype.equivFin _
def reindexCode (S : Fin r → LocalSystem F G) (C : Code F (TensorBasis S 1)) :
Code F (Fin (blockLength S)) :=
C.map (LinearMap.funLeft F F (label S).symm)
/-- Actual level-1 CSS codes and Equation (12), rather than existential
codes carrying their desired parameters as structure fields. -/
def productSubsystem (S : Fin r → LocalSystem F G) (i : Fin r) :
CSSSubsystem F (blockLength S) where
QX := reindexCode S (cyclesOne S i)
QZ := reindexCode S (cocycles S i 1)
LX := reindexCode S (selectedX S i)
LZ := reindexCode S (selectedZ S i)
/-- The source locality is the maximum row/column weight of the based
complex differential. In particular X and Z participation are separate. -/
def SourceLocality (S : Fin r → LocalSystem F G) (i : Fin r) (w : ℝ) : Prop :=
(∀ a, ((Finset.univ.filter (fun b => tensorDelta S i 0 b a ≠ 0)).card : ℝ) ≤ w) ∧
(∀ b, ((Finset.univ.filter (fun a => tensorDelta S i 0 b a ≠ 0)).card : ℝ) ≤ w) ∧
(∀ a, ((Finset.univ.filter (fun b => tensorDelta S i 1 b a ≠ 0)).card : ℝ) ≤ w) ∧
(∀ b, ((Finset.univ.filter (fun a => tensorDelta S i 1 b a ≠ 0)).card : ℝ) ≤ w)
/-- Separate bounds on generator weights and on participation, for families
that need not be presented as a specific tensor complex. -/
def HasSourceLocality {n : ℕ} (Q : CSSSubsystem F n) (w : ℝ) : Prop :=
∃ (a b : ℕ) (GX : Fin a → Fin n → F) (GZ : Fin b → Fin n → F),
Submodule.span F (Set.range GX) = dual Q.QX ∧
Submodule.span F (Set.range GZ) = dual Q.QZ ∧
(∀ j, (hammingNorm (GX j) : ℝ) ≤ w) ∧
(∀ j, (hammingNorm (GZ j) : ℝ) ≤ w) ∧
(∀ c, ((Finset.univ.filter (fun j => GX j c ≠ 0)).card : ℝ) ≤ w) ∧
(∀ c, ((Finset.univ.filter (fun j => GZ j c ≠ 0)).card : ℝ) ≤ w)
def xDistanceBound (d : Fin r → NNReal) : ℝ :=
∑ j ∈ Finset.univ.filter (fun j : Fin r => j.val + 1 = r), (d j : ℝ)
def zDistanceBound (d : Fin r → NNReal) (Δ : ℕ) : ℝ :=
(2 / (Δ : ℝ)) ^ (r-1) *
∏ j ∈ Finset.univ.filter (fun j : Fin r => j.val + 1 < r), (d j : ℝ)
end QuantumCupGates644.ConstantWeight.Supplement