Definitions for Lagrangian representation for fermionic linear optics
DefinitionQAlgorithms_Papers_Independent_Intake100_P22The 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.
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
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 , including , and any function on complex matrices indexed by , this predicate means that both for every complex matrix and , where is the identity matrix on . These are the two conditions imposed by the definition.
QAlgorithms.Papers.Independent.Intake100.P22.ComplexLinear
For any index type , with no finiteness, nonemptiness, or decidable-equality assumption, and any function from complex matrices to complex matrices, the defined condition is that for every two such matrices and every ,
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 , including , this declaration defines a type of finite recursively constructed programs with three constructors: a stopping program; a unitary node carrying real matrices , proofs that , , , and , together with one continuation program for the same ; and a measurement node carrying an index together with two continuation programs, designated zero and one, again for the same . Here is the matrix exponential. These constructors specify program data and impose no further conditions on the continuations. At , stopping and unitary nodes are available, while measurement nodes cannot be formed because there is no such index .
QAlgorithms.Papers.Independent.Intake100.P22.FermionicGaussianState
For every natural number , let be the -bit strings and let , where , be Hermitian complex matrices on satisfying . A complex matrix satisfies the defined condition precisely when there exists a real matrix such that , is positive semidefinite with trace , and
Here is the increasing-order product of the matrices indexed by , with empty product . The right side is a coefficient function on subsets of , with , identity , and multiplication for intersecting subsets and otherwise. The existentially quantified need not be unique. The case is included and requires to be the scalar matrix .
QAlgorithms.Papers.Independent.Intake100.P22.FullTracePreserving
For every natural number , including , and any function from complex matrices indexed by the -bit strings to matrices of the same size, this predicate means that for every complex matrix . 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 , let , and let consist of Hermitian matrices , indexed by , satisfying . A function on complex matrices indexed by satisfies this predicate precisely when there exist complex matrices and a complex scalar , with and , such that for all matrices and complex scalars , and, for every ,
Here for every subset of the Majorana indices, with the increasing ordered product and . The three blocks each contain Grassmann generators. Their coefficient multiplication sums over disjoint subsets whose union is the requested subset, with sign ; the unit is supported at the empty subset. The exponential is the finite sum , and uses increasing ordered products of the substituted generators. For each subset of the -block, extracts the coefficient indexed by and all - and -generators, with sign . The existentially quantified kernel need not be unique. The case , with empty generator sets and a one-dimensional matrix space, is included.
QAlgorithms.Papers.Independent.Intake100.P22.GaussianOperator
For every natural number , let be the -bit strings and let , , be Hermitian complex matrices on satisfying . A complex matrix satisfies the defined condition precisely when it belongs to the closure, in the usual finite-dimensional matrix topology, of the set of matrices for which and there exists a complex skew-symmetric matrix satisfying
Here is the increasing-order product, with empty product ; the coefficient algebra has basis , generators , identity , and multiplication zero for intersecting subsets and otherwise. Thus can be a limit of such ; the definition imposes no positivity, Hermiticity, normalization, or nonzero-trace condition directly on . The case is included.
QAlgorithms.Papers.Independent.Intake100.P22.Grass
For every natural number , let . Then is the space of all functions from the finite subsets of to , with no restrictions on their values. In particular, when , such a function has just one value, its value at the empty set.
QAlgorithms.Papers.Independent.Intake100.P22.GrassmannKernel
For any natural number , including , an object of this structure consists of three complex matrices , each with rows and columns indexed by , and a complex scalar , together with the requirements
These are ordinary transpose conditions, without complex conjugation. There is no additional condition on or , and no positivity, invertibility, or normalization requirement. When , all three matrices are empty and only the scalar remains unrestricted.
QAlgorithms.Papers.Independent.Intake100.P22.HasGrassmannKernel
For any natural number , let , and let consist of Hermitian matrices on satisfying . Let be any function from complex matrices on to complex matrices on , and let , where are complex matrices, , , and . This predicate means that for every pair of matrices and every , and that, for every matrix ,
Here is the coefficient function on subsets given by , where is the product of the in increasing order, with empty product . The symbols are three consecutive blocks of Grassmann generators. For coefficient functions on subsets of an ordered -element set, multiplication is defined by
the unit has coefficient at the empty set and elsewhere, and in the expression above. Substitution replaces each subset coefficient by the corresponding product of -generators in increasing order. The operation assigns to a subset of the first block the coefficient at together with every generator in the last two blocks; its defining sign is . The definition includes , when all generator blocks are empty and the matrix space is one-dimensional.
QAlgorithms.Papers.Independent.Intake100.P22.ImplementsRotation
For every natural number , every family of complex matrices on the basis , indexed by , satisfying and , every complex matrix on that same basis, and every real matrix , this predicate means
The matrices and are otherwise unrestricted by this definition. When , the universally quantified index set is empty, so the predicate holds for every such .
QAlgorithms.Papers.Independent.Intake100.P22.InSector
For every natural number , let be the -bit strings and let , , be Hermitian complex matrices on satisfying . Given any natural number and any complex matrix on this space, the defined condition is
where is the increasing-order product, with empty product . Thus requires all odd-cardinality coefficients to vanish, requires all even-cardinality coefficients to vanish, and requires every coefficient to vanish. No positivity or normalization is assumed. For , imposes no condition, while every requires .
QAlgorithms.Papers.Independent.Intake100.P22.IsCanonicalFLO
For every natural number , let , and let consist of Hermitian matrices , indexed by , with . A complex matrix on satisfies this predicate precisely when there exists a real matrix such that and
The matrix is not required to be unique. For , the empty sum is zero, so this predicate requires .
QAlgorithms.Papers.Independent.Intake100.P22.LinearCompletelyPositive
For every natural number , including , put , and let be any function. This predicate means that for all complex matrices and complex scalars , and that the function defined by
maps every positive semidefinite matrix on to a positive semidefinite matrix. The extension tested here has its second index set equal to .
QAlgorithms.Papers.Independent.Intake100.P22.ParityPreserving
For every natural number , let be the -bit strings and let , , be Hermitian complex matrices on satisfying . An arbitrary function from complex matrices on this space to complex matrices on the same space satisfies the defined condition precisely when, for each and every matrix ,
where is the increasing-order product, with empty product . No linearity, positivity, trace preservation, or channel property is required of , and ranges over all matrices. The case is included.
QAlgorithms.Papers.Independent.Intake100.P22.PositiveMap
For any finite index type , equipped with a specified finite enumeration, and any function , this predicate means that is positive semidefinite whenever is positive semidefinite. The quantifier ranges over every matrix , 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 equipped with decidable equality and every complex matrix indexed by , this predicate means precisely that every entry has zero imaginary part and that
is positive semidefinite. Here in the displayed expression denotes the identity matrix, and 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 , let be the -bit strings and let , , be Hermitian complex matrices on satisfying . For a complex matrix on this space and a complex matrix , the defined condition means that , , and
Here is the increasing-order product, with empty product . The right side lies in the algebra of complex coefficient functions on subsets, with , identity , and multiplication if the subsets intersect, and otherwise . No positivity or Hermiticity of , and no reality of , is required. For , the matrix is empty and the condition is exactly that the scalar matrix be nonzero.
QAlgorithms.Papers.Independent.Intake100.P22.Rotation
For every natural number , a real matrix whose rows and columns are indexed by satisfies this predicate precisely when
The case is included: the unique empty matrix satisfies the identity equation and has determinant .
QAlgorithms.Papers.Independent.Intake100.P22.RunTree
For any type , with no finiteness or other assumptions, this declaration defines a type of finite recursively constructed trees whose nodes carry values in . 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 , and no conditions relate the values at different nodes. If is empty, no tree can be formed, since every constructor requires a value in .
QAlgorithms.Papers.Independent.Intake100.P22.StateWith
For every natural number , let be the -bit strings, , and let be Hermitian complex matrices on satisfying . For a complex matrix on this space and a real matrix , the defined condition holds precisely when is positive semidefinite with , , and the following equality of coefficient functions on subsets of holds:
Here is the product of the in increasing index order, with empty product . On the right, in the coefficient algebra with basis ; its multiplication is if , and otherwise
with identity . Thus the exponential displayed is exactly the finite sum through degree . The definition includes , when is empty and the condition reduces to the single entry of being .
QAlgorithms.Papers.Independent.Intake100.P22.basisOp
For every natural number , let be a family of complex matrices indexed by , acting on the space with basis indexed by all Boolean strings of length , such that each is Hermitian and
For every subset , this defines to be the matrix product , where lists the elements of . The empty subset gives the identity matrix. In particular, when , 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 , , and , this defines a family indexed by of complex-valued functions on subsets . The function indexed by has value exactly when and , and has value otherwise. There is no assumption that ; if and , every function in the family is zero. When , the family has no indices.
QAlgorithms.Papers.Independent.Intake100.P22.canonicalFLO
For every natural number , let , and let provide Hermitian matrices satisfying . For any real matrix , this definition returns
where is the matrix exponential. No skew-symmetry condition on is required by this definition. When , 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 , including , let , and let specify Hermitian matrices , for , satisfying . For a subset of these indices, write for its product in increasing index order, with . Given any real-valued function on , this definition gives the function on all complex matrices specified by
Real factors are regarded as complex scalars; no bounds or sign conditions on are required. The empty scalar product is , and when the resulting function is the identity on one-by-one matrices.
QAlgorithms.Papers.Independent.Intake100.P22.doubleBasis
For every natural number , including , let , and let specify Hermitian complex matrices , indexed by for , satisfying . For any subsets , define and as the respective products in increasing index order, taking an empty product to be , and set . The defined matrix, indexed by , is
The order is part of the formula. When , 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 , including , let , and let specify Hermitian matrices , for , satisfying . Write for the increasing-order product over a subset of these indices, with empty product , and put . Given any complex matrix indexed by and any subsets , this definition returns the complex number
where is conjugate transpose and is the Kronecker product. No positivity, Hermiticity, or normalization of is assumed. For , this is the single entry of .
QAlgorithms.Papers.Independent.Intake100.P22.doubleSymbol
For every natural number , including , let , and let specify Hermitian matrices , for , satisfying . Write for the increasing-order product over , taking an empty product to be , and put . For any complex matrix indexed by , this definition returns a complex-valued function on subsets . Specifically, set
Its value at is
No condition is imposed on . When , the only possible subset is empty and its value is the single entry of .
QAlgorithms.Papers.Independent.Intake100.P22.dualReference
For every natural number , including , let , and let specify Hermitian matrices , for , satisfying . Set , with this product taken in increasing index order. This definition gives the matrix indexed by
where the displayed factors are multiplied from left to right in increasing order of , and denotes the Kronecker product. When , the product is empty and the result is the one-by-one identity matrix.
QAlgorithms.Papers.Independent.Intake100.P22.elementaryComposition
For every natural number , including , let , and let specify Hermitian matrices , for , satisfying . Given any real-valued function on these indices, define, for each , the function
where is the increasing-order product and . The declaration defines the function , so the function with the largest index acts first. No restrictions on the real numbers are imposed. When , 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 , let , and let specify Hermitian matrices , for , satisfying . Given an index and an arbitrary real number , the defined function on complex matrices is
where is the product in increasing index order and . The real multiplier is regarded as a complex scalar. No restriction on is imposed. For , there is no index with which to instantiate the definition.
QAlgorithms.Papers.Independent.Intake100.P22.fermionicDual
For every natural number , let , and let specify Hermitian matrices , for , satisfying . Let denote the increasing-order product over a subset , with empty product , put , and define
with factors in increasing index order. For any function , the defined matrix is
All three subset indices range over subsets of , denotes conjugate transpose, and denotes the Kronecker product. No linearity or channel assumption is imposed on . When , this matrix is , viewed as a one-by-one matrix.
QAlgorithms.Papers.Independent.Intake100.P22.fermionicExtension
For every natural number , let , and let specify Hermitian matrices , for , satisfying . For each subset of these indices, let be its increasing-order product, with , and set . Given any function , this definition produces the function sending every matrix to
where each range over all subsets of , and is the matrix Kronecker product. There is no assumption that is linear, positive, or a channel. The case is included: identifying one-by-one matrices with complex numbers, the resulting function is .
QAlgorithms.Papers.Independent.Intake100.P22.firstEmbedding
For every natural number , including , let , and let specify Hermitian complex matrices , indexed by , satisfying . For each subset , write for the product of its in increasing index order, with , and put . For every complex matrix indexed by , with no positivity or normalization requirement, this definition gives the matrix indexed by
Here denotes conjugate transpose and denotes the matrix Kronecker product. When , has one element, and the formula returns the single entry of as a one-by-one matrix.
QAlgorithms.Papers.Independent.Intake100.P22.firstK
For every natural number , this defines a complex matrix with rows and columns indexed by , whose entries are
When , this is the unique matrix on the empty index set.
QAlgorithms.Papers.Independent.Intake100.P22.firstOutcomeSymbol
For every natural number , arbitrary complex number , and arbitrary complex matrix indexed by , this defines a coefficient function on subsets of those indices. Identify such functions with the complex exterior algebra on ordered generators , where generators anticommute, square to zero, and the coefficient at a subset is the coefficient of its increasing ordered monomial. The defined symbol is
The power is the exterior-algebra identity, whose empty-subset coefficient is and other coefficients are zero. A generator whose numerical index lies outside the available range means the zero coefficient function; in particular, for , both displayed generators are zero and the resulting symbol has the sole coefficient . No skew-symmetry or reality condition is imposed on , and is not required to be a probability.
QAlgorithms.Papers.Independent.Intake100.P22.floMeasurementAction
For natural numbers , an index , a Boolean outcome , and arbitrary families , , of complex-valued functions on the subsets of , put , , and let for a true outcome and for a false outcome. This defines the subset-coefficient function
where addition and scalar multiplication are pointwise and the multiplication is explicitly
The families have no additional restrictions; in particular, they need not consist of single generators. The case is included, whereas admits no argument .
QAlgorithms.Papers.Independent.Intake100.P22.grassExp
For every natural number and every function , where , this defines the finite sum of powers through degree ; explicitly, for ,
where the inner sum for is when and otherwise. No hypothesis requires . When , the result has value at its only argument, independently of .
QAlgorithms.Papers.Independent.Intake100.P22.grassIntegrate
For every natural number , every natural number , and every function , where , this defines a function on subsets by
where, in the first case, the elements of are identified with the same numerical indices in . In particular, keeping all indices gives , while keeping zero indices gives the single value . Keeping more than indices gives the zero function.
QAlgorithms.Papers.Independent.Intake100.P22.grassMul
For every natural number and every two functions , where , this defines their product to be the function whose value at is
The sum ranges over ordered pairs of subsets. For , its value is ; when , this is its only value.
QAlgorithms.Papers.Independent.Intake100.P22.grassOne
For every natural number , this defines a complex-valued function on subsets by
This includes , when its only value is .
QAlgorithms.Papers.Independent.Intake100.P22.grassPow
For every natural number , every function , and every natural number , where , this defines the -fold product with coefficients
At , this is for and otherwise; the successor power is formed by multiplying on the left of the preceding power. There is no restriction on , and powers with are also defined.
QAlgorithms.Papers.Independent.Intake100.P22.grassProd
For every natural number and every finite list of functions , where , this defines a function whose value at is
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 at and elsewhere. The definition includes , when the result at is the ordinary product of the listed values at .
QAlgorithms.Papers.Independent.Intake100.P22.grassQuadratic
For all natural numbers , every complex matrix , and every family indexed by , where , this defines a function whose value at is
There is no symmetry or skew-symmetry assumption on , and the family is arbitrary. If , the result is zero; if , its only value is .
QAlgorithms.Papers.Independent.Intake100.P22.grassSubst
For all natural numbers , every function , and every family indexed by , where , this defines a function on subsets by
Thus the factors associated with are multiplied in increasing index order. The empty subset contributes at and zero elsewhere. The family is arbitrary, and or is permitted.
QAlgorithms.Papers.Independent.Intake100.P22.grassVar
For all natural numbers and , this defines a complex-valued function on subsets , whose value is exactly when there is an index with numerical value and , and is otherwise. Thus, if , it is the indicator of the singleton subset ; if , including every case with , it is the zero function.
QAlgorithms.Papers.Independent.Intake100.P22.homogeneousKernel
For every natural number and every complex matrix indexed by in both coordinates, this defines a kernel record with matrix fields , , , and scalar field . The record requires and , which hold for these zero matrices; it imposes no condition on . The case , with empty matrix index sets, is included.
QAlgorithms.Papers.Independent.Intake100.P22.kernelAction
For all natural numbers , let , and let consist of complex matrices and a scalar , with and . Given arbitrary families and of complex coefficient functions on subsets of , the defined action is the coefficient function
For coefficient functions , the product used here is defined at a subset by
The scalar does not occur in this action. No restriction on the degrees of is imposed; is allowed, and when , the action is zero.
QAlgorithms.Papers.Independent.Intake100.P22.kernelBlock
For every natural number and every kernel record consisting of complex matrices , a complex scalar , and the conditions and , this defines the complex block matrix
Its indices are two disjoint copies of ; the transpose in the lower-left block does not conjugate entries. The scalar does not enter this formula. When , the result has an empty index set.
QAlgorithms.Papers.Independent.Intake100.P22.kernelEval
For every natural number , put . Let consist of complex matrices , with and , and a complex scalar ; let be any complex coefficient function on subsets of . Form the coefficient algebra on subsets of , with basis , identity , and multiplication when , and otherwise . Write , , and , and define
The defined evaluation is the coefficient function on subsets whose value is
Thus the integration operation extracts coefficients containing every index from the last two blocks, with the displayed sign, which here equals . Empty products are the identity; when , the evaluation is simply .
QAlgorithms.Papers.Independent.Intake100.P22.lambdaOp
For every natural number and every family of complex matrices on the basis , indexed by , satisfying and , this defines the matrix
on the basis . Explicitly, its entry at row and column is . When , the sum is empty and the resulting matrix is zero.
QAlgorithms.Papers.Independent.Intake100.P22.majoranaSymbol
For every natural number , including , let be the set of -bit strings and . Let consist of complex matrices , indexed by and acting on , satisfying and . For any complex matrix on this space, its defined symbol is the complex coefficient function on subsets given by
The empty product is , so . No positivity, Hermiticity, or normalization is required of ; when , this is a function on the single subset , with value .
QAlgorithms.Papers.Independent.Intake100.P22.measurementEval
For every natural number , index , Boolean outcome , and complex-valued function on the subsets of , this defines another such function as follows. Work with subset-coefficient functions on , with unit for and otherwise, generators for and otherwise, and multiplication
Set , , and for a true outcome and for a false outcome, and form
where , , and an empty ordered product is . The returned coefficient at a subset is
This coefficient extraction expands the supplied integration rule: its sign is . There is no restriction on , and admits no index .
QAlgorithms.Papers.Independent.Intake100.P22.modeProjector
For every natural number , every family of complex matrices indexed by on the space with basis , satisfying and , every , and every Boolean outcome , this defines
Here is the identity on the bit-string basis. The argument can exist only when .
QAlgorithms.Papers.Independent.Intake100.P22.normalizeComplexTrace
For every natural number and every complex matrix whose rows and columns are indexed by the bit strings , this defines
The inverse is the complex reciprocal, with , so a matrix of trace zero is sent to the zero matrix. No positivity or Hermiticity condition is imposed, and is included.
QAlgorithms.Papers.Independent.Intake100.P22.operatorFromSymbol
For every natural number , let , and let supply Hermitian matrices , , satisfying . For any coefficient function , this defines the matrix
with . There are no assumptions on , and no positivity or normalization requirement on the resulting matrix. When , the result is on the one-dimensional space indexed by the unique empty bit string.
QAlgorithms.Papers.Independent.Intake100.P22.ordinaryExtension
For every natural number , including , and any function on complex matrices indexed by , this definition gives a function on matrices indexed by : for every such matrix and every ,
Thus each matrix block obtained by fixing the second row and column coordinates is supplied to . No property of is assumed in defining this function.
QAlgorithms.Papers.Independent.Intake100.P22.pfaffian
For every natural number and every complex matrix , this defines a complex number , where is computed recursively from ordered lists by
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 ; that fuel suffices for this list. In particular, the value is when and when is odd. No skew-symmetry assumption on is imposed.
QAlgorithms.Papers.Independent.Intake100.P22.productState
For every natural number , let , and let provide Hermitian matrices on , indexed by , satisfying . For every real-valued function , this definition returns
with the factors multiplied in increasing order of their indices. The parameters are unrestricted real numbers. For , 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 , let , and let provide Hermitian matrices on , indexed by , satisfying . For any real matrix , this definition returns the complex matrix
where the real entries of are regarded as complex scalars. There is no skew-symmetry condition on in this definition. For , 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 , let , and let supply Hermitian matrices , indexed by , satisfying . This defines an operator-valued execution tree for any program and any matrix on , without requiring to be positive or normalized. Programs are built from stopping, a unary instruction containing real matrices with , , , and , and a measurement instruction choosing with two continuation programs. Set
Stopping returns a terminal node labelled . A unary instruction returns a unary node labelled with the incoming , whose child executes its continuation on ; its stored and proofs are unused in this recursion. A measurement returns a binary node labelled , with its false continuation executed on and its true continuation executed on . These branch matrices are not normalized. The definition includes , when no measurement index exists.
QAlgorithms.Papers.Independent.Intake100.P22.regularCorrelation
For every natural number , including , let be the -bit strings and let , , be Hermitian complex matrices on satisfying . For any complex matrix on this space, the defined complex matrix has entries
There is no assumption that is positive, Hermitian, normalized, or of nonzero trace. Division uses the total complex-field convention , so if , every entry is . When , the resulting matrix has no entries.
QAlgorithms.Papers.Independent.Intake100.P22.singularForm
For every natural number , natural number , complex scalar , and arbitrary complex matrices indexed by , this defines a complex-valued function on subsets of that index set. Let when and otherwise, and put . For subset-coefficient functions use the multiplication
whose unit is supported at the empty subset. With
the defined function is
where empty products and zeroth powers are the unit, and . There is no assumption that , that is invertible, or that is skew-symmetric. If , the first product includes all indices and ; if , the result has its sole coefficient equal to .
QAlgorithms.Papers.Independent.Intake100.P22.symbolCorrelation
For every natural number and every arbitrary coefficient function , this defines a complex matrix by
No condition requires : complex division is total, so when , every entry is zero. For , this is the matrix on an empty index set.
QAlgorithms.Papers.Independent.Intake100.P22.symbolWeight
For every natural number and every coefficient function , this defines the real number
There are no positivity, normalization, or reality assumptions on , so this number need not be nonnegative. For , it is .
QAlgorithms.Papers.Independent.Intake100.P22.symbolicRun
For every natural number , put . A symbol is an arbitrary coefficient function from subsets of to , represented as , where is the product of its generators in increasing order, generators anticommute, and each generator squares to zero. Write in the exterior algebra on generators. In the algebra on generators, let be its three consecutive blocks of generators, write , and let be the coefficient in of the monomial containing and every - and -generator. This coefficient extraction equals the supplied integration operation here because its sign is . Define
and, for , , , and , define
The definition executes a program built from stopping, unary instructions containing real with , , , and , and measurements with false and true continuations: stopping gives a terminal node labelled ; a unary instruction gives a unary node labelled and runs its continuation on ; a measurement gives a binary node labelled and runs its false and true continuations on and , respectively. The recursion uses , while ignoring the instruction’s and proofs; it imposes no positivity or normalization condition on symbols. It includes , when measurement instructions cannot occur.
QAlgorithms.Papers.Independent.Intake100.P22.treeLeaves
For any type , this defines a list of terminal-node values in a finite tree with -valued terminal, unary, and ordered binary measurement nodes. A terminal node carrying contributes ; 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 , including possibly empty types, and any function , this defines a transformation of finite trees whose nodes carry values in . 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 to every node value while preserving each node’s kind and the ordering and structure of its children: a terminal value becomes a terminal value , a unary node becomes , and a measurement node becomes .
QAlgorithms.Papers.Independent.Intake100.P22.treeValues
For any type , this defines a list of all values in a finite tree with -valued terminal, unary, and ordered binary measurement nodes. A terminal node carrying contributes the singleton list ; a unary node carrying contributes followed by the list from its child; and a measurement node carrying contributes , 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.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.