Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Lagrangian representation for fermionic linear optics

Definition
QAlgorithms_Papers_Independent_Intake100_P22

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of Lagrangian representation for fermionic linear optics (arXiv:quant-ph/0404180) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Grass: PDF p.3: coefficients of ordered square-free Grassmann monomials.
  • grassOne: PDF p.3: the scalar unit of the Grassmann algebra.
  • grassVar: PDF p.3: variable with zero-based index a; zero outside the specified algebra.
  • grassMul: PDF p.3, Eq.(6): exterior multiplication, with one minus sign per crossing. Intersecting supports contribute zero.
  • grassProd: PDF p.3: ordered products; the empty product is the scalar unit.
  • grassPow: PDF pp.3-4: powers used in the finite nilpotent Taylor series.
  • grassExp: PDF p.4: finite exponential, used only on forms with zero constant term.
  • grassSubst: PDF pp.3-4, Eqs.(9),(16): substitute linear Grassmann forms into a symbol.
  • blockVars: PDF p.3: a consecutive variable block. All uses have block < blocks.
  • grassIntegrate: PDF p.3: left Berezin integration of the variables after a retained prefix. The sign comes from moving the left derivatives past the retained monomial. Every application below integrates an even number of variables.
  • grassQuadratic: PDF p.3: quadratic form without an implicit factor of one half.
  • basisOp: PDF p.4: ordered Majorana basis element associated to a support.
  • majoranaSymbol: PDF pp.2,4: the linear symbol map, via the trace-dual ordered CAR basis. It is not an algebra homomorphism.
  • StateWith: PDF p.4, Definition 1: positive trace-one Gaussian density with real skew matrix and no linear Grassmann terms.
  • FermionicGaussianState: PDF p.4, Definition 1, including mixed and rank-deficient densities.
  • regularCorrelation: PDF pp.4-5: normalized complex correlation matrix of a regular operator. It is used only with nonzero trace; states have trace one.
  • RegularWith: PDF p.5, Eq.(22): regular Gaussian operator with its complex skew matrix.
  • GaussianOperator: PDF p.5, Definition 2: closure in the finite-dimensional operator topology of the nonzero-trace Gaussian operators. In particular zero is admitted.
  • InSector: PDF pp.2,8: parity sector, defined on the full ordered CAR expansion.
  • ParityPreserving: PDF p.8, Definition 4: both even and odd sectors are preserved.
  • ComplexLinear: PDF p.7: complex linearity on every operator.
  • GrassmannKernel: PDF p.7, Eq.(38): independent kernel parameters; Gaussianity alone imposes neither positivity nor trace preservation.
  • kernelAction: PDF p.7, Eq.(38): action in arbitrary anticommuting variable blocks.
  • kernelEval: PDF pp.7-8, Eq.(37): actual finite Berezin-kernel evaluation on any symbol. The variable order is theta, eta, mu; Deta Dmu integrates mu first.
  • HasGrassmannKernel: PDF p.7, Definition 3: equality on all operators, including odd inputs.
  • GaussianMap: PDF p.7, Definition 3, as an existential integral representation.
  • FullTracePreserving: PDF p.9: TP is trace equality on all operators.
  • Bistochastic: PDF p.9: bistochastic means TP and unital, without a CP requirement.
  • ordinaryExtension: PDF p.9: ordinary extension E tensor Id, in first-factor block coordinates.
  • PositiveMap: PDF p.9: positivity, without normalization or a trace bound.
  • LinearCompletelyPositive: PDF p.9: complete positivity, tested on an equal-dimensional reference.
  • quadraticHamiltonian: PDF p.2, Eq.(4): the source's quadratic Hamiltonian.
  • canonicalFLO: PDF p.2: exactly exp(i H), with no additional scalar phase parameter.
  • IsCanonicalFLO: PDF p.2: the canonical group generated by the stated real skew Hamiltonians.
  • Rotation: PDF p.2: rotations are real special orthogonal matrices.
  • productState: PDF p.4, Eq.(19): the full product density, including its normalization.
  • pfaffian: PDF p.3: Pfaffian by the standard first-row pairing recursion. This reuses only the accepted algebraic recursion, not its Gaussian-state predicate.
  • modeProjector: PDF pp.4,11: projector onto a specified occupation-number outcome. false denotes empty and true occupied.
  • firstK: PDF pp.4-5,12: K supported only on the first mode, in zero-based indices.
  • lambdaOp: PDF p.5, Eq.(24): Lambda in the ordinary two-copy algebra.
  • floMeasurementAction: PDF p.11: projector action as a quadratic form on theta and eta. Its signs specify both outcomes and its missing two cross terms.
  • measurementEval: PDF p.11, Eq.(51): finite evaluation of the measurement action.
  • homogeneousKernel: PDF p.8: A=D=0 and arbitrary B, with prefactor one.
  • normalizeComplexTrace: PDF pp.5,11: normalized state of a nonzero outcome; theorems guard its trace.
  • singularForm: PDF p.5, Eq.(26): singular Gaussian symbol, with an even ordered prefix.
  • kernelBlock: PDF p.9, Theorem 2: the complete skew block, with theta before eta.
  • RealContraction: PDF p.9: entrywise reality and contraction in PSD matrix order.
  • ImplementsRotation: PDF p.2, Eq.(5): the source's V c V-dagger convention.
  • firstEmbedding: PDF pp.9-10, Eq.(48): first CAR-half embedding, with parity on the second ordinary tensor factor. This fixes the graded signs on odd operators.
  • doubleBasis: PDF p.9: ordered basis of two disjoint CAR halves.
  • doubleCoefficient: PDF pp.9-10: expansion coefficient in the full two-half CAR basis.
  • fermionicExtension: PDF p.9, Definition 5: E tensor_f Id, extended linearly on every monomial. No equality with the ordinary extension is assumed.
  • dualReference: PDF p.10, Definition 6: the fixed pure fermionic maximally entangled density.
  • fermionicDual: PDF p.10: the unnormalized dual operator, for the fixed CAR identification.
  • doubleSymbol: PDF p.10: theta then eta in a single anticommuting algebra; this is distinct from the ordinary tensor product of Grassmann algebras in Section V.
  • diagonalMap: PDF pp.10-11: full diagonal map, specified on every ordered monomial.
  • elementaryMap: PDF p.11: one elementary map rescales exactly the monomials containing a.
  • elementaryComposition: PDF p.11: compose all elementary maps in increasing index order.
  • FLOProgram: PDF pp.2,11-12: finite adaptive FLO program. At a measurement the two continuations may differ. A unitary input supplies its rotation exp(H), so the classical recurrence below uses only finite Grassmann arithmetic on given data.
  • RunTree: PDF pp.1,12: a record at every stage and every outcome branch.
  • treeMap: Apply a representation to every recorded state, preserving branch labels.
  • treeValues: All records, including intermediate states and impossible branches.
  • treeLeaves: Terminal records, ordered with the empty outcome before the occupied one.
  • quantumRun: PDF pp.2,11-12: exact quantum semantics with unnormalized branch densities. Their traces are path probabilities, so zero branches require no normalization.
  • symbolicRun: PDF pp.11-12: fixed finite classical recurrence of Gaussian integrals, computed from the initial covariance symbol. It never calls quantumRun.
  • operatorFromSymbol: PDF pp.2,4: reconstruct an operator from its ordered CAR coefficients.
  • symbolCorrelation: PDF p.4: recover the normalized complex covariance from a nonzero scalar symbol coefficient. Theorems use this only on positive-probability branches.
  • symbolWeight: PDF p.12: path probability recovered from the constant Grassmann coefficient.
  • firstOutcomeSymbol: PDF pp.11-12: the subnormalized empty-first-mode output symbol.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P19
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21

/-!
Bravyi, Lagrangian representation for fermionic linear optics,
arXiv:quant-ph/0404180v2. All page references are PDF pages.
The accepted CAR representation, ordered monomials, generic matrix alias and
Mathlib Kronecker product are reused. The accepted CAR module's
Wick-defined Gaussian-state predicate is deliberately not used. Grassmann
polynomials below are finite coefficient tables, with explicit graded signs.
Distinct fermionic concepts use explicit names where unrelated pinned papers
have the same short names. See ASSESSMENT.json and MODERATION_NOTES.md.
Theorem 2 includes the zero-prefactor correction discussed in HARD.md.
Compilation and independent moderation are pending the batch handoff.
-/

noncomputable section

open scoped BigOperators Matrix ComplexConjugate ComplexOrder

namespace QAlgorithms.Papers.Independent.Intake100.P22

open QAlgorithms.Papers.Independent.Advance50.P19
  (CARSystem Major monomial wick totalFermionParity)

open QAlgorithms.Papers.Independent.Information100.P21 (Op)

attribute [local instance] Classical.propDecidable Classical.decEq

/-- PDF p.3: coefficients of ordered square-free Grassmann monomials. -/
abbrev Grass (d : ℕ) := Finset (Fin d) → ℂ

/-- PDF p.3: the scalar unit of the Grassmann algebra. -/
def grassOne (d : ℕ) : Grass d := fun S => if S = ∅ then 1 else 0

/-- PDF p.3: variable with zero-based index a; zero outside the specified algebra. -/
def grassVar (d a : ℕ) : Grass d :=
  fun S => if ∃ i : Fin d, i.val = a ∧ S = {i} then 1 else 0

/-- PDF p.3, Eq.(6): exterior multiplication, with one minus sign per crossing.
Intersecting supports contribute zero. -/
def grassMul {d : ℕ} (f g : Grass d) : Grass d := fun S =>
  ∑ A : Finset (Fin d), ∑ B : Finset (Fin d),
    if Disjoint A B ∧ A ∪ B = S then
      (-1 : ℂ) ^ ((A.product B).filter (fun p => p.2 < p.1)).card * f A * g B
    else 0

/-- PDF p.3: ordered products; the empty product is the scalar unit. -/
def grassProd {d : ℕ} : List (Grass d) → Grass d
  | [] => grassOne d
  | f :: fs => grassMul f (grassProd fs)

/-- PDF pp.3-4: powers used in the finite nilpotent Taylor series. -/
def grassPow {d : ℕ} (f : Grass d) : ℕ → Grass d
  | 0 => grassOne d
  | k + 1 => grassMul f (grassPow f k)

/-- PDF p.4: finite exponential, used only on forms with zero constant term. -/
def grassExp {d : ℕ} (q : Grass d) : Grass d :=
  ∑ k ∈ Finset.range (d + 1), ((k.factorial : ℂ)⁻¹) • grassPow q k

/-- PDF pp.3-4, Eqs.(9),(16): substitute linear Grassmann forms into a symbol. -/
def grassSubst {d e : ℕ} (f : Grass d) (v : Fin d → Grass e) : Grass e :=
  ∑ S : Finset (Fin d), f S • grassProd ((S.sort (fun a b => a ≤ b)).map v)

/-- PDF p.3: a consecutive variable block. All uses have block < blocks. -/
def blockVars (m blocks block : ℕ) : Fin m → Grass (blocks * m) :=
  fun a => grassVar (blocks * m) (block * m + a.val)

/-- PDF p.3: left Berezin integration of the variables after a retained prefix.
The sign comes from moving the left derivatives past the retained monomial.
Every application below integrates an even number of variables. -/
def grassIntegrate {d : ℕ} (keep : ℕ) (f : Grass d) : Grass keep := fun S =>
  if keep ≤ d then
    (-1 : ℂ) ^ ((d - keep) * S.card) *
      f (Finset.univ.filter (fun a : Fin d =>
        keep ≤ a.val ∨ ∃ b ∈ S, b.val = a.val))
  else 0

/-- PDF p.3: quadratic form without an implicit factor of one half. -/
def grassQuadratic {d e : ℕ} (M : Matrix (Fin d) (Fin d) ℂ)
    (v : Fin d → Grass e) : Grass e :=
  ∑ a, ∑ b, M a b • grassMul (v a) (v b)

/-- PDF p.4: ordered Majorana basis element associated to a support. -/
def basisOp {n : ℕ} (s : CARSystem n) (S : Finset (Major n)) : Op (Qubits n) :=
  monomial s (S.sort (fun a b => a ≤ b))

/-- PDF pp.2,4: the linear symbol map, via the trace-dual ordered CAR basis.
It is not an algebra homomorphism. -/
def majoranaSymbol {n : ℕ} (s : CARSystem n) (X : Op (Qubits n)) : Grass (2 * n) :=
  fun S => (2 : ℂ) ^ (-(n : ℤ)) * ((basisOp s S)ᴴ * X).trace

/-- PDF p.4, Definition 1: positive trace-one Gaussian density with real skew
matrix and no linear Grassmann terms. -/
def StateWith {n : ℕ} (s : CARSystem n) (rho : Op (Qubits n))
    (M : Matrix (Major n) (Major n) ℝ) : Prop :=
  IsDensityMatrix rho ∧ M.transpose = -M ∧
    majoranaSymbol s rho = ((2 : ℂ) ^ n)⁻¹ •
      grassExp ((Complex.I / 2) • grassQuadratic (M.map Complex.ofReal)
        (fun a => grassVar (2 * n) a.val))

/-- PDF p.4, Definition 1, including mixed and rank-deficient densities. -/
def FermionicGaussianState {n : ℕ} (s : CARSystem n) (rho : Op (Qubits n)) : Prop :=
  ∃ M, StateWith s rho M

/-- PDF pp.4-5: normalized complex correlation matrix of a regular operator.
It is used only with nonzero trace; states have trace one. -/
def regularCorrelation {n : ℕ} (s : CARSystem n) (X : Op (Qubits n)) :
    Matrix (Major n) (Major n) ℂ := fun a b =>
  (Complex.I / (2 * X.trace)) *
    (X * (s.majorana a * s.majorana b - s.majorana b * s.majorana a)).trace

/-- PDF p.5, Eq.(22): regular Gaussian operator with its complex skew matrix. -/
def RegularWith {n : ℕ} (s : CARSystem n) (X : Op (Qubits n))
    (M : Matrix (Major n) (Major n) ℂ) : Prop :=
  X.trace ≠ 0 ∧ M.transpose = -M ∧
    majoranaSymbol s X = (X.trace / (2 : ℂ) ^ n) •
      grassExp ((Complex.I / 2) • grassQuadratic M (fun a => grassVar (2 * n) a.val))

/-- PDF p.5, Definition 2: closure in the finite-dimensional operator topology
of the nonzero-trace Gaussian operators. In particular zero is admitted. -/
def GaussianOperator {n : ℕ} (s : CARSystem n) (X : Op (Qubits n)) : Prop :=
  X ∈ closure {Y : Op (Qubits n) | ∃ M, RegularWith s Y M}

/-- PDF pp.2,8: parity sector, defined on the full ordered CAR expansion. -/
def InSector {n : ℕ} (s : CARSystem n) (parity : ℕ) (X : Op (Qubits n)) : Prop :=
  ∀ S, S.card % 2 ≠ parity → majoranaSymbol s X S = 0

/-- PDF p.8, Definition 4: both even and odd sectors are preserved. -/
def ParityPreserving {n : ℕ} (s : CARSystem n) (E : Superop (Qubits n) (Qubits n)) : Prop :=
  ∀ p ∈ ({0, 1} : Finset ℕ), ∀ X, InSector s p X → InSector s p (E X)

/-- PDF p.7: complex linearity on every operator. -/
def ComplexLinear {I : Type*} (E : Matrix I I ℂ → Matrix I I ℂ) : Prop :=
  ∀ X Y (a b : ℂ), E (a • X + b • Y) = a • E X + b • E Y

/-- PDF p.7, Eq.(38): independent kernel parameters; Gaussianity alone
imposes neither positivity nor trace preservation. -/
structure GrassmannKernel (n : ℕ) where
  A : Matrix (Major n) (Major n) ℂ
  B : Matrix (Major n) (Major n) ℂ
  D : Matrix (Major n) (Major n) ℂ
  C : ℂ
  skewA : A.transpose = -A
  skewD : D.transpose = -D

/-- PDF p.7, Eq.(38): action in arbitrary anticommuting variable blocks. -/
def kernelAction {n e : ℕ} (K : GrassmannKernel n) (theta eta : Major n → Grass e) : Grass e :=
  (Complex.I / 2) • grassQuadratic K.A theta +
    Complex.I • (∑ a, ∑ b, K.B a b • grassMul (theta a) (eta b)) +
    (Complex.I / 2) • grassQuadratic K.D eta

/-- PDF pp.7-8, Eq.(37): actual finite Berezin-kernel evaluation on any symbol.
The variable order is theta, eta, mu; Deta Dmu integrates mu first. -/
def kernelEval {n : ℕ} (K : GrassmannKernel n) (f : Grass (2 * n)) : Grass (2 * n) :=
  K.C • grassIntegrate (2 * n)
    (grassMul
      (grassExp (kernelAction K (blockVars (2 * n) 3 0) (blockVars (2 * n) 3 1) +
        Complex.I • (∑ a : Major n,
          grassMul (blockVars (2 * n) 3 1 a) (blockVars (2 * n) 3 2 a))))
      (grassSubst f (blockVars (2 * n) 3 2)))

/-- PDF p.7, Definition 3: equality on all operators, including odd inputs. -/
def HasGrassmannKernel {n : ℕ} (s : CARSystem n) (E : Superop (Qubits n) (Qubits n))
    (K : GrassmannKernel n) : Prop :=
  ComplexLinear E ∧ ∀ X, majoranaSymbol s (E X) = kernelEval K (majoranaSymbol s X)

/-- PDF p.7, Definition 3, as an existential integral representation. -/
def GaussianMap {n : ℕ} (s : CARSystem n) (E : Superop (Qubits n) (Qubits n)) : Prop :=
  ∃ K, HasGrassmannKernel s E K

/-- PDF p.9: TP is trace equality on all operators. -/
def FullTracePreserving {n : ℕ} (E : Superop (Qubits n) (Qubits n)) : Prop :=
  ∀ X, (E X).trace = X.trace

/-- PDF p.9: bistochastic means TP and unital, without a CP requirement. -/
def Bistochastic {n : ℕ} (E : Superop (Qubits n) (Qubits n)) : Prop :=
  FullTracePreserving E ∧ E 1 = 1

/-- PDF p.9: ordinary extension E tensor Id, in first-factor block coordinates. -/
def ordinaryExtension {n : ℕ} (E : Superop (Qubits n) (Qubits n)) :
    Superop (Qubits n × Qubits n) (Qubits n × Qubits n) :=
  fun Z p q => E (fun x y => Z (x, p.2) (y, q.2)) p.1 q.1

/-- PDF p.9: positivity, without normalization or a trace bound. -/
def PositiveMap {I : Type*} [Fintype I]
    (E : Matrix I I ℂ → Matrix I I ℂ) : Prop :=
  ∀ X, X.PosSemidef → (E X).PosSemidef

/-- PDF p.9: complete positivity, tested on an equal-dimensional reference. -/
def LinearCompletelyPositive {n : ℕ} (E : Superop (Qubits n) (Qubits n)) : Prop :=
  ComplexLinear E ∧ PositiveMap (ordinaryExtension E)

/-- PDF p.2, Eq.(4): the source's quadratic Hamiltonian. -/
def quadraticHamiltonian {n : ℕ} (s : CARSystem n)
    (H : Matrix (Major n) (Major n) ℝ) : Op (Qubits n) :=
  (Complex.I / 4) • ∑ a, ∑ b, (H a b : ℂ) • (s.majorana a * s.majorana b)

/-- PDF p.2: exactly exp(i H), with no additional scalar phase parameter. -/
def canonicalFLO {n : ℕ} (s : CARSystem n)
    (H : Matrix (Major n) (Major n) ℝ) : Op (Qubits n) :=
  NormedSpace.exp (Complex.I • quadraticHamiltonian s H)

/-- PDF p.2: the canonical group generated by the stated real skew Hamiltonians. -/
def IsCanonicalFLO {n : ℕ} (s : CARSystem n) (V : Op (Qubits n)) : Prop :=
  ∃ H : Matrix (Major n) (Major n) ℝ, H.transpose = -H ∧ V = canonicalFLO s H

/-- PDF p.2: rotations are real special orthogonal matrices. -/
def Rotation {n : ℕ} (R : Matrix (Major n) (Major n) ℝ) : Prop :=
  R * R.transpose = 1 ∧ R.det = 1

/-- PDF p.4, Eq.(19): the full product density, including its normalization. -/
def productState {n : ℕ} (s : CARSystem n) (lambda : Fin n → ℝ) : Op (Qubits n) :=
  ((2 : ℂ) ^ n)⁻¹ • (List.ofFn (fun j : Fin n =>
    (1 : Op (Qubits n)) + (Complex.I * (lambda j : ℂ)) •
      (s.majorana ⟨2 * j.val, by omega⟩ *
        s.majorana ⟨2 * j.val + 1, by omega⟩))).prod

/-- PDF p.3: Pfaffian by the standard first-row pairing recursion. This reuses
only the accepted algebraic recursion, not its Gaussian-state predicate. -/
def pfaffian {d : ℕ} (M : Matrix (Fin d) (Fin d) ℂ) : ℂ :=
  wick (fun a b => M a b) d (List.finRange d)

/-- PDF pp.4,11: projector onto a specified occupation-number outcome.
false denotes empty and true occupied. -/
def modeProjector {n : ℕ} (s : CARSystem n) (j : Fin n) (outcome : Bool) : Op (Qubits n) :=
  (1 / 2 : ℂ) • ((1 : Op (Qubits n)) +
    (if outcome then -Complex.I else Complex.I) •
      (s.majorana ⟨2 * j.val, by omega⟩ *
        s.majorana ⟨2 * j.val + 1, by omega⟩))

/-- PDF pp.4-5,12: K supported only on the first mode, in zero-based indices. -/
def firstK (n : ℕ) : Matrix (Major n) (Major n) ℂ :=
  fun a b => if a.val = 0 ∧ b.val = 1 then 1
    else if a.val = 1 ∧ b.val = 0 then -1 else 0

/-- PDF p.5, Eq.(24): Lambda in the ordinary two-copy algebra. -/
def lambdaOp {n : ℕ} (s : CARSystem n) :
    Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ :=
  ∑ a, Matrix.kronecker (s.majorana a) (s.majorana a)

/-- PDF p.11: projector action as a quadratic form on theta and eta.
Its signs specify both outcomes and its missing two cross terms. -/
def floMeasurementAction {n e : ℕ} (j : Fin n) (outcome : Bool)
    (theta eta : Major n → Grass e) : Grass e :=
  let a : Major n := ⟨2 * j.val, by omega⟩
  let b : Major n := ⟨2 * j.val + 1, by omega⟩
  (if outcome then -Complex.I else Complex.I) •
    (grassMul (theta a) (theta b) - grassMul (eta a) (eta b)) +
    Complex.I • (∑ c : Major n, if c = a ∨ c = b then 0 else grassMul (theta c) (eta c))

/-- PDF p.11, Eq.(51): finite evaluation of the measurement action. -/
def measurementEval {n : ℕ} (j : Fin n) (outcome : Bool)
    (f : Grass (2 * n)) : Grass (2 * n) :=
  (1 / 2 : ℂ) • grassIntegrate (2 * n)
    (grassMul
      (grassExp (floMeasurementAction j outcome
        (blockVars (2 * n) 3 0) (blockVars (2 * n) 3 1) +
        Complex.I • (∑ a : Major n,
          grassMul (blockVars (2 * n) 3 1 a) (blockVars (2 * n) 3 2 a))))
      (grassSubst f (blockVars (2 * n) 3 2)))

/-- PDF p.8: A=D=0 and arbitrary B, with prefactor one. -/
def homogeneousKernel {n : ℕ} (B : Matrix (Major n) (Major n) ℂ) : GrassmannKernel n :=
  ⟨0, B, 0, 1, by simp, by simp⟩

/-- PDF pp.5,11: normalized state of a nonzero outcome; theorems guard its trace. -/
def normalizeComplexTrace {n : ℕ} (X : Op (Qubits n)) : Op (Qubits n) := X.trace⁻¹ • X

/-- PDF p.5, Eq.(26): singular Gaussian symbol, with an even ordered prefix. -/
def singularForm {n : ℕ} (k : ℕ) (C : ℂ)
    (T M : Matrix (Major n) (Major n) ℂ) : Grass (2 * n) :=
  let mu := fun a : Major n => ∑ b : Major n, T a b • grassVar (2 * n) b.val
  C • grassMul
    (grassProd (((List.finRange (2 * n)).filter (fun a => a.val < 2 * k)).map mu))
    (grassExp ((Complex.I / 2) • (∑ a : Major n, ∑ b : Major n,
      if 2 * k ≤ a.val ∧ 2 * k ≤ b.val then M a b • grassMul (mu a) (mu b) else 0)))

/-- PDF p.9, Theorem 2: the complete skew block, with theta before eta. -/
def kernelBlock {n : ℕ} (K : GrassmannKernel n) :
    Matrix (Major n ⊕ Major n) (Major n ⊕ Major n) ℂ :=
  Matrix.fromBlocks K.A K.B (-K.B.transpose) K.D

/-- PDF p.9: entrywise reality and contraction in PSD matrix order. -/
def RealContraction {I : Type*} [Fintype I] [DecidableEq I]
    (M : Matrix I I ℂ) : Prop :=
  (∀ a b, (M a b).im = 0) ∧ (1 - M.transpose * M).PosSemidef

/-- PDF p.3: empty product fixes the scalar normalization. -/
example : grassProd ([] : List (Grass 0)) = grassOne 0 := rfl

/-- PDF p.3: the full Berezin integral picks the ordered top coefficient. -/
example {d : ℕ} (f : Grass d) : grassIntegrate 0 f ∅ = f Finset.univ := by
  simp [grassIntegrate]

/-- PDF p.3: the empty Pfaffian is one. -/
example : pfaffian (0 : Matrix (Fin 0) (Fin 0) ℂ) = 1 := rfl

/-- PDF p.8: the identity kernel has scalar prefactor one. -/
example (n : ℕ) : (homogeneousKernel (1 : Matrix (Major n) (Major n) ℂ)).C = 1 := rfl

/-- PDF p.2, Eq.(5): the source's V c V-dagger convention. -/
def ImplementsRotation {n : ℕ} (s : CARSystem n) (V : Op (Qubits n))
    (R : Matrix (Major n) (Major n) ℝ) : Prop :=
  ∀ a, V * s.majorana a * Vᴴ = ∑ b, (R a b : ℂ) • s.majorana b

/-- PDF pp.9-10, Eq.(48): first CAR-half embedding, with parity on the second
ordinary tensor factor. This fixes the graded signs on odd operators. -/
def firstEmbedding {n : ℕ} (s : CARSystem n) (X : Op (Qubits n)) :
    Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ :=
  ∑ A : Finset (Major n), majoranaSymbol s X A •
    Matrix.kronecker (basisOp s A) (totalFermionParity s ^ A.card)

/-- PDF p.9: ordered basis of two disjoint CAR halves. -/
def doubleBasis {n : ℕ} (s : CARSystem n) (A B : Finset (Major n)) :
    Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ :=
  Matrix.kronecker (basisOp s A) (totalFermionParity s ^ A.card * basisOp s B)

/-- PDF pp.9-10: expansion coefficient in the full two-half CAR basis. -/
def doubleCoefficient {n : ℕ} (s : CARSystem n)
    (Z : Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ)
    (A B : Finset (Major n)) : ℂ :=
  ((2 : ℂ) ^ (2 * n))⁻¹ * ((doubleBasis s A B)ᴴ * Z).trace

/-- PDF p.9, Definition 5: E tensor_f Id, extended linearly on every monomial.
No equality with the ordinary extension is assumed. -/
def fermionicExtension {n : ℕ} (s : CARSystem n)
    (E : Superop (Qubits n) (Qubits n)) :
    Superop (Qubits n × Qubits n) (Qubits n × Qubits n) := fun Z =>
  ∑ A : Finset (Major n), ∑ B : Finset (Major n),
    doubleCoefficient s Z A B •
      (firstEmbedding s (E (basisOp s A)) * Matrix.kronecker 1 (basisOp s B))

/-- PDF p.10, Definition 6: the fixed pure fermionic maximally entangled density. -/
def dualReference {n : ℕ} (s : CARSystem n) :
    Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ :=
  ((2 : ℂ) ^ (2 * n))⁻¹ •
    (List.ofFn (fun a : Major n =>
      (1 : Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ) +
        Complex.I • (Matrix.kronecker (s.majorana a) (totalFermionParity s) *
          Matrix.kronecker 1 (s.majorana a)))).prod

/-- PDF p.10: the unnormalized dual operator, for the fixed CAR identification. -/
def fermionicDual {n : ℕ} (s : CARSystem n) (E : Superop (Qubits n) (Qubits n)) :
    Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ :=
  fermionicExtension s E (dualReference s)

/-- PDF p.10: theta then eta in a single anticommuting algebra; this is distinct
from the ordinary tensor product of Grassmann algebras in Section V. -/
def doubleSymbol {n : ℕ} (s : CARSystem n)
    (Z : Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ) :
    Grass (2 * (2 * n)) := fun S =>
  doubleCoefficient s Z
    (Finset.univ.filter (fun a : Major n => ∃ i ∈ S, i.val = a.val))
    (Finset.univ.filter (fun a : Major n => ∃ i ∈ S, i.val = 2 * n + a.val))

/-- PDF pp.10-11: full diagonal map, specified on every ordered monomial. -/
def diagonalMap {n : ℕ} (s : CARSystem n) (b : Major n → ℝ) :
    Superop (Qubits n) (Qubits n) := fun X =>
  ∑ A : Finset (Major n), (majoranaSymbol s X A * ∏ a ∈ A, (b a : ℂ)) • basisOp s A

/-- PDF p.11: one elementary map rescales exactly the monomials containing a. -/
def elementaryMap {n : ℕ} (s : CARSystem n) (a : Major n) (b : ℝ) :
    Superop (Qubits n) (Qubits n) :=
  diagonalMap s (fun c => if c = a then b else 1)

/-- PDF p.11: compose all elementary maps in increasing index order. -/
def elementaryComposition {n : ℕ} (s : CARSystem n) (b : Major n → ℝ) :
    Superop (Qubits n) (Qubits n) :=
  (List.ofFn (fun a : Major n => elementaryMap s a (b a))).foldr
    (fun E F => E ∘ F) id

/-- PDF pp.2,11-12: finite adaptive FLO program. At a measurement the two
continuations may differ. A unitary input supplies its rotation exp(H), so the
classical recurrence below uses only finite Grassmann arithmetic on given data. -/
inductive FLOProgram (n : ℕ) where
  | stop : FLOProgram n
  | unitary (H R : Matrix (Major n) (Major n) ℝ)
      (skew : H.transpose = -H) (rotation : Rotation R)
      (generates : NormedSpace.exp H = R) (next : FLOProgram n) : FLOProgram n
  | measure (j : Fin n) (zero one : FLOProgram n) : FLOProgram n

/-- PDF pp.1,12: a record at every stage and every outcome branch. -/
inductive RunTree (A : Type*) where
  | stop (value : A) : RunTree A
  | unitary (value : A) (next : RunTree A) : RunTree A
  | measure (value : A) (zero one : RunTree A) : RunTree A

/-- Apply a representation to every recorded state, preserving branch labels. -/
def treeMap {A B : Type*} (f : A → B) : RunTree A → RunTree B
  | .stop v => .stop (f v)
  | .unitary v t => .unitary (f v) (treeMap f t)
  | .measure v t u => .measure (f v) (treeMap f t) (treeMap f u)

/-- All records, including intermediate states and impossible branches. -/
def treeValues {A : Type*} : RunTree A → List A
  | .stop v => [v]
  | .unitary v t => v :: treeValues t
  | .measure v t u => v :: (treeValues t ++ treeValues u)

/-- Terminal records, ordered with the empty outcome before the occupied one. -/
def treeLeaves {A : Type*} : RunTree A → List A
  | .stop v => [v]
  | .unitary _ t => treeLeaves t
  | .measure _ t u => treeLeaves t ++ treeLeaves u

/-- PDF pp.2,11-12: exact quantum semantics with unnormalized branch densities.
Their traces are path probabilities, so zero branches require no normalization. -/
def quantumRun {n : ℕ} (s : CARSystem n) : FLOProgram n → Op (Qubits n) → RunTree (Op (Qubits n))
  | .stop, X => .stop X
  | .unitary H _ _ _ _ next, X =>
      .unitary X (quantumRun s next (conjSuperop (canonicalFLO s H) X))
  | .measure j zero one, X => .measure X
      (quantumRun s zero (conjSuperop (modeProjector s j false) X))
      (quantumRun s one (conjSuperop (modeProjector s j true) X))

/-- PDF pp.11-12: fixed finite classical recurrence of Gaussian integrals,
computed from the initial covariance symbol. It never calls quantumRun. -/
def symbolicRun {n : ℕ} : FLOProgram n → Grass (2 * n) → RunTree (Grass (2 * n))
  | .stop, f => .stop f
  | .unitary _ R _ _ _ next, f => .unitary f
      (symbolicRun next (kernelEval (homogeneousKernel (R.transpose.map Complex.ofReal)) f))
  | .measure j zero one, f => .measure f
      (symbolicRun zero (measurementEval j false f))
      (symbolicRun one (measurementEval j true f))

/-- PDF pp.2,4: reconstruct an operator from its ordered CAR coefficients. -/
def operatorFromSymbol {n : ℕ} (s : CARSystem n) (f : Grass (2 * n)) : Op (Qubits n) :=
  ∑ A : Finset (Major n), f A • basisOp s A

/-- PDF p.4: recover the normalized complex covariance from a nonzero scalar
symbol coefficient. Theorems use this only on positive-probability branches. -/
def symbolCorrelation {n : ℕ} (f : Grass (2 * n)) :
    Matrix (Major n) (Major n) ℂ := fun a b =>
  if a = b then 0 else
    (if a < b then -Complex.I else Complex.I) * f {a, b} / f ∅

/-- PDF p.12: path probability recovered from the constant Grassmann coefficient. -/
def symbolWeight {n : ℕ} (f : Grass (2 * n)) : ℝ :=
  ((2 : ℂ) ^ n * f ∅).re

/-- Empty adaptive program records exactly its input. -/
example {n : ℕ} (s : CARSystem n) (X : Op (Qubits n)) :
    quantumRun s .stop X = .stop X := rfl

/-- The symbolic simulation has the same empty-program convention. -/
example {n : ℕ} (f : Grass (2 * n)) : symbolicRun .stop f = .stop f := rfl

/-- Ordinary and fermionic tensor products have separate definitions even at
this elementary ordinary-block sanity check. -/
example {n : ℕ} (X Y : Op (Qubits n)) (p q : Qubits n × Qubits n) :
    Matrix.kronecker X Y p q = X p.1 q.1 * Y p.2 q.2 := rfl

/-- PDF pp.11-12: the subnormalized empty-first-mode output symbol. -/
def firstOutcomeSymbol {n : ℕ} (p : ℂ)
    (L : Matrix (Major n) (Major n) ℂ) : Grass (2 * n) :=
  (p / (2 : ℂ) ^ n) • grassExp
    (Complex.I • grassMul (grassVar (2 * n) 0) (grassVar (2 * n) 1) +
      (Complex.I / 2) • (∑ a : Major n, ∑ b : Major n,
        if 2 ≤ a.val ∧ 2 ≤ b.val then
          L a b • grassMul (grassVar (2 * n) a.val) (grassVar (2 * n) b.val)
        else 0))

end QAlgorithms.Papers.Independent.Intake100.P22
Source
Lagrangian representation for fermionic linear optics, arXiv:quant-ph/0404180v2, https://arxiv.org/abs/quant-ph/0404180v2
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

QAlgorithms.Papers.Independent.Intake100.P22.Bistochastic

For every natural number nnn, including n=0n=0n=0, and any function EEE on complex matrices indexed by Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, this predicate means that both tr⁡(E(X))=tr⁡(X)\operatorname{tr}(E(X))=\operatorname{tr}(X)tr(E(X))=tr(X) for every complex matrix XXX and E(I)=IE(I)=IE(I)=I, where III is the identity matrix on CQn\mathbb C^{Q_n}CQn​. These are the two conditions imposed by the definition.

QAlgorithms.Papers.Independent.Intake100.P22.ComplexLinear

For any index type III, with no finiteness, nonemptiness, or decidable-equality assumption, and any function EEE from complex I×II\times II×I matrices to complex I×II\times II×I matrices, the defined condition is that for every two such matrices X,YX,YX,Y and every a,b∈Ca,b\in\mathbb Ca,b∈C,

E(aX+bY)=aE(X)+bE(Y).E(aX+bY)=aE(X)+bE(Y).E(aX+bY)=aE(X)+bE(Y).

Matrix addition and scalar multiplication are entrywise. This includes an empty index type; no positivity, multiplicativity, or trace condition is part of the definition.

QAlgorithms.Papers.Independent.Intake100.P22.FLOProgram

For each natural number nnn, including 000, this declaration defines a type of finite recursively constructed programs with three constructors: a stopping program; a unitary node carrying real 2n×2n2n\times2n2n×2n matrices H,RH,RH,R, proofs that HT=−HH^{\mathsf T}=-HHT=−H, RRT=IRR^{\mathsf T}=IRRT=I, det⁡R=1\det R=1detR=1, and exp⁡(H)=R\exp(H)=Rexp(H)=R, together with one continuation program for the same nnn; and a measurement node carrying an index j∈{0,…,n−1}j\in\{0,\ldots,n-1\}j∈{0,…,n−1} together with two continuation programs, designated zero and one, again for the same nnn. Here exp⁡(H)\exp(H)exp(H) is the matrix exponential. These constructors specify program data and impose no further conditions on the continuations. At n=0n=0n=0, stopping and unitary nodes are available, while measurement nodes cannot be formed because there is no such index jjj.

QAlgorithms.Papers.Independent.Intake100.P22.FermionicGaussianState

For every natural number nnn, let Bn\mathcal B_nBn​ be the nnn-bit strings and let (γa)a∈Jn(\gamma_a)_{a\in J_n}(γa​)a∈Jn​​, where Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. A complex matrix ρ\rhoρ satisfies the defined condition precisely when there exists a real Jn×JnJ_n\times J_nJn​×Jn​ matrix MMM such that MT=−MM^{\mathsf T}=-MMT=−M, ρ\rhoρ is positive semidefinite with trace 111, and

(S⟼2−ntr⁡(γS†ρ))=2−n∑k=02n1k!(i2∑a,b∈JnMab ξaξb)k.\left(S\longmapsto 2^{-n}\operatorname{tr}(\gamma_S^\dagger\rho)\right) = 2^{-n}\sum_{k=0}^{2n}\frac{1}{k!} \left(\frac{i}{2}\sum_{a,b\in J_n}M_{ab}\,\xi_a\xi_b\right)^k.(S⟼2−ntr(γS†​ρ))=2−nk=0∑2n​k!1​​2i​a,b∈Jn​∑​Mab​ξa​ξb​​k.

Here γS\gamma_SγS​ is the increasing-order product of the matrices indexed by SSS, with empty product III. The right side is a coefficient function on subsets of JnJ_nJn​, with ξa=e{a}\xi_a=e_{\{a\}}ξa​=e{a}​, identity e∅e_\varnothinge∅​, and multiplication eUeV=0e_Ue_V=0eU​eV​=0 for intersecting subsets and eUeV=(−1)∣{(u,v)∈U×V:v<u}∣eU∪Ve_Ue_V=(-1)^{|\{(u,v)\in U\times V:v<u\}|}e_{U\cup V}eU​eV​=(−1)∣{(u,v)∈U×V:v<u}∣eU∪V​ otherwise. The existentially quantified MMM need not be unique. The case n=0n=0n=0 is included and requires ρ\rhoρ to be the scalar matrix 111.

QAlgorithms.Papers.Independent.Intake100.P22.FullTracePreserving

For every natural number nnn, including n=0n=0n=0, and any function EEE from complex matrices indexed by the nnn-bit strings Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n to matrices of the same size, this predicate means that tr⁡(E(X))=tr⁡(X)\operatorname{tr}(E(X))=\operatorname{tr}(X)tr(E(X))=tr(X) for every complex matrix XXX. The equality is an equality of complex traces, and the quantifier ranges over all matrices without a positivity or normalization restriction.

QAlgorithms.Papers.Independent.Intake100.P22.GaussianMap

For any natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss consist of Hermitian matrices cac_aca​, indexed by 0≤a<2n0\le a<2n0≤a<2n, satisfying cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. A function EEE on complex matrices indexed by QnQ_nQn​ satisfies this predicate precisely when there exist complex 2n×2n2n\times2n2n×2n matrices A,B,DA,B,DA,B,D and a complex scalar CCC, with AT=−AA^{\mathsf T}=-AAT=−A and DT=−DD^{\mathsf T}=-DDT=−D, such that E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y) for all matrices X,YX,YX,Y and complex scalars a,ba,ba,b, and, for every XXX,

fE(X)=C I ⁣[exp⁡tr ⁣(i2∑a,bAabθaθb+i∑a,bBabθaηb+i2∑a,bDabηaηb+i∑aηaμa)fX(μ)].f_{E(X)} = C\,\mathcal I\!\left[ \exp_{\mathrm{tr}}\!\left( \frac{i}{2}\sum_{a,b}A_{ab}\theta_a\theta_b +i\sum_{a,b}B_{ab}\theta_a\eta_b +\frac{i}{2}\sum_{a,b}D_{ab}\eta_a\eta_b +i\sum_a\eta_a\mu_a \right)f_X(\mu) \right].fE(X)​=CI​exptr​​2i​a,b∑​Aab​θa​θb​+ia,b∑​Bab​θa​ηb​+2i​a,b∑​Dab​ηa​ηb​+ia∑​ηa​μa​​fX​(μ)​.

Here fX(S)=2−ntr⁡(cS†X)f_X(S)=2^{-n}\operatorname{tr}(c_S^\dagger X)fX​(S)=2−ntr(cS†​X) for every subset SSS of the Majorana indices, with cSc_ScS​ the increasing ordered product and c∅=Ic_\varnothing=Ic∅​=I. The three blocks θ,η,μ\theta,\eta,\muθ,η,μ each contain 2n2n2n Grassmann generators. Their coefficient multiplication sums over disjoint subsets U,VU,VU,V whose union is the requested subset, with sign (−1)∣{(u,v)∈U×V:v<u}∣(-1)^{|\{(u,v)\in U\times V:v<u\}|}(−1)∣{(u,v)∈U×V:v<u}∣; the unit is supported at the empty subset. The exponential is the finite sum ∑k=06nqk/k!\sum_{k=0}^{6n}q^k/k!∑k=06n​qk/k!, and fX(μ)f_X(\mu)fX​(μ) uses increasing ordered products of the substituted generators. For each subset SSS of the θ\thetaθ-block, I\mathcal II extracts the coefficient indexed by SSS and all η\etaη- and μ\muμ-generators, with sign (−1)4n∣S∣=1(-1)^{4n|S|}=1(−1)4n∣S∣=1. The existentially quantified kernel need not be unique. The case n=0n=0n=0, with empty generator sets and a one-dimensional matrix space, is included.

QAlgorithms.Papers.Independent.Intake100.P22.GaussianOperator

For every natural number nnn, let Bn\mathcal B_nBn​ be the nnn-bit strings and let (γa)a∈Jn(\gamma_a)_{a\in J_n}(γa​)a∈Jn​​, Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. A complex matrix XXX satisfies the defined condition precisely when it belongs to the closure, in the usual finite-dimensional matrix topology, of the set of matrices YYY for which tr⁡Y≠0\operatorname{tr}Y\ne0trY=0 and there exists a complex skew-symmetric Jn×JnJ_n\times J_nJn​×Jn​ matrix MMM satisfying

(S⟼2−ntr⁡(γS†Y))=tr⁡Y2n∑k=02n1k!(i2∑a,b∈JnMab ξaξb)k.\left(S\longmapsto 2^{-n}\operatorname{tr}(\gamma_S^\dagger Y)\right) = \frac{\operatorname{tr}Y}{2^n} \sum_{k=0}^{2n}\frac{1}{k!} \left(\frac{i}{2}\sum_{a,b\in J_n}M_{ab}\,\xi_a\xi_b\right)^k.(S⟼2−ntr(γS†​Y))=2ntrY​k=0∑2n​k!1​​2i​a,b∈Jn​∑​Mab​ξa​ξb​​k.

Here γS\gamma_SγS​ is the increasing-order product, with empty product III; the coefficient algebra has basis eSe_SeS​, generators ξa=e{a}\xi_a=e_{\{a\}}ξa​=e{a}​, identity e∅e_\varnothinge∅​, and multiplication zero for intersecting subsets and eUeV=(−1)∣{(u,v)∈U×V:v<u}∣eU∪Ve_Ue_V=(-1)^{|\{(u,v)\in U\times V:v<u\}|}e_{U\cup V}eU​eV​=(−1)∣{(u,v)∈U×V:v<u}∣eU∪V​ otherwise. Thus XXX can be a limit of such YYY; the definition imposes no positivity, Hermiticity, normalization, or nonzero-trace condition directly on XXX. The case n=0n=0n=0 is included.

QAlgorithms.Papers.Independent.Intake100.P22.Grass

For every natural number ddd, let Id={0,…,d−1}I_d=\{0,\ldots,d-1\}Id​={0,…,d−1}. Then Grass(d)\mathrm{Grass}(d)Grass(d) is the space of all functions from the finite subsets of IdI_dId​ to C\mathbb CC, with no restrictions on their values. In particular, when d=0d=0d=0, such a function has just one value, its value at the empty set.

QAlgorithms.Papers.Independent.Intake100.P22.GrassmannKernel

For any natural number nnn, including 000, an object of this structure consists of three complex matrices A,B,DA,B,DA,B,D, each with rows and columns indexed by {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, and a complex scalar CCC, together with the requirements

AT=−A,DT=−D.A^{\mathsf T}=-A,\qquad D^{\mathsf T}=-D.AT=−A,DT=−D.

These are ordinary transpose conditions, without complex conjugation. There is no additional condition on BBB or CCC, and no positivity, invertibility, or normalization requirement. When n=0n=0n=0, all three matrices are empty and only the scalar CCC remains unrestricted.

QAlgorithms.Papers.Independent.Intake100.P22.HasGrassmannKernel

For any natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss consist of Hermitian matrices c0,…,c2n−1c_0,\ldots,c_{2n-1}c0​,…,c2n−1​ on CQn\mathbb C^{Q_n}CQn​ satisfying cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. Let EEE be any function from complex matrices on QnQ_nQn​ to complex matrices on QnQ_nQn​, and let K=(A,B,D,C)K=(A,B,D,C)K=(A,B,D,C), where A,B,DA,B,DA,B,D are complex 2n×2n2n\times2n2n×2n matrices, AT=−AA^{\mathsf T}=-AAT=−A, DT=−DD^{\mathsf T}=-DDT=−D, and C∈CC\in\mathbb CC∈C. This predicate means that E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y) for every pair of matrices X,YX,YX,Y and every a,b∈Ca,b\in\mathbb Ca,b∈C, and that, for every matrix XXX,

fE(X)=C I ⁣[exp⁡tr ⁣(i2∑a,bAabθaθb+i∑a,bBabθaηb+i2∑a,bDabηaηb+i∑aηaμa)fX(μ)].f_{E(X)} = C\,\mathcal I\!\left[ \exp_{\mathrm{tr}}\!\left( \frac{i}{2}\sum_{a,b}A_{ab}\theta_a\theta_b +i\sum_{a,b}B_{ab}\theta_a\eta_b +\frac{i}{2}\sum_{a,b}D_{ab}\eta_a\eta_b +i\sum_a\eta_a\mu_a \right)f_X(\mu) \right].fE(X)​=CI​exptr​​2i​a,b∑​Aab​θa​θb​+ia,b∑​Bab​θa​ηb​+2i​a,b∑​Dab​ηa​ηb​+ia∑​ηa​μa​​fX​(μ)​.

Here fXf_XfX​ is the coefficient function on subsets S⊆{0,…,2n−1}S\subseteq\{0,\ldots,2n-1\}S⊆{0,…,2n−1} given by fX(S)=2−ntr⁡(cS†X)f_X(S)=2^{-n}\operatorname{tr}(c_S^\dagger X)fX​(S)=2−ntr(cS†​X), where cSc_ScS​ is the product of the cac_aca​ in increasing order, with empty product III. The symbols θ,η,μ\theta,\eta,\muθ,η,μ are three consecutive blocks of 2n2n2n Grassmann generators. For coefficient functions on subsets of an ordered ddd-element set, multiplication is defined by

(fg)(S)=∑U∩V=∅U∪V=S(−1)∣{(u,v)∈U×V:v<u}∣f(U)g(V),(fg)(S)= \sum_{\substack{U\cap V=\varnothing\\U\cup V=S}} (-1)^{|\{(u,v)\in U\times V:v<u\}|}f(U)g(V),(fg)(S)=U∩V=∅U∪V=S​∑​(−1)∣{(u,v)∈U×V:v<u}∣f(U)g(V),

the unit has coefficient 111 at the empty set and 000 elsewhere, and exp⁡tr(q)=∑k=06nqk/k!\exp_{\mathrm{tr}}(q)=\sum_{k=0}^{6n}q^k/k!exptr​(q)=∑k=06n​qk/k! in the expression above. Substitution fX(μ)f_X(\mu)fX​(μ) replaces each subset coefficient by the corresponding product of μ\muμ-generators in increasing order. The operation I\mathcal II assigns to a subset SSS of the first block the coefficient at SSS together with every generator in the last two blocks; its defining sign is (−1)4n∣S∣=1(-1)^{4n|S|}=1(−1)4n∣S∣=1. The definition includes n=0n=0n=0, when all generator blocks are empty and the matrix space is one-dimensional.

QAlgorithms.Papers.Independent.Intake100.P22.ImplementsRotation

For every natural number nnn, every family of complex matrices cac_aca​ on the basis {0,1}n\{0,1\}^n{0,1}n, indexed by 0≤a<2n0\le a<2n0≤a<2n, satisfying ca†=cac_a^\dagger=c_aca†​=ca​ and cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I, every complex matrix VVV on that same basis, and every real 2n×2n2n\times2n2n×2n matrix RRR, this predicate means

VcaV†=∑b=02n−1Rabcbfor every 0≤a<2n.V c_a V^\dagger=\sum_{b=0}^{2n-1}R_{ab}c_b \qquad\text{for every }0\le a<2n.Vca​V†=b=0∑2n−1​Rab​cb​for every 0≤a<2n.

The matrices VVV and RRR are otherwise unrestricted by this definition. When n=0n=0n=0, the universally quantified index set is empty, so the predicate holds for every such V,RV,RV,R.

QAlgorithms.Papers.Independent.Intake100.P22.InSector

For every natural number nnn, let Bn\mathcal B_nBn​ be the nnn-bit strings and let (γa)a∈Jn(\gamma_a)_{a\in J_n}(γa​)a∈Jn​​, Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. Given any natural number ppp and any complex matrix XXX on this space, the defined condition is

∀S⊆Jn,∣S∣ mod 2≠p ⟹ 2−ntr⁡(γS†X)=0,\forall S\subseteq J_n,\qquad |S|\bmod2\ne p \ \Longrightarrow\ 2^{-n}\operatorname{tr}(\gamma_S^\dagger X)=0,∀S⊆Jn​,∣S∣mod2=p ⟹ 2−ntr(γS†​X)=0,

where γS\gamma_SγS​ is the increasing-order product, with empty product III. Thus p=0p=0p=0 requires all odd-cardinality coefficients to vanish, p=1p=1p=1 requires all even-cardinality coefficients to vanish, and p≥2p\ge2p≥2 requires every coefficient to vanish. No positivity or normalization is assumed. For n=0n=0n=0, p=0p=0p=0 imposes no condition, while every p≠0p\ne0p=0 requires tr⁡X=0\operatorname{tr}X=0trX=0.

QAlgorithms.Papers.Independent.Intake100.P22.IsCanonicalFLO

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss consist of Hermitian matrices cac_aca​, indexed by 0≤a<2n0\le a<2n0≤a<2n, with cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. A complex matrix VVV on CQn\mathbb C^{Q_n}CQn​ satisfies this predicate precisely when there exists a real 2n×2n2n\times2n2n×2n matrix HHH such that HT=−HH^{\mathsf T}=-HHT=−H and

V=exp⁡ ⁣(−14∑a,b=02n−1Habcacb).V=\exp\!\left(-\frac14\sum_{a,b=0}^{2n-1}H_{ab}c_ac_b\right).V=exp​−41​a,b=0∑2n−1​Hab​ca​cb​​.

The matrix HHH is not required to be unique. For n=0n=0n=0, the empty sum is zero, so this predicate requires V=IV=IV=I.

QAlgorithms.Papers.Independent.Intake100.P22.LinearCompletelyPositive

For every natural number nnn, including n=0n=0n=0, put Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let E:MQn(C)→MQn(C)E:M_{Q_n}(\mathbb C)\to M_{Q_n}(\mathbb C)E:MQn​​(C)→MQn​​(C) be any function. This predicate means that E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y)E(aX+bY)=aE(X)+bE(Y) for all complex matrices X,YX,YX,Y and complex scalars a,ba,ba,b, and that the function E~\widetilde EE defined by

E~(Z)(u,r),(v,s)=E ⁣([Z(x,r),(y,s)]x,y∈Qn)u,v\widetilde E(Z)_{(u,r),(v,s)} = E\!\left(\bigl[Z_{(x,r),(y,s)}\bigr]_{x,y\in Q_n}\right)_{u,v}E(Z)(u,r),(v,s)​=E([Z(x,r),(y,s)​]x,y∈Qn​​)u,v​

maps every positive semidefinite matrix on Qn×QnQ_n\times Q_nQn​×Qn​ to a positive semidefinite matrix. The extension tested here has its second index set equal to QnQ_nQn​.

QAlgorithms.Papers.Independent.Intake100.P22.ParityPreserving

For every natural number nnn, let Bn\mathcal B_nBn​ be the nnn-bit strings and let (γa)a∈Jn(\gamma_a)_{a\in J_n}(γa​)a∈Jn​​, Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. An arbitrary function EEE from complex matrices on this space to complex matrices on the same space satisfies the defined condition precisely when, for each p∈{0,1}p\in\{0,1\}p∈{0,1} and every matrix XXX,

[∀S⊆Jn, ∣S∣ mod 2≠p ⟹ 2−ntr⁡(γS†X)=0]⟹[∀S⊆Jn, ∣S∣ mod 2≠p ⟹ 2−ntr⁡(γS†E(X))=0],\begin{aligned} &\left[\forall S\subseteq J_n,\ |S|\bmod2\ne p \ \Longrightarrow\ 2^{-n}\operatorname{tr}(\gamma_S^\dagger X)=0\right]\\ &\qquad\Longrightarrow \left[\forall S\subseteq J_n,\ |S|\bmod2\ne p \ \Longrightarrow\ 2^{-n}\operatorname{tr}(\gamma_S^\dagger E(X))=0\right], \end{aligned}​[∀S⊆Jn​, ∣S∣mod2=p ⟹ 2−ntr(γS†​X)=0]⟹[∀S⊆Jn​, ∣S∣mod2=p ⟹ 2−ntr(γS†​E(X))=0],​

where γS\gamma_SγS​ is the increasing-order product, with empty product III. No linearity, positivity, trace preservation, or channel property is required of EEE, and XXX ranges over all matrices. The case n=0n=0n=0 is included.

QAlgorithms.Papers.Independent.Intake100.P22.PositiveMap

For any finite index type III, equipped with a specified finite enumeration, and any function E:MI(C)→MI(C)E:M_I(\mathbb C)\to M_I(\mathbb C)E:MI​(C)→MI​(C), this predicate means that E(X)E(X)E(X) is positive semidefinite whenever XXX is positive semidefinite. The quantifier ranges over every matrix XXX, and no linearity assumption is included. The index type may be empty; in that case there is only one matrix and the condition holds automatically.

QAlgorithms.Papers.Independent.Intake100.P22.RealContraction

For every finite type III equipped with decidable equality and every complex matrix MMM indexed by III, this predicate means precisely that every entry has zero imaginary part and that

I−MTMI-M^{\mathsf T}MI−MTM

is positive semidefinite. Here III in the displayed expression denotes the identity matrix, and MTM^{\mathsf T}MT is the ordinary transpose. The index type may be empty; in that case both requirements hold.

QAlgorithms.Papers.Independent.Intake100.P22.RegularWith

For every natural number nnn, let Bn\mathcal B_nBn​ be the nnn-bit strings and let (γa)a∈Jn(\gamma_a)_{a\in J_n}(γa​)a∈Jn​​, Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For a complex matrix XXX on this space and a complex Jn×JnJ_n\times J_nJn​×Jn​ matrix MMM, the defined condition means that tr⁡X≠0\operatorname{tr}X\ne0trX=0, MT=−MM^{\mathsf T}=-MMT=−M, and

(S⟼2−ntr⁡(γS†X))=tr⁡X2n∑k=02n1k!(i2∑a,b∈JnMab ξaξb)k.\left(S\longmapsto 2^{-n}\operatorname{tr}(\gamma_S^\dagger X)\right) = \frac{\operatorname{tr}X}{2^n} \sum_{k=0}^{2n}\frac{1}{k!} \left(\frac{i}{2}\sum_{a,b\in J_n}M_{ab}\,\xi_a\xi_b\right)^k.(S⟼2−ntr(γS†​X))=2ntrX​k=0∑2n​k!1​​2i​a,b∈Jn​∑​Mab​ξa​ξb​​k.

Here γS\gamma_SγS​ is the increasing-order product, with empty product III. The right side lies in the algebra of complex coefficient functions on subsets, with ξa=e{a}\xi_a=e_{\{a\}}ξa​=e{a}​, identity e∅e_\varnothinge∅​, and multiplication eUeV=0e_Ue_V=0eU​eV​=0 if the subsets intersect, and otherwise eUeV=(−1)∣{(u,v)∈U×V:v<u}∣eU∪Ve_Ue_V=(-1)^{|\{(u,v)\in U\times V:v<u\}|}e_{U\cup V}eU​eV​=(−1)∣{(u,v)∈U×V:v<u}∣eU∪V​. No positivity or Hermiticity of XXX, and no reality of MMM, is required. For n=0n=0n=0, the matrix MMM is empty and the condition is exactly that the scalar matrix XXX be nonzero.

QAlgorithms.Papers.Independent.Intake100.P22.Rotation

For every natural number nnn, a real matrix RRR whose rows and columns are indexed by {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1} satisfies this predicate precisely when

RRT=Ianddet⁡R=1.RR^{\mathsf T}=I \qquad\text{and}\qquad \det R=1.RRT=IanddetR=1.

The case n=0n=0n=0 is included: the unique empty matrix satisfies the identity equation and has determinant 111.

QAlgorithms.Papers.Independent.Intake100.P22.RunTree

For any type AAA, with no finiteness or other assumptions, this declaration defines a type of finite recursively constructed trees whose nodes carry values in AAA. A stopping node carries one value and has no children; a unitary node carries one value and one continuation tree; and a measurement node carries one value and two continuation trees designated zero and one. Every continuation is a tree over the same type AAA, and no conditions relate the values at different nodes. If AAA is empty, no tree can be formed, since every constructor requires a value in AAA.

QAlgorithms.Papers.Independent.Intake100.P22.StateWith

For every natural number nnn, let Bn\mathcal B_nBn​ be the nnn-bit strings, Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, and let s=(γa)a∈Jns=(\gamma_a)_{a\in J_n}s=(γa​)a∈Jn​​ be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For a complex matrix ρ\rhoρ on this space and a real Jn×JnJ_n\times J_nJn​×Jn​ matrix MMM, the defined condition holds precisely when ρ\rhoρ is positive semidefinite with tr⁡ρ=1\operatorname{tr}\rho=1trρ=1, MT=−MM^{\mathsf T}=-MMT=−M, and the following equality of coefficient functions on subsets of JnJ_nJn​ holds:

(S⟼2−ntr⁡(γS†ρ))=2−n∑k=02n1k!(i2∑a,b∈JnMab ξaξb)k.\left(S\longmapsto 2^{-n}\operatorname{tr}(\gamma_S^\dagger\rho)\right) = 2^{-n}\sum_{k=0}^{2n}\frac{1}{k!} \left(\frac{i}{2}\sum_{a,b\in J_n}M_{ab}\,\xi_a\xi_b\right)^k.(S⟼2−ntr(γS†​ρ))=2−nk=0∑2n​k!1​​2i​a,b∈Jn​∑​Mab​ξa​ξb​​k.

Here γS\gamma_SγS​ is the product of the γa\gamma_aγa​ in increasing index order, with empty product III. On the right, ξa=e{a}\xi_a=e_{\{a\}}ξa​=e{a}​ in the coefficient algebra with basis eSe_SeS​; its multiplication is eUeV=0e_Ue_V=0eU​eV​=0 if U∩V≠∅U\cap V\ne\varnothingU∩V=∅, and otherwise

eUeV=(−1)∣{(u,v)∈U×V:v<u}∣eU∪V,e_Ue_V=(-1)^{|\{(u,v)\in U\times V:v<u\}|}e_{U\cup V},eU​eV​=(−1)∣{(u,v)∈U×V:v<u}∣eU∪V​,

with identity e∅e_\varnothinge∅​. Thus the exponential displayed is exactly the finite sum through degree 2n2n2n. The definition includes n=0n=0n=0, when MMM is empty and the condition reduces to the single entry of ρ\rhoρ being 111.

QAlgorithms.Papers.Independent.Intake100.P22.basisOp

For every natural number nnn, let sss be a family of complex matrices (γi)i∈I2n(\gamma_i)_{i\in I_{2n}}(γi​)i∈I2n​​ indexed by I2n={0,…,2n−1}I_{2n}=\{0,\ldots,2n-1\}I2n​={0,…,2n−1}, acting on the space with basis indexed by all Boolean strings of length nnn, such that each γi\gamma_iγi​ is Hermitian and

γiγj+γjγi={2I,i=j,0,i≠j.\gamma_i\gamma_j+\gamma_j\gamma_i= \begin{cases} 2I,&i=j,\\ 0,&i\ne j. \end{cases}γi​γj​+γj​γi​={2I,0,​i=j,i=j.​

For every subset S⊆I2nS\subseteq I_{2n}S⊆I2n​, this defines basisOp(s,S)\mathrm{basisOp}(s,S)basisOp(s,S) to be the matrix product γi1⋯γir\gamma_{i_1}\cdots\gamma_{i_r}γi1​​⋯γir​​, where i1<⋯<iri_1<\cdots<i_ri1​<⋯<ir​ lists the elements of SSS. The empty subset gives the identity matrix. In particular, when n=0n=0n=0, the index set is empty and the result is the identity on the one-dimensional space indexed by the empty Boolean string.

QAlgorithms.Papers.Independent.Intake100.P22.blockVars

For all natural numbers mmm, blocks\mathrm{blocks}blocks, and block\mathrm{block}block, this defines a family indexed by a∈Im={0,…,m−1}a\in I_m=\{0,\ldots,m-1\}a∈Im​={0,…,m−1} of complex-valued functions on subsets S⊆Iblocks mS\subseteq I_{\mathrm{blocks}\,m}S⊆Iblocksm​. The function indexed by aaa has value 111 exactly when block m+a<blocks m\mathrm{block}\,m+a<\mathrm{blocks}\,mblockm+a<blocksm and S={block m+a}S=\{\mathrm{block}\,m+a\}S={blockm+a}, and has value 000 otherwise. There is no assumption that block<blocks\mathrm{block}<\mathrm{blocks}block<blocks; if m>0m>0m>0 and block≥blocks\mathrm{block}\ge\mathrm{blocks}block≥blocks, every function in the family is zero. When m=0m=0m=0, the family has no indices.

QAlgorithms.Papers.Independent.Intake100.P22.canonicalFLO

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss provide Hermitian matrices c0,…,c2n−1c_0,\ldots,c_{2n-1}c0​,…,c2n−1​ satisfying cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. For any real 2n×2n2n\times2n2n×2n matrix HHH, this definition returns

exp⁡ ⁣(i(i4∑a,b=02n−1Habcacb))=exp⁡ ⁣(−14∑a,b=02n−1Habcacb),\exp\!\left(i\left(\frac{i}{4}\sum_{a,b=0}^{2n-1}H_{ab}c_ac_b\right)\right) = \exp\!\left(-\frac14\sum_{a,b=0}^{2n-1}H_{ab}c_ac_b\right),exp​i​4i​a,b=0∑2n−1​Hab​ca​cb​​​=exp​−41​a,b=0∑2n−1​Hab​ca​cb​​,

where exp⁡\expexp is the matrix exponential. No skew-symmetry condition on HHH is required by this definition. When n=0n=0n=0, the exponent is zero and the result is the identity on the one-dimensional space indexed by the empty bit string.

QAlgorithms.Papers.Independent.Intake100.P22.diagonalMap

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For a subset AAA of these indices, write γA\gamma_AγA​ for its product in increasing index order, with γ∅=I\gamma_\varnothing=Iγ∅​=I. Given any real-valued function bbb on {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, this definition gives the function on all complex matrices X∈MQn(C)X\in M_{Q_n}(\mathbb C)X∈MQn​​(C) specified by

X⟼∑A⊆{0,…,2n−1}(2−ntr⁡(γA†X)∏a∈Aba)γA.X\longmapsto \sum_{A\subseteq\{0,\ldots,2n-1\}} \left(2^{-n}\operatorname{tr}(\gamma_A^\dagger X) \prod_{a\in A}b_a\right)\gamma_A.X⟼A⊆{0,…,2n−1}∑​(2−ntr(γA†​X)a∈A∏​ba​)γA​.

Real factors are regarded as complex scalars; no bounds or sign conditions on bab_aba​ are required. The empty scalar product is 111, and when n=0n=0n=0 the resulting function is the identity on one-by-one matrices.

QAlgorithms.Papers.Independent.Intake100.P22.doubleBasis

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian complex matrices γa\gamma_aγa​, indexed by QnQ_nQn​ for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For any subsets A,B⊆{0,…,2n−1}A,B\subseteq\{0,\ldots,2n-1\}A,B⊆{0,…,2n−1}, define γA\gamma_AγA​ and γB\gamma_BγB​ as the respective products in increasing index order, taking an empty product to be III, and set P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​. The defined matrix, indexed by Qn×QnQ_n\times Q_nQn​×Qn​, is

γA⊗(P∣A∣γB).\gamma_A\otimes\bigl(P^{|A|}\gamma_B\bigr).γA​⊗(P∣A∣γB​).

The order P∣A∣γBP^{|A|}\gamma_BP∣A∣γB​ is part of the formula. When n=0n=0n=0, both subsets are necessarily empty and the result is the one-by-one identity matrix.

QAlgorithms.Papers.Independent.Intake100.P22.doubleCoefficient

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. Write γA\gamma_AγA​ for the increasing-order product over a subset AAA of these indices, with empty product III, and put P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​. Given any complex matrix ZZZ indexed by Qn×QnQ_n\times Q_nQn​×Qn​ and any subsets A,B⊆{0,…,2n−1}A,B\subseteq\{0,\ldots,2n-1\}A,B⊆{0,…,2n−1}, this definition returns the complex number

2−2ntr⁡[(γA⊗(P∣A∣γB))†Z],2^{-2n}\operatorname{tr} \left[\bigl(\gamma_A\otimes(P^{|A|}\gamma_B)\bigr)^\dagger Z\right],2−2ntr[(γA​⊗(P∣A∣γB​))†Z],

where †\dagger† is conjugate transpose and ⊗\otimes⊗ is the Kronecker product. No positivity, Hermiticity, or normalization of ZZZ is assumed. For n=0n=0n=0, this is the single entry of ZZZ.

QAlgorithms.Papers.Independent.Intake100.P22.doubleSymbol

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. Write γA\gamma_AγA​ for the increasing-order product over AAA, taking an empty product to be III, and put P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​. For any complex matrix ZZZ indexed by Qn×QnQ_n\times Q_nQn​×Qn​, this definition returns a complex-valued function on subsets S⊆{0,…,4n−1}S\subseteq\{0,\ldots,4n-1\}S⊆{0,…,4n−1}. Specifically, set

AS={a:0≤a<2n, a∈S},BS={a:0≤a<2n, 2n+a∈S}.A_S=\{a:0\le a<2n,\ a\in S\},\qquad B_S=\{a:0\le a<2n,\ 2n+a\in S\}.AS​={a:0≤a<2n, a∈S},BS​={a:0≤a<2n, 2n+a∈S}.

Its value at SSS is

2−2ntr⁡[(γAS⊗(P∣AS∣γBS))†Z].2^{-2n}\operatorname{tr} \left[\bigl(\gamma_{A_S}\otimes(P^{|A_S|}\gamma_{B_S})\bigr)^\dagger Z\right].2−2ntr[(γAS​​⊗(P∣AS​∣γBS​​))†Z].

No condition is imposed on ZZZ. When n=0n=0n=0, the only possible subset is empty and its value is the single entry of ZZZ.

QAlgorithms.Papers.Independent.Intake100.P22.dualReference

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. Set P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​, with this product taken in increasing index order. This definition gives the matrix indexed by Qn×QnQ_n\times Q_nQn​×Qn​

2−2n∏a=02n−1[I+i (γa⊗P)(I⊗γa)],2^{-2n}\prod_{a=0}^{2n-1} \left[I+i\,(\gamma_a\otimes P)(I\otimes\gamma_a)\right],2−2na=0∏2n−1​[I+i(γa​⊗P)(I⊗γa​)],

where the displayed factors are multiplied from left to right in increasing order of aaa, and ⊗\otimes⊗ denotes the Kronecker product. When n=0n=0n=0, the product is empty and the result is the one-by-one identity matrix.

QAlgorithms.Papers.Independent.Intake100.P22.elementaryComposition

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγc+γcγa=2δacI\gamma_a\gamma_c+\gamma_c\gamma_a=2\delta_{ac}Iγa​γc​+γc​γa​=2δac​I. Given any real-valued function bbb on these indices, define, for each aaa, the function

Ea(X)=∑A⊆{0,…,2n−1}2−ntr⁡(γA†X){ba,a∈A,1,a∉AγA,E_a(X)= \sum_{A\subseteq\{0,\ldots,2n-1\}} 2^{-n}\operatorname{tr}(\gamma_A^\dagger X) \begin{cases} b_a,&a\in A,\\ 1,&a\notin A \end{cases} \gamma_A,Ea​(X)=A⊆{0,…,2n−1}∑​2−ntr(γA†​X){ba​,1,​a∈A,a∈/A​γA​,

where γA\gamma_AγA​ is the increasing-order product and γ∅=I\gamma_\varnothing=Iγ∅​=I. The declaration defines the function E0∘E1∘⋯∘E2n−1E_0\circ E_1\circ\cdots\circ E_{2n-1}E0​∘E1​∘⋯∘E2n−1​, so the function with the largest index acts first. No restrictions on the real numbers bab_aba​ are imposed. When n=0n=0n=0, this is an empty composition and equals the identity function on one-by-one complex matrices.

QAlgorithms.Papers.Independent.Intake100.P22.elementaryMap

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γc∈MQn(C)\gamma_c\in M_{Q_n}(\mathbb C)γc​∈MQn​​(C), for 0≤c<2n0\le c<2n0≤c<2n, satisfying γcγd+γdγc=2δcdI\gamma_c\gamma_d+\gamma_d\gamma_c=2\delta_{cd}Iγc​γd​+γd​γc​=2δcd​I. Given an index a∈{0,…,2n−1}a\in\{0,\ldots,2n-1\}a∈{0,…,2n−1} and an arbitrary real number bbb, the defined function on complex matrices is

X⟼∑A⊆{0,…,2n−1}2−ntr⁡(γA†X){b,a∈A,1,a∉AγA,X\longmapsto \sum_{A\subseteq\{0,\ldots,2n-1\}} 2^{-n}\operatorname{tr}(\gamma_A^\dagger X) \begin{cases} b,&a\in A,\\ 1,&a\notin A \end{cases} \gamma_A,X⟼A⊆{0,…,2n−1}∑​2−ntr(γA†​X){b,1,​a∈A,a∈/A​γA​,

where γA\gamma_AγA​ is the product in increasing index order and γ∅=I\gamma_\varnothing=Iγ∅​=I. The real multiplier is regarded as a complex scalar. No restriction on bbb is imposed. For n=0n=0n=0, there is no index aaa with which to instantiate the definition.

QAlgorithms.Papers.Independent.Intake100.P22.fermionicDual

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. Let γA\gamma_AγA​ denote the increasing-order product over a subset AAA, with empty product III, put P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​, and define

Ω=2−2n∏a=02n−1[I+i (γa⊗P)(I⊗γa)],\Omega=2^{-2n}\prod_{a=0}^{2n-1} \left[I+i\,(\gamma_a\otimes P)(I\otimes\gamma_a)\right],Ω=2−2na=0∏2n−1​[I+i(γa​⊗P)(I⊗γa​)],

with factors in increasing index order. For any function E:MQn(C)→MQn(C)E:M_{Q_n}(\mathbb C)\to M_{Q_n}(\mathbb C)E:MQn​​(C)→MQn​​(C), the defined matrix is

∑A,B2−2ntr⁡[(γA⊗(P∣A∣γB))†Ω][(∑D2−ntr⁡(γD†E(γA)) γD⊗P∣D∣)(I⊗γB)].\sum_{A,B} 2^{-2n}\operatorname{tr} \left[\bigl(\gamma_A\otimes(P^{|A|}\gamma_B)\bigr)^\dagger\Omega\right] \left[ \left(\sum_D 2^{-n}\operatorname{tr}\bigl(\gamma_D^\dagger E(\gamma_A)\bigr) \,\gamma_D\otimes P^{|D|}\right) (I\otimes\gamma_B) \right].A,B∑​2−2ntr[(γA​⊗(P∣A∣γB​))†Ω][(D∑​2−ntr(γD†​E(γA​))γD​⊗P∣D∣)(I⊗γB​)].

All three subset indices range over subsets of {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, †\dagger† denotes conjugate transpose, and ⊗\otimes⊗ denotes the Kronecker product. No linearity or channel assumption is imposed on EEE. When n=0n=0n=0, this matrix is E(1)E(1)E(1), viewed as a one-by-one matrix.

QAlgorithms.Papers.Independent.Intake100.P22.fermionicExtension

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian matrices γa∈MQn(C)\gamma_a\in M_{Q_n}(\mathbb C)γa​∈MQn​​(C), for 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For each subset AAA of these indices, let γA\gamma_AγA​ be its increasing-order product, with γ∅=I\gamma_\varnothing=Iγ∅​=I, and set P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​. Given any function E:MQn(C)→MQn(C)E:M_{Q_n}(\mathbb C)\to M_{Q_n}(\mathbb C)E:MQn​​(C)→MQn​​(C), this definition produces the function sending every matrix Z∈MQn×Qn(C)Z\in M_{Q_n\times Q_n}(\mathbb C)Z∈MQn​×Qn​​(C) to

∑A,B2−2ntr⁡[(γA⊗(P∣A∣γB))†Z][(∑D2−ntr⁡(γD†E(γA)) γD⊗P∣D∣)(I⊗γB)],\sum_{A,B} 2^{-2n}\operatorname{tr} \left[\bigl(\gamma_A\otimes(P^{|A|}\gamma_B)\bigr)^\dagger Z\right] \left[ \left(\sum_D 2^{-n}\operatorname{tr}\bigl(\gamma_D^\dagger E(\gamma_A)\bigr) \,\gamma_D\otimes P^{|D|}\right) (I\otimes\gamma_B) \right],A,B∑​2−2ntr[(γA​⊗(P∣A∣γB​))†Z][(D∑​2−ntr(γD†​E(γA​))γD​⊗P∣D∣)(I⊗γB​)],

where A,B,DA,B,DA,B,D each range over all subsets of {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, and ⊗\otimes⊗ is the matrix Kronecker product. There is no assumption that EEE is linear, positive, or a channel. The case n=0n=0n=0 is included: identifying one-by-one matrices with complex numbers, the resulting function is z↦zE(1)z\mapsto zE(1)z↦zE(1).

QAlgorithms.Papers.Independent.Intake100.P22.firstEmbedding

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss specify Hermitian complex matrices γ0,…,γ2n−1\gamma_0,\ldots,\gamma_{2n-1}γ0​,…,γ2n−1​, indexed by QnQ_nQn​, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For each subset A⊆{0,…,2n−1}A\subseteq\{0,\ldots,2n-1\}A⊆{0,…,2n−1}, write γA\gamma_AγA​ for the product of its γa\gamma_aγa​ in increasing index order, with γ∅=I\gamma_\varnothing=Iγ∅​=I, and put P=inγ0⋯γ2n−1P=i^n\gamma_0\cdots\gamma_{2n-1}P=inγ0​⋯γ2n−1​. For every complex matrix XXX indexed by QnQ_nQn​, with no positivity or normalization requirement, this definition gives the matrix indexed by Qn×QnQ_n\times Q_nQn​×Qn​

∑A⊆{0,…,2n−1}2−ntr⁡(γA†X) (γA⊗P∣A∣).\sum_{A\subseteq\{0,\ldots,2n-1\}} 2^{-n}\operatorname{tr}(\gamma_A^\dagger X)\, \bigl(\gamma_A\otimes P^{|A|}\bigr).A⊆{0,…,2n−1}∑​2−ntr(γA†​X)(γA​⊗P∣A∣).

Here †\dagger† denotes conjugate transpose and ⊗\otimes⊗ denotes the matrix Kronecker product. When n=0n=0n=0, QnQ_nQn​ has one element, and the formula returns the single entry of XXX as a one-by-one matrix.

QAlgorithms.Papers.Independent.Intake100.P22.firstK

For every natural number nnn, this defines a complex matrix with rows and columns indexed by {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, whose entries are

Kab={1,a=0, b=1,−1,a=1, b=0,0,otherwise.K_{ab}= \begin{cases} 1,&a=0,\ b=1,\\ -1,&a=1,\ b=0,\\ 0,&\text{otherwise}. \end{cases}Kab​=⎩⎨⎧​1,−1,0,​a=0, b=1,a=1, b=0,otherwise.​

When n=0n=0n=0, this is the unique matrix on the empty index set.

QAlgorithms.Papers.Independent.Intake100.P22.firstOutcomeSymbol

For every natural number nnn, arbitrary complex number ppp, and arbitrary complex matrix LLL indexed by 0,…,2n−10,\ldots,2n-10,…,2n−1, this defines a coefficient function on subsets of those indices. Identify such functions with the complex exterior algebra on ordered generators ξ0,…,ξ2n−1\xi_0,\ldots,\xi_{2n-1}ξ0​,…,ξ2n−1​, where generators anticommute, square to zero, and the coefficient at a subset is the coefficient of its increasing ordered monomial. The defined symbol is

p2n∑k=02nQkk!,Q=i ξ0ξ1+i2∑a,b<2n2≤a, 2≤bLabξaξb.\frac{p}{2^n}\sum_{k=0}^{2n}\frac{Q^k}{k!}, \qquad Q=i\,\xi_0\xi_1+ \frac{i}{2}\sum_{\substack{a,b<2n\\2\le a,\ 2\le b}}L_{ab}\xi_a\xi_b.2np​k=0∑2n​k!Qk​,Q=iξ0​ξ1​+2i​a,b<2n2≤a, 2≤b​∑​Lab​ξa​ξb​.

The power Q0Q^0Q0 is the exterior-algebra identity, whose empty-subset coefficient is 111 and other coefficients are zero. A generator whose numerical index lies outside the available range means the zero coefficient function; in particular, for n=0n=0n=0, both displayed generators are zero and the resulting symbol has the sole coefficient ppp. No skew-symmetry or reality condition is imposed on LLL, and ppp is not required to be a probability.

QAlgorithms.Papers.Independent.Intake100.P22.floMeasurementAction

For natural numbers n,en,en,e, an index 0≤j<n0\le j<n0≤j<n, a Boolean outcome ooo, and arbitrary families θc,ηc\theta_c,\eta_cθc​,ηc​, 0≤c<2n0\le c<2n0≤c<2n, of complex-valued functions on the subsets of {0,…,e−1}\{0,\ldots,e-1\}{0,…,e−1}, put a=2ja=2ja=2j, b=2j+1b=2j+1b=2j+1, and let εo=−1\varepsilon_o=-1εo​=−1 for a true outcome and 111 for a false outcome. This defines the subset-coefficient function

εo i (θa∗θb−ηa∗ηb)+i∑0≤c<2nc≠a, c≠bθc∗ηc,\varepsilon_o\,\mathrm{i}\, (\theta_a*\theta_b-\eta_a*\eta_b) +\mathrm{i}\sum_{\substack{0\le c<2n\\c\ne a,\ c\ne b}}\theta_c*\eta_c,εo​i(θa​∗θb​−ηa​∗ηb​)+i0≤c<2nc=a, c=b​∑​θc​∗ηc​,

where addition and scalar multiplication are pointwise and the multiplication is explicitly

(u∗v)(S)=∑U,V⊆{0,…,e−1}U∩V=∅, U∪V=S(−1) ∣{(r,s)∈U×V:s<r}∣ u(U)v(V).(u*v)(S)= \sum_{\substack{U,V\subseteq\{0,\ldots,e-1\}\\ U\cap V=\varnothing,\ U\cup V=S}} (-1)^{\,|\{(r,s)\in U\times V:s<r\}|}\,u(U)v(V).(u∗v)(S)=U,V⊆{0,…,e−1}U∩V=∅, U∪V=S​∑​(−1)∣{(r,s)∈U×V:s<r}∣u(U)v(V).

The families θ,η\theta,\etaθ,η have no additional restrictions; in particular, they need not consist of single generators. The case e=0e=0e=0 is included, whereas n=0n=0n=0 admits no argument jjj.

QAlgorithms.Papers.Independent.Intake100.P22.grassExp

For every natural number ddd and every function q:P(Id)→Cq:\mathcal P(I_d)\to\mathbb Cq:P(Id​)→C, where Id={0,…,d−1}I_d=\{0,\ldots,d-1\}Id​={0,…,d−1}, this defines the finite sum of powers through degree ddd; explicitly, for S⊆IdS\subseteq I_dS⊆Id​,

grassExp(q)(S)=∑k=0d1k!∑A1,…,Ak⊆IdAi∩Aj=∅ (i≠j)⋃i=1kAi=S(−1) ∑i<j∣{(a,b)∈Ai×Aj:b<a}∣∏i=1kq(Ai),\mathrm{grassExp}(q)(S)= \sum_{k=0}^{d}\frac{1}{k!} \sum_{\substack{A_1,\ldots,A_k\subseteq I_d\\ A_i\cap A_j=\varnothing\ (i\ne j)\\ \bigcup_{i=1}^{k}A_i=S}} (-1)^{\,\sum_{i<j}|\{(a,b)\in A_i\times A_j:b<a\}|} \prod_{i=1}^{k}q(A_i),grassExp(q)(S)=k=0∑d​k!1​A1​,…,Ak​⊆Id​Ai​∩Aj​=∅ (i=j)⋃i=1k​Ai​=S​∑​(−1)∑i<j​∣{(a,b)∈Ai​×Aj​:b<a}∣i=1∏k​q(Ai​),

where the inner sum for k=0k=0k=0 is 111 when S=∅S=\varnothingS=∅ and 000 otherwise. No hypothesis requires q(∅)=0q(\varnothing)=0q(∅)=0. When d=0d=0d=0, the result has value 111 at its only argument, independently of qqq.

QAlgorithms.Papers.Independent.Intake100.P22.grassIntegrate

For every natural number ddd, every natural number k=keepk=\mathrm{keep}k=keep, and every function f:P(Id)→Cf:\mathcal P(I_d)\to\mathbb Cf:P(Id​)→C, where Ir={0,…,r−1}I_r=\{0,\ldots,r-1\}Ir​={0,…,r−1}, this defines a function on subsets S⊆IkS\subseteq I_kS⊆Ik​ by

grassIntegrate(k,f)(S)={(−1)(d−k)∣S∣ f ⁣(S∪{k,…,d−1}),k≤d,0,k>d,\mathrm{grassIntegrate}(k,f)(S)= \begin{cases} (-1)^{(d-k)|S|}\, f\!\left(S\cup\{k,\ldots,d-1\}\right),&k\le d,\\ 0,&k>d, \end{cases}grassIntegrate(k,f)(S)={(−1)(d−k)∣S∣f(S∪{k,…,d−1}),0,​k≤d,k>d,​

where, in the first case, the elements of SSS are identified with the same numerical indices in IdI_dId​. In particular, keeping all ddd indices gives fff, while keeping zero indices gives the single value f(Id)f(I_d)f(Id​). Keeping more than ddd indices gives the zero function.

QAlgorithms.Papers.Independent.Intake100.P22.grassMul

For every natural number ddd and every two functions f,g:P(Id)→Cf,g:\mathcal P(I_d)\to\mathbb Cf,g:P(Id​)→C, where Id={0,…,d−1}I_d=\{0,\ldots,d-1\}Id​={0,…,d−1}, this defines their product to be the function whose value at S⊆IdS\subseteq I_dS⊆Id​ is

grassMul(f,g)(S)=∑A,B⊆IdA∩B=∅A∪B=S(−1) ∣{(a,b)∈A×B:b<a}∣ f(A)g(B).\mathrm{grassMul}(f,g)(S)= \sum_{\substack{A,B\subseteq I_d\\A\cap B=\varnothing\\A\cup B=S}} (-1)^{\,|\{(a,b)\in A\times B:b<a\}|}\,f(A)g(B).grassMul(f,g)(S)=A,B⊆Id​A∩B=∅A∪B=S​∑​(−1)∣{(a,b)∈A×B:b<a}∣f(A)g(B).

The sum ranges over ordered pairs of subsets. For S=∅S=\varnothingS=∅, its value is f(∅)g(∅)f(\varnothing)g(\varnothing)f(∅)g(∅); when d=0d=0d=0, this is its only value.

QAlgorithms.Papers.Independent.Intake100.P22.grassOne

For every natural number ddd, this defines a complex-valued function on subsets S⊆Id={0,…,d−1}S\subseteq I_d=\{0,\ldots,d-1\}S⊆Id​={0,…,d−1} by

grassOned(S)={1,S=∅,0,S≠∅.\mathrm{grassOne}_d(S)= \begin{cases} 1,&S=\varnothing,\\ 0,&S\ne\varnothing. \end{cases}grassOned​(S)={1,0,​S=∅,S=∅.​

This includes d=0d=0d=0, when its only value is 111.

QAlgorithms.Papers.Independent.Intake100.P22.grassPow

For every natural number ddd, every function f:P(Id)→Cf:\mathcal P(I_d)\to\mathbb Cf:P(Id​)→C, and every natural number kkk, where Id={0,…,d−1}I_d=\{0,\ldots,d-1\}Id​={0,…,d−1}, this defines the kkk-fold product with coefficients

grassPow(f,k)(S)=∑A1,…,Ak⊆IdAi∩Aj=∅ (i≠j)⋃i=1kAi=S(−1) ∑i<j∣{(a,b)∈Ai×Aj:b<a}∣∏i=1kf(Ai).\mathrm{grassPow}(f,k)(S)= \sum_{\substack{A_1,\ldots,A_k\subseteq I_d\\ A_i\cap A_j=\varnothing\ (i\ne j)\\ \bigcup_{i=1}^{k}A_i=S}} (-1)^{\,\sum_{i<j}|\{(a,b)\in A_i\times A_j:b<a\}|} \prod_{i=1}^{k}f(A_i).grassPow(f,k)(S)=A1​,…,Ak​⊆Id​Ai​∩Aj​=∅ (i=j)⋃i=1k​Ai​=S​∑​(−1)∑i<j​∣{(a,b)∈Ai​×Aj​:b<a}∣i=1∏k​f(Ai​).

At k=0k=0k=0, this is 111 for S=∅S=\varnothingS=∅ and 000 otherwise; the successor power is formed by multiplying fff on the left of the preceding power. There is no restriction on f(∅)f(\varnothing)f(∅), and powers with k>dk>dk>d are also defined.

QAlgorithms.Papers.Independent.Intake100.P22.grassProd

For every natural number ddd and every finite list [f1,…,fr][f_1,\ldots,f_r][f1​,…,fr​] of functions P(Id)→C\mathcal P(I_d)\to\mathbb CP(Id​)→C, where Id={0,…,d−1}I_d=\{0,\ldots,d-1\}Id​={0,…,d−1}, this defines a function whose value at S⊆IdS\subseteq I_dS⊆Id​ is

∑A1,…,Ar⊆IdAi∩Aj=∅ (i≠j)⋃i=1rAi=S(−1) ∑i<j∣{(a,b)∈Ai×Aj:b<a}∣∏i=1rfi(Ai).\sum_{\substack{A_1,\ldots,A_r\subseteq I_d\\ A_i\cap A_j=\varnothing\ (i\ne j)\\ \bigcup_{i=1}^{r}A_i=S}} (-1)^{\,\sum_{i<j}|\{(a,b)\in A_i\times A_j:b<a\}|} \prod_{i=1}^{r}f_i(A_i).A1​,…,Ar​⊆Id​Ai​∩Aj​=∅ (i=j)⋃i=1r​Ai​=S​∑​(−1)∑i<j​∣{(a,b)∈Ai​×Aj​:b<a}∣i=1∏r​fi​(Ai​).

Equivalently, the list is multiplied recursively from its first element, with the remaining list forming the right factor. The empty list gives the function that is 111 at ∅\varnothing∅ and 000 elsewhere. The definition includes d=0d=0d=0, when the result at ∅\varnothing∅ is the ordinary product of the listed values at ∅\varnothing∅.

QAlgorithms.Papers.Independent.Intake100.P22.grassQuadratic

For all natural numbers d,ed,ed,e, every complex matrix M=(Mab)a,b∈IdM=(M_{ab})_{a,b\in I_d}M=(Mab​)a,b∈Id​​, and every family va:P(Ie)→Cv_a:\mathcal P(I_e)\to\mathbb Cva​:P(Ie​)→C indexed by a∈Ida\in I_da∈Id​, where Ir={0,…,r−1}I_r=\{0,\ldots,r-1\}Ir​={0,…,r−1}, this defines a function whose value at S⊆IeS\subseteq I_eS⊆Ie​ is

grassQuadratic(M,v)(S)=∑a,b∈IdMab∑A,B⊆IeA∩B=∅A∪B=S(−1) ∣{(i,j)∈A×B:j<i}∣ va(A)vb(B).\mathrm{grassQuadratic}(M,v)(S)= \sum_{a,b\in I_d}M_{ab} \sum_{\substack{A,B\subseteq I_e\\A\cap B=\varnothing\\A\cup B=S}} (-1)^{\,|\{(i,j)\in A\times B:j<i\}|}\,v_a(A)v_b(B).grassQuadratic(M,v)(S)=a,b∈Id​∑​Mab​A,B⊆Ie​A∩B=∅A∪B=S​∑​(−1)∣{(i,j)∈A×B:j<i}∣va​(A)vb​(B).

There is no symmetry or skew-symmetry assumption on MMM, and the family vvv is arbitrary. If d=0d=0d=0, the result is zero; if e=0e=0e=0, its only value is ∑a,bMabva(∅)vb(∅)\sum_{a,b}M_{ab}v_a(\varnothing)v_b(\varnothing)∑a,b​Mab​va​(∅)vb​(∅).

QAlgorithms.Papers.Independent.Intake100.P22.grassSubst

For all natural numbers d,ed,ed,e, every function f:P(Id)→Cf:\mathcal P(I_d)\to\mathbb Cf:P(Id​)→C, and every family vi:P(Ie)→Cv_i:\mathcal P(I_e)\to\mathbb Cvi​:P(Ie​)→C indexed by i∈Idi\in I_di∈Id​, where Ir={0,…,r−1}I_r=\{0,\ldots,r-1\}Ir​={0,…,r−1}, this defines a function on subsets T⊆IeT\subseteq I_eT⊆Ie​ by

grassSubst(f,v)(T)=∑S⊆Idf(S)∑(Ai)i∈S, Ai⊆IeAi∩Aj=∅ (i≠j)⋃i∈SAi=T(−1) ∑i,j∈Si<j∣{(a,b)∈Ai×Aj:b<a}∣∏i∈Svi(Ai).\mathrm{grassSubst}(f,v)(T)= \sum_{S\subseteq I_d}f(S) \sum_{\substack{(A_i)_{i\in S},\ A_i\subseteq I_e\\ A_i\cap A_j=\varnothing\ (i\ne j)\\ \bigcup_{i\in S}A_i=T}} (-1)^{\,\sum_{\substack{i,j\in S\\i<j}} |\{(a,b)\in A_i\times A_j:b<a\}|} \prod_{i\in S}v_i(A_i).grassSubst(f,v)(T)=S⊆Id​∑​f(S)(Ai​)i∈S​, Ai​⊆Ie​Ai​∩Aj​=∅ (i=j)⋃i∈S​Ai​=T​∑​(−1)∑i,j∈Si<j​​∣{(a,b)∈Ai​×Aj​:b<a}∣i∈S∏​vi​(Ai​).

Thus the factors associated with SSS are multiplied in increasing index order. The empty subset SSS contributes f(∅)f(\varnothing)f(∅) at T=∅T=\varnothingT=∅ and zero elsewhere. The family vvv is arbitrary, and d=0d=0d=0 or e=0e=0e=0 is permitted.

QAlgorithms.Papers.Independent.Intake100.P22.grassVar

For all natural numbers ddd and aaa, this defines a complex-valued function on subsets S⊆Id={0,…,d−1}S\subseteq I_d=\{0,\ldots,d-1\}S⊆Id​={0,…,d−1}, whose value is 111 exactly when there is an index i∈Idi\in I_di∈Id​ with numerical value aaa and S={i}S=\{i\}S={i}, and is 000 otherwise. Thus, if a<da<da<d, it is the indicator of the singleton subset {a}\{a\}{a}; if a≥da\ge da≥d, including every case with d=0d=0d=0, it is the zero function.

QAlgorithms.Papers.Independent.Intake100.P22.homogeneousKernel

For every natural number nnn and every complex matrix BBB indexed by {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1} in both coordinates, this defines a kernel record with matrix fields A=0A=0A=0, B=BB=BB=B, D=0D=0D=0, and scalar field C=1C=1C=1. The record requires AT=−AA^{\mathsf T}=-AAT=−A and DT=−DD^{\mathsf T}=-DDT=−D, which hold for these zero matrices; it imposes no condition on BBB. The case n=0n=0n=0, with empty matrix index sets, is included.

QAlgorithms.Papers.Independent.Intake100.P22.kernelAction

For all natural numbers n,en,en,e, let Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, and let KKK consist of complex Jn×JnJ_n\times J_nJn​×Jn​ matrices A,B,DA,B,DA,B,D and a scalar CCC, with AT=−AA^{\mathsf T}=-AAT=−A and DT=−DD^{\mathsf T}=-DDT=−D. Given arbitrary families (θa)a∈Jn(\theta_a)_{a\in J_n}(θa​)a∈Jn​​ and (ηa)a∈Jn(\eta_a)_{a\in J_n}(ηa​)a∈Jn​​ of complex coefficient functions on subsets of {0,…,e−1}\{0,\ldots,e-1\}{0,…,e−1}, the defined action is the coefficient function

i2∑a,b∈JnAab θaθb+i∑a,b∈JnBab θaηb+i2∑a,b∈JnDab ηaηb.\frac{i}{2}\sum_{a,b\in J_n}A_{ab}\,\theta_a\theta_b +i\sum_{a,b\in J_n}B_{ab}\,\theta_a\eta_b +\frac{i}{2}\sum_{a,b\in J_n}D_{ab}\,\eta_a\eta_b.2i​a,b∈Jn​∑​Aab​θa​θb​+ia,b∈Jn​∑​Bab​θa​ηb​+2i​a,b∈Jn​∑​Dab​ηa​ηb​.

For coefficient functions f,gf,gf,g, the product used here is defined at a subset SSS by

(fg)(S)=∑U,V⊆{0,…,e−1}U∩V=∅, U∪V=S(−1)∣{(u,v)∈U×V:v<u}∣f(U)g(V).(fg)(S)= \sum_{\substack{U,V\subseteq\{0,\ldots,e-1\}\\ U\cap V=\varnothing,\ U\cup V=S}} (-1)^{|\{(u,v)\in U\times V:v<u\}|}f(U)g(V).(fg)(S)=U,V⊆{0,…,e−1}U∩V=∅, U∪V=S​∑​(−1)∣{(u,v)∈U×V:v<u}∣f(U)g(V).

The scalar CCC does not occur in this action. No restriction on the degrees of θa,ηa\theta_a,\eta_aθa​,ηa​ is imposed; e=0e=0e=0 is allowed, and when n=0n=0n=0, the action is zero.

QAlgorithms.Papers.Independent.Intake100.P22.kernelBlock

For every natural number nnn and every kernel record KKK consisting of complex 2n×2n2n\times2n2n×2n matrices A,B,DA,B,DA,B,D, a complex scalar CCC, and the conditions AT=−AA^{\mathsf T}=-AAT=−A and DT=−DD^{\mathsf T}=-DDT=−D, this defines the complex block matrix

(AB−BTD).\begin{pmatrix} A&B\\ -B^{\mathsf T}&D \end{pmatrix}.(A−BT​BD​).

Its indices are two disjoint copies of {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}; the transpose in the lower-left block does not conjugate entries. The scalar CCC does not enter this formula. When n=0n=0n=0, the result has an empty index set.

QAlgorithms.Papers.Independent.Intake100.P22.kernelEval

For every natural number nnn, put d=2nd=2nd=2n. Let KKK consist of complex d×dd\times dd×d matrices A,B,DA,B,DA,B,D, with AT=−AA^{\mathsf T}=-AAT=−A and DT=−DD^{\mathsf T}=-DDT=−D, and a complex scalar CCC; let fff be any complex coefficient function on subsets of {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}. Form the coefficient algebra on subsets of {0,…,3d−1}\{0,\ldots,3d-1\}{0,…,3d−1}, with basis eUe_UeU​, identity e∅e_\varnothinge∅​, and multiplication eUeV=0e_Ue_V=0eU​eV​=0 when U∩V≠∅U\cap V\ne\varnothingU∩V=∅, and otherwise eUeV=(−1)∣{(u,v)∈U×V:v<u}∣eU∪Ve_Ue_V=(-1)^{|\{(u,v)\in U\times V:v<u\}|}e_{U\cup V}eU​eV​=(−1)∣{(u,v)∈U×V:v<u}∣eU∪V​. Write θa=e{a}\theta_a=e_{\{a\}}θa​=e{a}​, ηa=e{d+a}\eta_a=e_{\{d+a\}}ηa​=e{d+a}​, and χa=e{2d+a}\chi_a=e_{\{2d+a\}}χa​=e{2d+a}​, and define

q=i2∑a,b<dAabθaθb+i∑a,b<dBabθaηb+i2∑a,b<dDabηaηb+i∑a<dηaχa,H=(∑k=03dqkk!)(∑S⊆{0,…,d−1}f(S)∏a∈Sincreasingχa).q= \frac{i}{2}\sum_{a,b<d}A_{ab}\theta_a\theta_b +i\sum_{a,b<d}B_{ab}\theta_a\eta_b +\frac{i}{2}\sum_{a,b<d}D_{ab}\eta_a\eta_b +i\sum_{a<d}\eta_a\chi_a, \qquad H=\left(\sum_{k=0}^{3d}\frac{q^k}{k!}\right) \left(\sum_{S\subseteq\{0,\ldots,d-1\}}f(S)\prod_{a\in S}^{\text{increasing}}\chi_a\right).q=2i​a,b<d∑​Aab​θa​θb​+ia,b<d∑​Bab​θa​ηb​+2i​a,b<d∑​Dab​ηa​ηb​+ia<d∑​ηa​χa​,H=(k=0∑3d​k!qk​)​S⊆{0,…,d−1}∑​f(S)a∈S∏increasing​χa​​.

The defined evaluation is the coefficient function on subsets S⊆{0,…,d−1}S\subseteq\{0,\ldots,d-1\}S⊆{0,…,d−1} whose value is

C (−1)2d∣S∣ H ⁣(S∪{d,…,3d−1}).C\,(-1)^{2d|S|}\, H\!\left(S\cup\{d,\ldots,3d-1\}\right).C(−1)2d∣S∣H(S∪{d,…,3d−1}).

Thus the integration operation extracts coefficients containing every index from the last two blocks, with the displayed sign, which here equals 111. Empty products are the identity; when n=0n=0n=0, the evaluation is simply CfC fCf.

QAlgorithms.Papers.Independent.Intake100.P22.lambdaOp

For every natural number nnn and every family cac_aca​ of complex matrices on the basis {0,1}n\{0,1\}^n{0,1}n, indexed by 0≤a<2n0\le a<2n0≤a<2n, satisfying ca†=cac_a^\dagger=c_aca†​=ca​ and cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I, this defines the matrix

Λ=∑a=02n−1ca⊗ca\Lambda=\sum_{a=0}^{2n-1}c_a\otimes c_aΛ=a=0∑2n−1​ca​⊗ca​

on the basis {0,1}n×{0,1}n\{0,1\}^n\times\{0,1\}^n{0,1}n×{0,1}n. Explicitly, its entry at row (x,y)(x,y)(x,y) and column (x′,y′)(x',y')(x′,y′) is ∑a(ca)xx′(ca)yy′\sum_a(c_a)_{xx'}(c_a)_{yy'}∑a​(ca​)xx′​(ca​)yy′​. When n=0n=0n=0, the sum is empty and the resulting matrix is zero.

QAlgorithms.Papers.Independent.Intake100.P22.majoranaSymbol

For every natural number nnn, including 000, let Bn\mathcal B_nBn​ be the set of nnn-bit strings and Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}. Let sss consist of complex matrices γa\gamma_aγa​, indexed by a∈Jna\in J_na∈Jn​ and acting on CBn\mathbb C^{\mathcal B_n}CBn​, satisfying γa†=γa\gamma_a^\dagger=\gamma_aγa†​=γa​ and γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For any complex matrix XXX on this space, its defined symbol is the complex coefficient function on subsets S⊆JnS\subseteq J_nS⊆Jn​ given by

X^s(S)=2−ntr⁡ ⁣(γS†X),γS=γa1⋯γak(a1<⋯<ak, S={a1,…,ak}).\widehat X_s(S)=2^{-n}\operatorname{tr}\!\left(\gamma_S^\dagger X\right), \qquad \gamma_S=\gamma_{a_1}\cdots\gamma_{a_k} \quad(a_1<\cdots<a_k,\ S=\{a_1,\ldots,a_k\}).Xs​(S)=2−ntr(γS†​X),γS​=γa1​​⋯γak​​(a1​<⋯<ak​, S={a1​,…,ak​}).

The empty product is III, so X^s(∅)=2−ntr⁡X\widehat X_s(\varnothing)=2^{-n}\operatorname{tr}XXs​(∅)=2−ntrX. No positivity, Hermiticity, or normalization is required of XXX; when n=0n=0n=0, this is a function on the single subset ∅\varnothing∅, with value tr⁡X\operatorname{tr}XtrX.

QAlgorithms.Papers.Independent.Intake100.P22.measurementEval

For every natural number nnn, index 0≤j<n0\le j<n0≤j<n, Boolean outcome ooo, and complex-valued function fff on the subsets of {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, this defines another such function as follows. Work with subset-coefficient functions on {0,…,6n−1}\{0,\ldots,6n-1\}{0,…,6n−1}, with unit 1(S)=11(S)=11(S)=1 for S=∅S=\varnothingS=∅ and 000 otherwise, generators ξr(S)=1\xi_r(S)=1ξr​(S)=1 for S={r}S=\{r\}S={r} and 000 otherwise, and multiplication

(u∗v)(S)=∑U∩V=∅U∪V=S(−1) ∣{(r,s)∈U×V:s<r}∣u(U)v(V).(u*v)(S)= \sum_{\substack{U\cap V=\varnothing\\U\cup V=S}} (-1)^{\,|\{(r,s)\in U\times V:s<r\}|}u(U)v(V).(u∗v)(S)=U∩V=∅U∪V=S​∑​(−1)∣{(r,s)∈U×V:s<r}∣u(U)v(V).

Set a=2ja=2ja=2j, b=2j+1b=2j+1b=2j+1, and εo=−1\varepsilon_o=-1εo​=−1 for a true outcome and 111 for a false outcome, and form

q=εo i(ξa∗ξb−ξ2n+a∗ξ2n+b)+i∑0≤c<2nc≠a, c≠bξc∗ξ2n+c+i∑c=02n−1ξ2n+c∗ξ4n+c,g=(∑r=06nq∗rr!)∗(∑U⊆{0,…,2n−1}f(U)∏∗c∈U in increasing orderξ4n+c),\begin{aligned} q={}&\varepsilon_o\,\mathrm{i} (\xi_a*\xi_b-\xi_{2n+a}*\xi_{2n+b}) +\mathrm{i}\sum_{\substack{0\le c<2n\\c\ne a,\ c\ne b}} \xi_c*\xi_{2n+c} +\mathrm{i}\sum_{c=0}^{2n-1}\xi_{2n+c}*\xi_{4n+c},\\ g={}& \left(\sum_{r=0}^{6n}\frac{q^{*r}}{r!}\right)* \left(\sum_{U\subseteq\{0,\ldots,2n-1\}} f(U)\mathop{\prod\nolimits^{*}}_{c\in U\text{ in increasing order}}\xi_{4n+c}\right), \end{aligned}q=g=​εo​i(ξa​∗ξb​−ξ2n+a​∗ξ2n+b​)+i0≤c<2nc=a, c=b​∑​ξc​∗ξ2n+c​+ic=0∑2n−1​ξ2n+c​∗ξ4n+c​,(r=0∑6n​r!q∗r​)∗​U⊆{0,…,2n−1}∑​f(U)∏∗c∈U in increasing order​ξ4n+c​​,​

where q∗0=1q^{*0}=1q∗0=1, q∗(r+1)=q∗q∗rq^{*(r+1)}=q*q^{*r}q∗(r+1)=q∗q∗r, and an empty ordered product is 111. The returned coefficient at a subset S⊆{0,…,2n−1}S\subseteq\{0,\ldots,2n-1\}S⊆{0,…,2n−1} is

12 g(S∪{2n,…,6n−1}).\frac12\,g\bigl(S\cup\{2n,\ldots,6n-1\}\bigr).21​g(S∪{2n,…,6n−1}).

This coefficient extraction expands the supplied integration rule: its sign is (−1)4n∣S∣=1(-1)^{4n|S|}=1(−1)4n∣S∣=1. There is no restriction on fff, and n=0n=0n=0 admits no index jjj.

QAlgorithms.Papers.Independent.Intake100.P22.modeProjector

For every natural number nnn, every family of complex matrices cac_aca​ indexed by a∈{0,…,2n−1}a\in\{0,\ldots,2n-1\}a∈{0,…,2n−1} on the space with basis {0,1}n\{0,1\}^n{0,1}n, satisfying ca†=cac_a^\dagger=c_aca†​=ca​ and cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I, every j∈{0,…,n−1}j\in\{0,\ldots,n-1\}j∈{0,…,n−1}, and every Boolean outcome ooo, this defines

12(I+εo i c2jc2j+1),εo={−1,o=true,1,o=false.\frac12\left(I+\varepsilon_o\,\mathrm{i}\,c_{2j}c_{2j+1}\right), \qquad \varepsilon_o= \begin{cases} -1,&o=\mathrm{true},\\ 1,&o=\mathrm{false}. \end{cases}21​(I+εo​ic2j​c2j+1​),εo​={−1,1,​o=true,o=false.​

Here III is the identity on the bit-string basis. The argument jjj can exist only when n≥1n\ge1n≥1.

QAlgorithms.Papers.Independent.Intake100.P22.normalizeComplexTrace

For every natural number nnn and every complex matrix XXX whose rows and columns are indexed by the bit strings {0,1}n\{0,1\}^n{0,1}n, this defines

(tr⁡X)−1X,tr⁡X=∑z∈{0,1}nXzz.(\operatorname{tr}X)^{-1}X, \qquad \operatorname{tr}X=\sum_{z\in\{0,1\}^n}X_{zz}.(trX)−1X,trX=z∈{0,1}n∑​Xzz​.

The inverse is the complex reciprocal, with 0−1=00^{-1}=00−1=0, so a matrix of trace zero is sent to the zero matrix. No positivity or Hermiticity condition is imposed, and n=0n=0n=0 is included.

QAlgorithms.Papers.Independent.Intake100.P22.operatorFromSymbol

For every natural number nnn, let Hn=C{0,1}n\mathcal H_n=\mathbb C^{\{0,1\}^n}Hn​=C{0,1}n, and let sss supply Hermitian matrices γa\gamma_aγa​, 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For any coefficient function f:P({0,…,2n−1})→Cf:\mathcal P(\{0,\ldots,2n-1\})\to\mathbb Cf:P({0,…,2n−1})→C, this defines the matrix

∑S⊆{0,…,2n−1}f(S) γS,γS=γa1⋯γak(a1<⋯<ak, S={a1,…,ak}),\sum_{S\subseteq\{0,\ldots,2n-1\}} f(S)\,\gamma_S, \qquad \gamma_S=\gamma_{a_1}\cdots\gamma_{a_k} \quad(a_1<\cdots<a_k,\ S=\{a_1,\ldots,a_k\}),S⊆{0,…,2n−1}∑​f(S)γS​,γS​=γa1​​⋯γak​​(a1​<⋯<ak​, S={a1​,…,ak​}),

with γ∅=I\gamma_\varnothing=Iγ∅​=I. There are no assumptions on fff, and no positivity or normalization requirement on the resulting matrix. When n=0n=0n=0, the result is f(∅)If(\varnothing)If(∅)I on the one-dimensional space indexed by the unique empty bit string.

QAlgorithms.Papers.Independent.Intake100.P22.ordinaryExtension

For every natural number nnn, including n=0n=0n=0, and any function EEE on complex matrices indexed by Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, this definition gives a function E~\widetilde EE on matrices indexed by Qn×QnQ_n\times Q_nQn​×Qn​: for every such matrix ZZZ and every u,v,r,s∈Qnu,v,r,s\in Q_nu,v,r,s∈Qn​,

E~(Z)(u,r),(v,s)=E ⁣([Z(x,r),(y,s)]x,y∈Qn)u,v.\widetilde E(Z)_{(u,r),(v,s)} = E\!\left(\bigl[Z_{(x,r),(y,s)}\bigr]_{x,y\in Q_n}\right)_{u,v}.E(Z)(u,r),(v,s)​=E([Z(x,r),(y,s)​]x,y∈Qn​​)u,v​.

Thus each matrix block obtained by fixing the second row and column coordinates is supplied to EEE. No property of EEE is assumed in defining this function.

QAlgorithms.Papers.Independent.Intake100.P22.pfaffian

For every natural number ddd and every complex d×dd\times dd×d matrix MMM, this defines a complex number F([0,…,d−1])F([0,\ldots,d-1])F([0,…,d−1]), where FFF is computed recursively from ordered lists by

F([])=1,F([i0,…,ir−1])=∑q=1r−1(−1)q−1Mi0iqF([i1,…,iq^,…,ir−1]).F([])=1,\qquad F([i_0,\ldots,i_{r-1}]) =\sum_{q=1}^{r-1}(-1)^{q-1}M_{i_0i_q} F([i_1,\ldots,\widehat{i_q},\ldots,i_{r-1}]).F([])=1,F([i0​,…,ir−1​])=q=1∑r−1​(−1)q−1Mi0​iq​​F([i1​,…,iq​​,…,ir−1​]).

The hat means that the indicated occurrence is deleted while the other entries retain their order. This is the supplied finite-fuel recursion with initial fuel ddd; that fuel suffices for this list. In particular, the value is 111 when d=0d=0d=0 and 000 when ddd is odd. No skew-symmetry assumption on MMM is imposed.

QAlgorithms.Papers.Independent.Intake100.P22.productState

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss provide Hermitian matrices cac_aca​ on CQn\mathbb C^{Q_n}CQn​, indexed by 0≤a<2n0\le a<2n0≤a<2n, satisfying cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. For every real-valued function λ:{0,…,n−1}→R\lambda:\{0,\ldots,n-1\}\to\mathbb Rλ:{0,…,n−1}→R, this definition returns

2−n(I+iλ0c0c1)(I+iλ1c2c3)⋯(I+iλn−1c2n−2c2n−1),2^{-n} \bigl(I+i\lambda_0c_0c_1\bigr) \bigl(I+i\lambda_1c_2c_3\bigr) \cdots \bigl(I+i\lambda_{n-1}c_{2n-2}c_{2n-1}\bigr),2−n(I+iλ0​c0​c1​)(I+iλ1​c2​c3​)⋯(I+iλn−1​c2n−2​c2n−1​),

with the factors multiplied in increasing order of their indices. The parameters λj\lambda_jλj​ are unrestricted real numbers. For n=0n=0n=0, the product is empty and equals the identity on the one-dimensional space indexed by the empty bit string.

QAlgorithms.Papers.Independent.Intake100.P22.quadraticHamiltonian

For every natural number nnn, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss provide Hermitian matrices cac_aca​ on CQn\mathbb C^{Q_n}CQn​, indexed by 0≤a<2n0\le a<2n0≤a<2n, satisfying cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. For any real 2n×2n2n\times2n2n×2n matrix HHH, this definition returns the complex matrix

i4∑a=02n−1∑b=02n−1Habcacb,\frac{i}{4}\sum_{a=0}^{2n-1}\sum_{b=0}^{2n-1}H_{ab}c_ac_b,4i​a=0∑2n−1​b=0∑2n−1​Hab​ca​cb​,

where the real entries of HHH are regarded as complex scalars. There is no skew-symmetry condition on HHH in this definition. For n=0n=0n=0, the sum is empty and the returned matrix is zero on the one-dimensional space indexed by the unique empty bit string.

QAlgorithms.Papers.Independent.Intake100.P22.quantumRun

For every natural number nnn, let Hn=C{0,1}n\mathcal H_n=\mathbb C^{\{0,1\}^n}Hn​=C{0,1}n, and let sss supply Hermitian matrices γa\gamma_aγa​, indexed by 0≤a<2n0\le a<2n0≤a<2n, satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. This defines an operator-valued execution tree for any program and any matrix XXX on Hn\mathcal H_nHn​, without requiring XXX to be positive or normalized. Programs are built from stopping, a unary instruction containing real matrices H,RH,RH,R with HT=−HH^{\mathsf T}=-HHT=−H, RRT=IRR^{\mathsf T}=IRRT=I, det⁡R=1\det R=1detR=1, and eH=Re^H=ReH=R, and a measurement instruction choosing j<nj<nj<n with two continuation programs. Set

VH=exp⁡ ⁣(i(i4∑a,b=02n−1Habγaγb)),Pj,o=12(I+εoi γ2jγ2j+1),εfalse=1,εtrue=−1.V_H=\exp\!\left(i\left(\frac{i}{4}\sum_{a,b=0}^{2n-1}H_{ab}\gamma_a\gamma_b\right)\right), \qquad P_{j,o}=\frac12\left(I+\varepsilon_o i\,\gamma_{2j}\gamma_{2j+1}\right), \quad \varepsilon_{\mathrm{false}}=1,\quad \varepsilon_{\mathrm{true}}=-1.VH​=exp​i​4i​a,b=0∑2n−1​Hab​γa​γb​​​,Pj,o​=21​(I+εo​iγ2j​γ2j+1​),εfalse​=1,εtrue​=−1.

Stopping returns a terminal node labelled XXX. A unary instruction returns a unary node labelled with the incoming XXX, whose child executes its continuation on VHXVH†V_HXV_H^\daggerVH​XVH†​; its stored RRR and proofs are unused in this recursion. A measurement returns a binary node labelled XXX, with its false continuation executed on Pj,falseXPj,false†P_{j,\mathrm{false}}XP_{j,\mathrm{false}}^\daggerPj,false​XPj,false†​ and its true continuation executed on Pj,trueXPj,true†P_{j,\mathrm{true}}XP_{j,\mathrm{true}}^\daggerPj,true​XPj,true†​. These branch matrices are not normalized. The definition includes n=0n=0n=0, when no measurement index j<nj<nj<n exists.

QAlgorithms.Papers.Independent.Intake100.P22.regularCorrelation

For every natural number nnn, including 000, let Bn\mathcal B_nBn​ be the nnn-bit strings and let (γa)a∈Jn(\gamma_a)_{a\in J_n}(γa​)a∈Jn​​, Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}, be Hermitian complex matrices on CBn\mathbb C^{\mathcal B_n}CBn​ satisfying γaγb+γbγa=2δabI\gamma_a\gamma_b+\gamma_b\gamma_a=2\delta_{ab}Iγa​γb​+γb​γa​=2δab​I. For any complex matrix XXX on this space, the defined complex Jn×JnJ_n\times J_nJn​×Jn​ matrix has entries

i2tr⁡X tr⁡ ⁣(X(γaγb−γbγa)).\frac{i}{2\operatorname{tr}X}\, \operatorname{tr}\!\left(X(\gamma_a\gamma_b-\gamma_b\gamma_a)\right).2trXi​tr(X(γa​γb​−γb​γa​)).

There is no assumption that XXX is positive, Hermitian, normalized, or of nonzero trace. Division uses the total complex-field convention 0−1=00^{-1}=00−1=0, so if tr⁡X=0\operatorname{tr}X=0trX=0, every entry is 000. When n=0n=0n=0, the resulting matrix has no entries.

QAlgorithms.Papers.Independent.Intake100.P22.singularForm

For every natural number nnn, natural number kkk, complex scalar CCC, and arbitrary complex matrices T,MT,MT,M indexed by {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, this defines a complex-valued function on subsets of that index set. Let ξb(S)=1\xi_b(S)=1ξb​(S)=1 when S={b}S=\{b\}S={b} and 000 otherwise, and put μa=∑b=02n−1Tabξb\mu_a=\sum_{b=0}^{2n-1}T_{ab}\xi_bμa​=∑b=02n−1​Tab​ξb​. For subset-coefficient functions use the multiplication

(u∗v)(S)=∑U∩V=∅U∪V=S(−1) ∣{(r,s)∈U×V:s<r}∣u(U)v(V),(u*v)(S)= \sum_{\substack{U\cap V=\varnothing\\U\cup V=S}} (-1)^{\,|\{(r,s)\in U\times V:s<r\}|}u(U)v(V),(u∗v)(S)=U∩V=∅U∪V=S​∑​(−1)∣{(r,s)∈U×V:s<r}∣u(U)v(V),

whose unit is supported at the empty subset. With

q=i2∑0≤a,b<2n2k≤a, 2k≤bMab(μa∗μb),q=\frac{\mathrm{i}}2 \sum_{\substack{0\le a,b<2n\\2k\le a,\ 2k\le b}} M_{ab}(\mu_a*\mu_b),q=2i​0≤a,b<2n2k≤a, 2k≤b​∑​Mab​(μa​∗μb​),

the defined function is

C(∏∗0≤a<2na<2k in increasing orderμa)∗(∑r=02nq∗rr!),C\left(\mathop{\prod\nolimits^{*}}_{\substack{0\le a<2n\\a<2k} \text{ in increasing order}}\mu_a\right)* \left(\sum_{r=0}^{2n}\frac{q^{*r}}{r!}\right),C(∏∗0≤a<2na<2k​ in increasing order​μa​)∗(r=0∑2n​r!q∗r​),

where empty products and zeroth powers are the unit, and q∗(r+1)=q∗q∗rq^{*(r+1)}=q*q^{*r}q∗(r+1)=q∗q∗r. There is no assumption that k≤nk\le nk≤n, that TTT is invertible, or that MMM is skew-symmetric. If k≥nk\ge nk≥n, the first product includes all 2n2n2n indices and q=0q=0q=0; if n=0n=0n=0, the result has its sole coefficient equal to CCC.

QAlgorithms.Papers.Independent.Intake100.P22.symbolCorrelation

For every natural number nnn and every arbitrary coefficient function f:P({0,…,2n−1})→Cf:\mathcal P(\{0,\ldots,2n-1\})\to\mathbb Cf:P({0,…,2n−1})→C, this defines a complex 2n×2n2n\times2n2n×2n matrix CCC by

Cab={0,a=b,−i f({a,b})/f(∅),a<b,i f({a,b})/f(∅),b<a.C_{ab}= \begin{cases} 0,&a=b,\\[2pt] -i\,f(\{a,b\})/f(\varnothing),&a<b,\\[2pt] i\,f(\{a,b\})/f(\varnothing),&b<a. \end{cases}Cab​=⎩⎨⎧​0,−if({a,b})/f(∅),if({a,b})/f(∅),​a=b,a<b,b<a.​

No condition requires f(∅)≠0f(\varnothing)\ne0f(∅)=0: complex division is total, so when f(∅)=0f(\varnothing)=0f(∅)=0, every entry is zero. For n=0n=0n=0, this is the matrix on an empty index set.

QAlgorithms.Papers.Independent.Intake100.P22.symbolWeight

For every natural number nnn and every coefficient function f:P({0,…,2n−1})→Cf:\mathcal P(\{0,\ldots,2n-1\})\to\mathbb Cf:P({0,…,2n−1})→C, this defines the real number

Re⁡ ⁣(2nf(∅)).\operatorname{Re}\!\left(2^n f(\varnothing)\right).Re(2nf(∅)).

There are no positivity, normalization, or reality assumptions on fff, so this number need not be nonnegative. For n=0n=0n=0, it is Re⁡f(∅)\operatorname{Re}f(\varnothing)Ref(∅).

QAlgorithms.Papers.Independent.Intake100.P22.symbolicRun

For every natural number nnn, put d=2nd=2nd=2n. A symbol is an arbitrary coefficient function fff from subsets of {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} to C\mathbb CC, represented as ∑Sf(S)ξS\sum_S f(S)\xi_S∑S​f(S)ξS​, where ξS\xi_SξS​ is the product of its generators in increasing order, generators anticommute, and each generator squares to zero. Write Eq(Q)=∑k=0qQk/k!E_q(Q)=\sum_{k=0}^{q}Q^k/k!Eq​(Q)=∑k=0q​Qk/k! in the exterior algebra on qqq generators. In the algebra on 3d3d3d generators, let θ,η,ζ\theta,\eta,\zetaθ,η,ζ be its three consecutive blocks of ddd generators, write f(ζ)=∑Sf(S)ζSf(\zeta)=\sum_S f(S)\zeta_Sf(ζ)=∑S​f(S)ζS​, and let J(F)(S)J(F)(S)J(F)(S) be the coefficient in FFF of the monomial containing θS\theta_SθS​ and every η\etaη- and ζ\zetaζ-generator. This coefficient extraction equals the supplied integration operation here because its sign is (−1)2d∣S∣=1(-1)^{2d|S|}=1(−1)2d∣S∣=1. Define

KRf=J ⁣(E3d ⁣(i∑a,b<dRbaθaηb+i∑a<dηaζa)f(ζ)),K_Rf =J\!\left(E_{3d}\!\left(i\sum_{a,b<d}R_{ba}\theta_a\eta_b+i\sum_{a<d}\eta_a\zeta_a\right)f(\zeta)\right),KR​f=J​E3d​​ia,b<d∑​Rba​θa​ηb​+ia<d∑​ηa​ζa​​f(ζ)​,

and, for j<nj<nj<n, a=2ja=2ja=2j, b=2j+1b=2j+1b=2j+1, and εfalse=1,εtrue=−1\varepsilon_{\mathrm{false}}=1,\varepsilon_{\mathrm{true}}=-1εfalse​=1,εtrue​=−1, define

Mj,of=12J ⁣(E3d ⁣(εoi(θaθb−ηaηb)+i∑c<dc≠a,bθcηc+i∑c<dηcζc)f(ζ)).M_{j,o}f =\frac12J\!\left(E_{3d}\!\left( \varepsilon_o i(\theta_a\theta_b-\eta_a\eta_b) +i\sum_{\substack{c<d\\c\ne a,b}}\theta_c\eta_c +i\sum_{c<d}\eta_c\zeta_c\right)f(\zeta)\right).Mj,o​f=21​J​E3d​​εo​i(θa​θb​−ηa​ηb​)+ic<dc=a,b​∑​θc​ηc​+ic<d∑​ηc​ζc​​f(ζ)​.

The definition executes a program built from stopping, unary instructions containing real H,RH,RH,R with HT=−HH^{\mathsf T}=-HHT=−H, RRT=IRR^{\mathsf T}=IRRT=I, det⁡R=1\det R=1detR=1, and eH=Re^H=ReH=R, and measurements with false and true continuations: stopping gives a terminal node labelled fff; a unary instruction gives a unary node labelled fff and runs its continuation on KRfK_RfKR​f; a measurement gives a binary node labelled fff and runs its false and true continuations on Mj,falsefM_{j,\mathrm{false}}fMj,false​f and Mj,truefM_{j,\mathrm{true}}fMj,true​f, respectively. The recursion uses RRR, while ignoring the instruction’s HHH and proofs; it imposes no positivity or normalization condition on symbols. It includes n=0n=0n=0, when measurement instructions cannot occur.

QAlgorithms.Papers.Independent.Intake100.P22.treeLeaves

For any type AAA, this defines a list of terminal-node values in a finite tree with AAA-valued terminal, unary, and ordered binary measurement nodes. A terminal node carrying vvv contributes [v][v][v]; a unary node contributes only its child’s terminal values; and a measurement node contributes its first child’s terminal values followed by its second child’s terminal values. Values stored at nonterminal nodes are omitted, and repeated terminal values remain repeated.

QAlgorithms.Papers.Independent.Intake100.P22.treeMap

For any types A,BA,BA,B, including possibly empty types, and any function f:A→Bf:A\to Bf:A→B, this defines a transformation of finite trees whose nodes carry values in AAA. Such a tree has either a terminal node carrying one value, a unary node carrying a value and one child, or a binary measurement node carrying a value and two ordered children. The transformation applies fff to every node value while preserving each node’s kind and the ordering and structure of its children: a terminal value vvv becomes a terminal value f(v)f(v)f(v), a unary node (v,t)(v,t)(v,t) becomes (f(v),treeMap⁡f(t))(f(v),\operatorname{treeMap}_f(t))(f(v),treeMapf​(t)), and a measurement node (v,t,u)(v,t,u)(v,t,u) becomes (f(v),treeMap⁡f(t),treeMap⁡f(u))(f(v),\operatorname{treeMap}_f(t),\operatorname{treeMap}_f(u))(f(v),treeMapf​(t),treeMapf​(u)).

QAlgorithms.Papers.Independent.Intake100.P22.treeValues

For any type AAA, this defines a list of all values in a finite tree with AAA-valued terminal, unary, and ordered binary measurement nodes. A terminal node carrying vvv contributes the singleton list [v][v][v]; a unary node carrying vvv contributes vvv followed by the list from its child; and a measurement node carrying vvv contributes vvv, then all values from its first child, then all values from its second child. Thus the order is preorder traversal, with the first measurement branch preceding the second; repeated values remain repeated.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me