Definitions for Positive maps and trace polynomials from the symmetric group
DefinitionQAlgorithms_Papers_Independent_Extend50_P13The objects the formalized statements of Positive maps and trace polynomials from the symmetric group (arXiv:2002.12887) are stated in. Each was checked against the paper by a blind read-back and a moderator.
tensorFamily: Entrywise finite tensor product in the original factor order (pp.6–7).tensorMatrices: Homogeneous tensor product (pp.6–9).append: Append the output coordinate after the input coordinates (Eq.32).contractInputs: Partial-trace contraction of an arbitrary physical operator, Eq.57, p.14. The indices compute tr_inputs[P (X_1 ⊗ ... ⊗ X_r ⊗ I)].linearContraction: Linearization on the entire joint-input algebra, the first equality of Eq.53, p.13. It is independent of any factorization of the input.copositiveAmplification: Amplification of Z ↦ linearContraction P Z.transpose on a single, arbitrary ancilla (p.13). Transposition is on all input factors, not on the ancilla.centralProjector: Fixed normalized central Young projector, Eq.31, p.9. The partition bound is k, independent of physical d; shapes taller than d remain included. The character is computed from the accepted regular Young ideal, never supplied as a PSD certificate.polarizedMap: Definition 4, Eq.32, p.9, with its original normalization.verticalOperators: Vertical tensor product followed by regrouping into input/output copies of the global register, Eq.45, p.12. No factorization of the input is assumed.mixedMap: Mixed tensor product of the normalized maps, Eq.45–47, p.12.rankOneOperator: Arbitrary, unnormalized rank-one operator |v><w|, Eq.33, p.10.RealNonnegative: Scalar nonnegativity includes reality; discarding the imaginary part alone would not express the source's scalar inequalities (pp.5,14).finiteMatrixElement: Matrix element, with conjugate linearity in the bra, Eq.33.FullyBlockPositive: Full multipartite block positivity, tested on all unnormalized pure product vectors; by convexity this is exactly testing all fully separable states (p.14).PositiveMap: Positivity on every tuple in the positive cone, pp.6,15.DiagonalUnitaryInvariant: Diagonal-unitary invariance of the physical operator, pp.14–15.ConjugationEquivariant: Simultaneous-conjugation equivariance for arbitrary complex inputs, p.6 and footnote 61 on p.28.TraceMonomial: A multilinear trace monomial: one open word and finitely many traced words, using each variable exactly once in total, Eq.60, p.15. Empty open word is I.matrixWord: Ordered matrix-word evaluation, Eq.27, p.9.TracePolynomial: Finite complex linear combination of the actual multilinear trace monomials; raw syntax is not asserted to be unique (p.15).evaluateTracePolynomial: Evaluation of the syntax; scalar trace-only terms multiply I (pp.6,15).IsTracePolynomial: Evaluated trace-polynomial maps, modulo all evaluation identities (p.15).fillSlot: Fill one retained slot with a and the other slots with s, Eq.25, p.8.partialTraceSlot: Ordinary partial trace retaining slot q, pp.8–9.cycleList: Cycle written starting immediately after q and ending at q, Eq.27, p.9. Mathlib omits fixed points, so they are supplied explicitly as singleton words.cycleLeaders: Canonical cycle representatives: largest element in each cycle, including fixed points. Products of their scalar traces do not require a list ordering (p.9).closedCycleExpression: Full trace-word product over all canonical cycles, Eq.30.openCycleExpression: Traced closed cycles times the untraced word ending at the retained slot, Eq.28, pp.8–9. Untraced words are never cyclically rotated without changing q.FullySeparableDensity: Fully separable density matrices, using arbitrary finite convex combinations of product density matrices; no bipartite-only relaxation (p.14).OptimalWernerWitness: The paper's optimal Werner witness: invariant, block positive, detecting some entangled state, and saturating on a separable state (p.14).Saturates: The paper's saturation convention for optimal positive maps (p.15).joinSubsystemCoordinates: Join reduced and complement coordinates, preserving subsystem positions (Eqs.48–51, p.12).embedSubsystemIdentity: Tensor identities into the complement in its original positions (p.12).transposeOn: Partial transpose on a specified set of tensor factors, p.12.shadow: Shadow operator, Eq.48, p.12.anti: Anticommutator used in Eq.49 (p.12).bilinearExpansion: Eq.51 with the forced correction (2/3)^n, rather than printed (3/2)^n. All products are formed on the reduced register before embedding (p.12).bipartiteExpansion: Explicit bipartite Eq.49, p.12.reductionPolynomial: Unscaled reduction polynomial, p.10, Example 8.antisymmetricThree: Unscaled three-box antisymmetric polynomial, Eq.40, p.11.mixedThree: Unscaled (2,1) polynomial, p.12.witnessThree: Unscaled tripartite-witness polynomial, Eq.67, p.16.finePolynomial: The four literal fine-grained inequalities in Eq.54, p.13.fineProjector: Four normalized physical projectors, from the two decompositions above Eq.54. The sum of either pair is P_(2,1); each displayed polynomial is six times its map.motzkin: Motzkin matrix polynomial, Eq.70, p.17.motzkinSquares: Exact square decomposition printed in Eq.71, p.17.homogeneousMotzkin: Homogenized Motzkin formula, Eq.72, p.17. No division by a trace.tableFour31: Literal Table II entry for [3,1], with trace-only terms multiplying I (PDF p.25, table introduced p.24).tableFour22: Literal Table II entry for [2,2] (PDF p.25).tableFour211: Literal Table II entry for [2,1,1] (PDF p.25).tableFour1111: Literal Table II entry for [1,1,1,1] (PDF p.25).TableProperties: The properties asserted for each Table II map in the Appendix B introduction (PDF p.24): positive, dimension-dependent vanishing, equivariant, completely copositive, and tensor-stable, with positive dimensions and arbitrary ancillas.GroupCoefficients: The finite group algebra in its full coefficient-function coordinates (pp.18–21). Coefficients are constant complex numbers, independent of all inputs.coefficientProduct: Group-algebra multiplication in coefficient coordinates (pp.20–21).groupOperator: Fixed linear extension of the physical permutation action, pp.8,20.centralCoefficients: Character-computed central idempotent coefficients, Eq.A16 and Eq.31. These are independent of the physical dimension (pp.9,24).InAntisymmetricIdeal: The actual sum of isotypic ideals for shapes with more than d rows, Eq.C2, p.26. It is constructed as the sum of the central-idempotent-generated ideals, not defined as the physical representation's kernel.inputSlot: First r slots are matrix inputs, last t slots are marked tensor outputs (Eqs.81–85 and C3–C5, pp.18–19,26).outputSlot: Output marker in the shared input/output register (pp.18–19,26).joinSlots: Ordered concatenation of input and output coordinates (pp.18–19,26).gPolynomial: C1 with its last variable still present, p.26.hPolynomial: All-t-output contraction with identities in the output slots (C3–C5, p.26). The coordinate formula fixes the C5 alpha/beta, k−t argument and retained-slot typos.TensorTraceMonomial: Multilinear tensor-trace monomial with t ordered output words and arbitrary closed input trace words. Every input label appears once overall. Empty output words give identity factors (pp.6,18–19,25–26).TensorTracePolynomial: Formal finite tensor-trace polynomials, before taking evaluation identities (pp.6,18–19,25–26).evaluateTensorTrace: Ordered tensor-word evaluation; closed words supply scalar ordinary traces (pp.6,18–19).IsNoncommutativePolynomial: Noncommutative polynomial functions (Definition 29, p.25); evaluation is from actual words, not an arbitrary function with a desired output certificate.IsTensorPolynomial: Pure tensor-polynomial functions are the no-closed-trace subcase of the formal tensor-word evaluation (Definition 29, p.25).monomialPermutation: Concrete permutation for a tensor trace monomial: close each output word with its own output marker, close the trace words, then invert the disjoint cycle product to match the paper's T convention (pp.9,18–19).tensorPermutationExpansion: Constant-coefficient group-algebra expansion beta constructed from formal words, not selected separately for each evaluated input (Eqs.81,84, pp.18–19).PureTraceMonomial: Scalar pure trace monomial with each input label appearing once (pp.6,18).PureTracePolynomial: Scalar multilinear trace polynomials, pp.6,18.evaluatePureTrace: Scalar closed-word evaluation (pp.6,18).outputPermutation: Lift a fixed output permutation by its disjoint cycles onto the output markers; singleton cycles are retained in the cycle convention (p.19).pureTracePermutation: Permutation representing a scalar pure-trace monomial times a fixed output permutation. The input cycle factors are inverted, the output action is not (p.19).pureTraceExpansion: Constant-coefficient gamma after expanding the scalar invariant into closed trace words. This replaces the input-dependent group-algebra shorthand in Eq.83 (PDF p.19), without making that shorthand a definition.FullNontrivialCycle: Full-support single nontrivial cycle (Theorem 30(i)–(iii), p.26).OutputMarkedCycles: Exactly t cycles with exactly one marked output apiece and no extra input-only cycles. Output actions are required nontrivial where printed in Theorem 30(iv)–(v), p.26; empty words remain allowed in the general syntax.ClosedOutputAction: A closed prescribed output permutation, with input-only remaining cycles (Theorem 30(iv), C4, p.26).
import Mathlib
import Definitions.Def_QAlgorithms_Defs_SchurWeylDecomposition
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Papers_Independent_Gap48_P38
noncomputable section
open scoped Matrix ComplexConjugate ComplexOrder
namespace QAlgorithms.Papers.Independent.Extend50.P13
attribute [local instance] Classical.propDecidable
/-- Entrywise finite tensor product in the original factor order (pp.6–7). -/
def tensorFamily {J : Type*} [Fintype J] (dims : J → ℕ)
(X : (j : J) → (Matrix (Fin (dims j)) (Fin (dims j)) ℂ)) : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
fun a b => ∏ j, X j (a j) (b j)
/-- Homogeneous tensor product (pp.6–9). -/
def tensorMatrices {I : Type*} {r : ℕ} (X : Fin r → (Matrix I I ℂ)) : (Matrix (Fin r → I) (Fin r → I) ℂ) :=
fun a b => ∏ i, X i (a i) (b i)
/-- Append the output coordinate after the input coordinates (Eq.32). -/
def append {I : Type*} {r : ℕ} (x : Fin r → I) (a : I) : Fin (r+1) → I :=
Fin.lastCases a x
/-- Partial-trace contraction of an arbitrary physical operator, Eq.57, p.14.
The indices compute tr_inputs[P (X_1 ⊗ ... ⊗ X_r ⊗ I)]. -/
def contractInputs {I : Type*} [Fintype I] {r : ℕ}
(P : (Matrix (Fin (r+1) → I) (Fin (r+1) → I) ℂ)) (X : Fin r → (Matrix I I ℂ)) : (Matrix I I ℂ) :=
fun a b => ∑ x : Fin r → I, ∑ y : Fin r → I,
P (append x a) (append y b) * ∏ i, X i (y i) (x i)
/-- Linearization on the entire joint-input algebra, the first equality of Eq.53,
p.13. It is independent of any factorization of the input. -/
def linearContraction {I : Type*} [Fintype I] {r : ℕ}
(P : (Matrix (Fin (r+1) → I) (Fin (r+1) → I) ℂ)) (Z : (Matrix (Fin r → I) (Fin r → I) ℂ)) : (Matrix I I ℂ) :=
fun a b => ∑ x : Fin r → I, ∑ y : Fin r → I,
P (append x a) (append y b) * Z y x
/-- Amplification of Z ↦ linearContraction P Z.transpose on a single, arbitrary
ancilla (p.13). Transposition is on all input factors, not on the ancilla. -/
def copositiveAmplification {I : Type*} [Fintype I] {r : ℕ}
(P : (Matrix (Fin (r+1) → I) (Fin (r+1) → I) ℂ)) (m : ℕ)
(Z : (Matrix ((Fin r → I) × Fin m) ((Fin r → I) × Fin m) ℂ)) : (Matrix (I × Fin m) (I × Fin m) ℂ) :=
fun a b => ∑ x : Fin r → I, ∑ y : Fin r → I,
P (append x a.1) (append y b.1) * Z (x,a.2) (y,b.2)
/-- Fixed normalized central Young projector, Eq.31, p.9. The partition bound is
k, independent of physical d; shapes taller than d remain included. The character
is computed from the accepted regular Young ideal, never supplied as a PSD certificate. -/
def centralProjector {k : ℕ} (d : ℕ) (lambda : QAlgorithms.Schur.Partition k k) :
(Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ) :=
(QAlgorithms.Schur.spechtCharacter lambda 1 / (k.factorial : ℂ)) •
∑ pi : Equiv.Perm (Fin k), QAlgorithms.Schur.spechtCharacter lambda pi⁻¹ •
QAlgorithms.Schur.tensorPermutation d k pi
/-- Definition 4, Eq.32, p.9, with its original normalization. -/
def polarizedMap {d r : ℕ} (lambda : QAlgorithms.Schur.Partition (r+1) (r+1))
(X : Fin r → (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
contractInputs (centralProjector d lambda) X
/-- Vertical tensor product followed by regrouping into input/output copies of
the global register, Eq.45, p.12. No factorization of the input is assumed. -/
def verticalOperators {n k : ℕ} (dims : Fin n → ℕ)
(P : (j : Fin n) → (Matrix (Fin k → Fin (dims j)) (Fin k → Fin (dims j)) ℂ)) :
(Matrix (Fin k → (∀ j, Fin (dims j))) (Fin k → (∀ j, Fin (dims j))) ℂ) :=
fun a b => ∏ j, P j (fun i => a i j) (fun i => b i j)
/-- Mixed tensor product of the normalized maps, Eq.45–47, p.12. -/
def mixedMap {n r : ℕ} (dims : Fin n → ℕ)
(lambda : Fin n → QAlgorithms.Schur.Partition (r+1) (r+1))
(X : Fin r → (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
contractInputs (verticalOperators dims (fun j => centralProjector (dims j) (lambda j))) X
/-- Arbitrary, unnormalized rank-one operator |v><w|, Eq.33, p.10. -/
def rankOneOperator {I : Type*} (v w : I → ℂ) : (Matrix I I ℂ) := fun a b => v a * conj (w b)
/-- Scalar nonnegativity includes reality; discarding the imaginary part alone
would not express the source's scalar inequalities (pp.5,14). -/
def RealNonnegative (z : ℂ) : Prop := z.im = 0 ∧ 0 ≤ z.re
/-- Matrix element, with conjugate linearity in the bra, Eq.33. -/
def finiteMatrixElement {I : Type*} [Fintype I] (w : I → ℂ) (A : (Matrix I I ℂ)) (v : I → ℂ) : ℂ :=
∑ a, ∑ b, conj (w a) * A a b * v b
/-- Full multipartite block positivity, tested on all unnormalized pure product
vectors; by convexity this is exactly testing all fully separable states (p.14). -/
def FullyBlockPositive {d k : ℕ} (P : (Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ)) : Prop :=
P.IsHermitian ∧ ∀ v : Fin k → (Fin d → ℂ),
RealNonnegative (Matrix.trace (P * tensorMatrices (fun i => rankOneOperator (v i) (v i))))
/-- Positivity on every tuple in the positive cone, pp.6,15. -/
def PositiveMap {I : Type*} [Fintype I] {r : ℕ}
(f : (Fin r → (Matrix I I ℂ)) → (Matrix I I ℂ)) : Prop :=
∀ X, (∀ i, (X i).PosSemidef) → (f X).PosSemidef
/-- Diagonal-unitary invariance of the physical operator, pp.14–15. -/
def DiagonalUnitaryInvariant {d k : ℕ} (P : (Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ)) : Prop :=
∀ U : Matrix.unitaryGroup (Fin d) ℂ,
tensorMatrices (fun _ : Fin k => (U : (Matrix (Fin d) (Fin d) ℂ))) * P *
star (tensorMatrices (fun _ : Fin k => (U : (Matrix (Fin d) (Fin d) ℂ)))) = P
/-- Simultaneous-conjugation equivariance for arbitrary complex inputs, p.6 and
footnote 61 on p.28. -/
def ConjugationEquivariant {d r : ℕ} (f : (Fin r → (Matrix (Fin d) (Fin d) ℂ)) → (Matrix (Fin d) (Fin d) ℂ)) : Prop :=
∀ (U : Matrix.unitaryGroup (Fin d) ℂ) X,
f (fun i => (U : (Matrix (Fin d) (Fin d) ℂ)) * X i * star (U : (Matrix (Fin d) (Fin d) ℂ))) =
(U : (Matrix (Fin d) (Fin d) ℂ)) * f X * star (U : (Matrix (Fin d) (Fin d) ℂ))
/-- A multilinear trace monomial: one open word and finitely many traced words,
using each variable exactly once in total, Eq.60, p.15. Empty open word is I. -/
structure TraceMonomial (r : ℕ) where
openWord : List (Fin r)
closedWords : List (List (Fin r))
closed_nonempty : ∀ w ∈ closedWords, w ≠ []
labels_once : (openWord ++ closedWords.flatten).Perm (List.finRange r)
/-- Ordered matrix-word evaluation, Eq.27, p.9. -/
def matrixWord {I : Type*} [Fintype I] [DecidableEq I] {r : ℕ}
(X : Fin r → (Matrix I I ℂ)) (w : List (Fin r)) : (Matrix I I ℂ) := (w.map X).prod
/-- Finite complex linear combination of the actual multilinear trace monomials;
raw syntax is not asserted to be unique (p.15). -/
abbrev TracePolynomial (r : ℕ) := List (ℂ × TraceMonomial r)
/-- Evaluation of the syntax; scalar trace-only terms multiply I (pp.6,15). -/
def evaluateTracePolynomial {I : Type*} [Fintype I] [DecidableEq I] {r : ℕ}
(p : TracePolynomial r) (X : Fin r → (Matrix I I ℂ)) : (Matrix I I ℂ) :=
(p.map fun t => (t.1 * (t.2.closedWords.map fun w => Matrix.trace (matrixWord X w)).prod) •
matrixWord X t.2.openWord).sum
/-- Evaluated trace-polynomial maps, modulo all evaluation identities (p.15). -/
def IsTracePolynomial {d r : ℕ} (f : (Fin r → (Matrix (Fin d) (Fin d) ℂ)) → (Matrix (Fin d) (Fin d) ℂ)) : Prop :=
∃ p : TracePolynomial r, ∀ X, evaluateTracePolynomial p X = f X
/-- Fill one retained slot with a and the other slots with s, Eq.25, p.8. -/
def fillSlot {d k : ℕ} (q : Fin k) (a : Fin d)
(s : {i : Fin k // i ≠ q} → Fin d) : Fin k → Fin d :=
fun i => if h : i = q then a else s ⟨i,h⟩
/-- Ordinary partial trace retaining slot q, pp.8–9. -/
def partialTraceSlot {d k : ℕ} (q : Fin k) (M : (Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
fun a b => ∑ s : {i : Fin k // i ≠ q} → Fin d, M (fillSlot q a s) (fillSlot q b s)
/-- Cycle written starting immediately after q and ending at q, Eq.27, p.9.
Mathlib omits fixed points, so they are supplied explicitly as singleton words. -/
def cycleList {k : ℕ} (pi : Equiv.Perm (Fin k)) (q : Fin k) : List (Fin k) :=
if pi q = q then [q] else (pi.toList q).rotate 1
/-- Canonical cycle representatives: largest element in each cycle, including
fixed points. Products of their scalar traces do not require a list ordering (p.9). -/
def cycleLeaders {k : ℕ} (pi : Equiv.Perm (Fin k)) : Finset (Fin k) :=
Finset.univ.filter fun q => ∀ j ∈ cycleList pi q, j ≤ q
/-- Full trace-word product over all canonical cycles, Eq.30. -/
def closedCycleExpression {d k : ℕ} (pi : Equiv.Perm (Fin k))
(X : Fin k → (Matrix (Fin d) (Fin d) ℂ)) : ℂ :=
∏ q ∈ cycleLeaders pi, Matrix.trace (matrixWord X (cycleList pi q))
/-- Traced closed cycles times the untraced word ending at the retained slot,
Eq.28, pp.8–9. Untraced words are never cyclically rotated without changing q. -/
def openCycleExpression {d k : ℕ} (pi : Equiv.Perm (Fin k)) (q : Fin k)
(X : Fin k → (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(∏ c ∈ (cycleLeaders pi).filter (fun c => q ∉ cycleList pi c),
Matrix.trace (matrixWord X (cycleList pi c))) • matrixWord X (cycleList pi q)
/-- Fully separable density matrices, using arbitrary finite convex combinations
of product density matrices; no bipartite-only relaxation (p.14). -/
def FullySeparableDensity {d k : ℕ} (rho : (Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ)) : Prop :=
∃ m : ℕ, ∃ p : Fin m → ℝ, ∃ sigma : Fin m → Fin k → (Matrix (Fin d) (Fin d) ℂ),
(∀ a, 0 ≤ p a) ∧ (∑ a, p a) = 1 ∧
(∀ a j, QAlgorithms.IsDensityMatrix (sigma a j)) ∧
rho = ∑ a, (p a : ℂ) • tensorMatrices (sigma a)
/-- The paper's optimal Werner witness: invariant, block positive, detecting
some entangled state, and saturating on a separable state (p.14). -/
def OptimalWernerWitness {d k : ℕ} (W : (Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ)) : Prop :=
DiagonalUnitaryInvariant W ∧ FullyBlockPositive W ∧
(∃ rho, QAlgorithms.IsDensityMatrix rho ∧ ¬ FullySeparableDensity rho ∧ (Matrix.trace (W * rho)).re < 0) ∧
(∃ rho, QAlgorithms.IsDensityMatrix rho ∧ FullySeparableDensity rho ∧ Matrix.trace (W * rho) = 0)
/-- The paper's saturation convention for optimal positive maps (p.15). -/
def Saturates {d r : ℕ} (f : (Fin r → (Matrix (Fin d) (Fin d) ℂ)) → (Matrix (Fin d) (Fin d) ℂ)) : Prop :=
PositiveMap f ∧ ∃ X, (∀ i, (X i).PosSemidef ∧ X i ≠ 0) ∧
∃ v : Fin d → ℂ, v ≠ 0 ∧ (f X).mulVec v = 0
/-- Join reduced and complement coordinates, preserving subsystem positions
(Eqs.48–51, p.12). -/
def joinSubsystemCoordinates {J : Type*} (dims : J → ℕ) (S : Finset J)
(a : (j : {j // j ∈ S}) → Fin (dims j.val))
(e : (j : {j // j ∉ S}) → Fin (dims j.val)) : (∀ j, Fin (dims j)) :=
fun j => if h : j ∈ S then a ⟨j,h⟩ else e ⟨j,h⟩
/-- Tensor identities into the complement in its original positions (p.12). -/
def embedSubsystemIdentity {J : Type*} [Fintype J] (dims : J → ℕ) (S : Finset J)
(M : (Matrix ((j : {j // j ∈ S}) → Fin (dims j.val)) ((j : {j // j ∈ S}) → Fin (dims j.val)) ℂ)) : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
fun a b => if ∀ j, j ∉ S → a j = b j then
M (fun j => a j.val) (fun j => b j.val) else 0
/-- Partial transpose on a specified set of tensor factors, p.12. -/
def transposeOn {J : Type*} (dims : J → ℕ) (T : J → Prop)
(M : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
fun a b => M (fun j => if T j then b j else a j)
(fun j => if T j then a j else b j)
/-- Shadow operator, Eq.48, p.12. -/
def shadow {n : ℕ} (dims : Fin n → ℕ) (T : Finset (Fin n))
(rho : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
∑ S : Finset (Fin n), ((-1 : ℂ) ^ (S ∩ T).card) • embedSubsystemIdentity dims S (QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) rho S)
/-- Anticommutator used in Eq.49 (p.12). -/
def anti {I : Type*} [Fintype I] (A B : (Matrix I I ℂ)) : (Matrix I I ℂ) := A*B+B*A
/-- Eq.51 with the forced correction (2/3)^n, rather than printed (3/2)^n.
All products are formed on the reduced register before embedding (p.12). -/
def bilinearExpansion {n : ℕ} (dims : Fin n → ℕ)
(rho mu : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
((2/3 : ℂ)^n) • ∑ S : Finset (Fin n), ∑ A ∈ S.powerset,
((-1/2 : ℂ)^S.card) • embedSubsystemIdentity dims S
(transposeOn (fun j : {j // j ∈ S} => dims j.val) (fun j => j.val ∈ A)
(transposeOn (fun j : {j // j ∈ S} => dims j.val) (fun j => j.val ∈ A)
(QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) rho S) *
transposeOn (fun j : {j // j ∈ S} => dims j.val) (fun j => j.val ∈ A)
(QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) mu S)))
/-- Explicit bipartite Eq.49, p.12. -/
def bipartiteExpansion (dims : Fin 2 → ℕ) (rho mu : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) :
(Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ) :=
(1/9 : ℂ) • ((4 : ℂ) • (1 : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) +
transposeOn dims (fun j => j = 0)
(transposeOn dims (fun j => j = 0) rho * transposeOn dims (fun j => j = 0) mu) +
transposeOn dims (fun j => j = 1)
(transposeOn dims (fun j => j = 1) rho * transposeOn dims (fun j => j = 1) mu) -
(2 : ℂ) • (embedSubsystemIdentity dims {0} (anti (QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) rho {0}) (QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) mu {0})) +
embedSubsystemIdentity dims {1} (anti (QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) rho {1}) (QAlgorithms.Papers.Independent.Gap48.P38.subsystemReduction (fun j => Fin (dims j)) mu {1}))) + anti rho mu)
/-- Unscaled reduction polynomial, p.10, Example 8. -/
def reductionPolynomial {d : ℕ} (X : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
Matrix.trace X • (1 : (Matrix (Fin d) (Fin d) ℂ)) - X
/-- Unscaled three-box antisymmetric polynomial, Eq.40, p.11. -/
def antisymmetricThree {d : ℕ} (X Y : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(Matrix.trace X * Matrix.trace Y - Matrix.trace (X*Y)) • (1 : (Matrix (Fin d) (Fin d) ℂ)) -
Matrix.trace X • Y - Matrix.trace Y • X + X*Y + Y*X
/-- Unscaled (2,1) polynomial, p.12. -/
def mixedThree {d : ℕ} (X Y : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(2 * Matrix.trace X * Matrix.trace Y) • (1 : (Matrix (Fin d) (Fin d) ℂ)) - X*Y-Y*X
/-- Unscaled tripartite-witness polynomial, Eq.67, p.16. -/
def witnessThree {d : ℕ} (X Y : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
Matrix.trace (X*Y) • (1 : (Matrix (Fin d) (Fin d) ℂ)) + Matrix.trace X • Y +
Matrix.trace Y • X-X*Y-Y*X
/-- The four literal fine-grained inequalities in Eq.54, p.13. -/
def finePolynomial {d : ℕ} (i : Fin 4) (X Y : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
if i = 0 then
(2*Matrix.trace X*Matrix.trace Y+2*Matrix.trace (X*Y)) • (1 : (Matrix (Fin d) (Fin d) ℂ)) -
Matrix.trace X • Y-Matrix.trace Y • X-X*Y-Y*X
else if i = 1 then
(2*Matrix.trace X*Matrix.trace Y-2*Matrix.trace (X*Y)) • (1 : (Matrix (Fin d) (Fin d) ℂ)) +
Matrix.trace X • Y+Matrix.trace Y • X-X*Y-Y*X
else if i = 2 then
(2*Matrix.trace X*Matrix.trace Y-Matrix.trace (X*Y)) • (1 : (Matrix (Fin d) (Fin d) ℂ)) +
(2*Matrix.trace X) • Y-Matrix.trace Y • X-X*Y-Y*X
else
(2*Matrix.trace X*Matrix.trace Y+Matrix.trace (X*Y)) • (1 : (Matrix (Fin d) (Fin d) ℂ)) -
(2*Matrix.trace X) • Y+Matrix.trace Y • X-X*Y-Y*X
/-- Four normalized physical projectors, from the two decompositions above Eq.54.
The sum of either pair is P_(2,1); each displayed polynomial is six times its map. -/
def fineProjector (d : ℕ) (i : Fin 4) : (Matrix (Fin 3 → Fin d) (Fin 3 → Fin d) ℂ) :=
let T := QAlgorithms.Schur.tensorPermutation d 3
let c : Equiv.Perm (Fin 3) := (List.finRange 3).formPerm
let s : Equiv.Perm (Fin 3) := if i.val < 2 then Equiv.swap 0 1 else Equiv.swap 1 2
let e : ℂ := if i.val % 2 = 0 then 1 else -1
(1/6 : ℂ) • ((2 : ℂ) • (1 : (Matrix (Fin 3 → Fin d) (Fin 3 → Fin d) ℂ)) +
e • ((3 : ℂ) • T s - (T (Equiv.swap 0 1)+T (Equiv.swap 0 2)+T (Equiv.swap 1 2))) -
T c-T c⁻¹)
/-- Motzkin matrix polynomial, Eq.70, p.17. -/
def motzkin {d : ℕ} (A B : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
A*B^4*A+A^2*B^2*A^2-(3 : ℂ) • (A*B^2*A)+1
/-- Exact square decomposition printed in Eq.71, p.17. -/
def motzkinSquares {d : ℕ} (A B : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(A^2-A)*B^2*(A^2-A) +
(A*B^2+A^2-(2 : ℂ) • A)*(B^2*A+A^2-(2 : ℂ) • A) +
(1-A)*(1+(2 : ℂ) • A-A^2)*(1-A)
/-- Homogenized Motzkin formula, Eq.72, p.17. No division by a trace. -/
def homogeneousMotzkin {d : ℕ} (A B : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(Matrix.trace A)^2 • (A*B^4*A) + (Matrix.trace B)^2 • (A^2*B^2*A^2) -
(3*(Matrix.trace A)^2*(Matrix.trace B)^2) • (A*B^2*A) +
((Matrix.trace A)^4*(Matrix.trace B)^4) • (1 : (Matrix (Fin d) (Fin d) ℂ))
/-- Empty words and zero inputs retain their literal algebraic meanings. -/
example {d r : ℕ} (X : Fin r → (Matrix (Fin d) (Fin d) ℂ)) : matrixWord X [] = 1 := rfl
example {d : ℕ} (B : (Matrix (Fin d) (Fin d) ℂ)) : motzkin (0 : (Matrix (Fin d) (Fin d) ℂ)) B = 1 := by
simp [motzkin]
example {d : ℕ} (B : (Matrix (Fin d) (Fin d) ℂ)) : homogeneousMotzkin (0 : (Matrix (Fin d) (Fin d) ℂ)) B = 0 := by
simp [homogeneousMotzkin]
example {k : ℕ} (q : Fin k) : cycleList (1 : Equiv.Perm (Fin k)) q = [q] := by
simp [cycleList]
/-- Literal Table II entry for [3,1], with trace-only terms multiplying I
(PDF p.25, table introduced p.24). -/
def tableFour31 {d : ℕ} (A B C : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(3*Matrix.trace A*Matrix.trace B*Matrix.trace C + Matrix.trace A*Matrix.trace (C*B) +
Matrix.trace (B*A)*Matrix.trace C + Matrix.trace (C*A)*Matrix.trace B) •
(1 : (Matrix (Fin d) (Fin d) ℂ)) +
(Matrix.trace A*Matrix.trace B) • C + (Matrix.trace C*Matrix.trace A) • B -
Matrix.trace (B*A) • C-C*B*A-B*A*C-C*A*B -
Matrix.trace (C*A) • B-B*C*A-A*B*C +
(Matrix.trace B*Matrix.trace C) • A-A*C*B-Matrix.trace (C*B) • A
/-- Literal Table II entry for [2,2] (PDF p.25). -/
def tableFour22 {d : ℕ} (A B C : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(2*Matrix.trace A*Matrix.trace B*Matrix.trace C-Matrix.trace (C*B*A)-
Matrix.trace (B*C*A)) • (1 : (Matrix (Fin d) (Fin d) ℂ)) -
Matrix.trace A • (C*B)-Matrix.trace A • (B*C) +
(2*Matrix.trace (B*A)) • C-Matrix.trace C • (B*A)-Matrix.trace B • (C*A) +
(2*Matrix.trace (C*A)) • B-Matrix.trace C • (A*B)-Matrix.trace B • (A*C) +
(2*Matrix.trace (C*B)) • A
/-- Literal Table II entry for [2,1,1] (PDF p.25). -/
def tableFour211 {d : ℕ} (A B C : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(3*Matrix.trace A*Matrix.trace B*Matrix.trace C-Matrix.trace A*Matrix.trace (C*B)-
Matrix.trace (B*A)*Matrix.trace C-Matrix.trace (C*A)*Matrix.trace B) •
(1 : (Matrix (Fin d) (Fin d) ℂ)) -
(Matrix.trace A*Matrix.trace B) • C-(Matrix.trace C*Matrix.trace A) • B -
Matrix.trace (B*A) • C+C*B*A+B*A*C+C*A*B -
Matrix.trace (C*A) • B+B*C*A+A*B*C -
(Matrix.trace B*Matrix.trace C) • A+A*C*B-Matrix.trace (C*B) • A
/-- Literal Table II entry for [1,1,1,1] (PDF p.25). -/
def tableFour1111 {d : ℕ} (A B C : (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
(Matrix.trace A*Matrix.trace B*Matrix.trace C-Matrix.trace A*Matrix.trace (C*B)-
Matrix.trace (B*A)*Matrix.trace C+Matrix.trace (C*B*A)+Matrix.trace (B*C*A)-
Matrix.trace (C*A)*Matrix.trace B) • (1 : (Matrix (Fin d) (Fin d) ℂ)) -
(Matrix.trace A*Matrix.trace B) • C + Matrix.trace A • (C*B) +
Matrix.trace A • (B*C)-(Matrix.trace C*Matrix.trace A) • B +
Matrix.trace (B*A) • C-C*B*A-B*A*C+Matrix.trace C • (B*A)-C*A*B +
Matrix.trace B • (C*A)+Matrix.trace (C*A) • B-B*C*A-A*B*C +
Matrix.trace C • (A*B)+Matrix.trace B • (A*C) -
(Matrix.trace B*Matrix.trace C) • A-A*C*B+Matrix.trace (C*B) • A
/-- The properties asserted for each Table II map in the Appendix B introduction
(PDF p.24): positive, dimension-dependent vanishing, equivariant, completely
copositive, and tensor-stable, with positive dimensions and arbitrary ancillas. -/
def TableProperties {r : ℕ} (lambda : QAlgorithms.Schur.Partition (r+1) (r+1)) : Prop :=
(∀ (d : ℕ), 0 < d →
PositiveMap (polarizedMap (d := d) lambda) ∧
(d < lambda.val.colLen 0 → ∀ X : Fin r → (Matrix (Fin d) (Fin d) ℂ), polarizedMap lambda X = 0) ∧
ConjugationEquivariant (polarizedMap (d := d) lambda) ∧
(∀ (m : ℕ), 0 < m → ∀ Z : (Matrix ((Fin r → Fin d) × Fin m) ((Fin r → Fin d) × Fin m) ℂ), Z.PosSemidef →
(copositiveAmplification (centralProjector d lambda) m Z).PosSemidef)) ∧
(∀ (n : ℕ) (dims : Fin n → ℕ), (∀ j, 0 < dims j) →
PositiveMap (mixedMap dims (fun _ => lambda)))
/-- The finite group algebra in its full coefficient-function coordinates
(pp.18–21). Coefficients are constant complex numbers, independent of all inputs. -/
abbrev GroupCoefficients (k : ℕ) := Equiv.Perm (Fin k) → ℂ
/-- Group-algebra multiplication in coefficient coordinates (pp.20–21). -/
def coefficientProduct {k : ℕ} (a b : GroupCoefficients k) : GroupCoefficients k :=
fun pi => ∑ sigma : Equiv.Perm (Fin k), a sigma*b (sigma⁻¹*pi)
/-- Fixed linear extension of the physical permutation action, pp.8,20. -/
def groupOperator {k : ℕ} (d : ℕ) (a : GroupCoefficients k) : (Matrix (Fin k → Fin d) (Fin k → Fin d) ℂ) :=
∑ pi : Equiv.Perm (Fin k), a pi • QAlgorithms.Schur.tensorPermutation d k pi
/-- Character-computed central idempotent coefficients, Eq.A16 and Eq.31.
These are independent of the physical dimension (pp.9,24). -/
def centralCoefficients {k : ℕ} (lambda : QAlgorithms.Schur.Partition k k) :
GroupCoefficients k :=
fun pi => QAlgorithms.Schur.spechtCharacter lambda 1 / (k.factorial : ℂ) *
QAlgorithms.Schur.spechtCharacter lambda pi⁻¹
/-- The actual sum of isotypic ideals for shapes with more than d rows, Eq.C2,
p.26. It is constructed as the sum of the central-idempotent-generated ideals,
not defined as the physical representation's kernel. -/
def InAntisymmetricIdeal {k : ℕ} (d : ℕ) (a : GroupCoefficients k) : Prop :=
∃ b : QAlgorithms.Schur.Partition k k → GroupCoefficients k,
∀ pi, a pi = ∑ lambda : QAlgorithms.Schur.Partition k k,
if d < lambda.val.colLen 0 then
coefficientProduct (centralCoefficients lambda) (b lambda) pi else 0
/-- First r slots are matrix inputs, last t slots are marked tensor outputs
(Eqs.81–85 and C3–C5, pp.18–19,26). -/
def inputSlot {r t : ℕ} (i : Fin r) : Fin (r+t) := ⟨i.val, by omega⟩
/-- Output marker in the shared input/output register (pp.18–19,26). -/
def outputSlot {r t : ℕ} (j : Fin t) : Fin (r+t) := ⟨r+j.val, by omega⟩
/-- Ordered concatenation of input and output coordinates (pp.18–19,26). -/
def joinSlots {I : Type*} {r t : ℕ} (x : Fin r → I) (a : Fin t → I) : Fin (r+t) → I :=
fun i => if h : i.val < r then x ⟨i.val,h⟩ else a ⟨i.val-r,by omega⟩
/-- C1 with its last variable still present, p.26. -/
def gPolynomial {d r : ℕ} (a : GroupCoefficients (r+1))
(X : Fin (r+1) → (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin d) (Fin d) ℂ) :=
partialTraceSlot (Fin.last r) (groupOperator d a * tensorMatrices X)
/-- All-t-output contraction with identities in the output slots (C3–C5, p.26).
The coordinate formula fixes the C5 alpha/beta, k−t argument and retained-slot typos. -/
def hPolynomial {d r t : ℕ} (a : GroupCoefficients (r+t))
(X : Fin r → (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin t → Fin d) (Fin t → Fin d) ℂ) :=
fun u v => ∑ x : Fin r → Fin d, ∑ y : Fin r → Fin d,
groupOperator d a (joinSlots x u) (joinSlots y v) * ∏ i, X i (y i) (x i)
/-- Multilinear tensor-trace monomial with t ordered output words and arbitrary
closed input trace words. Every input label appears once overall. Empty output
words give identity factors (pp.6,18–19,25–26). -/
structure TensorTraceMonomial (r t : ℕ) where
outputWords : Fin t → List (Fin r)
closedWords : List (List (Fin r))
closed_nonempty : ∀ w ∈ closedWords, w ≠ []
labels_once : ((List.ofFn outputWords).flatten ++ closedWords.flatten).Perm (List.finRange r)
/-- Formal finite tensor-trace polynomials, before taking evaluation identities
(pp.6,18–19,25–26). -/
abbrev TensorTracePolynomial (r t : ℕ) := List (ℂ × TensorTraceMonomial r t)
/-- Ordered tensor-word evaluation; closed words supply scalar ordinary traces
(pp.6,18–19). -/
def evaluateTensorTrace {d r t : ℕ} (p : TensorTracePolynomial r t)
(X : Fin r → (Matrix (Fin d) (Fin d) ℂ)) : (Matrix (Fin t → Fin d) (Fin t → Fin d) ℂ) :=
(p.map fun term =>
(term.1 * (term.2.closedWords.map fun w => Matrix.trace (matrixWord X w)).prod) •
tensorMatrices (fun j => matrixWord X (term.2.outputWords j))).sum
/-- Noncommutative polynomial functions (Definition 29, p.25); evaluation is
from actual words, not an arbitrary function with a desired output certificate. -/
def IsNoncommutativePolynomial {d r : ℕ} (f : (Fin r → (Matrix (Fin d) (Fin d) ℂ)) → (Matrix (Fin d) (Fin d) ℂ)) : Prop :=
∃ p : List (ℂ × List (Fin r)),
∀ X, (p.map fun term => term.1 • matrixWord X term.2).sum = f X
/-- Pure tensor-polynomial functions are the no-closed-trace subcase of the
formal tensor-word evaluation (Definition 29, p.25). -/
def IsTensorPolynomial {d r t : ℕ}
(f : (Fin r → (Matrix (Fin d) (Fin d) ℂ)) → (Matrix (Fin t → Fin d) (Fin t → Fin d) ℂ)) : Prop :=
∃ p : TensorTracePolynomial r t,
(∀ term ∈ p, term.2.closedWords = []) ∧ ∀ X, evaluateTensorTrace p X = f X
/-- Concrete permutation for a tensor trace monomial: close each output word
with its own output marker, close the trace words, then invert the disjoint cycle
product to match the paper's T convention (pp.9,18–19). -/
def monomialPermutation {r t : ℕ} (term : TensorTraceMonomial r t) :
Equiv.Perm (Fin (r+t)) :=
(((List.ofFn fun j : Fin t =>
((term.outputWords j).map (inputSlot (t := t)) ++ [outputSlot (r := r) j]).formPerm).prod) *
((term.closedWords.map fun w => (w.map (inputSlot (t := t))).formPerm).prod))⁻¹
/-- Constant-coefficient group-algebra expansion beta constructed from formal
words, not selected separately for each evaluated input (Eqs.81,84, pp.18–19). -/
def tensorPermutationExpansion {r t : ℕ} (p : TensorTracePolynomial r t) :
GroupCoefficients (r+t) :=
fun pi => (p.map fun term => if pi = monomialPermutation term.2 then term.1 else 0).sum
/-- Scalar pure trace monomial with each input label appearing once (pp.6,18). -/
structure PureTraceMonomial (r : ℕ) where
closedWords : List (List (Fin r))
closed_nonempty : ∀ w ∈ closedWords, w ≠ []
labels_once : closedWords.flatten.Perm (List.finRange r)
/-- Scalar multilinear trace polynomials, pp.6,18. -/
abbrev PureTracePolynomial (r : ℕ) := List (ℂ × PureTraceMonomial r)
/-- Scalar closed-word evaluation (pp.6,18). -/
def evaluatePureTrace {d r : ℕ} (p : PureTracePolynomial r)
(X : Fin r → (Matrix (Fin d) (Fin d) ℂ)) : ℂ :=
(p.map fun term => term.1 * (term.2.closedWords.map fun w => Matrix.trace (matrixWord X w)).prod).sum
/-- Lift a fixed output permutation by its disjoint cycles onto the output
markers; singleton cycles are retained in the cycle convention (p.19). -/
def outputPermutation {r t : ℕ} (rho : Equiv.Perm (Fin t)) : Equiv.Perm (Fin (r+t)) :=
(List.ofFn fun j : Fin t => if j ∈ cycleLeaders rho then
((cycleList rho j).map (outputSlot (r := r))).formPerm else 1).prod
/-- Permutation representing a scalar pure-trace monomial times a fixed output
permutation. The input cycle factors are inverted, the output action is not (p.19). -/
def pureTracePermutation {r t : ℕ} (term : PureTraceMonomial r)
(rho : Equiv.Perm (Fin t)) : Equiv.Perm (Fin (r+t)) :=
((term.closedWords.map fun w => (w.map (inputSlot (t := t))).formPerm).prod)⁻¹ *
outputPermutation rho
/-- Constant-coefficient gamma after expanding the scalar invariant into closed
trace words. This replaces the input-dependent group-algebra shorthand in Eq.83
(PDF p.19), without making that shorthand a definition. -/
def pureTraceExpansion {r t : ℕ} (p : PureTracePolynomial r)
(rho : Equiv.Perm (Fin t)) : GroupCoefficients (r+t) :=
fun pi => (p.map fun term => if pi = pureTracePermutation term.2 rho then term.1 else 0).sum
/-- Full-support single nontrivial cycle (Theorem 30(i)–(iii), p.26). -/
def FullNontrivialCycle {k : ℕ} (pi : Equiv.Perm (Fin k)) : Prop :=
(∀ i, pi i ≠ i) ∧ ∀ i j : Fin k, j ∈ cycleList pi i
/-- Exactly t cycles with exactly one marked output apiece and no extra
input-only cycles. Output actions are required nontrivial where printed in
Theorem 30(iv)–(v), p.26; empty words remain allowed in the general syntax. -/
def OutputMarkedCycles {r t : ℕ} (pi : Equiv.Perm (Fin (r+t))) : Prop :=
(∀ j : Fin t, pi (outputSlot j) ≠ outputSlot j) ∧
(∀ j l : Fin t, outputSlot l ∈ cycleList pi (outputSlot j) ↔ l = j) ∧
(∀ i : Fin (r+t), ∃ j : Fin t, i ∈ cycleList pi (outputSlot j))
/-- A closed prescribed output permutation, with input-only remaining cycles
(Theorem 30(iv), C4, p.26). -/
def ClosedOutputAction {r t : ℕ} (rho : Equiv.Perm (Fin t))
(pi : Equiv.Perm (Fin (r+t))) : Prop :=
∀ j : Fin t, pi (outputSlot j) = outputSlot (rho j)
/-- Empty formal sums evaluate to zero, without introducing phantom terms. -/
example {d r t : ℕ} (X : Fin r → (Matrix (Fin d) (Fin d) ℂ)) :
evaluateTensorTrace ([] : TensorTracePolynomial r t) X = 0 := rfl
example {r t : ℕ} : tensorPermutationExpansion ([] : TensorTracePolynomial r t) = 0 := rfl
/-- Empty-family tensor conventions, pp.6,12. -/
example (dims : Fin 0 → ℕ) (X : (j : Fin 0) → (Matrix (Fin (dims j)) (Fin (dims j)) ℂ))
(a b : (∀ j, Fin (dims j))) : tensorFamily dims X a b = 1 := by
simp [tensorFamily]
example {k : ℕ} (dims : Fin 0 → ℕ)
(P : (j : Fin 0) → (Matrix (Fin k → Fin (dims j)) (Fin k → Fin (dims j)) ℂ))
(a b : Fin k → (∀ j, Fin (dims j))) : verticalOperators dims P a b = 1 := by
simp [verticalOperators]
example {k : ℕ} (d : ℕ) : groupOperator d (0 : GroupCoefficients k) = 0 := by
simp [groupOperator]
/-- Product-input specialization of the full linear extension, Eq.53, p.13. -/
example {I : Type*} [Fintype I] {r : ℕ}
(P : (Matrix (Fin (r+1) → I) (Fin (r+1) → I) ℂ)) (X : Fin r → (Matrix I I ℂ)) :
linearContraction P (tensorMatrices X) = contractInputs P X := rfl
example {I : Type*} [Fintype I] {r : ℕ} (X : Fin r → (Matrix I I ℂ)) :
contractInputs (0 : (Matrix (Fin (r+1) → I) (Fin (r+1) → I) ℂ)) X = 0 := by
ext a b
simp [contractInputs]
example {J : Type*} (dims : J → ℕ) (M : (Matrix ((∀ j, Fin (dims j))) ((∀ j, Fin (dims j))) ℂ)) :
transposeOn dims (fun _ => False) M = M := by
ext a b
simp [transposeOn]
end QAlgorithms.Papers.Independent.Extend50.P13
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Extend50.P13.ClosedOutputAction
For arbitrary natural numbers , a permutation of the output labels, and a permutation of all slots, this predicate means exactly that
There are no additional conditions on the input slots beyond those imposed by being a permutation; in particular, they necessarily permute among themselves. Fixed output slots are permitted whenever fixes the corresponding labels. When , the requirement is vacuous.
QAlgorithms.Papers.Independent.Extend50.P13.ConjugationEquivariant
For any natural numbers and any function taking an -indexed family of complex matrices to a complex matrix, this predicate means that, for every unitary complex matrix and every input family , , where denotes conjugate transpose. The inputs are arbitrary matrices, and no linearity or positivity is assumed. When , this requires the output on the unique empty family to be invariant under every unitary conjugation. When , the predicate holds automatically.
QAlgorithms.Papers.Independent.Extend50.P13.DiagonalUnitaryInvariant
For any natural numbers and any complex matrix indexed by functions , this predicate means that for every unitary complex matrix , where and denotes conjugate transpose. Thus the same arbitrary unitary is used in every factor. No Hermitian or positivity condition is imposed on . For , , so every satisfies the predicate; for , is the unique matrix on an empty index set and also satisfies it.
QAlgorithms.Papers.Independent.Extend50.P13.FullNontrivialCycle
For every natural number and every permutation of , this predicate requires both that for every index , and that every index belongs to the cycle list of every index . The cycle list at a fixed index is its singleton; at a nonfixed index it is the ordered list of that permutation cycle, rotated left by one position. Consequently, for the predicate says that all indices form one cycle and none is fixed, so it is impossible when ; when , both requirements are vacuous and the predicate holds.
QAlgorithms.Papers.Independent.Extend50.P13.FullyBlockPositive
For any natural numbers , including zero, and any complex matrix indexed by the functions , this predicate means that is Hermitian and that, for every family of vectors , the complex number has imaginary part zero and nonnegative real part, where . The vectors may be zero and need not be normalized. If , the index set contains one empty function, , and the condition requires the sole entry of to be real and nonnegative. If , the matrix index set is empty and the predicate holds for its unique matrix.
QAlgorithms.Papers.Independent.Extend50.P13.FullySeparableDensity
For arbitrary natural numbers and a complex matrix indexed by functions , this predicate means that there exist a natural number , real weights , and complex matrices for and , such that every , , every is positive semidefinite with trace , and for all indices . Zero weights are allowed, but cannot satisfy the weight sum. When , the local matrix conditions are vacuous and this requires the sole entry of to equal . When and , the predicate cannot hold because a local empty matrix cannot have trace .
QAlgorithms.Papers.Independent.Extend50.P13.GroupCoefficients
For every natural number , this denotes the type of all functions , where is the group of permutations of . There are no restrictions on the coefficients. When , the permutation group has one element, so a coefficient function consists of one arbitrary complex number.
QAlgorithms.Papers.Independent.Extend50.P13.InAntisymmetricIdeal
For natural numbers and an arbitrary function , this predicate says that there exists a family of arbitrary complex coefficient functions , indexed by all Young diagrams with boxes and first-column length at most , such that
Here the coefficients are specified as follows: number the boxes using the fixed cardinality-based bijection with ; let preserve their rows and columns; form
let be the orthogonal projection onto its range; and set
The inequality selecting diagrams is strict. No positivity condition is imposed on or . If , including , the selected-diagram sum is empty, so the predicate holds exactly when is identically zero.
QAlgorithms.Papers.Independent.Extend50.P13.IsNoncommutativePolynomial
For arbitrary natural numbers and any function from -tuples of complex matrices to complex matrices, this predicate means that there exists a finite list of pairs , with and an arbitrary finite word in the labels , such that, for every tuple ,
An empty word contributes , and an empty representing list contributes zero. Words may repeat or omit labels, repeat labels internally, and have different lengths; no multilinearity or homogeneity condition is imposed. The parameters may be zero; for , only empty words are available, so the represented function is a scalar multiple of .
QAlgorithms.Papers.Independent.Extend50.P13.IsTensorPolynomial
For arbitrary natural numbers and a function from -tuples of complex matrices to matrices indexed by functions , this predicate means that there exists a finite list of terms, each with a complex coefficient and ordered output words, such that every input label occurs exactly once across those output words, every term has no closed words, and, for every tuple ,
The representing list may be empty and output words may be empty. All parameters may be zero. In particular, if , no individual term can satisfy the label requirement, so only the empty list is available and must be zero; if , every term has only empty output words.
QAlgorithms.Papers.Independent.Extend50.P13.IsTracePolynomial
For any natural numbers and any function from -indexed families of complex matrices to complex matrices, this predicate means that there exists a finite list of terms representing on every input family , each term having the form . Here , each is the ordered product of matrices whose labels occur in the word , every closed word in is nonempty, the open word may be empty, and every label occurs exactly once across that term’s words. Empty word products are identities, empty scalar products are , and an empty term list represents zero. For , this requires the output on the unique empty input family to be a complex scalar multiple of the identity. For , every such function satisfies the predicate.
QAlgorithms.Papers.Independent.Extend50.P13.OptimalWernerWitness
For arbitrary natural numbers and a complex matrix indexed by functions , this predicate requires all of the following: for every unitary complex matrix , the matrix with entries satisfies ; is Hermitian, and for every family of vectors , setting makes have zero imaginary part and nonnegative real part; there exists a positive semidefinite trace-one matrix that has no representation as a finite convex combination of matrices with entries , where all local are positive semidefinite of trace , and for which ; and there exists another positive semidefinite trace-one matrix admitting such a representation for which the complex trace equals . The product-vector condition includes zero vectors. The predicate cannot hold for , when every density matrix is the scalar and has the required convex representation, or for and , when no density matrix exists.
QAlgorithms.Papers.Independent.Extend50.P13.OutputMarkedCycles
For arbitrary natural numbers and a permutation of , call the output slot corresponding to . This predicate requires that every output slot is moved by ; that, for every pair of output labels, the output slot belongs to the cycle list of if and only if ; and that every slot belongs to the cycle list of some output slot. A cycle list is the singleton at a fixed slot and otherwise the ordered list of its permutation cycle rotated left once. Thus every cycle must contain exactly one output slot, and that cycle must also contain at least one input slot. The definition includes and : with no output slots, the covering requirement holds only when there are no slots at all, and with the requirements cannot be satisfied.
QAlgorithms.Papers.Independent.Extend50.P13.PositiveMap
For any finite type , any natural number , and any function taking an -indexed family of complex matrices to a complex matrix, this predicate means that is positive semidefinite whenever every input matrix , for , is positive semidefinite. No linearity or multilinearity is required. When , there is one empty input family, its hypothesis is vacuous, and the predicate requires its output to be positive semidefinite. If is empty, the predicate holds automatically.
QAlgorithms.Papers.Independent.Extend50.P13.PureTraceMonomial
For any natural number , a pure trace monomial consists of a finite ordered list of nonempty words in the labels , together with the requirement that concatenating those words gives a rearrangement of the list . Consequently, every input label occurs exactly once across the words. The list of words may be empty, and for it must be empty.
QAlgorithms.Papers.Independent.Extend50.P13.PureTracePolynomial
For any natural number , a pure trace polynomial is a finite ordered list of pairs , where and is a finite ordered list of nonempty words in whose concatenation contains every input label exactly once. The polynomial list may be empty, coefficients may be zero, and monomials may repeat. When , each monomial’s word list is empty.
QAlgorithms.Papers.Independent.Extend50.P13.RealNonnegative
For any complex number , this defines the proposition that its imaginary part is zero and its real part is nonnegative:
The value is included.
QAlgorithms.Papers.Independent.Extend50.P13.Saturates
For arbitrary natural numbers and a function from -tuples of complex matrices to complex matrices, this predicate means that is positive semidefinite whenever every input matrix is positive semidefinite, and that there exist inputs that are each positive semidefinite and nonzero, together with a nonzero vector , such that . No linearity or multilinearity of is required. For , the conditions on individual input matrices are vacuous, and the predicate requires the value on the empty tuple to be positive semidefinite with a nonzero kernel vector. For , no such vector exists.
QAlgorithms.Papers.Independent.Extend50.P13.TableProperties
Let be any natural number, put , and let be a Young diagram with boxes and first-column length at most . The following constructions specify the predicate being defined. Number the boxes of by the fixed bijection with selected from their equal cardinalities; let be the permutations preserving, respectively, the row and column of each numbered box. On the complex Euclidean space indexed by , define
let be the orthogonal projection onto the range of , and set
For every natural number , define matrices indexed by by
For a finite index set , a matrix indexed by , and matrices indexed by , define the contraction and its indicated amplification by
where appends as the final coordinate and . The predicate asserts that, for every , all four statements hold: is positive semidefinite whenever every is positive semidefinite; if is smaller than the first-column length of , then this contraction is zero for every complex matrix tuple ; for every unitary and every complex matrix tuple ,
and, for every and every positive semidefinite indexed by , the matrix is positive semidefinite. It additionally asserts that for every natural number and every tuple of positive natural dimensions , the contraction is positive on tuples of positive semidefinite matrices on , where
The quantifiers include , with no input matrices, and , with singleton product registers; empty products equal .
QAlgorithms.Papers.Independent.Extend50.P13.TensorTraceMonomial
For any natural numbers , a tensor trace monomial consists of an ordered word in the labels for each output index , together with an ordered finite list of closed words in the same labels. Every closed word must be nonempty. Concatenating the output words in increasing output-index order and then concatenating the closed words must give a rearrangement of the list ; thus every input label occurs exactly once across all words. Output words may be empty. When , every output word and the list of closed words are empty; when , all input labels must occur in the closed words.
QAlgorithms.Papers.Independent.Extend50.P13.TensorTracePolynomial
For any natural numbers , a tensor trace polynomial is a finite ordered list of pairs , where and consists of output words and a finite ordered list of nonempty closed words in the input labels , with every input label occurring exactly once across these words. The polynomial list may be empty, coefficients may be zero, and monomials may repeat. Output words may be empty; in particular, for all output words and every monomial’s closed-word list are empty.
QAlgorithms.Papers.Independent.Extend50.P13.TraceMonomial
For a natural number , this structure consists of an ordered list called the open word, whose entries lie in , and an ordered list of closed words, each itself a list of such entries, together with the requirements that every closed word is nonempty and that concatenating the open word with all the closed words gives a permutation of the list . Consequently, every label occurs exactly once across all words. The open word and the list of closed words may each be empty. When , both must be empty. No identification under cyclic rotation or rearrangement of words is part of this structure.
QAlgorithms.Papers.Independent.Extend50.P13.TracePolynomial
For a natural number , this is an abbreviation for a finite ordered list of pairs consisting of a complex coefficient and the following word data: one possibly empty open word and a list of nonempty closed words, all using labels in , with each label appearing exactly once across their concatenation. The coefficient list may be empty, coefficients may be zero, and repeated terms are permitted. This is a list representation, with no quotient identifying different lists that evaluate to the same function. For , each term has empty open and closed word lists.
QAlgorithms.Papers.Independent.Extend50.P13.anti
For any finite type equipped with an enumeration and any two complex matrices indexed by , this defines their anticommutator , whose entry is . No Hermiticity, positivity, or commutation assumption is imposed. The type may be empty, in which case the result is the unique empty matrix.
QAlgorithms.Papers.Independent.Extend50.P13.antisymmetricThree
For every natural number , including zero, and arbitrary complex matrices , this defines
All products of matrices occur in the displayed order.
QAlgorithms.Papers.Independent.Extend50.P13.append
For any type , any natural number , any function , and any element , this defines the function obtained by placing after the entries of :
Its domain is . In particular, when , the resulting function has the single value ; supplying these arguments is impossible if is empty.
QAlgorithms.Papers.Independent.Extend50.P13.bilinearExpansion
For any natural number , dimensions for , and arbitrary complex matrices indexed by , this defines the matrix
Here , where specify the coordinates in and ranges over all coordinates outside ; is defined identically. The operation interchanges the row and column coordinates belonging to , leaving the other coordinates unchanged. The embedding has entry when for every , and entry zero otherwise. Both sums include the empty subset. Zero dimensions and are allowed; products over no coordinates have one possible index, and empty products equal .
QAlgorithms.Papers.Independent.Extend50.P13.bipartiteExpansion
For any two natural dimensions , including zero, and arbitrary complex matrices indexed by , this defines
Here swaps the row and column coordinates of subsystem ; and are obtained by summing diagonal entries over the other subsystem, for example ; and embeds by multiplying its entries by the identity entries on the other subsystem. The factor multiplies the entire displayed expression.
QAlgorithms.Papers.Independent.Extend50.P13.centralCoefficients
For every natural number and Young diagram with boxes and first-column length at most , this defines a complex coefficient function on . Its construction uses the fixed bijection between the boxes of and selected from their equal cardinalities. Let and be the permutations preserving the row and column, respectively, of every numbered box, and define the matrix on by
Let be the orthogonal projection onto the range of in the complex Euclidean space indexed by , and define
The resulting coefficient function is
with the factorial regarded as a complex scalar. The definition includes , for which , so this denominator is never zero.
QAlgorithms.Papers.Independent.Extend50.P13.centralProjector
For natural numbers and a Young diagram having exactly cells and first-column length at most , this defines a complex matrix indexed by functions , with entries
Here is the permutation group on , and is defined as follows: choose the definition’s fixed bijection from the cells of to these labels; let and consist respectively of permutations preserving each label’s cell row and cell column; form the matrix , indexed by , whose entry is ; let be the orthogonal projection in onto the range of ; and set , where . All coefficients are interpreted in . The definition includes , when is empty and the resulting matrix has its sole entry , and , when its index set is empty unless .
QAlgorithms.Papers.Independent.Extend50.P13.closedCycleExpression
For arbitrary natural numbers , a permutation of , and a family of complex matrices , this defines the complex number , where ranges over the largest index of each cycle of , and is for a fixed point and otherwise the permutation’s cycle list based at , rotated one position to the left. Matrix factors are multiplied in the displayed list order. No positivity or normalization of the matrices is assumed. For , the product is empty and equals ; is also allowed, with traces of empty matrices equal to .
QAlgorithms.Papers.Independent.Extend50.P13.coefficientProduct
For every natural number and arbitrary coefficient functions , this defines their product to be the coefficient function
The order is part of the definition. For , this is ordinary multiplication of the two coefficients at the unique permutation.
QAlgorithms.Papers.Independent.Extend50.P13.contractInputs
For any type equipped with a finite enumeration, any natural number , any complex matrix indexed by functions , and any family of complex matrices indexed by , this defines the matrix indexed by with entries
where denotes the function agreeing with at positions below and taking value at position , and likewise for . No positivity or symmetry conditions are imposed. When , both sums have one term and the product is , so the entry is ; when is empty, the output matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.copositiveAmplification
For any type equipped with a finite enumeration, natural numbers , any complex matrix indexed by functions , and any complex matrix indexed by pairs consisting of a function and an element of , this defines the matrix indexed by with entries
where both sums range over all functions , and appends at position . No positivity condition is assumed or asserted. For , the entry is ; if or is empty, the output matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.cycleLeaders
For every natural number and permutation of , this defines the finite set of indices such that every entry of the following list satisfies : use if , and otherwise use the permutation’s cycle list based at , rotated one position to the left. Thus the set selects the largest index in each cycle, including every fixed point. When , the set is empty.
QAlgorithms.Papers.Independent.Extend50.P13.cycleList
For every natural number , permutation of , and index in that set, this defines a list as follows: if , the list is ; otherwise, take the permutation’s cycle list based at and rotate it one position to the left, moving its first entry to the end. There is no possible argument when .
QAlgorithms.Papers.Independent.Extend50.P13.embedSubsystemIdentity
For any finite type equipped with an enumeration, natural dimensions , a finite subset , and a complex matrix indexed by coordinate assignments on , this defines a matrix on full coordinate assignments by if for every , and otherwise. No positivity, Hermiticity, or normalization of is assumed. For , has a single scalar entry and is that scalar times the identity; for , the outside-coordinate condition is vacuous. Zero dimensions and an empty are allowed.
QAlgorithms.Papers.Independent.Extend50.P13.evaluatePureTrace
For arbitrary natural numbers , a pure trace polynomial , and complex matrices , this definition returns the complex number
Here each is an ordered list of nonempty words, with every input label occurring exactly once across those words, and matrix multiplication follows each word’s order. Every occurrence in the polynomial list contributes separately. The empty polynomial evaluates to zero, and an empty word list contributes the scalar ; hence for the value is the sum of the polynomial’s coefficients. The dimension is also allowed, with traces taken over the empty index set.
QAlgorithms.Papers.Independent.Extend50.P13.evaluateTensorTrace
For arbitrary natural numbers , a tensor trace polynomial , and complex matrices , this definition returns a matrix indexed by functions . Each list entry of has a coefficient , output words , and a list of nonempty closed words, with every input label occurring exactly once across those words. Writing for a word , with , the returned matrix has entries
Every list occurrence contributes separately. An empty polynomial evaluates to the zero matrix, and an empty closed-word list contributes the scalar . Zero dimensions and zero input or output counts are allowed; when , the result is a matrix with a single entry.
QAlgorithms.Papers.Independent.Extend50.P13.evaluateTracePolynomial
For any finite type equipped with decidable equality, any natural number , any finite list of complex coefficients paired with word data, and any family of complex matrices, this defines , counting every list occurrence. Here , with the empty word giving the identity; each closed word in is nonempty, and the open word together with the closed words uses every label exactly once. An empty list of closed words gives scalar factor , and an empty polynomial list gives the zero matrix. For , the result is the sum of the listed coefficients times the identity. The type may be empty.
QAlgorithms.Papers.Independent.Extend50.P13.fillSlot
For natural numbers , a distinguished index , a value , and an assignment of values in to every index other than , this defines the full assignment whose value at is and whose value at each is . Supplying and requires and ; there are no such arguments when either relevant index set is empty.
QAlgorithms.Papers.Independent.Extend50.P13.finePolynomial
For every natural number , including zero, an index , and arbitrary complex matrices , put , , and . This defines the matrix
QAlgorithms.Papers.Independent.Extend50.P13.fineProjector
For any natural number , including zero, and , this defines a complex matrix indexed by triples with entries in as
Here for and for ; for and for ; is the cyclic permutation formed from the ordered list ; and is the identity matrix on the triple index set. For every permutation of the three positions, the matrix has entry at exactly when for every position , and entry otherwise.
QAlgorithms.Papers.Independent.Extend50.P13.finiteMatrixElement
For any finite type , any functions , and any complex matrix indexed by , this defines the complex number . Neither vector is required to be normalized, and has no assumed properties. If is empty, the value is .
QAlgorithms.Papers.Independent.Extend50.P13.gPolynomial
For any natural numbers , arbitrary complex coefficient function , and tuple of arbitrary complex matrices, this defines a complex matrix as follows. On the index set , put
Multiply these matrices in the order , and sum over equal row and column coordinates in all positions except the final position . Explicitly, if denotes with appended as its final coordinate, the result has entries
No positivity or Hermitian assumptions are imposed. For , there are no coordinates to trace out and the result is ; for , the result has empty row and column index sets.
QAlgorithms.Papers.Independent.Extend50.P13.groupOperator
For any natural numbers and arbitrary coefficient function , this defines a complex matrix whose rows and columns are functions from to , with entries
Equivalently, it is the sum of the permutation matrices for these coordinate permutations, weighted by . No positivity or symmetry condition is imposed on . When , the matrix has one entry, , for every ; when and , its row and column index sets are empty.
QAlgorithms.Papers.Independent.Extend50.P13.hPolynomial
For arbitrary natural numbers , let , let assign a complex coefficient to every permutation of , and let be complex matrices. This definition produces a matrix indexed by functions , with entries
where is the function on whose first coordinates are and whose last coordinates are , and is when holds and otherwise. No positivity, normalization, or symmetry is required of or the matrices. Zero values of all three parameters are allowed; empty products are , empty sums are , and there is exactly one function with empty domain.
QAlgorithms.Papers.Independent.Extend50.P13.homogeneousMotzkin
For every natural number , including zero, and arbitrary complex matrices , this defines
The traces and their powers are complex scalars multiplying the indicated matrices.
QAlgorithms.Papers.Independent.Extend50.P13.inputSlot
For any natural numbers and any index , this defines its input position in to be the index with the same numerical value . If , there is no index to supply; if , this map is the identity on the indices.
QAlgorithms.Papers.Independent.Extend50.P13.joinSlots
For any type , natural numbers , function , and function , this defines the joined function on by
The subtraction is natural-number subtraction, used here only when , and then . No finiteness or nonemptiness assumption is imposed on . The definition allows or , yielding the other supplied function, and when both are zero the result is the unique function with empty domain.
QAlgorithms.Papers.Independent.Extend50.P13.joinSubsystemCoordinates
For any type , a family of natural numbers , a finite subset , coordinates for , and coordinates in the same respective sets for , this defines the full coordinate assignment by on and outside . The type need not be finite. Zero dimensions are permitted, although a coordinate assignment on any collection containing an index of dimension zero cannot exist; assignments on an empty collection are unique.
QAlgorithms.Papers.Independent.Extend50.P13.linearContraction
For any type equipped with a finite enumeration, any natural number , any complex matrix indexed by functions , and any complex matrix indexed by functions , this defines the matrix indexed by with entries
where appends as the last coordinate of . Neither matrix is subject to further assumptions. When , writing for the unique empty function, the entry is . If is empty, the output matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.matrixWord
For any finite type equipped with decidable equality, any natural number , any family of complex matrices, and any finite list of labels from , this defines the ordered matrix product . Labels may repeat or be omitted. The empty word evaluates to the identity matrix; in particular, when , the only possible word is empty. The type may also be empty.
QAlgorithms.Papers.Independent.Extend50.P13.mixedMap
For natural numbers , dimensions for , Young diagrams each having cells and first-column length at most , and arbitrary complex matrices indexed by , this defines the matrix indexed by with entries
For each , its character here is defined using the definition’s fixed numbering of its cells by : take the row-preserving and column-preserving permutation sets , form , let be the orthogonal projection onto the range of in , and set , where . No positivity conditions are imposed. When , the sums each have one term and the final product is ; when , is a singleton and the sole output entry is the product of the sole entries of the ; if any , is empty and the output matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.mixedThree
For every natural number , including zero, and arbitrary complex matrices , this defines
where is the identity matrix.
QAlgorithms.Papers.Independent.Extend50.P13.monomialPermutation
For arbitrary natural numbers , take a tensor trace monomial whose output words are , , and whose closed-word list is , where closed words are nonempty and every input label occurs exactly once across all words. Regard input label as position in , and output label as position . For each output word , form the cycle ; for each closed word , form the cycle . This definition returns the inverse of the product of the output cycles in increasing , followed by the closed cycles in their list order. A singleton cycle and an empty product are identities. The label condition makes these cycles disjoint; empty output words simply give fixed output positions. Zero input and output counts are allowed.
QAlgorithms.Papers.Independent.Extend50.P13.motzkin
For every natural number , including zero, and arbitrary complex matrices , this defines
Powers and products are matrix powers and matrix products in the displayed order.
QAlgorithms.Papers.Independent.Extend50.P13.motzkinSquares
For every natural number , including zero, and arbitrary complex matrices , this defines
Every denotes the identity, and all products retain the displayed order.
QAlgorithms.Papers.Independent.Extend50.P13.openCycleExpression
For arbitrary natural numbers , a permutation of , an index , and complex matrices , define to be if , and otherwise the permutation’s cycle list based at , rotated one position to the left; for a list , write in that order. This declaration defines the matrix , where ranges over the largest indices of those cycles whose lists do not contain . The scalar product is when there are no such cycles. No positivity or normalization is assumed, is permitted, and admits no argument .
QAlgorithms.Papers.Independent.Extend50.P13.outputPermutation
For arbitrary natural numbers and a permutation of , this definition constructs a permutation of using the cycles of . For a fixed point , its cycle list is ; otherwise the cycle traversal list based at is rotated one position to the left. An index is selected precisely when every element in its cycle list is at most , so the selected index is the largest element of its cycle. For each selected , replace every label in that cycle list by and form the corresponding cyclic permutation; for each unselected , use the identity. Multiply these permutations in increasing . Thus input positions are fixed and the output positions carry the cycles of . Singleton cycles are identities, and gives the identity permutation.
QAlgorithms.Papers.Independent.Extend50.P13.outputSlot
For any natural numbers and any index , this defines its output position in to be . Thus the output positions follow the first positions. If , there is no index to supply; if , the map preserves the numerical value of each index.
QAlgorithms.Papers.Independent.Extend50.P13.partialTraceSlot
For natural numbers , an index , and any complex matrix indexed by assignments , this defines the complex matrix with entry at . The sum runs over every assignment to all slots other than , and fills slot with and every other slot with its value from . No positivity or normalization is assumed. The argument requires . When , the sum contains the single empty assignment; when , the output matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.polarizedMap
For natural numbers , a Young diagram having cells and first-column length at most , and arbitrary complex matrices , this defines the complex matrix
where appends at position , and
To define , use the definition’s fixed bijection between the cells of and ; let be the permutations preserving cell rows and columns respectively, form , let be the orthogonal projection onto the range of in , and put , with . No positivity assumptions are imposed on the inputs. For , the sums each range over the unique empty function and the product is ; for , the output matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.pureTraceExpansion
For arbitrary natural numbers , let be a finite list of pairs , where and is an ordered list of nonempty closed words whose concatenation contains every input label exactly once, and let permute the output labels. The definition assigns a complex coefficient to every permutation of slots: its coefficient is the sum of the coefficients of precisely those list entries for which equals the following permutation. Embed the input labels in the first slots, form the product of the cyclic permutations given by ’s closed words, invert this product, and multiply it on the right by the output permutation constructed from : choose the greatest label in each -cycle, form the cycle on the corresponding shifted output slots , and multiply these cycles. The cycle list used for a fixed label is its singleton; otherwise it is the ordered permutation-cycle list rotated left once. Thus repeated list entries or distinct entries producing the same permutation contribute additively, coefficients may be arbitrary complex numbers, and the empty polynomial list gives the zero coefficient function. Empty permutation products are identities, including when or .
QAlgorithms.Papers.Independent.Extend50.P13.pureTracePermutation
For arbitrary natural numbers , let a pure trace monomial consist of an ordered list of nonempty words in the input labels , such that concatenating the words gives each input label exactly once, in some order, and let be a permutation of . This definition produces a permutation of as follows. Embed every input label as , turn each closed word into its cyclic permutation, multiply these permutations in their listed order, and invert the product. Multiply this inverse on the right by the following permutation of the output slots : for each cycle of , choose its greatest label, take that label’s cycle list, replace each output label by , and form the corresponding cyclic permutation; multiply these permutations in increasing order of the chosen labels. Here a cycle list is when , and otherwise is the permutation’s ordered cycle list at , rotated left by one position. Permutation multiplication means composition with the right factor acting first, and an empty product is the identity. In particular, permits no closed words, and contributes the identity output permutation.
QAlgorithms.Papers.Independent.Extend50.P13.rankOneOperator
For any type and arbitrary functions , this defines the complex matrix indexed by with entries
No finiteness, normalization, or nonzero assumption is required. In particular, if either function is zero, the matrix is zero; if is empty, it has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.reductionPolynomial
For every natural number , including , and every complex matrix , this defines the complex matrix
where is the identity matrix and the trace is the sum of diagonal entries.
QAlgorithms.Papers.Independent.Extend50.P13.shadow
For any natural number , natural dimensions , a finite subset , and a complex matrix indexed by full coordinate assignments, this defines the matrix as follows: first form the matrix , where assign coordinates on , assigns coordinates on its complement, and joins these assignments; then set when and agree outside , and otherwise. The sum includes both the empty and full subsets. No density, positivity, or normalization condition is imposed on . Empty coordinate products have one assignment, so for the result is ; zero local dimensions are also permitted.
QAlgorithms.Papers.Independent.Extend50.P13.tableFour1111
For every natural number , including , and arbitrary complex matrices , this defines a complex matrix as follows. Write , , , and
The defined matrix is
No positivity or Hermitian assumptions are imposed on ; when , the result is the unique matrix with empty row and column index sets.
QAlgorithms.Papers.Independent.Extend50.P13.tableFour211
For every natural number , including , and arbitrary complex matrices , this declaration defines the complex matrix
Here is the identity, all traces are complex, and matrix products have precisely the displayed order; no Hermitian or positivity assumptions are imposed.
QAlgorithms.Papers.Independent.Extend50.P13.tableFour22
For every natural number , including , and arbitrary complex matrices , this declaration defines the complex matrix
Here is the identity and all traces are complex; no Hermitian or positivity assumptions are imposed.
QAlgorithms.Papers.Independent.Extend50.P13.tableFour31
For every natural number , including , and arbitrary complex matrices , this declaration defines the complex matrix
Here is the identity, all traces are complex, scalar juxtaposition denotes scalar multiplication when appropriate, and matrix products retain the displayed order; there are no Hermitian or positivity assumptions.
QAlgorithms.Papers.Independent.Extend50.P13.tensorFamily
For any type equipped with a finite enumeration, any dimensions , and any family of complex matrices indexed by , this defines a complex matrix whose rows and columns are indexed by tuples , with entry
There are no assumptions on the matrices. If is empty, the tuple index set is a singleton and the resulting matrix has its sole entry equal to ; if some , the tuple index set is empty and the resulting matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.tensorMatrices
For any type , any natural number , and any family of complex matrices with rows and columns indexed by , this defines a complex matrix indexed by functions , with entry
No finiteness assumption on and no conditions on the matrices are required. For , there is exactly one indexing function, even when is empty, and the resulting matrix has its sole entry equal to . If is empty and , the resulting matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P13.tensorPermutationExpansion
For arbitrary natural numbers and a tensor trace polynomial , this definition assigns a complex coefficient to each permutation of . A term of has coefficient , output words , and nonempty closed words, with every input label occurring exactly once across all words. Associate to the term the inverse of the product of the cycles obtained by appending output position to and turning each resulting word and each closed word into a cycle. The coefficient assigned to is the sum of over all list entries whose associated permutation equals , with every other entry contributing zero. Repeated entries contribute repeatedly and their coefficients may cancel. The empty polynomial gives zero coefficients everywhere; singleton cycles and empty products are identities, including when parameters are zero.
QAlgorithms.Papers.Independent.Extend50.P13.transposeOn
For any type , natural dimensions , a predicate on , and a complex matrix indexed by full coordinate assignments, this defines a matrix by , where and when holds, while and otherwise. No finiteness of or positivity of is required, and no complex conjugation is performed. If is everywhere false this returns ; if it is everywhere true this returns its transpose. Zero dimensions are allowed.
QAlgorithms.Papers.Independent.Extend50.P13.verticalOperators
For natural numbers , dimensions for , and complex matrices indexed by functions , this defines a complex matrix indexed by functions assigning to each a tuple in , with entries
There are no conditions on the matrices. If , the resulting matrix has its sole entry . If , it has one entry equal to the product of the sole entries of the . If and some , its index set is empty.
QAlgorithms.Papers.Independent.Extend50.P13.witnessThree
For every natural number , including zero, and arbitrary complex matrices , this defines
where is the identity matrix.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.