The source top-degree cup form and addressable phase action
DefinitionQuantumCupGates644_ConstantWeight_Supplement_cupThe source cup product is evaluated on tensor basis tuples using the actual local generators. In each output tensor column exactly one input contributes its edge; earlier degree-zero inputs are evaluated at the tail, and later ones at the head. Reordering the input tensors contributes every Koszul inversion sign from Equation (11). Multilinear extension gives
Taking z equal to the all-ones vector on E(Γ)^r gives precisely Equation (14). Intermediate degree-zero cup products are evaluated through their generator images; this eliminates the unique preimages in Definition 3.4 without changing their top-degree coefficient.
Subrank is expressed using logical cocycle representatives in the published full-preimage convention. Addressability chooses those representatives once, before every coefficient vector a, then requires a form whose logical tensor is the weighted diagonal. Over finite fields the physical predicate also requires the actual weighted trace-phase action on normalized CSS coset states. Zero address coefficients are allowed. These predicates impose no multiplication assumptions on the input systems.
import Definitions.Def_QuantumCupGates644_ConstantWeight_Supplement_complexes
import Definitions.Def_QuantumCupGates644_ConstantWeight_phase_circuits
noncomputable section
namespace QuantumCupGates644.ConstantWeight.Supplement
open scoped BigOperators
open Classical
variable {F : Type} [Field F] {G : Graph} {r : ℕ}
/-- Inverse of the cyclic position permutation. -/
def unrotate (i j : Fin r) : Fin r :=
⟨(j.val + r - ((i.val + 1) % r)) % r, Nat.mod_lt _ (by have := i.isLt; omega)⟩
def physicalDegree (S : Fin r → LocalSystem F G)
(a : Fin r → TensorBasis S 1) (i j : Fin r) : ℕ :=
basisDegree ((a i).val (unrotate i j))
/-- Koszul inversions when the ordered input tensors are rearranged into
ordered tensor columns (Equation (11), applied from left to right). -/
def cupSignExponent (S : Fin r → LocalSystem F G)
(a : Fin r → TensorBasis S 1) : ℕ :=
∑ i : Fin r, ∑ l ∈ Finset.univ.filter (fun l => i < l),
∑ j : Fin r, ∑ h ∈ Finset.univ.filter (fun h => h < j),
physicalDegree S a i j * physicalDegree S a l h
/-- A degree-zero factor before the degree-one input is evaluated at the
tail; after that input it is evaluated at the head (Definition 3.4).
This also evaluates all intermediate 0×0 products through their generator
images, so no choice of an intermediate preimage affects the result. -/
def zeroCupCoefficient (S : Fin r → LocalSystem F G) (i j h : Fin r)
(b : TensorBasis S 1) (e : Fin G.ne) : F :=
match b.val (unrotate i j) with
| .inr _ => 0
| .inl a => if a.1 = (if i < h then G.tail e else G.head e)
then (factors S (unrotate i j)).coeff a e else 0
/-- Coefficient of the output edge in one tensor column. Exactly one
input must have degree one, and its edge must be the output edge. -/
def cupColumn (S : Fin r → LocalSystem F G) (a : Fin r → TensorBasis S 1)
(j : Fin r) (e : Fin G.ne) : F :=
∑ h : Fin r,
(match (a h).val (unrotate h j) with
| .inl _ => 0
| .inr e' => if e' = e then 1 else 0) *
∏ i ∈ Finset.univ.erase h, zeroCupCoefficient S i j h (a i) e
/-- Expanded coefficient of the source left-associated cup product into
A'^r = F^(E^r), with its Koszul sign. -/
def topCupCoefficient (S : Fin r → LocalSystem F G)
(a : Fin r → TensorBasis S 1) (e : Fin r → Fin G.ne) : F :=
(-1 : F) ^ cupSignExponent S a * ∏ j, cupColumn S a j (e j)
/-- Equations (14) and (26), by multilinear extension of the specified
basis coefficients. z=1 gives the exact form of Equation (14). -/
def cupForm (S : Fin r → LocalSystem F G) (z : (Fin r → Fin G.ne) → F) :
GateForm F r (blockLength S) :=
∑ a : Fin r → TensorBasis S 1,
(∑ e : Fin r → Fin G.ne, z e * topCupCoefficient S a e) •
(MultilinearMap.mkPiAlgebra F (Fin r) F).compLinearMap
(fun i => LinearMap.proj (label S (a i)))
def sourceForm (S : Fin r → LocalSystem F G) : GateForm F r (blockLength S) :=
cupForm S (fun _ => 1)
/-- Subrank of the restriction, represented by cocycle representatives in
the full preimages LZ. Invariance is stated separately. -/
def SubrankAtLeast {n : ℕ} (f : GateForm F r n)
(Q : Fin r → CSSSubsystem F n) (s : ℕ) : Prop :=
∃ v : Fin r → Fin s → Fin n → F,
(∀ i l, v i l ∈ (Q i).LZ) ∧
∀ l : Fin r → Fin s, f (fun i => v i (l i)) = if ∀ i j, l i = l j then 1 else 0
/-- The algebraic gate condition of Definition 2.14 over an arbitrary field. -/
def AlgebraicGate {n : ℕ} (Q : Fin r → CSSSubsystem F n) (w s : ℕ) : Prop :=
∃ f : GateForm F r n,
f.SparsityAtMost w ∧ f.CohomologyInvariant Q ∧ SubrankAtLeast f Q s
/-- Definition A.1: logical representatives are fixed BEFORE every
coefficient vector, including vectors with zero entries. -/
def AlgebraicAddressable {n : ℕ} (Q : Fin r → CSSSubsystem F n) (w s : ℕ) : Prop :=
∃ v : Fin r → Fin s → Fin n → F,
(∀ i l, v i l ∈ (Q i).LZ) ∧
(∀ i, LinearIndependent F (fun l => (dual (Q i).QX).mkQ (v i l))) ∧
∀ a : Fin s → F, ∃ f : GateForm F r n,
f.SparsityAtMost w ∧ f.CohomologyInvariant Q ∧
∀ l : Fin r → Fin s,
f (fun i => v i (l i)) = if ∀ i j, l i = l j then (∑ k : Fin s, if ∀ i, l i = k then a k else 0) else 0
/-- Actual weighted trace-phase action, at finite fields. -/
def PhysicalAddressable [Fintype F] (p : ℕ) [Fact p.Prime] [Algebra (ZMod p) F]
{n : ℕ} (Q : Fin r → CSSSubsystem F n) (w s : ℕ) : Prop :=
∃ v : Fin r → Fin s → Fin n → F,
(∀ i l, v i l ∈ (Q i).LZ) ∧
(∀ i, LinearIndependent F (fun l => (dual (Q i).QX).mkQ (v i l))) ∧
∀ a : Fin s → F, ∃ f : GateForm F r n,
f.SparsityAtMost w ∧ f.CohomologyInvariant Q ∧
(∀ l : Fin r → Fin s,
f (fun i => v i (l i)) = if ∀ i j, l i = l j then (∑ k : Fin s, if ∀ i, l i = k then a k else 0) else 0) ∧
∀ (y : Fin r → Fin s → F) (x : Fin r → Fin n → F),
physicalPhase p f x * encodedAmplitude Q v y x =
fieldPhase p (∑ l, a l * ∏ i, y i l) * encodedAmplitude Q v y x
end QuantumCupGates644.ConstantWeight.Supplement