Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for A purification postulate for quantum mechanics with indefinite causal order

Definition
QAlgorithms_Papers_Independent_Intake100_P46

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

prove2quantum

The objects the formalized statements of A purification postulate for quantum mechanics with indefinite causal order (arXiv:1611.08535) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • ProcessWireDimensions: PDF pp.2,10: positive dimensions in wire order P, AI, AO, BI, BO, F.
  • ProcessBasis: PDF p.2: the fixed computational basis of all six wires.
  • ProcessMatrix: PDF p.2: a process operator, without any validity condition imposed by its type.
  • processCoordinates: PDF pp.2–3: coordinate insertion in the fixed six-wire order.
  • unitaryChannelProjector: PDF p.10, Eq.(40): |U>><<U| in input-first order, with no dimension factor.
  • IsReversibleMatrix: PDF pp.3–4: reversible unitarity between possibly differently labelled finite bases. Both equations are required; an isometry into a larger space is excluded.
  • IsIsometricMatrix: PDF p.4: an isometry need only satisfy the first of the two unitary equations.
  • IsCPTPChoi: PDF p.11, before Eq.(45): the independent finite Choi criterion for a local CPTP map.
  • IsUnitaryChoi: PDF pp.3,10: the CJ operator of some reversible unitary channel.
  • linkLaboratories: PDF p.2, Eq.(1), and p.11, Eq.(43): link W with arbitrary ancillary local CJ operators. The laboratory indices are contracted bilinearly (no conjugation). All off-diagonal blocks of the ancillary wires are retained.
  • IsValidProcess: PDF pp.2–3,11: operational process validity, independently of LV. Every positive ancillary dimension and every pair of local CPTP operators is tested.
  • IsPureProcess: PDF p.3, Definition 1: purity tests all compatible unitary laboratories on all ancillary wires, including the enlarged SWAP laboratories in Eq.(9). Validity is kept separate so Theorem 2 does not silently assume arbitrary unitaries are processes.
  • processProjector: PDF pp.3–4: a matrix from P AO BO to AI BI F, in its input-first CJ wire order.
  • replaceWires: PDF p.11, Eq.(53): replace the wires in s by maximally mixed identity factors, preserving the order of every other wire. Strictly positive dimensions guard division.
  • validSubspaceProjector: PDF p.12, Eq.(64): the complete bipartite linear normalization projector. The order of wire labels is P, AI, AO, BI, BO, F.
  • invalidSubspaceProjector: PDF p.6, before Eq.(21): the complementary projector 1-LV.
  • vectorOuter: PDF pp.5–6: a process-vector outer product; these vectors are unnormalized.
  • processVectorPairing: PDF pp.5–6, Eq.(24): the usual conjugate-linear-first finite inner product.
  • laboratorySignature: PDF pp.4–6: fixed laboratory dimensions, with independently specified global wires.
  • recoverProcess: PDF p.4, Definition 3, specialized to trivial original P,F: insert |0> in Pprime and trace Fprime. The two new global dimensions are independent.
  • IsPurifiable: PDF p.4, Definition 3: physical purification by an operationally valid pure process, with unrestricted positive new-past and new-future dimensions.
  • SupportSpectrum: PDF pp.5–6, Eq.(19): the complete positive spectral support, with multiplicity. This is chosen spectral data, not extra unproved process constraints.
  • canonicalVector: PDF pp.5–6, Eqs.(20),(23): the canonical positive-matrix purification, with future basis indexed by the spectral support. There is no normalization to trace one.
  • IsCompletion: PDF p.6, Eqs.(23)–(24): all prescribed vectors, bilinear LV constraints and orthogonality with squared norm dAO*dBO.
  • reconstructedUnitary: PDF p.6, Eq.(25): the actual matrix reconstructed by using wi as the past slices. Its input basis is Pprime AO BO and its output basis AI BI Fprime.
  • stateOutputSignature: PDF p.4: a concrete dimension-increasing isometry, with every laboratory wire and P trivial, and F two-dimensional.
  • stateOutputIsometry: PDF p.4: the isometry sends the only global input basis vector to future |0>.
  • IsTotallyIsotropic: PDF pp.12–13: total isotropy is a zero compression, not invariance or membership in the kernel of C. Zero-dimensional ambient spaces are permitted.
  • positiveCount: PDF p.12: positive eigenvalues counted with multiplicity.
  • negativeCount: PDF p.12: strictly negative eigenvalues counted with multiplicity.
  • zeroCount: PDF p.12: zero eigenvalues counted with multiplicity.
  • nullSquareSize: PDF p.12: the claimed greatest null-square size, expressed without any supremum.
  • vectorizedComplement: PDF p.6, Eq.(26): matrix of 1-LV on input-first vectorized operators. The coordinate pair (a,b) represents the operator entry (b,a).
  • purificationKernelOperator: PDF p.6, Eq.(28): OW is computed from the canonical vector. Its ket factor is conjugated w0, so its bra factor is w0, using the conjugate-linear-first convention.
  • KernelBasisData: PDF p.6, Eqs.(28)–(30): an explicit orthonormal basis of the entire kernel of OW. No basis-independence of the eventual numerical bound is asserted.
  • compressedOperator: PDF p.6, Eq.(30): (conj R tensor R) Pi (transpose R tensor adjoint R), with Ria=conj(ri(a)). The entry formula retains the source's conjugations and factor order.
  • CompressionSpectrum: PDF p.7, Eq.(31): a full orthonormal eigenbasis of the computed compression. Filtering its strictly nonzero eigenvalues below gives exactly the source's mk family.
  • NonzeroModes: PDF p.7, Eq.(31): the complete nonzero-eigenvalue index set, possibly empty.
  • modeMatrix: PDF p.7, Eq.(32): |transpose Mk>>=mk, with the same input-first CJ ordering. The intervening printed bra identity has a transpose discrepancy in this convention; only the printed reshaping and its inertia counts are used here. Transposing every constraint leaves its eigenvalues and the test bound unchanged.
  • constraintMatrix: PDF p.7, Eq.(32): M+M† for false and i(M-M†) for true. Writing the latter as (iM)+(iM)† gives a Hermitian matrix by construction, without adding a hypothesis.
  • testBound: PDF p.7, Eq.(34): the actual minimum over the explicit Hermitian constraints. Only the empty-family extension is top, rather than a junk natural-number zero; the footnote theorem treats that case separately.
  • liftKernelVector: PDF pp.6–7: lift the kernel coordinates back to the laboratory/future vector.
  • qubitSignature: PDF p.7, §6: four qubit laboratory wires, with trivial P and F.
  • laboratoryTensor: PDF p.7, §6: a four-wire tensor, in AI AO BI BO order. Reuse the frozen Bool-indexed Pauli gates, with computational labels 0=false and 1=true.
  • ocbProcess: PDF p.7, Eq.(35): the exact OCB matrix; the factor is 1/4, not 1/16.
  • optProcess: PDF p.7, Eq.(37): the exact Wopt matrix, without a claim about purifiability.
  • qubitLaboratories: PDF p.7: the common qubit laboratory dimensions, independently of global wires.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Gates

/-!
Statements from Araújo, Feix, Navascués and Brukner, arXiv:1611.08535v4.
The local process interface uses fixed finite computational bases and unnormalized,
input-first Choi operators. Physical dimensions are positive natural numbers.
Theorem 4 below is explicitly restricted to the balanced domain required by
its proof; the unrestricted printed statement remains deferred.
Pauli gates come from the frozen Gates module. Other local names distinguish
this six-wire, arbitrary-ancilla process interface from incompatible accepted
interfaces with coincidentally matching short names.
-/

noncomputable section

open scoped Matrix ComplexConjugate ComplexOrder

attribute [local instance] Classical.decEq Classical.propDecidable

namespace QAlgorithms.Papers.Independent.Intake100.P46

/-- PDF pp.2,10: positive dimensions in wire order P, AI, AO, BI, BO, F. -/
abbrev ProcessWireDimensions := Fin 6 → ℕ+

/-- PDF p.2: the fixed computational basis of all six wires. -/
abbrev ProcessBasis (d : ProcessWireDimensions) := (s : Fin 6) → Fin (d s : ℕ)

/-- PDF p.2: a process operator, without any validity condition imposed by its type. -/
abbrev ProcessMatrix (d : ProcessWireDimensions) := Matrix (ProcessBasis d) (ProcessBasis d) ℂ

/-- PDF pp.2–3: coordinate insertion in the fixed six-wire order. -/
def processCoordinates (d : ProcessWireDimensions) (p : Fin (d 0 : ℕ)) (ai : Fin (d 1 : ℕ))
    (ao : Fin (d 2 : ℕ)) (bi : Fin (d 3 : ℕ)) (bo : Fin (d 4 : ℕ))
    (f : Fin (d 5 : ℕ)) : ProcessBasis d :=
  Fin.cases p (Fin.cases ai (Fin.cases ao (Fin.cases bi
    (Fin.cases bo (Fin.cases f (fun i => Fin.elim0 i))))))

/-- PDF p.10, Eq.(40): |U>><<U| in input-first order, with no dimension factor. -/
def unitaryChannelProjector {I O : Type*} (U : Matrix O I ℂ) : Matrix (I × O) (I × O) ℂ :=
  fun x y => U x.2 x.1 * conj (U y.2 y.1)

/-- PDF pp.3–4: reversible unitarity between possibly differently labelled finite bases.
Both equations are required; an isometry into a larger space is excluded. -/
def IsReversibleMatrix {I O : Type*} [Fintype I] [Fintype O] [DecidableEq I]
    [DecidableEq O] (U : Matrix O I ℂ) : Prop :=
  Uᴴ * U = 1 ∧ U * Uᴴ = 1

/-- PDF p.4: an isometry need only satisfy the first of the two unitary equations. -/
def IsIsometricMatrix {I O : Type*} [Fintype O] [DecidableEq I]
    (V : Matrix O I ℂ) : Prop := Vᴴ * V = 1

/-- PDF p.11, before Eq.(45): the independent finite Choi criterion for a local CPTP map. -/
def IsCPTPChoi {I O : Type*} [Fintype I] [Fintype O] [DecidableEq I]
    (J : Matrix (I × O) (I × O) ℂ) : Prop :=
  J.PosSemidef ∧ ∀ i j, (∑ o, J (i,o) (j,o)) = if i = j then 1 else 0

/-- PDF pp.3,10: the CJ operator of some reversible unitary channel. -/
def IsUnitaryChoi {I O : Type*} [Fintype I] [Fintype O] [DecidableEq I]
    [DecidableEq O] (J : Matrix (I × O) (I × O) ℂ) : Prop :=
  ∃ U : Matrix O I ℂ, IsReversibleMatrix U ∧ J = unitaryChannelProjector U

/-- PDF p.2, Eq.(1), and p.11, Eq.(43): link W with arbitrary ancillary local CJ
operators. The laboratory indices are contracted bilinearly (no conjugation).
All off-diagonal blocks of the ancillary wires are retained. -/
def linkLaboratories (d : ProcessWireDimensions) (aIn aOut bIn bOut : ℕ+) (W : ProcessMatrix d)
    (A : Matrix ((Fin (d 1 : ℕ) × Fin (aIn : ℕ)) ×
      (Fin (d 2 : ℕ) × Fin (aOut : ℕ)))
      ((Fin (d 1 : ℕ) × Fin (aIn : ℕ)) ×
      (Fin (d 2 : ℕ) × Fin (aOut : ℕ))) ℂ)
    (B : Matrix ((Fin (d 3 : ℕ) × Fin (bIn : ℕ)) ×
      (Fin (d 4 : ℕ) × Fin (bOut : ℕ)))
      ((Fin (d 3 : ℕ) × Fin (bIn : ℕ)) ×
      (Fin (d 4 : ℕ) × Fin (bOut : ℕ))) ℂ) :
    Matrix ((Fin (d 0 : ℕ) × Fin (aIn : ℕ) × Fin (bIn : ℕ)) ×
      (Fin (d 5 : ℕ) × Fin (aOut : ℕ) × Fin (bOut : ℕ)))
      ((Fin (d 0 : ℕ) × Fin (aIn : ℕ) × Fin (bIn : ℕ)) ×
      (Fin (d 5 : ℕ) × Fin (aOut : ℕ) × Fin (bOut : ℕ))) ℂ :=
  fun u v => ∑ x : ProcessBasis d, ∑ y : ProcessBasis d,
    if x 0 = u.1.1 ∧ y 0 = v.1.1 ∧ x 5 = u.2.1 ∧ y 5 = v.2.1 then
      W x y * A ((x 1,u.1.2.1),(x 2,u.2.2.1))
        ((y 1,v.1.2.1),(y 2,v.2.2.1)) *
      B ((x 3,u.1.2.2),(x 4,u.2.2.2))
        ((y 3,v.1.2.2),(y 4,v.2.2.2)) else 0

/-- PDF pp.2–3,11: operational process validity, independently of LV. Every positive
ancillary dimension and every pair of local CPTP operators is tested. -/
def IsValidProcess {d : ProcessWireDimensions} (W : ProcessMatrix d) : Prop :=
  ∀ (aIn aOut bIn bOut : ℕ+) A B,
    IsCPTPChoi A → IsCPTPChoi B → IsCPTPChoi (linkLaboratories d aIn aOut bIn bOut W A B)

/-- PDF p.3, Definition 1: purity tests all compatible unitary laboratories on all
ancillary wires, including the enlarged SWAP laboratories in Eq.(9). Validity is
kept separate so Theorem 2 does not silently assume arbitrary unitaries are processes. -/
def IsPureProcess {d : ProcessWireDimensions} (W : ProcessMatrix d) : Prop :=
  ∀ (aIn aOut bIn bOut : ℕ+) U V,
    IsReversibleMatrix U → IsReversibleMatrix V →
      IsUnitaryChoi (linkLaboratories d aIn aOut bIn bOut W (unitaryChannelProjector U) (unitaryChannelProjector V))

/-- PDF pp.3–4: a matrix from P AO BO to AI BI F, in its input-first CJ wire order. -/
def processProjector {d : ProcessWireDimensions}
    (U : Matrix (Fin (d 1 : ℕ) × Fin (d 3 : ℕ) × Fin (d 5 : ℕ))
      (Fin (d 0 : ℕ) × Fin (d 2 : ℕ) × Fin (d 4 : ℕ)) ℂ) : ProcessMatrix d :=
  fun x y => U (x 1,x 3,x 5) (x 0,x 2,x 4) *
    conj (U (y 1,y 3,y 5) (y 0,y 2,y 4))

/-- PDF p.11, Eq.(53): replace the wires in s by maximally mixed identity factors,
preserving the order of every other wire. Strictly positive dimensions guard division. -/
def replaceWires {d : ProcessWireDimensions} (s : Finset (Fin 6)) (W : ProcessMatrix d) :
    ProcessMatrix d :=
  fun x y => if ∀ i ∈ s, x i = y i then
    ((∏ i ∈ s, (d i : ℕ) : ℕ) : ℂ)⁻¹ *
      ∑ z : ProcessBasis d,
        if ∀ i, i ∉ s → z i = x i then
          W z (fun i => if i ∈ s then z i else y i) else 0
    else 0

/-- PDF p.12, Eq.(64): the complete bipartite linear normalization projector.
The order of wire labels is P, AI, AO, BI, BO, F. -/
def validSubspaceProjector {d : ProcessWireDimensions} (W : ProcessMatrix d) : ProcessMatrix d :=
  W - replaceWires {5} W + replaceWires {2,5} W + replaceWires {4,5} W -
    replaceWires {2,4,5} W - replaceWires {1,2,5} W + replaceWires {1,2,4,5} W -
    replaceWires {3,4,5} W + replaceWires {2,3,4,5} W -
    replaceWires {1,2,3,4,5} W + replaceWires {0,1,2,3,4,5} W

/-- PDF p.6, before Eq.(21): the complementary projector 1-LV. -/
def invalidSubspaceProjector {d : ProcessWireDimensions} (W : ProcessMatrix d) : ProcessMatrix d :=
  W - validSubspaceProjector W

/-- PDF pp.5–6: a process-vector outer product; these vectors are unnormalized. -/
def vectorOuter {I : Type*} (v w : I → ℂ) : Matrix I I ℂ :=
  fun x y => v x * conj (w y)

/-- PDF pp.5–6, Eq.(24): the usual conjugate-linear-first finite inner product. -/
def processVectorPairing {I : Type*} [Fintype I] (v w : I → ℂ) : ℂ :=
  ∑ x, conj (v x) * w x

/-- PDF pp.4–6: fixed laboratory dimensions, with independently specified global wires. -/
def laboratorySignature (d : Fin 4 → ℕ+) (p f : ℕ+) : ProcessWireDimensions :=
  ![p,d 0,d 1,d 2,d 3,f]

-- the wire dimensions of the two signatures are compared by unfolding `![...]`; prove2me's checker needs more than
-- the default 200000 heartbeats here
set_option maxHeartbeats 800000 in
/-- PDF p.4, Definition 3, specialized to trivial original P,F: insert |0> in Pprime
and trace Fprime. The two new global dimensions are independent. -/
def recoverProcess {d : Fin 4 → ℕ+} {p f : ℕ+}
    (S : ProcessMatrix (laboratorySignature d p f)) :
    ProcessMatrix (laboratorySignature d 1 1) :=
  fun x y => ∑ t : Fin (f : ℕ),
    S (processCoordinates (laboratorySignature d p f) 0 (x 1) (x 2) (x 3) (x 4) t)
      (processCoordinates (laboratorySignature d p f) 0 (y 1) (y 2) (y 3) (y 4) t)

/-- PDF p.4, Definition 3: physical purification by an operationally valid pure process,
with unrestricted positive new-past and new-future dimensions. -/
def IsPurifiable {d : Fin 4 → ℕ+}
    (W : ProcessMatrix (laboratorySignature d 1 1)) : Prop :=
  ∃ (p f : ℕ+) (S : ProcessMatrix (laboratorySignature d p f)),
    IsValidProcess S ∧ IsPureProcess S ∧ recoverProcess S = W

/-- PDF pp.5–6, Eq.(19): the complete positive spectral support, with multiplicity.
This is chosen spectral data, not extra unproved process constraints. -/
structure SupportSpectrum {d : Fin 4 → ℕ+}
    (W : ProcessMatrix (laboratorySignature d 1 1)) where
  rank : ℕ+
  rank_eq : (rank : ℕ) = Matrix.rank W
  values : Fin (rank : ℕ) → ℝ
  positive : ∀ i, 0 < values i
  vectors : Fin (rank : ℕ) → ProcessBasis (laboratorySignature d 1 1) → ℂ
  orthonormal : ∀ i j, processVectorPairing (vectors i) (vectors j) = if i = j then 1 else 0
  decomposition : ∀ x y, W x y = ∑ i, (values i : ℂ) * vectors i x * conj (vectors i y)

/-- PDF pp.5–6, Eqs.(20),(23): the canonical positive-matrix purification, with future
basis indexed by the spectral support. There is no normalization to trace one. -/
def canonicalVector {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} (e : SupportSpectrum W) :
    ProcessBasis (laboratorySignature d 1 e.rank) → ℂ :=
  fun x => (Real.sqrt (e.values (x 5)) : ℂ) *
    e.vectors (x 5) (processCoordinates (laboratorySignature d 1 1) 0 (x 1) (x 2) (x 3) (x 4) 0)

/-- PDF p.6, Eqs.(23)–(24): all prescribed vectors, bilinear LV constraints and
orthogonality with squared norm dAO*dBO. -/
def IsCompletion {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} (e : SupportSpectrum W)
    (w : Fin (e.rank : ℕ) → ProcessBasis (laboratorySignature d 1 e.rank) → ℂ) : Prop :=
  w 0 = canonicalVector e ∧ ∀ i j,
    invalidSubspaceProjector (vectorOuter (w i) (w j)) = 0 ∧
    processVectorPairing (w i) (w j) = if i = j then ((d 1 : ℕ) * (d 3 : ℕ) : ℂ) else 0

/-- PDF p.6, Eq.(25): the actual matrix reconstructed by using wi as the past slices.
Its input basis is Pprime AO BO and its output basis AI BI Fprime. -/
def reconstructedUnitary {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} (e : SupportSpectrum W)
    (w : Fin (e.rank : ℕ) → ProcessBasis (laboratorySignature d 1 e.rank) → ℂ) :
    Matrix (Fin (d 0 : ℕ) × Fin (d 2 : ℕ) × Fin (e.rank : ℕ))
      (Fin (e.rank : ℕ) × Fin (d 1 : ℕ) × Fin (d 3 : ℕ)) ℂ :=
  fun o i => w i.1
    (processCoordinates (laboratorySignature d 1 e.rank) 0 o.1 i.2.1 o.2.1 i.2.2 o.2.2)

/-- PDF p.4: a concrete dimension-increasing isometry, with every laboratory wire
and P trivial, and F two-dimensional. -/
def stateOutputSignature : ProcessWireDimensions := ![1,1,1,1,1,2]

/-- PDF p.4: the isometry sends the only global input basis vector to future |0>. -/
def stateOutputIsometry :
    Matrix (Fin (stateOutputSignature 1 : ℕ) × Fin (stateOutputSignature 3 : ℕ) ×
      Fin (stateOutputSignature 5 : ℕ))
      (Fin (stateOutputSignature 0 : ℕ) × Fin (stateOutputSignature 2 : ℕ) ×
      Fin (stateOutputSignature 4 : ℕ)) ℂ :=
  fun o _ => if o.2.2 = 0 then 1 else 0

/-- PDF pp.12–13: total isotropy is a zero compression, not invariance or membership
in the kernel of C. Zero-dimensional ambient spaces are permitted. -/
def IsTotallyIsotropic {I : Type*} [Fintype I] (C : Matrix I I ℂ)
    (S : Submodule ℂ (I → ℂ)) : Prop :=
  ∀ v ∈ S, ∀ w ∈ S, ∑ i, ∑ j, conj (v i) * C i j * w j = 0

/-- PDF p.12: positive eigenvalues counted with multiplicity. -/
def positiveCount {I : Type*} [Fintype I] [DecidableEq I]
    {C : Matrix I I ℂ} (hC : C.IsHermitian) : ℕ :=
  (Finset.univ.filter fun i => 0 < hC.eigenvalues i).card

/-- PDF p.12: strictly negative eigenvalues counted with multiplicity. -/
def negativeCount {I : Type*} [Fintype I] [DecidableEq I]
    {C : Matrix I I ℂ} (hC : C.IsHermitian) : ℕ :=
  (Finset.univ.filter fun i => hC.eigenvalues i < 0).card

/-- PDF p.12: zero eigenvalues counted with multiplicity. -/
def zeroCount {I : Type*} [Fintype I] [DecidableEq I]
    {C : Matrix I I ℂ} (hC : C.IsHermitian) : ℕ :=
  (Finset.univ.filter fun i => hC.eigenvalues i = 0).card

/-- PDF p.12: the claimed greatest null-square size, expressed without any supremum. -/
def nullSquareSize {I : Type*} [Fintype I] [DecidableEq I]
    {C : Matrix I I ℂ} (hC : C.IsHermitian) : ℕ :=
  min (positiveCount hC) (negativeCount hC) + zeroCount hC

/-- PDF p.6, Eq.(26): matrix of 1-LV on input-first vectorized operators.
The coordinate pair (a,b) represents the operator entry (b,a). -/
def vectorizedComplement {d : ProcessWireDimensions} :
    Matrix (ProcessBasis d × ProcessBasis d) (ProcessBasis d × ProcessBasis d) ℂ :=
  fun a b => invalidSubspaceProjector (Matrix.single b.2 b.1 1) a.2 a.1

/-- PDF p.6, Eq.(28): OW is computed from the canonical vector. Its ket factor
is conjugated w0, so its bra factor is w0, using the conjugate-linear-first convention. -/
def purificationKernelOperator {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} (e : SupportSpectrum W) :
    ProcessMatrix (laboratorySignature d 1 e.rank) :=
  fun v w => ∑ a, ∑ b, canonicalVector e a *
    vectorizedComplement (a,v) (b,w) * conj (canonicalVector e b)

/-- PDF p.6, Eqs.(28)–(30): an explicit orthonormal basis of the entire kernel of OW.
No basis-independence of the eventual numerical bound is asserted. -/
structure KernelBasisData {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} (e : SupportSpectrum W) where
  dimension : ℕ
  vectors : Fin dimension → ProcessBasis (laboratorySignature d 1 e.rank) → ℂ
  orthonormal : ∀ i j, processVectorPairing (vectors i) (vectors j) = if i = j then 1 else 0
  kernel_span : (Submodule.span ℂ (Set.range vectors) :
      Set (ProcessBasis (laboratorySignature d 1 e.rank) → ℂ)) =
    {v | (purificationKernelOperator e).mulVec v = 0}

/-- PDF p.6, Eq.(30): (conj R tensor R) Pi (transpose R tensor adjoint R), with
Ria=conj(ri(a)). The entry formula retains the source's conjugations and factor order. -/
def compressedOperator {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    (b : KernelBasisData e) :
    Matrix (Fin b.dimension × Fin b.dimension) (Fin b.dimension × Fin b.dimension) ℂ :=
  fun i j => ∑ a, ∑ v, ∑ c, ∑ w,
    b.vectors i.1 a * conj (b.vectors i.2 v) * vectorizedComplement (a,v) (c,w) *
      conj (b.vectors j.1 c) * b.vectors j.2 w

/-- PDF p.7, Eq.(31): a full orthonormal eigenbasis of the computed compression.
Filtering its strictly nonzero eigenvalues below gives exactly the source's mk family. -/
structure CompressionSpectrum {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    (b : KernelBasisData e) where
  values : (Fin b.dimension × Fin b.dimension) → ℝ
  vectors : (Fin b.dimension × Fin b.dimension) → (Fin b.dimension × Fin b.dimension) → ℂ
  orthonormal : ∀ i j, processVectorPairing (vectors i) (vectors j) = if i = j then 1 else 0
  spans : Submodule.span ℂ (Set.range vectors) = ⊤
  eigenvectors : ∀ i, (compressedOperator b).mulVec (vectors i) =
    (values i : ℂ) • vectors i

/-- PDF p.7, Eq.(31): the complete nonzero-eigenvalue index set, possibly empty. -/
abbrev NonzeroModes {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    {b : KernelBasisData e} (s : CompressionSpectrum b) :=
  {i : Fin b.dimension × Fin b.dimension // s.values i ≠ 0}

/-- PDF p.7, Eq.(32): |transpose Mk>>=mk, with the same input-first CJ ordering.
The intervening printed bra identity has a transpose discrepancy in this convention;
only the printed reshaping and its inertia counts are used here. Transposing every
constraint leaves its eigenvalues and the test bound unchanged. -/
def modeMatrix {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    {b : KernelBasisData e} (s : CompressionSpectrum b) (k : NonzeroModes s) :
    Matrix (Fin b.dimension) (Fin b.dimension) ℂ := fun i j => s.vectors k.val (i,j)

/-- PDF p.7, Eq.(32): M+M† for false and i(M-M†) for true. Writing the latter as
(iM)+(iM)† gives a Hermitian matrix by construction, without adding a hypothesis. -/
def constraintMatrix {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    {b : KernelBasisData e} (s : CompressionSpectrum b) (k : NonzeroModes s × Bool) :
    Matrix (Fin b.dimension) (Fin b.dimension) ℂ :=
  let M := if k.2 then Complex.I • modeMatrix s k.1 else modeMatrix s k.1
  M + Mᴴ

/-- PDF p.7, Eq.(34): the actual minimum over the explicit Hermitian constraints.
Only the empty-family extension is top, rather than a junk natural-number zero;
the footnote theorem treats that case separately. -/
def testBound {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    {b : KernelBasisData e} (s : CompressionSpectrum b) : WithTop ℕ :=
  Finset.univ.inf fun k : NonzeroModes s × Bool =>
    (nullSquareSize (C := constraintMatrix s k)
      (Matrix.isHermitian_add_transpose_self
        (if k.2 then Complex.I • modeMatrix s k.1 else modeMatrix s k.1)) : WithTop ℕ)

/-- PDF pp.6–7: lift the kernel coordinates back to the laboratory/future vector. -/
def liftKernelVector {d : Fin 4 → ℕ+}
    {W : ProcessMatrix (laboratorySignature d 1 1)} {e : SupportSpectrum W}
    (b : KernelBasisData e) (v : Fin b.dimension → ℂ) :
    ProcessBasis (laboratorySignature d 1 e.rank) → ℂ :=
  fun x => ∑ i, v i * b.vectors i x

/-- PDF p.7, §6: four qubit laboratory wires, with trivial P and F. -/
def qubitSignature : ProcessWireDimensions := ![1,2,2,2,2,1]

/-- PDF p.7, §6: a four-wire tensor, in AI AO BI BO order. Reuse the frozen
Bool-indexed Pauli gates, with computational labels 0=false and 1=true. -/
def laboratoryTensor (A B C D : Matrix Bool Bool ℂ) : ProcessMatrix qubitSignature :=
  fun x y => A (decide (x 1 ≠ 0)) (decide (y 1 ≠ 0)) *
    B (decide (x 2 ≠ 0)) (decide (y 2 ≠ 0)) *
    C (decide (x 3 ≠ 0)) (decide (y 3 ≠ 0)) *
    D (decide (x 4 ≠ 0)) (decide (y 4 ≠ 0))

/-- PDF p.7, Eq.(35): the exact OCB matrix; the factor is 1/4, not 1/16. -/
def ocbProcess : ProcessMatrix qubitSignature :=
  (1 / 4 : ℂ) • (laboratoryTensor 1 1 1 1 + (1 / (Real.sqrt 2 : ℂ)) •
    (laboratoryTensor 1 pauliZ pauliZ 1 + laboratoryTensor pauliZ 1 pauliX pauliZ))

/-- PDF p.7, Eq.(37): the exact Wopt matrix, without a claim about purifiability. -/
def optProcess : ProcessMatrix qubitSignature :=
  (1 / 4 : ℂ) • (laboratoryTensor 1 1 1 1 + (1 / (Real.sqrt 3 : ℂ)) •
    laboratoryTensor pauliZ 1 pauliX pauliZ + (((Real.sqrt 3 : ℂ) - 1) / 3) •
    (laboratoryTensor 1 pauliX pauliX 1 + laboratoryTensor 1 pauliY pauliY 1 +
      laboratoryTensor 1 pauliZ pauliZ 1))

/-- PDF p.7: the common qubit laboratory dimensions, independently of global wires. -/
def qubitLaboratories : Fin 4 → ℕ+ := ![2,2,2,2]

/-- Sanity: an empty mode family has top bound, never natural-number zero. -/
example {d : Fin 4 → ℕ+} {W : ProcessMatrix (laboratorySignature d 1 1)}
    {e : SupportSpectrum W} {b : KernelBasisData e} (s : CompressionSpectrum b)
    (hempty : ∀ k, s.values k = 0) : testBound s = ⊤ := by
  letI : IsEmpty (NonzeroModes s) := ⟨fun k => k.property (hempty k.val)⟩
  simp [testBound]

/-- Sanity: the qubit signature agrees exactly with the laboratory/past/future split. -/
example : laboratorySignature qubitLaboratories 1 1 = qubitSignature := by
  ext i
  fin_cases i <;> rfl

/-- Sanity: the tensor identity has diagonal entry one, without a normalization factor. -/
example (x : ProcessBasis qubitSignature) : laboratoryTensor 1 1 1 1 x x = 1 := by
  simp [laboratoryTensor, Matrix.one_apply_eq]

/-- Sanity: dependent coordinate insertion selects the future wire without a cast. -/
example (d : ProcessWireDimensions) (p : Fin (d 0 : ℕ)) (ai : Fin (d 1 : ℕ))
    (ao : Fin (d 2 : ℕ)) (bi : Fin (d 3 : ℕ)) (bo : Fin (d 4 : ℕ))
    (f : Fin (d 5 : ℕ)) : processCoordinates d p ai ao bi bo f 5 = f := by
  rfl

/-- Sanity: the imported Pauli convention sends |1> to -i|0> under Y. -/
example : QAlgorithms.pauliY false true = -Complex.I := by
  rfl

/-- Sanity: the one-dimensional identity has unnormalized CJ entry one. -/
example : unitaryChannelProjector (1 : Matrix (Fin 1) (Fin 1) ℂ) (0,0) (0,0) = 1 := by
  simp [unitaryChannelProjector]

/-- Sanity: both inverse equations hold for the identity, in every finite dimension. -/
example {I : Type*} [Fintype I] [DecidableEq I] :
    IsReversibleMatrix (1 : Matrix I I ℂ) := by
  simp [IsReversibleMatrix]

/-- Sanity: a zero process vector gives the zero operator, without a hidden offset. -/
example {d : ProcessWireDimensions} : processProjector (d := d) 0 = 0 := by
  ext x y
  simp [processProjector]

/-- Sanity: the zero Hermitian form is totally isotropic on every subspace. -/
example {I : Type*} [Fintype I] (S : Submodule ℂ (I → ℂ)) :
    IsTotallyIsotropic (0 : Matrix I I ℂ) S := by
  intro v hv w hw
  simp

end QAlgorithms.Papers.Independent.Intake100.P46
Source
A purification postulate for quantum mechanics with indefinite causal order, arXiv:1611.08535v4, https://arxiv.org/abs/1611.08535v4
Read-back

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

QAlgorithms.Papers.Independent.Intake100.P46.CompressionSpectrum

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, let XXX be the set of six-tuples with wire dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and let WWW be a complex matrix indexed by XXX. The supplied support-spectrum data eee consist of a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λt\lambda_tλt​, and vectors ut:X→Cu_t:X\to\mathbb Cut​:X→C, for 0≤t<r0\le t<r0≤t<r, satisfying ∑xut(x)‾us(x)=δts\sum_x\overline{u_t(x)}u_s(x)=\delta_{ts}∑x​ut​(x)​us​(x)=δts​ and Wxy=∑tλtut(x)ut(y)‾W_{xy}=\sum_t\lambda_tu_t(x)\overline{u_t(y)}Wxy​=∑t​λt​ut​(x)ut​(y)​. Thus these data require positive rank. Put Y=∏j=05{0,…,Dj−1}Y=\prod_{j=0}^5\{0,\ldots,D_j-1\}Y=∏j=05​{0,…,Dj​−1}, where D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r), and put c(x)=λx5 ux5(0,x1,x2,x3,x4,0)c(x)=\sqrt{\lambda_{x_5}}\,u_{x_5}(0,x_1,x_2,x_3,x_4,0)c(x)=λx5​​​ux5​​(0,x1​,x2​,x3​,x4​,0). For matrices on YYY, let RSR_SRS​ mean partial trace over the wires in SSS, followed by insertion of the identity on those wires divided by ∏j∈SDj\prod_{j\in S}D_j∏j∈S​Dj​, restoring the original wire positions, and define

L=R{5}−R{2,5}−R{4,5}+R{2,4,5}+R{1,2,5}−R{1,2,4,5}+R{3,4,5}−R{2,3,4,5}+R{1,2,3,4,5}−R{0,1,2,3,4,5}.\mathcal L =R_{\{5\}}-R_{\{2,5\}}-R_{\{4,5\}}+R_{\{2,4,5\}} +R_{\{1,2,5\}}-R_{\{1,2,4,5\}} +R_{\{3,4,5\}}-R_{\{2,3,4,5\}} +R_{\{1,2,3,4,5\}}-R_{\{0,1,2,3,4,5\}}.L=R{5}​−R{2,5}​−R{4,5}​+R{2,4,5}​+R{1,2,5}​−R{1,2,4,5}​+R{3,4,5}​−R{2,3,4,5}​+R{1,2,3,4,5}​−R{0,1,2,3,4,5}​.

Writing Ew,zE_{w,z}Ew,z​ for the matrix whose only nonzero entry is 111 in row www, column zzz, set H(a,v),(z,w)=[L(Ew,z)]v,aH_{(a,v),(z,w)}=[\mathcal L(E_{w,z})]_{v,a}H(a,v),(z,w)​=[L(Ew,z​)]v,a​ and Kvw=∑a,z∈Yc(a)H(a,v),(z,w)c(z)‾K_{vw}=\sum_{a,z\in Y}c(a)H_{(a,v),(z,w)}\overline{c(z)}Kvw​=∑a,z∈Y​c(a)H(a,v),(z,w)​c(z)​. The supplied data bbb consist of a natural number mmm, which may be zero, and vectors βi:Y→C\beta_i:Y\to\mathbb Cβi​:Y→C, 0≤i<m0\le i<m0≤i<m, satisfying ∑xβi(x)‾βj(x)=δij\sum_x\overline{\beta_i(x)}\beta_j(x)=\delta_{ij}∑x​βi​(x)​βj​(x)=δij​, whose complex span is exactly {v:Kv=0}\{v:Kv=0\}{v:Kv=0}. Define the matrix CCC, indexed by J={0,…,m−1}2J=\{0,\ldots,m-1\}^2J={0,…,m−1}2, by

C(i,j),(k,ℓ)=∑a,v,z,w∈Yβi(a)βj(v)‾H(a,v),(z,w)βk(z)‾βℓ(w).C_{(i,j),(k,\ell)} =\sum_{a,v,z,w\in Y} \beta_i(a)\overline{\beta_j(v)} H_{(a,v),(z,w)} \overline{\beta_k(z)}\beta_\ell(w).C(i,j),(k,ℓ)​=a,v,z,w∈Y∑​βi​(a)βj​(v)​H(a,v),(z,w)​βk​(z)​βℓ​(w).

A value of CompressionSpectrum for this bbb consists of real numbers μα\mu_\alphaμα​ and complex vectors zα:J→Cz_\alpha:J\to\mathbb Czα​:J→C, one of each for every α∈J\alpha\in Jα∈J, such that ∑γ∈Jzα(γ)‾zη(γ)=δαη\sum_{\gamma\in J}\overline{z_\alpha(\gamma)}z_\eta(\gamma)=\delta_{\alpha\eta}∑γ∈J​zα​(γ)​zη​(γ)=δαη​, the complex span of all zαz_\alphazα​ is the whole space CJ\mathbb C^JCJ, and Czα=μαzαCz_\alpha=\mu_\alpha z_\alphaCzα​=μα​zα​ for every α\alphaα. The numbers μα\mu_\alphaμα​ need not be positive or nonzero; when m=0m=0m=0, the indexing set is empty and the vector conditions are vacuous in the zero-dimensional space.

QAlgorithms.Papers.Independent.Intake100.P46.IsCPTPChoi

For finite types III and OOO, with decidable equality on III, and a complex matrix JJJ indexed on both sides by I×OI\times OI×O, this predicate means that JJJ is positive semidefinite and that

∑o∈OJ(i,o),(j,o)={1i=j,0i≠jfor every i,j∈I.\sum_{o\in O}J_{(i,o),(j,o)} = \begin{cases}1&i=j,\\0&i\ne j\end{cases} \qquad\text{for every }i,j\in I.o∈O∑​J(i,o),(j,o)​={10​i=j,i=j​for every i,j∈I.

Empty types are included: if III is empty, the unique matrix satisfies the predicate; if III is nonempty and OOO is empty, the diagonal normalization equations would require 0=10=10=1, so the predicate cannot hold.

QAlgorithms.Papers.Independent.Intake100.P46.IsCompletion

For any four positive integers d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​, any complex matrix WWW indexed by tuples of dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), supplied data consisting of a positive integer r=rank⁡(W)r=\operatorname{rank}(W)r=rank(W), positive real numbers λi\lambda_iλi​, and functions viv_ivi​ satisfying ∑zvi(z)‾vj(z)=δij\sum_z\overline{v_i(z)}v_j(z)=\delta_{ij}∑z​vi​(z)​vj​(z)=δij​ and Wz,z′=∑i=0r−1λivi(z)vi(z′)‾W_{z,z'}=\sum_{i=0}^{r-1}\lambda_i v_i(z)\overline{v_i(z')}Wz,z′​=∑i=0r−1​λi​vi​(z)vi​(z′)​, and any family of functions wi:B→Cw_i:B\to\mathbb Cwi​:B→C indexed by 0≤i<r0\le i<r0≤i<r, where BBB has coordinate dimensions D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r), this predicate imposes the following conditions. For a matrix MMM on BBB, define Rs(M)x,y=0R_s(M)_{x,y}=0Rs​(M)x,y​=0 unless xk=ykx_k=y_kxk​=yk​ for every k∈sk\in sk∈s, and otherwise define

Rs(M)x,y=1∏k∈sDk∑z∈Bzk=xk for every k∉sMz,z[s;y],z[s;y]k={zkk∈s,ykk∉s.R_s(M)_{x,y} = \frac{1}{\prod_{k\in s}D_k} \sum_{\substack{z\in B\\z_k=x_k\text{ for every }k\notin s}} M_{z,z[s;y]}, \qquad z[s;y]_k= \begin{cases}z_k&k\in s,\\y_k&k\notin s.\end{cases}Rs​(M)x,y​=∏k∈s​Dk​1​z∈Bzk​=xk​ for every k∈/s​∑​Mz,z[s;y]​,z[s;y]k​={zk​yk​​k∈s,k∈/s.​

The function with index zero must satisfy

w0(x)=λx5 vx5(0,x1,x2,x3,x4,0)for every x∈B.w_0(x)=\sqrt{\lambda_{x_5}}\, v_{x_5}(0,x_1,x_2,x_3,x_4,0) \quad\text{for every }x\in B.w0​(x)=λx5​​​vx5​​(0,x1​,x2​,x3​,x4​,0)for every x∈B.

Furthermore, for every i,j∈{0,…,r−1}i,j\in\{0,\ldots,r-1\}i,j∈{0,…,r−1}, the matrix Mx,yij=wi(x)wj(y)‾M^{ij}_{x,y}=w_i(x)\overline{w_j(y)}Mx,yij​=wi​(x)wj​(y)​ must satisfy

0=R{5}(Mij)−R{2,5}(Mij)−R{4,5}(Mij)+R{2,4,5}(Mij)+R{1,2,5}(Mij)−R{1,2,4,5}(Mij)+R{3,4,5}(Mij)−R{2,3,4,5}(Mij)+R{1,2,3,4,5}(Mij)−R{0,1,2,3,4,5}(Mij),\begin{aligned} 0={}&R_{\{5\}}(M^{ij})-R_{\{2,5\}}(M^{ij})-R_{\{4,5\}}(M^{ij}) +R_{\{2,4,5\}}(M^{ij})+R_{\{1,2,5\}}(M^{ij})\\ &-R_{\{1,2,4,5\}}(M^{ij})+R_{\{3,4,5\}}(M^{ij}) -R_{\{2,3,4,5\}}(M^{ij})+R_{\{1,2,3,4,5\}}(M^{ij}) -R_{\{0,1,2,3,4,5\}}(M^{ij}), \end{aligned}0=​R{5}​(Mij)−R{2,5}​(Mij)−R{4,5}​(Mij)+R{2,4,5}​(Mij)+R{1,2,5}​(Mij)−R{1,2,4,5}​(Mij)+R{3,4,5}​(Mij)−R{2,3,4,5}​(Mij)+R{1,2,3,4,5}​(Mij)−R{0,1,2,3,4,5}​(Mij),​

as an equality of matrices, and the functions must also satisfy

∑x∈Bwi(x)‾ wj(x)={d1d3i=j,0i≠j.\sum_{x\in B}\overline{w_i(x)}\,w_j(x)= \begin{cases} d_1d_3&i=j,\\ 0&i\ne j. \end{cases}x∈B∑​wi​(x)​wj​(x)={d1​d3​0​i=j,i=j.​

The index zero exists because r>0r>0r>0; all pairs i,ji,ji,j, including equal indices, are included in both requirements.

QAlgorithms.Papers.Independent.Intake100.P46.IsIsometricMatrix

For an arbitrary type III equipped with decidable equality, a finite type OOO, and a complex matrix VVV with rows indexed by OOO and columns indexed by III, this predicate means

V†V=Id⁡I,equivalently∑o∈OVo,i‾Vo,j={1i=j,0i≠jfor every i,j∈I.V^\dagger V=\operatorname{Id}_I, \quad\text{equivalently}\quad \sum_{o\in O}\overline{V_{o,i}}V_{o,j} = \begin{cases}1&i=j,\\0&i\ne j\end{cases} \quad\text{for every }i,j\in I.V†V=IdI​,equivalentlyo∈O∑​Vo,i​​Vo,j​={10​i=j,i=j​for every i,j∈I.

Thus the columns are orthonormal in CO\mathbb C^OCO. The type III is not assumed finite, although the equation cannot hold for infinite III because OOO is finite. If III is empty, the equation holds for every such matrix; if OOO is empty and III is nonempty, it cannot hold.

QAlgorithms.Papers.Independent.Intake100.P46.IsPureProcess

For any positive integer dimensions d0,…,d5d_0,\ldots,d_5d0​,…,d5​, put Ds={0,…,ds−1}D_s=\{0,\ldots,d_s-1\}Ds​={0,…,ds​−1} and D=∏s=05DsD=\prod_{s=0}^{5}D_sD=∏s=05​Ds​, and let WWW be any complex matrix indexed by DDD. This predicate means the following universal condition. For every four positive integers ain,aout,bin,bouta_{\mathrm{in}},a_{\mathrm{out}},b_{\mathrm{in}},b_{\mathrm{out}}ain​,aout​,bin​,bout​, let EA,FA,EB,FBE_A,F_A,E_B,F_BEA​,FA​,EB​,FB​ be their respective index sets {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, and put IA=D1×EAI_A=D_1\times E_AIA​=D1​×EA​, OA=D2×FAO_A=D_2\times F_AOA​=D2​×FA​, IB=D3×EBI_B=D_3\times E_BIB​=D3​×EB​, and OB=D4×FBO_B=D_4\times F_BOB​=D4​×FB​. For every complex matrix UUU with rows in OAO_AOA​ and columns in IAI_AIA​, and every complex matrix VVV with rows in OBO_BOB​ and columns in IBI_BIB​, if

U†U=Id⁡IA,UU†=Id⁡OA,V†V=Id⁡IB,VV†=Id⁡OB,U^\dagger U=\operatorname{Id}_{I_A},\qquad UU^\dagger=\operatorname{Id}_{O_A}, \qquad V^\dagger V=\operatorname{Id}_{I_B},\qquad VV^\dagger=\operatorname{Id}_{O_B},U†U=IdIA​​,UU†=IdOA​​,V†V=IdIB​​,VV†=IdOB​​,

then, writing E=D0×EA×EBE=D_0\times E_A\times E_BE=D0​×EA​×EB​ and F=D5×FA×FBF=D_5\times F_A\times F_BF=D5​×FA​×FB​, there exists a complex matrix TTT with rows in FFF and columns in EEE such that

T†T=Id⁡E,TT†=Id⁡F,T^\dagger T=\operatorname{Id}_E,\qquad TT^\dagger=\operatorname{Id}_F,T†T=IdE​,TT†=IdF​,

and, for every u=((p,α,β),(f,γ,η))u=((p,\alpha,\beta),(f,\gamma,\eta))u=((p,α,β),(f,γ,η)) and v=((p′,α′,β′),(f′,γ′,η′))v=((p',\alpha',\beta'),(f',\gamma',\eta'))v=((p′,α′,β′),(f′,γ′,η′)) in E×FE\times FE×F,

∑x,y∈Dx0=p, y0=p′x5=f, y5=f′Wx,y U(x2,γ),(x1,α)U(y2,γ′),(y1,α′)‾ V(x4,η),(x3,β)V(y4,η′),(y3,β′)‾=T(f,γ,η),(p,α,β)T(f′,γ′,η′),(p′,α′,β′)‾.\sum_{\substack{x,y\in D\\x_0=p,\ y_0=p'\\x_5=f,\ y_5=f'}} W_{x,y}\, U_{(x_2,\gamma),(x_1,\alpha)} \overline{U_{(y_2,\gamma'),(y_1,\alpha')}}\, V_{(x_4,\eta),(x_3,\beta)} \overline{V_{(y_4,\eta'),(y_3,\beta')}} = T_{(f,\gamma,\eta),(p,\alpha,\beta)} \overline{T_{(f',\gamma',\eta'),(p',\alpha',\beta')}}.x,y∈Dx0​=p, y0​=p′x5​=f, y5​=f′​∑​Wx,y​U(x2​,γ),(x1​,α)​U(y2​,γ′),(y1​,α′)​​V(x4​,η),(x3​,β)​V(y4​,η′),(y3​,β′)​​=T(f,γ,η),(p,α,β)​T(f′,γ′,η′),(p′,α′,β′)​​.

The witness TTT need not be unique. All dimensions include 111 and exclude 000; for fixed auxiliary dimensions, the hypotheses on UUU and VVV are impossible unless d1ain=d2aoutd_1a_{\mathrm{in}}=d_2a_{\mathrm{out}}d1​ain​=d2​aout​ and d3bin=d4boutd_3b_{\mathrm{in}}=d_4b_{\mathrm{out}}d3​bin​=d4​bout​, so the implication is vacuous whenever either equality fails.

QAlgorithms.Papers.Independent.Intake100.P46.IsPurifiable

For any four positive integers d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ and any complex matrix WWW indexed by tuples of dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), this predicate means that there exist positive integers p,fp,fp,f and a complex matrix SSS indexed by tuples of dimensions (p,d0,d1,d2,d3,f)(p,d_0,d_1,d_2,d_3,f)(p,d0​,d1​,d2​,d3​,f) satisfying the following requirements. To express them, for any four positive auxiliary dimensions ain,aout,bin,bouta_{\mathrm{in}},a_{\mathrm{out}},b_{\mathrm{in}},b_{\mathrm{out}}ain​,aout​,bin​,bout​, set

IA={0,…,d0−1}×{0,…,ain−1},OA={0,…,d1−1}×{0,…,aout−1},IB={0,…,d2−1}×{0,…,bin−1},OB={0,…,d3−1}×{0,…,bout−1}.\begin{gathered} I_A=\{0,\ldots,d_0-1\}\times\{0,\ldots,a_{\mathrm{in}}-1\}, \quad O_A=\{0,\ldots,d_1-1\}\times\{0,\ldots,a_{\mathrm{out}}-1\},\\ I_B=\{0,\ldots,d_2-1\}\times\{0,\ldots,b_{\mathrm{in}}-1\}, \quad O_B=\{0,\ldots,d_3-1\}\times\{0,\ldots,b_{\mathrm{out}}-1\}. \end{gathered}IA​={0,…,d0​−1}×{0,…,ain​−1},OA​={0,…,d1​−1}×{0,…,aout​−1},IB​={0,…,d2​−1}×{0,…,bin​−1},OB​={0,…,d3​−1}×{0,…,bout​−1}.​

For matrices AAA on IA×OAI_A\times O_AIA​×OA​ and BBB on IB×OBI_B\times O_BIB​×OB​, define a matrix LS(A,B)L_S(A,B)LS​(A,B) on I×OI\times OI×O, where I={0,…,p−1}×{0,…,ain−1}×{0,…,bin−1}I=\{0,\ldots,p-1\}\times\{0,\ldots,a_{\mathrm{in}}-1\}\times\{0,\ldots,b_{\mathrm{in}}-1\}I={0,…,p−1}×{0,…,ain​−1}×{0,…,bin​−1} and O={0,…,f−1}×{0,…,aout−1}×{0,…,bout−1}O=\{0,\ldots,f-1\}\times\{0,\ldots,a_{\mathrm{out}}-1\}\times\{0,\ldots,b_{\mathrm{out}}-1\}O={0,…,f−1}×{0,…,aout​−1}×{0,…,bout​−1}, by

LS(A,B)((h,a,b),(t,c,e)), ((h′,a′,b′),(t′,c′,e′))=∑i,i′<d0; o,o′<d1j,j′<d2; q,q′<d3S(h,i,o,j,q,t),(h′,i′,o′,j′,q′,t′)A((i,a),(o,c)),((i′,a′),(o′,c′))B((j,b),(q,e)),((j′,b′),(q′,e′)),\begin{aligned} &L_S(A,B)_{((h,a,b),(t,c,e)),\,((h',a',b'),(t',c',e'))}\\ &\quad= \sum_{\substack{i,i'<d_0;\ o,o'<d_1\\j,j'<d_2;\ q,q'<d_3}} S_{(h,i,o,j,q,t),(h',i',o',j',q',t')} A_{((i,a),(o,c)),((i',a'),(o',c'))} B_{((j,b),(q,e)),((j',b'),(q',e'))}, \end{aligned}​LS​(A,B)((h,a,b),(t,c,e)),((h′,a′,b′),(t′,c′,e′))​=i,i′<d0​; o,o′<d1​j,j′<d2​; q,q′<d3​​∑​S(h,i,o,j,q,t),(h′,i′,o′,j′,q′,t′)​A((i,a),(o,c)),((i′,a′),(o′,c′))​B((j,b),(q,e)),((j′,b′),(q′,e′))​,​

where every summation index is a nonnegative integer. A matrix JJJ on an input-output product E×FE\times FE×F satisfies the required channel condition precisely when it is positive semidefinite and

∑o∈FJ(i,o),(j,o)=δijfor every i,j∈E.\sum_{o\in F}J_{(i,o),(j,o)}=\delta_{ij} \quad\text{for every }i,j\in E.o∈F∑​J(i,o),(j,o)​=δij​for every i,j∈E.

The first requirement on SSS is that, for every choice of the four positive auxiliary dimensions and every A,BA,BA,B satisfying this condition on their respective input-output products, LS(A,B)L_S(A,B)LS​(A,B) also satisfies this condition. The second requirement is that, for every such choice of auxiliary dimensions and every complex matrix U:IA→OAU: I_A\to O_AU:IA​→OA​ and V:IB→OBV:I_B\to O_BV:IB​→OB​ satisfying

U†U=Id⁡IA,UU†=Id⁡OA,V†V=Id⁡IB,VV†=Id⁡OB,U^\dagger U=\operatorname{Id}_{I_A},\quad UU^\dagger=\operatorname{Id}_{O_A}, \qquad V^\dagger V=\operatorname{Id}_{I_B},\quad VV^\dagger=\operatorname{Id}_{O_B},U†U=IdIA​​,UU†=IdOA​​,V†V=IdIB​​,VV†=IdOB​​,

there exists a complex matrix T:I→OT:I\to OT:I→O satisfying T†T=Id⁡IT^\dagger T=\operatorname{Id}_IT†T=IdI​ and TT†=Id⁡OTT^\dagger=\operatorname{Id}_OTT†=IdO​, such that

LS(QU,QV)=QT,(QR)(i,o),(j,o′)=Ro,i Ro′,j‾.L_S(Q_U,Q_V)=Q_T, \qquad (Q_R)_{(i,o),(j,o')}=R_{o,i}\,\overline{R_{o',j}}.LS​(QU​,QV​)=QT​,(QR​)(i,o),(j,o′)​=Ro,i​Ro′,j​​.

For auxiliary dimensions admitting no such UUU or VVV, this second requirement is vacuous. The final requirement is

Wx,y=∑t=0f−1S(0,x1,x2,x3,x4,t), (0,y1,y2,y3,y4,t)for every x,y.W_{x,y} = \sum_{t=0}^{f-1} S_{(0,x_1,x_2,x_3,x_4,t),\, (0,y_1,y_2,y_3,y_4,t)} \quad\text{for every }x,y.Wx,y​=t=0∑f−1​S(0,x1​,x2​,x3​,x4​,t),(0,y1​,y2​,y3​,y4​,t)​for every x,y.

QAlgorithms.Papers.Independent.Intake100.P46.IsReversibleMatrix

For finite types III and OOO, each equipped with decidable equality, and a complex matrix UUU with rows indexed by OOO and columns indexed by III, this predicate means that both

U†U=Id⁡IandUU†=Id⁡OU^\dagger U=\operatorname{Id}_I \qquad\text{and}\qquad UU^\dagger=\operatorname{Id}_OU†U=IdI​andUU†=IdO​

hold, where U†U^\daggerU† is the conjugate transpose. Empty index types are allowed: both equations hold for the unique matrix when both types are empty, whereas they cannot both hold when the two finite types have different cardinalities.

QAlgorithms.Papers.Independent.Intake100.P46.IsTotallyIsotropic

For any finite type III, any complex matrix C=(Cij)i,j∈IC=(C_{ij})_{i,j\in I}C=(Cij​)i,j∈I​, and any complex linear subspace S⊆CIS\subseteq\mathbb C^IS⊆CI, this predicate means that every pair v,w∈Sv,w\in Sv,w∈S satisfies

∑i∈I∑j∈Ivi‾ Cij wj=0.\sum_{i\in I}\sum_{j\in I}\overline{v_i}\,C_{ij}\,w_j=0.i∈I∑​j∈I∑​vi​​Cij​wj​=0.

There is no Hermitian assumption on CCC. The zero subspace is allowed; if III is empty, the sums are empty and the condition holds.

QAlgorithms.Papers.Independent.Intake100.P46.IsUnitaryChoi

For finite types III and OOO, each equipped with decidable equality, and a complex matrix JJJ indexed on both sides by I×OI\times OI×O, this predicate means that there exists a complex matrix UUU with rows indexed by OOO and columns indexed by III such that

U†U=Id⁡I,UU†=Id⁡O,J(i,o),(j,q)=Uo,iUq,j‾for all i,j∈I, o,q∈O.U^\dagger U=\operatorname{Id}_I,\qquad UU^\dagger=\operatorname{Id}_O,\qquad J_{(i,o),(j,q)}=U_{o,i}\overline{U_{q,j}} \quad\text{for all }i,j\in I,\ o,q\in O.U†U=IdI​,UU†=IdO​,J(i,o),(j,q)​=Uo,i​Uq,j​​for all i,j∈I, o,q∈O.

The witness UUU is required to exist but is not required to be unique. The predicate cannot hold when ∣I∣≠∣O∣|I|\ne|O|∣I∣=∣O∣; when both types are empty, it holds for the unique matrix JJJ.

QAlgorithms.Papers.Independent.Intake100.P46.IsValidProcess

For any positive integer dimensions d0,…,d5d_0,\ldots,d_5d0​,…,d5​, put Ds={0,…,ds−1}D_s=\{0,\ldots,d_s-1\}Ds​={0,…,ds​−1} and D=∏s=05DsD=\prod_{s=0}^{5}D_sD=∏s=05​Ds​, and let WWW be any complex matrix indexed by DDD. This predicate means the following universal condition. For every four positive integers ain,aout,bin,bouta_{\mathrm{in}},a_{\mathrm{out}},b_{\mathrm{in}},b_{\mathrm{out}}ain​,aout​,bin​,bout​, let EA,FA,EB,FBE_A,F_A,E_B,F_BEA​,FA​,EB​,FB​ be their respective index sets {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, and put IA=D1×EAI_A=D_1\times E_AIA​=D1​×EA​, OA=D2×FAO_A=D_2\times F_AOA​=D2​×FA​, IB=D3×EBI_B=D_3\times E_BIB​=D3​×EB​, and OB=D4×FBO_B=D_4\times F_BOB​=D4​×FB​. For every complex matrix AAA indexed by IA×OAI_A\times O_AIA​×OA​ and every complex matrix BBB indexed by IB×OBI_B\times O_BIB​×OB​, if AAA and BBB are positive semidefinite and satisfy

∑o∈OAA(i,o),(j,o)=δi,j(i,j∈IA),∑o∈OBB(i,o),(j,o)=δi,j(i,j∈IB),\sum_{o\in O_A}A_{(i,o),(j,o)}=\delta_{i,j}\quad(i,j\in I_A), \qquad \sum_{o\in O_B}B_{(i,o),(j,o)}=\delta_{i,j}\quad(i,j\in I_B),o∈OA​∑​A(i,o),(j,o)​=δi,j​(i,j∈IA​),o∈OB​∑​B(i,o),(j,o)​=δi,j​(i,j∈IB​),

then the matrix LLL indexed by E×FE\times FE×F, where E=D0×EA×EBE=D_0\times E_A\times E_BE=D0​×EA​×EB​ and F=D5×FA×FBF=D_5\times F_A\times F_BF=D5​×FA​×FB​, and defined by

L((p,α,β),(f,γ,η)), ((p′,α′,β′),(f′,γ′,η′))=∑x,y∈Dx0=p, y0=p′x5=f, y5=f′Wx,y A((x1,α),(x2,γ)), ((y1,α′),(y2,γ′)) B((x3,β),(x4,η)), ((y3,β′),(y4,η′)),L_{((p,\alpha,\beta),(f,\gamma,\eta)),\,((p',\alpha',\beta'),(f',\gamma',\eta'))} = \sum_{\substack{x,y\in D\\x_0=p,\ y_0=p'\\x_5=f,\ y_5=f'}} W_{x,y}\, A_{((x_1,\alpha),(x_2,\gamma)),\,((y_1,\alpha'),(y_2,\gamma'))}\, B_{((x_3,\beta),(x_4,\eta)),\,((y_3,\beta'),(y_4,\eta'))},L((p,α,β),(f,γ,η)),((p′,α′,β′),(f′,γ′,η′))​=x,y∈Dx0​=p, y0​=p′x5​=f, y5​=f′​∑​Wx,y​A((x1​,α),(x2​,γ)),((y1​,α′),(y2​,γ′))​B((x3​,β),(x4​,η)),((y3​,β′),(y4​,η′))​,

is positive semidefinite and satisfies ∑o∈FL(i,o),(j,o)=δi,j\sum_{o\in F}L_{(i,o),(j,o)}=\delta_{i,j}∑o∈F​L(i,o),(j,o)​=δi,j​ for every i,j∈Ei,j\in Ei,j∈E. Here δi,j\delta_{i,j}δi,j​ is 111 when i=ji=ji=j and 000 otherwise. All dimensions quantified in this condition include 111 and exclude 000.

QAlgorithms.Papers.Independent.Intake100.P46.KernelBasisData

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, put B0={(0,a0,a1,a2,a3,0):0≤aj<dj}B_0=\{(0,a_0,a_1,a_2,a_3,0):0\le a_j<d_j\}B0​={(0,a0​,a1​,a2​,a3​,0):0≤aj​<dj​}, and let WWW be a complex matrix indexed by B0B_0B0​. Fix data eee consisting of a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λs\lambda_sλs​, and functions us:B0→Cu_s:B_0\to\mathbb Cus​:B0​→C, 0≤s<r0\le s<r0≤s<r, such that

∑x∈B0us(x)‾ut(x)=δst,Wxy=∑s=0r−1λsus(x)us(y)‾.\sum_{x\in B_0}\overline{u_s(x)}u_t(x)=\delta_{st}, \qquad W_{xy}=\sum_{s=0}^{r-1}\lambda_su_s(x)\overline{u_s(y)}.x∈B0​∑​us​(x)​ut​(x)=δst​,Wxy​=s=0∑r−1​λs​us​(x)us​(y)​.

Put h=(1,d0,d1,d2,d3,r)h=(1,d_0,d_1,d_2,d_3,r)h=(1,d0​,d1​,d2​,d3​,r), B=∏i=05{0,…,hi−1}B=\prod_{i=0}^{5}\{0,\ldots,h_i-1\}B=∏i=05​{0,…,hi​−1}, and q(0,a0,a1,a2,a3,t)=λt ut(0,a0,a1,a2,a3,0)q(0,a_0,a_1,a_2,a_3,t)=\sqrt{\lambda_t}\,u_t(0,a_0,a_1,a_2,a_3,0)q(0,a0​,a1​,a2​,a3​,t)=λt​​ut​(0,a0​,a1​,a2​,a3​,0). For matrices XXX indexed by BBB, define

(RSX)xy={1∏i∈Shi∑z∈Bzi=xi for all i∉SXz, y[S←z],xi=yi for all i∈S,0,otherwise,(R_SX)_{xy}= \begin{cases} \displaystyle \frac{1}{\prod_{i\in S}h_i} \sum_{\substack{z\in B\\z_i=x_i\text{ for all }i\notin S}} X_{z,\,y[S\leftarrow z]}, &x_i=y_i\text{ for all }i\in S,\\ 0,&\text{otherwise}, \end{cases}(RS​X)xy​=⎩⎨⎧​∏i∈S​hi​1​z∈Bzi​=xi​ for all i∈/S​∑​Xz,y[S←z]​,0,​xi​=yi​ for all i∈S,otherwise,​

where y[S←z]y[S\leftarrow z]y[S←z] uses zzz on SSS and yyy elsewhere, and set

D(X)=R{5}X−R{2,5}X−R{4,5}X+R{2,4,5}X+R{1,2,5}X−R{1,2,4,5}X+R{3,4,5}X−R{2,3,4,5}X+R{1,2,3,4,5}X−R{0,1,2,3,4,5}X.\begin{aligned} D(X)={}&R_{\{5\}}X-R_{\{2,5\}}X-R_{\{4,5\}}X +R_{\{2,4,5\}}X+R_{\{1,2,5\}}X\\ &-R_{\{1,2,4,5\}}X+R_{\{3,4,5\}}X -R_{\{2,3,4,5\}}X\\ &+R_{\{1,2,3,4,5\}}X-R_{\{0,1,2,3,4,5\}}X. \end{aligned}D(X)=​R{5}​X−R{2,5}​X−R{4,5}​X+R{2,4,5}​X+R{1,2,5}​X−R{1,2,4,5}​X+R{3,4,5}​X−R{2,3,4,5}​X+R{1,2,3,4,5}​X−R{0,1,2,3,4,5}​X.​

With Ep,qE_{p,q}Ep,q​ denoting the matrix having a single 111 at row ppp, column qqq, define Kvw=∑a,b∈Bq(a)(D(Ew,b))v,aq(b)‾K_{vw}=\sum_{a,b\in B}q(a)\bigl(D(E_{w,b})\bigr)_{v,a}\overline{q(b)}Kvw​=∑a,b∈B​q(a)(D(Ew,b​))v,a​q(b)​. An object of this structure consists of a natural number mmm, functions bi:B→Cb_i:B\to\mathbb Cbi​:B→C for 0≤i<m0\le i<m0≤i<m, and proofs that

∑x∈Bbi(x)‾bj(x)=δij,span⁡C{bi:0≤i<m}={v:B→C:∀x∈B, ∑y∈BKxyv(y)=0}.\sum_{x\in B}\overline{b_i(x)}b_j(x)=\delta_{ij}, \qquad \operatorname{span}_{\mathbb C}\{b_i:0\le i<m\} = \left\{v:B\to\mathbb C: \forall x\in B,\ \sum_{y\in B}K_{xy}v(y)=0\right\}.x∈B∑​bi​(x)​bj​(x)=δij​,spanC​{bi​:0≤i<m}=⎩⎨⎧​v:B→C:∀x∈B, y∈B∑​Kxy​v(y)=0⎭⎬⎫​.

The value m=0m=0m=0 is allowed; then the family is empty, its span is the zero subspace, and the required span equality says that the kernel of KKK is the zero subspace.

QAlgorithms.Papers.Independent.Intake100.P46.NonzeroModes

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, XXX the six-wire basis with dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and WWW a complex matrix on XXX. The supplied data eee specify a positive rank r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λt\lambda_tλt​, and orthonormal vectors ut:X→Cu_t:X\to\mathbb Cut​:X→C such that Wxy=∑t<rλtut(x)ut(y)‾W_{xy}=\sum_{t<r}\lambda_tu_t(x)\overline{u_t(y)}Wxy​=∑t<r​λt​ut​(x)ut​(y)​. Let YYY have wire dimensions D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r), and define c(x)=λx5 ux5(0,x1,x2,x3,x4,0)c(x)=\sqrt{\lambda_{x_5}}\,u_{x_5}(0,x_1,x_2,x_3,x_4,0)c(x)=λx5​​​ux5​​(0,x1​,x2​,x3​,x4​,0). For S⊆{0,…,5}S\subseteq\{0,\ldots,5\}S⊆{0,…,5}, let RSR_SRS​ trace out those wires and insert their identity divided by ∏j∈SDj\prod_{j\in S}D_j∏j∈S​Dj​, in their original positions, and set

L=R{5}−R{2,5}−R{4,5}+R{2,4,5}+R{1,2,5}−R{1,2,4,5}+R{3,4,5}−R{2,3,4,5}+R{1,2,3,4,5}−R{0,1,2,3,4,5}.\mathcal L =R_{\{5\}}-R_{\{2,5\}}-R_{\{4,5\}}+R_{\{2,4,5\}} +R_{\{1,2,5\}}-R_{\{1,2,4,5\}} +R_{\{3,4,5\}}-R_{\{2,3,4,5\}} +R_{\{1,2,3,4,5\}}-R_{\{0,1,2,3,4,5\}}.L=R{5}​−R{2,5}​−R{4,5}​+R{2,4,5}​+R{1,2,5}​−R{1,2,4,5}​+R{3,4,5}​−R{2,3,4,5}​+R{1,2,3,4,5}​−R{0,1,2,3,4,5}​.

With Ew,zE_{w,z}Ew,z​ denoting the matrix unit in row www, column zzz, put H(a,v),(z,w)=[L(Ew,z)]v,aH_{(a,v),(z,w)}=[\mathcal L(E_{w,z})]_{v,a}H(a,v),(z,w)​=[L(Ew,z​)]v,a​ and Kvw=∑a,zc(a)H(a,v),(z,w)c(z)‾K_{vw}=\sum_{a,z}c(a)H_{(a,v),(z,w)}\overline{c(z)}Kvw​=∑a,z​c(a)H(a,v),(z,w)​c(z)​. The supplied bbb specifies a natural number mmm and an orthonormal family βi:Y→C\beta_i:Y\to\mathbb Cβi​:Y→C, i<mi<mi<m, whose complex span is ker⁡K\ker KkerK. On J={0,…,m−1}2J=\{0,\ldots,m-1\}^2J={0,…,m−1}2, define

C(i,j),(k,ℓ)=∑a,v,z,w∈Yβi(a)βj(v)‾H(a,v),(z,w)βk(z)‾βℓ(w).C_{(i,j),(k,\ell)} =\sum_{a,v,z,w\in Y} \beta_i(a)\overline{\beta_j(v)} H_{(a,v),(z,w)} \overline{\beta_k(z)}\beta_\ell(w).C(i,j),(k,ℓ)​=a,v,z,w∈Y∑​βi​(a)βj​(v)​H(a,v),(z,w)​βk​(z)​βℓ​(w).

The supplied sss specifies real numbers μα\mu_\alphaμα​ and an orthonormal spanning family zα∈CJz_\alpha\in\mathbb C^Jzα​∈CJ, indexed by α∈J\alpha\in Jα∈J, with Czα=μαzαCz_\alpha=\mu_\alpha z_\alphaCzα​=μα​zα​. Here orthonormality means that the sum of the conjugate of the first vector times the second is the corresponding Kronecker delta. NonzeroModes is the type of indices

{α∈J:μα≠0},\{\alpha\in J:\mu_\alpha\ne0\},{α∈J:μα​=0},

each accompanied by the condition that its assigned real eigenvalue is nonzero. It includes both positive and negative eigenvalues, and is empty if all assigned eigenvalues are zero, including when m=0m=0m=0.

QAlgorithms.Papers.Independent.Intake100.P46.ProcessBasis

For any function d:{0,…,5}→N>0d:\{0,\ldots,5\}\to\mathbb N_{>0}d:{0,…,5}→N>0​, the process basis is the set of functions xxx assigning to every s∈{0,…,5}s\in\{0,\ldots,5\}s∈{0,…,5} an integer xsx_sxs​ with 0≤xs<ds0\le x_s<d_s0≤xs​<ds​. Equivalently, this is the Cartesian product ∏s=05{0,…,ds−1}\prod_{s=0}^{5}\{0,\ldots,d_s-1\}∏s=05​{0,…,ds​−1}. It has ∏s=05ds\prod_{s=0}^{5}d_s∏s=05​ds​ elements and is nonempty because every dsd_sds​ is positive.

QAlgorithms.Papers.Independent.Intake100.P46.ProcessMatrix

For any six positive integer dimensions d0,…,d5d_0,\ldots,d_5d0​,…,d5​, a process matrix is an arbitrary complex matrix whose rows and columns are both indexed by tuples x=(x0,…,x5)x=(x_0,\ldots,x_5)x=(x0​,…,x5​) satisfying 0≤xs<ds0\le x_s<d_s0≤xs​<ds​ for every sss. Thus it is a square complex matrix of size ∏s=05ds\prod_{s=0}^{5}d_s∏s=05​ds​. This definition imposes no positivity, normalization, or other condition on its entries.

QAlgorithms.Papers.Independent.Intake100.P46.ProcessWireDimensions

A choice of process wire dimensions is a function d:{0,1,2,3,4,5}→N>0d:\{0,1,2,3,4,5\}\to\mathbb N_{>0}d:{0,1,2,3,4,5}→N>0​. Thus it specifies six positive integer dimensions d0,…,d5d_0,\ldots,d_5d0​,…,d5​; each dimension may equal 111, and none may equal 000.

QAlgorithms.Papers.Independent.Intake100.P46.SupportSpectrum

For any four positive integers d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ and any complex matrix WWW indexed by B={0}×{0,…,d0−1}×{0,…,d1−1}×{0,…,d2−1}×{0,…,d3−1}×{0}B=\{0\}\times\{0,\ldots,d_0-1\}\times\{0,\ldots,d_1-1\}\times\{0,\ldots,d_2-1\}\times\{0,\ldots,d_3-1\}\times\{0\}B={0}×{0,…,d0​−1}×{0,…,d1​−1}×{0,…,d2​−1}×{0,…,d3​−1}×{0}, an instance of this structure consists of a positive integer rrr, an equality r=rank⁡(W)r=\operatorname{rank}(W)r=rank(W), positive real numbers λi>0\lambda_i>0λi​>0 for every i∈{0,…,r−1}i\in\{0,\ldots,r-1\}i∈{0,…,r−1}, and functions vi:B→Cv_i:B\to\mathbb Cvi​:B→C, together with the identities

∑x∈Bvi(x)‾ vj(x)={1i=j,0i≠j,Wx,y=∑i=0r−1λi vi(x) vi(y)‾\sum_{x\in B}\overline{v_i(x)}\,v_j(x)= \begin{cases}1&i=j,\\0&i\ne j,\end{cases} \qquad W_{x,y}=\sum_{i=0}^{r-1}\lambda_i\,v_i(x)\,\overline{v_i(y)}x∈B∑​vi​(x)​vj​(x)={10​i=j,i=j,​Wx,y​=i=0∑r−1​λi​vi​(x)vi​(y)​

for all i,j∈{0,…,r−1}i,j\in\{0,\ldots,r-1\}i,j∈{0,…,r−1} and all x,y∈Bx,y\in Bx,y∈B. Since rrr is required to be positive, no instance can have rank⁡(W)=0\operatorname{rank}(W)=0rank(W)=0.

QAlgorithms.Papers.Independent.Intake100.P46.canonicalVector

For any four positive integers d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​, any complex matrix WWW indexed by tuples of dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and supplied data consisting of a positive integer r=rank⁡(W)r=\operatorname{rank}(W)r=rank(W), positive real numbers λi\lambda_iλi​, and functions viv_ivi​ on those tuples satisfying

∑zvi(z)‾vj(z)=δij,Wz,z′=∑i=0r−1λivi(z)vi(z′)‾,\sum_z\overline{v_i(z)}v_j(z)=\delta_{ij}, \qquad W_{z,z'}=\sum_{i=0}^{r-1}\lambda_i v_i(z)\overline{v_i(z')},z∑​vi​(z)​vj​(z)=δij​,Wz,z′​=i=0∑r−1​λi​vi​(z)vi​(z′)​,

this definition produces the function ccc on tuples of dimensions (1,d0,d1,d2,d3,r)(1,d_0,d_1,d_2,d_3,r)(1,d0​,d1​,d2​,d3​,r) given by

c(x)=λx5 vx5(0,x1,x2,x3,x4,0),c(x)=\sqrt{\lambda_{x_5}}\, v_{x_5}(0,x_1,x_2,x_3,x_4,0),c(x)=λx5​​​vx5​​(0,x1​,x2​,x3​,x4​,0),

where the square root is the real square root, regarded as a complex scalar. Here 0≤x5<r0\le x_5<r0≤x5​<r, and all the other coordinates range over their specified dimensions.

QAlgorithms.Papers.Independent.Intake100.P46.compressedOperator

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, put B0={(0,a0,a1,a2,a3,0):0≤aj<dj}B_0=\{(0,a_0,a_1,a_2,a_3,0):0\le a_j<d_j\}B0​={(0,a0​,a1​,a2​,a3​,0):0≤aj​<dj​}, and let WWW be a complex matrix indexed by B0B_0B0​. Fix data eee consisting of a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λs\lambda_sλs​, and functions us:B0→Cu_s:B_0\to\mathbb Cus​:B0​→C, 0≤s<r0\le s<r0≤s<r, satisfying

∑x∈B0us(x)‾ut(x)=δst,Wxy=∑s=0r−1λsus(x)us(y)‾.\sum_{x\in B_0}\overline{u_s(x)}u_t(x)=\delta_{st}, \qquad W_{xy}=\sum_{s=0}^{r-1}\lambda_su_s(x)\overline{u_s(y)}.x∈B0​∑​us​(x)​ut​(x)=δst​,Wxy​=s=0∑r−1​λs​us​(x)us​(y)​.

Put h=(1,d0,d1,d2,d3,r)h=(1,d_0,d_1,d_2,d_3,r)h=(1,d0​,d1​,d2​,d3​,r), B=∏i=05{0,…,hi−1}B=\prod_{i=0}^{5}\{0,\ldots,h_i-1\}B=∏i=05​{0,…,hi​−1}, and q(0,a0,a1,a2,a3,t)=λt ut(0,a0,a1,a2,a3,0)q(0,a_0,a_1,a_2,a_3,t)=\sqrt{\lambda_t}\,u_t(0,a_0,a_1,a_2,a_3,0)q(0,a0​,a1​,a2​,a3​,t)=λt​​ut​(0,a0​,a1​,a2​,a3​,0). For a matrix XXX indexed by BBB, define

(RSX)xy={1∏i∈Shi∑z∈Bzi=xi for all i∉SXz, y[S←z],xi=yi for all i∈S,0,otherwise,(R_SX)_{xy}= \begin{cases} \displaystyle \frac{1}{\prod_{i\in S}h_i} \sum_{\substack{z\in B\\z_i=x_i\text{ for all }i\notin S}} X_{z,\,y[S\leftarrow z]}, &x_i=y_i\text{ for all }i\in S,\\ 0,&\text{otherwise}, \end{cases}(RS​X)xy​=⎩⎨⎧​∏i∈S​hi​1​z∈Bzi​=xi​ for all i∈/S​∑​Xz,y[S←z]​,0,​xi​=yi​ for all i∈S,otherwise,​

where y[S←z]y[S\leftarrow z]y[S←z] uses zzz on SSS and yyy elsewhere, and set

D(X)=R{5}X−R{2,5}X−R{4,5}X+R{2,4,5}X+R{1,2,5}X−R{1,2,4,5}X+R{3,4,5}X−R{2,3,4,5}X+R{1,2,3,4,5}X−R{0,1,2,3,4,5}X.\begin{aligned} D(X)={}&R_{\{5\}}X-R_{\{2,5\}}X-R_{\{4,5\}}X +R_{\{2,4,5\}}X+R_{\{1,2,5\}}X\\ &-R_{\{1,2,4,5\}}X+R_{\{3,4,5\}}X -R_{\{2,3,4,5\}}X\\ &+R_{\{1,2,3,4,5\}}X-R_{\{0,1,2,3,4,5\}}X. \end{aligned}D(X)=​R{5}​X−R{2,5}​X−R{4,5}​X+R{2,4,5}​X+R{1,2,5}​X−R{1,2,4,5}​X+R{3,4,5}​X−R{2,3,4,5}​X+R{1,2,3,4,5}​X−R{0,1,2,3,4,5}​X.​

Let Ep,qE_{p,q}Ep,q​ have a single 111 at row ppp, column qqq, and define Kvw=∑a,c∈Bq(a)(D(Ew,c))v,aq(c)‾K_{vw}=\sum_{a,c\in B}q(a)\bigl(D(E_{w,c})\bigr)_{v,a}\overline{q(c)}Kvw​=∑a,c∈B​q(a)(D(Ew,c​))v,a​q(c)​. The argument bbb consists of a natural number mmm and functions βi:B→C\beta_i:B\to\mathbb Cβi​:B→C, 0≤i<m0\le i<m0≤i<m, satisfying

∑x∈Bβi(x)‾βj(x)=δij,span⁡C{βi:0≤i<m}={v:B→C:∀x∈B, ∑y∈BKxyv(y)=0}.\sum_{x\in B}\overline{\beta_i(x)}\beta_j(x)=\delta_{ij}, \qquad \operatorname{span}_{\mathbb C}\{\beta_i:0\le i<m\} = \left\{v:B\to\mathbb C: \forall x\in B,\ \sum_{y\in B}K_{xy}v(y)=0\right\}.x∈B∑​βi​(x)​βj​(x)=δij​,spanC​{βi​:0≤i<m}=⎩⎨⎧​v:B→C:∀x∈B, y∈B∑​Kxy​v(y)=0⎭⎬⎫​.

The definition gives a complex matrix TTT whose rows and columns are indexed by pairs from {0,…,m−1}2\{0,\ldots,m-1\}^2{0,…,m−1}2, with entries

T(i1,i2),(j1,j2)=∑a,v,c,w∈Bβi1(a) βi2(v)‾ (D(Ew,c))v,a βj1(c)‾ βj2(w).T_{(i_1,i_2),(j_1,j_2)} = \sum_{a,v,c,w\in B} \beta_{i_1}(a)\, \overline{\beta_{i_2}(v)}\, \bigl(D(E_{w,c})\bigr)_{v,a}\, \overline{\beta_{j_1}(c)}\, \beta_{j_2}(w).T(i1​,i2​),(j1​,j2​)​=a,v,c,w∈B∑​βi1​​(a)βi2​​(v)​(D(Ew,c​))v,a​βj1​​(c)​βj2​​(w).

The case m=0m=0m=0 is included, in which case this matrix has empty row and column index sets.

QAlgorithms.Papers.Independent.Intake100.P46.constraintMatrix

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, XXX the basis with dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and WWW a complex matrix on XXX. The supplied support data give a positive rank r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λt\lambda_tλt​, and orthonormal vectors utu_tut​ with Wxy=∑t<rλtut(x)ut(y)‾W_{xy}=\sum_{t<r}\lambda_tu_t(x)\overline{u_t(y)}Wxy​=∑t<r​λt​ut​(x)ut​(y)​. Let YYY have dimensions D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r), put c(x)=λx5 ux5(0,x1,x2,x3,x4,0)c(x)=\sqrt{\lambda_{x_5}}\,u_{x_5}(0,x_1,x_2,x_3,x_4,0)c(x)=λx5​​​ux5​​(0,x1​,x2​,x3​,x4​,0), and let RSR_SRS​ trace out wires SSS and reinsert their identity divided by ∏j∈SDj\prod_{j\in S}D_j∏j∈S​Dj​, in their original positions. Define

L=R{5}−R{2,5}−R{4,5}+R{2,4,5}+R{1,2,5}−R{1,2,4,5}+R{3,4,5}−R{2,3,4,5}+R{1,2,3,4,5}−R{0,1,2,3,4,5}.\mathcal L =R_{\{5\}}-R_{\{2,5\}}-R_{\{4,5\}}+R_{\{2,4,5\}} +R_{\{1,2,5\}}-R_{\{1,2,4,5\}} +R_{\{3,4,5\}}-R_{\{2,3,4,5\}} +R_{\{1,2,3,4,5\}}-R_{\{0,1,2,3,4,5\}}.L=R{5}​−R{2,5}​−R{4,5}​+R{2,4,5}​+R{1,2,5}​−R{1,2,4,5}​+R{3,4,5}​−R{2,3,4,5}​+R{1,2,3,4,5}​−R{0,1,2,3,4,5}​.

For matrix units Ew,zE_{w,z}Ew,z​, put H(a,v),(z,w)=[L(Ew,z)]v,aH_{(a,v),(z,w)}=[\mathcal L(E_{w,z})]_{v,a}H(a,v),(z,w)​=[L(Ew,z​)]v,a​ and Kvw=∑a,zc(a)H(a,v),(z,w)c(z)‾K_{vw}=\sum_{a,z}c(a)H_{(a,v),(z,w)}\overline{c(z)}Kvw​=∑a,z​c(a)H(a,v),(z,w)​c(z)​. The supplied bbb gives a natural number mmm and orthonormal vectors βi:Y→C\beta_i:Y\to\mathbb Cβi​:Y→C, i<mi<mi<m, spanning ker⁡K\ker KkerK. On J={0,…,m−1}2J=\{0,\ldots,m-1\}^2J={0,…,m−1}2, put

C(i,j),(k,ℓ)=∑a,v,z,w∈Yβi(a)βj(v)‾H(a,v),(z,w)βk(z)‾βℓ(w).C_{(i,j),(k,\ell)} =\sum_{a,v,z,w\in Y} \beta_i(a)\overline{\beta_j(v)} H_{(a,v),(z,w)} \overline{\beta_k(z)}\beta_\ell(w).C(i,j),(k,ℓ)​=a,v,z,w∈Y∑​βi​(a)βj​(v)​H(a,v),(z,w)​βk​(z)​βℓ​(w).

The supplied sss gives real numbers μα\mu_\alphaμα​ and orthonormal vectors zα:J→Cz_\alpha:J\to\mathbb Czα​:J→C spanning CJ\mathbb C^JCJ, with Czα=μαzαCz_\alpha=\mu_\alpha z_\alphaCzα​=μα​zα​; orthonormality throughout means ∑xvi(x)‾vj(x)=δij\sum_x\overline{v_i(x)}v_j(x)=\delta_{ij}∑x​vi​(x)​vj​(x)=δij​. Given α∈J\alpha\in Jα∈J with μα≠0\mu_\alpha\ne0μα​=0 and a Boolean flag ttt, define (Mα)ij=zα(i,j)(M_\alpha)_{ij}=z_\alpha(i,j)(Mα​)ij​=zα​(i,j). constraintMatrix returns the m×mm\times mm×m matrix

Qα,t={Mα+Mα†,t=false,iMα−iMα†,t=true,Q_{\alpha,t}= \begin{cases} M_\alpha+M_\alpha^\dagger,&t=\mathrm{false},\\ \mathrm iM_\alpha-\mathrm iM_\alpha^\dagger,&t=\mathrm{true}, \end{cases}Qα,t​={Mα​+Mα†​,iMα​−iMα†​,​t=false,t=true,​

where †\dagger† denotes conjugate transpose and i2=−1\mathrm i^2=-1i2=−1. Both choices are Hermitian. When m=0m=0m=0, or when all μα\mu_\alphaμα​ vanish, there is no permissible α\alphaα and hence no input pair for this definition.

QAlgorithms.Papers.Independent.Intake100.P46.invalidSubspaceProjector

For any six positive integers d0,…,d5d_0,\ldots,d_5d0​,…,d5​ and any complex matrix WWW indexed by Bd=∏k=05{0,…,dk−1}B_d=\prod_{k=0}^{5}\{0,\ldots,d_k-1\}Bd​=∏k=05​{0,…,dk​−1}, let Rs(W)x,yR_s(W)_{x,y}Rs​(W)x,y​ be zero when some i∈si\in si∈s satisfies xi≠yix_i\ne y_ixi​=yi​, and otherwise let

Rs(W)x,y=1∏i∈sdi∑z∈Bdzi=xi for every i∉sWz,z[s;y],z[s;y]i={zii∈s,yii∉s.R_s(W)_{x,y} = \frac{1}{\prod_{i\in s}d_i} \sum_{\substack{z\in B_d\\z_i=x_i\text{ for every }i\notin s}} W_{z,z[s;y]}, \qquad z[s;y]_i= \begin{cases}z_i&i\in s,\\y_i&i\notin s.\end{cases}Rs​(W)x,y​=∏i∈s​di​1​z∈Bd​zi​=xi​ for every i∈/s​∑​Wz,z[s;y]​,z[s;y]i​={zi​yi​​i∈s,i∈/s.​

The definition assigns to WWW the matrix

N(W)=R{5}(W)−R{2,5}(W)−R{4,5}(W)+R{2,4,5}(W)+R{1,2,5}(W)−R{1,2,4,5}(W)+R{3,4,5}(W)−R{2,3,4,5}(W)+R{1,2,3,4,5}(W)−R{0,1,2,3,4,5}(W),\begin{aligned} N(W)={}&R_{\{5\}}(W)-R_{\{2,5\}}(W)-R_{\{4,5\}}(W) +R_{\{2,4,5\}}(W)+R_{\{1,2,5\}}(W)\\ &-R_{\{1,2,4,5\}}(W)+R_{\{3,4,5\}}(W) -R_{\{2,3,4,5\}}(W)+R_{\{1,2,3,4,5\}}(W) -R_{\{0,1,2,3,4,5\}}(W), \end{aligned}N(W)=​R{5}​(W)−R{2,5}​(W)−R{4,5}​(W)+R{2,4,5}​(W)+R{1,2,5}​(W)−R{1,2,4,5}​(W)+R{3,4,5}​(W)−R{2,3,4,5}​(W)+R{1,2,3,4,5}​(W)−R{0,1,2,3,4,5}​(W),​

which is WWW minus the specified alternating-sum matrix defining the valid-subspace operation.

QAlgorithms.Papers.Independent.Intake100.P46.laboratorySignature

Given a function d:{0,1,2,3}→Z>0d:\{0,1,2,3\}\to\mathbb Z_{>0}d:{0,1,2,3}→Z>0​ and positive integers p,fp,fp,f, this definition produces the six-coordinate positive-integer dimension function with values

(p,d0,d1,d2,d3,f)(p,d_0,d_1,d_2,d_3,f)(p,d0​,d1​,d2​,d3​,f)

at coordinates 0,1,2,3,4,50,1,2,3,4,50,1,2,3,4,5, respectively. Each supplied dimension may equal 111, and none may equal 000.

QAlgorithms.Papers.Independent.Intake100.P46.laboratoryTensor

For any four complex matrices A,B,C,DA,B,C,DA,B,C,D whose rows and columns are indexed by the Boolean values false,true\mathrm{false},\mathrm{true}false,true, laboratoryTensor defines a complex matrix indexed by six-tuples x,yx,yx,y with wire dimensions (1,2,2,2,2,1)(1,2,2,2,2,1)(1,2,2,2,2,1). For a coordinate a∈{0,1}a\in\{0,1\}a∈{0,1}, let ϵ(a)=false\epsilon(a)=\mathrm{false}ϵ(a)=false when a=0a=0a=0 and ϵ(a)=true\epsilon(a)=\mathrm{true}ϵ(a)=true when a=1a=1a=1. Its entries are

T(A,B,C,D)xy=Aϵ(x1),ϵ(y1)Bϵ(x2),ϵ(y2)Cϵ(x3),ϵ(y3)Dϵ(x4),ϵ(y4).T(A,B,C,D)_{xy} =A_{\epsilon(x_1),\epsilon(y_1)} B_{\epsilon(x_2),\epsilon(y_2)} C_{\epsilon(x_3),\epsilon(y_3)} D_{\epsilon(x_4),\epsilon(y_4)}.T(A,B,C,D)xy​=Aϵ(x1​),ϵ(y1​)​Bϵ(x2​),ϵ(y2​)​Cϵ(x3​),ϵ(y3​)​Dϵ(x4​),ϵ(y4​)​.

The coordinates on wires 000 and 555 are necessarily zero. No normalization, positivity, or other condition is imposed on the four input matrices.

QAlgorithms.Papers.Independent.Intake100.P46.liftKernelVector

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, XXX the basis with dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and WWW a complex matrix on XXX. The supplied eee gives a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λt\lambda_tλt​, and orthonormal vectors ut:X→Cu_t:X\to\mathbb Cut​:X→C, t<rt<rt<r, satisfying Wxy=∑tλtut(x)ut(y)‾W_{xy}=\sum_t\lambda_tu_t(x)\overline{u_t(y)}Wxy​=∑t​λt​ut​(x)ut​(y)​. Let YYY have dimensions D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r) and put c(x)=λx5 ux5(0,x1,x2,x3,x4,0)c(x)=\sqrt{\lambda_{x_5}}\,u_{x_5}(0,x_1,x_2,x_3,x_4,0)c(x)=λx5​​​ux5​​(0,x1​,x2​,x3​,x4​,0). Let RSR_SRS​ trace out wires SSS and insert their identity divided by ∏j∈SDj\prod_{j\in S}D_j∏j∈S​Dj​, in the original positions, and define

L=R{5}−R{2,5}−R{4,5}+R{2,4,5}+R{1,2,5}−R{1,2,4,5}+R{3,4,5}−R{2,3,4,5}+R{1,2,3,4,5}−R{0,1,2,3,4,5}.\mathcal L =R_{\{5\}}-R_{\{2,5\}}-R_{\{4,5\}}+R_{\{2,4,5\}} +R_{\{1,2,5\}}-R_{\{1,2,4,5\}} +R_{\{3,4,5\}}-R_{\{2,3,4,5\}} +R_{\{1,2,3,4,5\}}-R_{\{0,1,2,3,4,5\}}.L=R{5}​−R{2,5}​−R{4,5}​+R{2,4,5}​+R{1,2,5}​−R{1,2,4,5}​+R{3,4,5}​−R{2,3,4,5}​+R{1,2,3,4,5}​−R{0,1,2,3,4,5}​.

Writing Ew,zE_{w,z}Ew,z​ for the matrix unit in row www, column zzz, define

Kvw=∑a,z∈Yc(a)[L(Ew,z)]v,ac(z)‾.K_{vw}=\sum_{a,z\in Y}c(a)[\mathcal L(E_{w,z})]_{v,a}\overline{c(z)}.Kvw​=a,z∈Y∑​c(a)[L(Ew,z​)]v,a​c(z)​.

The supplied bbb consists of a natural number mmm and vectors βi:Y→C\beta_i:Y\to\mathbb Cβi​:Y→C, i<mi<mi<m, satisfying ∑xβi(x)‾βj(x)=δij\sum_x\overline{\beta_i(x)}\beta_j(x)=\delta_{ij}∑x​βi​(x)​βj​(x)=δij​, whose complex span equals {q:Kq=0}\{q:Kq=0\}{q:Kq=0}. Given any coefficient vector v:{0,…,m−1}→Cv:\{0,\ldots,m-1\}\to\mathbb Cv:{0,…,m−1}→C, without a normalization or nonzero requirement, liftKernelVector returns the function on YYY defined by

x⟼∑i=0m−1viβi(x).x\longmapsto\sum_{i=0}^{m-1}v_i\beta_i(x).x⟼i=0∑m−1​vi​βi​(x).

When m=0m=0m=0, the coefficient vector has empty domain and the returned function is identically zero.

QAlgorithms.Papers.Independent.Intake100.P46.linkLaboratories

Given positive integers d0,…,d5,ain,aout,bin,boutd_0,\ldots,d_5,a_{\mathrm{in}},a_{\mathrm{out}},b_{\mathrm{in}},b_{\mathrm{out}}d0​,…,d5​,ain​,aout​,bin​,bout​, write Ds={0,…,ds−1}D_s=\{0,\ldots,d_s-1\}Ds​={0,…,ds​−1}, D=∏s=05DsD=\prod_{s=0}^{5}D_sD=∏s=05​Ds​, EA={0,…,ain−1}E_A=\{0,\ldots,a_{\mathrm{in}}-1\}EA​={0,…,ain​−1}, FA={0,…,aout−1}F_A=\{0,\ldots,a_{\mathrm{out}}-1\}FA​={0,…,aout​−1}, EB={0,…,bin−1}E_B=\{0,\ldots,b_{\mathrm{in}}-1\}EB​={0,…,bin​−1}, and FB={0,…,bout−1}F_B=\{0,\ldots,b_{\mathrm{out}}-1\}FB​={0,…,bout​−1}. For arbitrary complex matrices WWW indexed by DDD, AAA indexed by (D1×EA)×(D2×FA)(D_1\times E_A)\times(D_2\times F_A)(D1​×EA​)×(D2​×FA​), and BBB indexed by (D3×EB)×(D4×FB)(D_3\times E_B)\times(D_4\times F_B)(D3​×EB​)×(D4​×FB​), this defines a complex matrix LLL indexed on both sides by (D0×EA×EB)×(D5×FA×FB)(D_0\times E_A\times E_B)\times(D_5\times F_A\times F_B)(D0​×EA​×EB​)×(D5​×FA​×FB​). For u=((p,α,β),(f,γ,η))u=((p,\alpha,\beta),(f,\gamma,\eta))u=((p,α,β),(f,γ,η)) and v=((p′,α′,β′),(f′,γ′,η′))v=((p',\alpha',\beta'),(f',\gamma',\eta'))v=((p′,α′,β′),(f′,γ′,η′)), its entry is

Lu,v=∑x,y∈Dx0=p, y0=p′x5=f, y5=f′Wx,y A((x1,α),(x2,γ)), ((y1,α′),(y2,γ′)) B((x3,β),(x4,η)), ((y3,β′),(y4,η′)).L_{u,v} = \sum_{\substack{x,y\in D\\x_0=p,\ y_0=p'\\x_5=f,\ y_5=f'}} W_{x,y}\, A_{((x_1,\alpha),(x_2,\gamma)),\,((y_1,\alpha'),(y_2,\gamma'))}\, B_{((x_3,\beta),(x_4,\eta)),\,((y_3,\beta'),(y_4,\eta'))}.Lu,v​=x,y∈Dx0​=p, y0​=p′x5​=f, y5​=f′​∑​Wx,y​A((x1​,α),(x2​,γ)),((y1​,α′),(y2​,γ′))​B((x3​,β),(x4​,η)),((y3​,β′),(y4​,η′))​.

All coordinates range over the corresponding sets just specified. The definition imposes no positivity or normalization conditions on WWW, AAA, or BBB.

QAlgorithms.Papers.Independent.Intake100.P46.modeMatrix

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, XXX the basis with wire dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and WWW a complex matrix on XXX. The supplied eee consists of a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λt\lambda_tλt​, and orthonormal vectors ut:X→Cu_t:X\to\mathbb Cut​:X→C satisfying Wxy=∑t<rλtut(x)ut(y)‾W_{xy}=\sum_{t<r}\lambda_tu_t(x)\overline{u_t(y)}Wxy​=∑t<r​λt​ut​(x)ut​(y)​. On the basis YYY with dimensions D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r), put c(x)=λx5 ux5(0,x1,x2,x3,x4,0)c(x)=\sqrt{\lambda_{x_5}}\,u_{x_5}(0,x_1,x_2,x_3,x_4,0)c(x)=λx5​​​ux5​​(0,x1​,x2​,x3​,x4​,0). Let RSR_SRS​ trace out wires SSS and insert the identity on those wires divided by ∏j∈SDj\prod_{j\in S}D_j∏j∈S​Dj​, in the original positions, and define

L=R{5}−R{2,5}−R{4,5}+R{2,4,5}+R{1,2,5}−R{1,2,4,5}+R{3,4,5}−R{2,3,4,5}+R{1,2,3,4,5}−R{0,1,2,3,4,5}.\mathcal L =R_{\{5\}}-R_{\{2,5\}}-R_{\{4,5\}}+R_{\{2,4,5\}} +R_{\{1,2,5\}}-R_{\{1,2,4,5\}} +R_{\{3,4,5\}}-R_{\{2,3,4,5\}} +R_{\{1,2,3,4,5\}}-R_{\{0,1,2,3,4,5\}}.L=R{5}​−R{2,5}​−R{4,5}​+R{2,4,5}​+R{1,2,5}​−R{1,2,4,5}​+R{3,4,5}​−R{2,3,4,5}​+R{1,2,3,4,5}​−R{0,1,2,3,4,5}​.

For the matrix unit Ew,zE_{w,z}Ew,z​, put H(a,v),(z,w)=[L(Ew,z)]v,aH_{(a,v),(z,w)}=[\mathcal L(E_{w,z})]_{v,a}H(a,v),(z,w)​=[L(Ew,z​)]v,a​ and Kvw=∑a,zc(a)H(a,v),(z,w)c(z)‾K_{vw}=\sum_{a,z}c(a)H_{(a,v),(z,w)}\overline{c(z)}Kvw​=∑a,z​c(a)H(a,v),(z,w)​c(z)​. The supplied bbb consists of a natural number mmm and orthonormal vectors βi:Y→C\beta_i:Y\to\mathbb Cβi​:Y→C, i<mi<mi<m, spanning exactly ker⁡K\ker KkerK. Define J={0,…,m−1}2J=\{0,\ldots,m-1\}^2J={0,…,m−1}2 and

C(i,j),(k,ℓ)=∑a,v,z,w∈Yβi(a)βj(v)‾H(a,v),(z,w)βk(z)‾βℓ(w).C_{(i,j),(k,\ell)} =\sum_{a,v,z,w\in Y} \beta_i(a)\overline{\beta_j(v)} H_{(a,v),(z,w)} \overline{\beta_k(z)}\beta_\ell(w).C(i,j),(k,ℓ)​=a,v,z,w∈Y∑​βi​(a)βj​(v)​H(a,v),(z,w)​βk​(z)​βℓ​(w).

The supplied sss consists of real numbers μα\mu_\alphaμα​ and orthonormal vectors zα:J→Cz_\alpha:J\to\mathbb Czα​:J→C spanning CJ\mathbb C^JCJ, with Czα=μαzαCz_\alpha=\mu_\alpha z_\alphaCzα​=μα​zα​; all vector orthonormality uses the pairing ∑xv(x)‾w(x)\sum_x\overline{v(x)}w(x)∑x​v(x)​w(x). Given an index α∈J\alpha\in Jα∈J with μα≠0\mu_\alpha\ne0μα​=0, modeMatrix returns the complex m×mm\times mm×m matrix

(Mα)ij=zα(i,j)(0≤i,j<m).(M_\alpha)_{ij}=z_\alpha(i,j)\qquad(0\le i,j<m).(Mα​)ij​=zα​(i,j)(0≤i,j<m).

Thus it reshapes the selected vector into a matrix using the ordered pair of indices directly. The required index can exist only if m>0m>0m>0 and some assigned eigenvalue is nonzero.

QAlgorithms.Papers.Independent.Intake100.P46.negativeCount

For any finite type III with decidable equality, any complex matrix CCC indexed by I×II\times II×I, and a supplied proof hCh_ChC​ that CCC is Hermitian, let λi∈R\lambda_i\in\mathbb Rλi​∈R, i∈Ii\in Ii∈I, be the eigenvalues supplied by the Hermitian spectral construction associated with hCh_ChC​. This definition returns

#{i∈I:λi<0}.\#\{i\in I:\lambda_i<0\}.#{i∈I:λi​<0}.

It counts indices, so repeated eigenvalues contribute according to their multiplicity; zero eigenvalues are excluded. If III is empty, the count is 000.

QAlgorithms.Papers.Independent.Intake100.P46.nullSquareSize

For any finite type III with decidable equality, any complex matrix CCC indexed by I×II\times II×I, and a supplied proof hCh_ChC​ that CCC is Hermitian, let λi∈R\lambda_i\in\mathbb Rλi​∈R, i∈Ii\in Ii∈I, be the eigenvalues supplied by the Hermitian spectral construction associated with hCh_ChC​. This definition returns the natural number

min⁡ ⁣(#{i∈I:λi>0}, #{i∈I:λi<0})+#{i∈I:λi=0}.\min\!\left(\#\{i\in I:\lambda_i>0\},\ \#\{i\in I:\lambda_i<0\}\right) +\#\{i\in I:\lambda_i=0\}.min(#{i∈I:λi​>0}, #{i∈I:λi​<0})+#{i∈I:λi​=0}.

All counts include multiplicities through their indexing by III. If III is empty, the result is 000.

QAlgorithms.Papers.Independent.Intake100.P46.ocbProcess

On the six-wire basis with dimensions (1,2,2,2,2,1)(1,2,2,2,2,1)(1,2,2,2,2,1), identify a basis tuple with its four coordinates on wires 1,2,3,41,2,3,41,2,3,4, each in {0,1}\{0,1\}{0,1}. In the Boolean order (false,true)(\mathrm{false},\mathrm{true})(false,true), let

I=(1001),X=(0110),Z=(100−1).I=\begin{pmatrix}1&0\\0&1\end{pmatrix},\qquad X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.I=(10​01​),X=(01​10​),Z=(10​0−1​).

For four such matrices, write T(A,B,C,D)xy=Ax1y1Bx2y2Cx3y3Dx4y4T(A,B,C,D)_{xy}=A_{x_1y_1}B_{x_2y_2}C_{x_3y_3}D_{x_4y_4}T(A,B,C,D)xy​=Ax1​y1​​Bx2​y2​​Cx3​y3​​Dx4​y4​​. ocbProcess is the complex matrix

14(T(I,I,I,I)+12(T(I,Z,Z,I)+T(Z,I,X,Z))),\frac14\left( T(I,I,I,I)+\frac1{\sqrt2} \bigl(T(I,Z,Z,I)+T(Z,I,X,Z)\bigr) \right),41​(T(I,I,I,I)+2​1​(T(I,Z,Z,I)+T(Z,I,X,Z))),

where 2\sqrt22​ is the nonnegative real square root, regarded as a complex scalar.

QAlgorithms.Papers.Independent.Intake100.P46.optProcess

On the six-wire basis with dimensions (1,2,2,2,2,1)(1,2,2,2,2,1)(1,2,2,2,2,1), identify a basis tuple with its four coordinates on wires 1,2,3,41,2,3,41,2,3,4, each in {0,1}\{0,1\}{0,1}. In the Boolean order (false,true)(\mathrm{false},\mathrm{true})(false,true), let

I=(1001),X=(0110),Y=(0−ii0),Z=(100−1),I=\begin{pmatrix}1&0\\0&1\end{pmatrix},\quad X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad Y=\begin{pmatrix}0&-\mathrm i\\ \mathrm i&0\end{pmatrix},\quad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},I=(10​01​),X=(01​10​),Y=(0i​−i0​),Z=(10​0−1​),

where i2=−1\mathrm i^2=-1i2=−1, and write T(A,B,C,D)xy=Ax1y1Bx2y2Cx3y3Dx4y4T(A,B,C,D)_{xy}=A_{x_1y_1}B_{x_2y_2}C_{x_3y_3}D_{x_4y_4}T(A,B,C,D)xy​=Ax1​y1​​Bx2​y2​​Cx3​y3​​Dx4​y4​​. optProcess is the complex matrix

14(T(I,I,I,I)+13T(Z,I,X,Z)+3−13(T(I,X,X,I)+T(I,Y,Y,I)+T(I,Z,Z,I))),\frac14\left( T(I,I,I,I)+\frac1{\sqrt3}T(Z,I,X,Z) +\frac{\sqrt3-1}{3} \bigl(T(I,X,X,I)+T(I,Y,Y,I)+T(I,Z,Z,I)\bigr) \right),41​(T(I,I,I,I)+3​1​T(Z,I,X,Z)+33​−1​(T(I,X,X,I)+T(I,Y,Y,I)+T(I,Z,Z,I))),

where 3\sqrt33​ is the nonnegative real square root, regarded as a complex scalar.

QAlgorithms.Papers.Independent.Intake100.P46.positiveCount

For any finite type III with decidable equality, any complex matrix CCC indexed by I×II\times II×I, and a supplied proof hCh_ChC​ that CCC is Hermitian, let λi∈R\lambda_i\in\mathbb Rλi​∈R, i∈Ii\in Ii∈I, be the eigenvalues supplied by the Hermitian spectral construction associated with hCh_ChC​. This definition returns

#{i∈I:λi>0}.\#\{i\in I:\lambda_i>0\}.#{i∈I:λi​>0}.

It counts indices, so repeated eigenvalues contribute according to their multiplicity; zero eigenvalues are excluded. If III is empty, the count is 000.

QAlgorithms.Papers.Independent.Intake100.P46.processCoordinates

Given six positive integer dimensions d0,…,d5d_0,\ldots,d_5d0​,…,d5​ and indices p,ai,ao,bi,bo,fp,a_i,a_o,b_i,b_o,fp,ai​,ao​,bi​,bo​,f satisfying 0≤p<d00\le p<d_00≤p<d0​, 0≤ai<d10\le a_i<d_10≤ai​<d1​, 0≤ao<d20\le a_o<d_20≤ao​<d2​, 0≤bi<d30\le b_i<d_30≤bi​<d3​, 0≤bo<d40\le b_o<d_40≤bo​<d4​, and 0≤f<d50\le f<d_50≤f<d5​, this defines the process basis element xxx by

(x0,x1,x2,x3,x4,x5)=(p,ai,ao,bi,bo,f).(x_0,x_1,x_2,x_3,x_4,x_5)=(p,a_i,a_o,b_i,b_o,f).(x0​,x1​,x2​,x3​,x4​,x5​)=(p,ai​,ao​,bi​,bo​,f).

QAlgorithms.Papers.Independent.Intake100.P46.processProjector

For any six positive integers d0,…,d5d_0,\ldots,d_5d0​,…,d5​, let Bd=∏k=05{0,…,dk−1}B_d=\prod_{k=0}^{5}\{0,\ldots,d_k-1\}Bd​=∏k=05​{0,…,dk​−1}. Given any complex matrix UUU whose rows are indexed by triples in {0,…,d1−1}×{0,…,d3−1}×{0,…,d5−1}\{0,\ldots,d_1-1\}\times\{0,\ldots,d_3-1\}\times\{0,\ldots,d_5-1\}{0,…,d1​−1}×{0,…,d3​−1}×{0,…,d5​−1} and whose columns are indexed by triples in {0,…,d0−1}×{0,…,d2−1}×{0,…,d4−1}\{0,\ldots,d_0-1\}\times\{0,\ldots,d_2-1\}\times\{0,\ldots,d_4-1\}{0,…,d0​−1}×{0,…,d2​−1}×{0,…,d4​−1}, this definition produces the complex matrix on BdB_dBd​ with entries

Px,y=U(x1,x3,x5),(x0,x2,x4)U(y1,y3,y5),(y0,y2,y4)‾.P_{x,y} = U_{(x_1,x_3,x_5),(x_0,x_2,x_4)} \overline{U_{(y_1,y_3,y_5),(y_0,y_2,y_4)}}.Px,y​=U(x1​,x3​,x5​),(x0​,x2​,x4​)​U(y1​,y3​,y5​),(y0​,y2​,y4​)​​.

There is no assumption on UUU, such as unitarity or normalization.

QAlgorithms.Papers.Independent.Intake100.P46.processVectorPairing

For any index type III equipped with a finite enumeration and any functions v,w:I→Cv,w:I\to\mathbb Cv,w:I→C, this definition assigns the complex number

∑x∈Iv(x)‾ w(x).\sum_{x\in I}\overline{v(x)}\,w(x).x∈I∑​v(x)​w(x).

There are no normalization assumptions on vvv or www; if III is empty, the sum is zero.

QAlgorithms.Papers.Independent.Intake100.P46.purificationKernelOperator

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, put B0={(0,a0,a1,a2,a3,0):0≤aj<dj}B_0=\{(0,a_0,a_1,a_2,a_3,0):0\le a_j<d_j\}B0​={(0,a0​,a1​,a2​,a3​,0):0≤aj​<dj​}, and let WWW be a complex matrix indexed by B0B_0B0​. The argument eee consists of a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λs\lambda_sλs​, and functions us:B0→Cu_s:B_0\to\mathbb Cus​:B0​→C, 0≤s<r0\le s<r0≤s<r, satisfying

∑x∈B0us(x)‾ut(x)=δst,Wxy=∑s=0r−1λsus(x)us(y)‾.\sum_{x\in B_0}\overline{u_s(x)}u_t(x)=\delta_{st}, \qquad W_{xy}=\sum_{s=0}^{r-1}\lambda_su_s(x)\overline{u_s(y)}.x∈B0​∑​us​(x)​ut​(x)=δst​,Wxy​=s=0∑r−1​λs​us​(x)us​(y)​.

Put h=(1,d0,d1,d2,d3,r)h=(1,d_0,d_1,d_2,d_3,r)h=(1,d0​,d1​,d2​,d3​,r), B=∏i=05{0,…,hi−1}B=\prod_{i=0}^{5}\{0,\ldots,h_i-1\}B=∏i=05​{0,…,hi​−1}, and define

q(0,a0,a1,a2,a3,t)=λt ut(0,a0,a1,a2,a3,0).q(0,a_0,a_1,a_2,a_3,t) =\sqrt{\lambda_t}\,u_t(0,a_0,a_1,a_2,a_3,0).q(0,a0​,a1​,a2​,a3​,t)=λt​​ut​(0,a0​,a1​,a2​,a3​,0).

For a matrix XXX indexed by BBB, define

(RSX)xy={1∏i∈Shi∑z∈Bzi=xi for all i∉SXz, y[S←z],xi=yi for all i∈S,0,otherwise,(R_SX)_{xy}= \begin{cases} \displaystyle \frac{1}{\prod_{i\in S}h_i} \sum_{\substack{z\in B\\z_i=x_i\text{ for all }i\notin S}} X_{z,\,y[S\leftarrow z]}, &x_i=y_i\text{ for all }i\in S,\\ 0,&\text{otherwise}, \end{cases}(RS​X)xy​=⎩⎨⎧​∏i∈S​hi​1​z∈Bzi​=xi​ for all i∈/S​∑​Xz,y[S←z]​,0,​xi​=yi​ for all i∈S,otherwise,​

where y[S←z]y[S\leftarrow z]y[S←z] uses ziz_izi​ on SSS and yiy_iyi​ outside SSS, and set

D(X)=R{5}X−R{2,5}X−R{4,5}X+R{2,4,5}X+R{1,2,5}X−R{1,2,4,5}X+R{3,4,5}X−R{2,3,4,5}X+R{1,2,3,4,5}X−R{0,1,2,3,4,5}X.\begin{aligned} D(X)={}&R_{\{5\}}X-R_{\{2,5\}}X-R_{\{4,5\}}X +R_{\{2,4,5\}}X+R_{\{1,2,5\}}X\\ &-R_{\{1,2,4,5\}}X+R_{\{3,4,5\}}X -R_{\{2,3,4,5\}}X\\ &+R_{\{1,2,3,4,5\}}X-R_{\{0,1,2,3,4,5\}}X. \end{aligned}D(X)=​R{5}​X−R{2,5}​X−R{4,5}​X+R{2,4,5}​X+R{1,2,5}​X−R{1,2,4,5}​X+R{3,4,5}​X−R{2,3,4,5}​X+R{1,2,3,4,5}​X−R{0,1,2,3,4,5}​X.​

Writing Ep,qE_{p,q}Ep,q​ for the matrix with a single 111 at row ppp, column qqq, the definition gives the complex matrix KKK indexed by BBB with entries

Kvw=∑a∈B∑b∈Bq(a) (D(Ew,b))v,a q(b)‾.K_{vw} =\sum_{a\in B}\sum_{b\in B} q(a)\,\bigl(D(E_{w,b})\bigr)_{v,a}\,\overline{q(b)}.Kvw​=a∈B∑​b∈B∑​q(a)(D(Ew,b​))v,a​q(b)​.

QAlgorithms.Papers.Independent.Intake100.P46.qubitLaboratories

qubitLaboratories is the function from {0,1,2,3}\{0,1,2,3\}{0,1,2,3} to the positive integers that takes the value 222 at every argument.

QAlgorithms.Papers.Independent.Intake100.P46.qubitSignature

qubitSignature is the function from the six wire labels {0,1,2,3,4,5}\{0,1,2,3,4,5\}{0,1,2,3,4,5} to the positive integers whose values, in that order, are

(1,2,2,2,2,1).(1,2,2,2,2,1).(1,2,2,2,2,1).

Thus wires 000 and 555 each have one basis value, and wires 1,2,3,41,2,3,41,2,3,4 each have two.

QAlgorithms.Papers.Independent.Intake100.P46.reconstructedUnitary

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, and put B0={(0,a0,a1,a2,a3,0):0≤aj<dj}B_0=\{(0,a_0,a_1,a_2,a_3,0):0\le a_j<d_j\}B0​={(0,a0​,a1​,a2​,a3​,0):0≤aj​<dj​}. Let WWW be a complex matrix indexed by B0B_0B0​. The argument eee consists of a positive integer r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λs\lambda_sλs​, and functions us:B0→Cu_s:B_0\to\mathbb Cus​:B0​→C, indexed by 0≤s<r0\le s<r0≤s<r, satisfying

∑x∈B0us(x)‾ut(x)=δst,Wxy=∑s=0r−1λsus(x)us(y)‾.\sum_{x\in B_0}\overline{u_s(x)}u_t(x)=\delta_{st}, \qquad W_{xy}=\sum_{s=0}^{r-1}\lambda_su_s(x)\overline{u_s(y)}.x∈B0​∑​us​(x)​ut​(x)=δst​,Wxy​=s=0∑r−1​λs​us​(x)us​(y)​.

For any family of functions ws:Br→Cw_s:B_r\to\mathbb Cws​:Br​→C, where Br={(0,a0,a1,a2,a3,t):0≤aj<dj, 0≤t<r}B_r=\{(0,a_0,a_1,a_2,a_3,t):0\le a_j<d_j,\ 0\le t<r\}Br​={(0,a0​,a1​,a2​,a3​,t):0≤aj​<dj​, 0≤t<r}, the definition gives the complex matrix UUU whose rows are indexed by (a0,a2,t)(a_0,a_2,t)(a0​,a2​,t), whose columns are indexed by (s,a1,a3)(s,a_1,a_3)(s,a1​,a3​), and whose entries are

U(a0,a2,t),(s,a1,a3)=ws(0,a0,a1,a2,a3,t).U_{(a_0,a_2,t),(s,a_1,a_3)} =w_s(0,a_0,a_1,a_2,a_3,t).U(a0​,a2​,t),(s,a1​,a3​)​=ws​(0,a0​,a1​,a2​,a3​,t).

Thus UUU has d0d2rd_0d_2rd0​d2​r rows and rd1d3rd_1d_3rd1​d3​ columns; the family www is arbitrary.

QAlgorithms.Papers.Independent.Intake100.P46.recoverProcess

For any four positive integers d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​, any positive integers p,fp,fp,f, and any complex matrix SSS indexed by tuples of dimensions (p,d0,d1,d2,d3,f)(p,d_0,d_1,d_2,d_3,f)(p,d0​,d1​,d2​,d3​,f), this definition produces a complex matrix WWW indexed by tuples of dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), with entries

Wx,y=∑t=0f−1S(0,x1,x2,x3,x4,t), (0,y1,y2,y3,y4,t).W_{x,y} = \sum_{t=0}^{f-1} S_{(0,x_1,x_2,x_3,x_4,t),\, (0,y_1,y_2,y_3,y_4,t)}.Wx,y​=t=0∑f−1​S(0,x1​,x2​,x3​,x4​,t),(0,y1​,y2​,y3​,y4​,t)​.

Thus the first coordinate of both indices of SSS is fixed to 000, while the last coordinate is summed with equal values on both indices. No hypothesis is imposed on SSS, and the sum is nonempty because f>0f>0f>0.

QAlgorithms.Papers.Independent.Intake100.P46.replaceWires

For any six positive integers d0,…,d5d_0,\ldots,d_5d0​,…,d5​, any subset s⊆{0,…,5}s\subseteq\{0,\ldots,5\}s⊆{0,…,5}, and any complex matrix WWW indexed by Bd=∏k=05{0,…,dk−1}B_d=\prod_{k=0}^{5}\{0,\ldots,d_k-1\}Bd​=∏k=05​{0,…,dk​−1}, this definition produces a matrix Rs(W)R_s(W)Rs​(W) as follows. For x,y∈Bdx,y\in B_dx,y∈Bd​, let z[s;y]z[s;y]z[s;y] denote the tuple whose iii-th coordinate is ziz_izi​ if i∈si\in si∈s and yiy_iyi​ otherwise. Then

Rs(W)x,y={1∏i∈sdi∑z∈Bdzi=xi for every i∉sWz,z[s;y],xi=yi for every i∈s,0,otherwise.R_s(W)_{x,y} = \begin{cases} \displaystyle \frac{1}{\prod_{i\in s}d_i} \sum_{\substack{z\in B_d\\ z_i=x_i\text{ for every }i\notin s}} W_{z,z[s;y]}, & x_i=y_i\text{ for every }i\in s,\\[6pt] 0,&\text{otherwise}. \end{cases}Rs​(W)x,y​=⎩⎨⎧​∏i∈s​di​1​z∈Bd​zi​=xi​ for every i∈/s​∑​Wz,z[s;y]​,0,​xi​=yi​ for every i∈s,otherwise.​

The dimensions are positive, so the denominator is nonzero. The subset sss may be empty, in which case Rs(W)=WR_s(W)=WRs​(W)=W; if s={0,…,5}s=\{0,\ldots,5\}s={0,…,5}, the result is tr⁡(W)/(∏i=05di)\operatorname{tr}(W)/(\prod_{i=0}^{5}d_i)tr(W)/(∏i=05​di​) times the identity matrix.

QAlgorithms.Papers.Independent.Intake100.P46.stateOutputIsometry

This definition gives a complex matrix whose row indices are triples (a,b,t)(a,b,t)(a,b,t) with a=b=0a=b=0a=b=0 and t∈{0,1}t\in\{0,1\}t∈{0,1}, and whose column indices are the single triple (0,0,0)(0,0,0)(0,0,0). Its entry is 111 when the third row coordinate is 000, and 000 otherwise:

V(0,0,t),(0,0,0)={1,t=0,0,t=1.V_{(0,0,t),(0,0,0)} = \begin{cases} 1,&t=0,\\ 0,&t=1. \end{cases}V(0,0,t),(0,0,0)​={1,0,​t=0,t=1.​

QAlgorithms.Papers.Independent.Intake100.P46.stateOutputSignature

This definition specifies six positive integer wire dimensions, indexed by 0,1,…,50,1,\ldots,50,1,…,5, as

(d0,d1,d2,d3,d4,d5)=(1,1,1,1,1,2).(d_0,d_1,d_2,d_3,d_4,d_5)=(1,1,1,1,1,2).(d0​,d1​,d2​,d3​,d4​,d5​)=(1,1,1,1,1,2).

QAlgorithms.Papers.Independent.Intake100.P46.testBound

Let d0,d1,d2,d3d_0,d_1,d_2,d_3d0​,d1​,d2​,d3​ be positive integers, XXX the basis with dimensions (1,d0,d1,d2,d3,1)(1,d_0,d_1,d_2,d_3,1)(1,d0​,d1​,d2​,d3​,1), and WWW a complex matrix on XXX. The supplied eee gives a positive rank r=rank⁡Wr=\operatorname{rank}Wr=rankW, positive real numbers λt\lambda_tλt​, and orthonormal vectors utu_tut​ such that Wxy=∑t<rλtut(x)ut(y)‾W_{xy}=\sum_{t<r}\lambda_tu_t(x)\overline{u_t(y)}Wxy​=∑t<r​λt​ut​(x)ut​(y)​. On the basis YYY with dimensions D=(1,d0,d1,d2,d3,r)D=(1,d_0,d_1,d_2,d_3,r)D=(1,d0​,d1​,d2​,d3​,r), put c(x)=λx5 ux5(0,x1,x2,x3,x4,0)c(x)=\sqrt{\lambda_{x_5}}\,u_{x_5}(0,x_1,x_2,x_3,x_4,0)c(x)=λx5​​​ux5​​(0,x1​,x2​,x3​,x4​,0). Let RSR_SRS​ trace out wires SSS and insert their identity divided by ∏j∈SDj\prod_{j\in S}D_j∏j∈S​Dj​, restoring the original wire positions, and set

L=R{5}−R{2,5}−R{4,5}+R{2,4,5}+R{1,2,5}−R{1,2,4,5}+R{3,4,5}−R{2,3,4,5}+R{1,2,3,4,5}−R{0,1,2,3,4,5}.\mathcal L =R_{\{5\}}-R_{\{2,5\}}-R_{\{4,5\}}+R_{\{2,4,5\}} +R_{\{1,2,5\}}-R_{\{1,2,4,5\}} +R_{\{3,4,5\}}-R_{\{2,3,4,5\}} +R_{\{1,2,3,4,5\}}-R_{\{0,1,2,3,4,5\}}.L=R{5}​−R{2,5}​−R{4,5}​+R{2,4,5}​+R{1,2,5}​−R{1,2,4,5}​+R{3,4,5}​−R{2,3,4,5}​+R{1,2,3,4,5}​−R{0,1,2,3,4,5}​.

For matrix units Ew,zE_{w,z}Ew,z​, define H(a,v),(z,w)=[L(Ew,z)]v,aH_{(a,v),(z,w)}=[\mathcal L(E_{w,z})]_{v,a}H(a,v),(z,w)​=[L(Ew,z​)]v,a​ and Kvw=∑a,zc(a)H(a,v),(z,w)c(z)‾K_{vw}=\sum_{a,z}c(a)H_{(a,v),(z,w)}\overline{c(z)}Kvw​=∑a,z​c(a)H(a,v),(z,w)​c(z)​. The supplied bbb gives a natural number mmm and orthonormal vectors βi:Y→C\beta_i:Y\to\mathbb Cβi​:Y→C, i<mi<mi<m, whose span is exactly ker⁡K\ker KkerK. On J={0,…,m−1}2J=\{0,\ldots,m-1\}^2J={0,…,m−1}2, define

C(i,j),(k,ℓ)=∑a,v,z,w∈Yβi(a)βj(v)‾H(a,v),(z,w)βk(z)‾βℓ(w).C_{(i,j),(k,\ell)} =\sum_{a,v,z,w\in Y} \beta_i(a)\overline{\beta_j(v)} H_{(a,v),(z,w)} \overline{\beta_k(z)}\beta_\ell(w).C(i,j),(k,ℓ)​=a,v,z,w∈Y∑​βi​(a)βj​(v)​H(a,v),(z,w)​βk​(z)​βℓ​(w).

The supplied sss gives real numbers μα\mu_\alphaμα​ and orthonormal vectors zα:J→Cz_\alpha:J\to\mathbb Czα​:J→C spanning CJ\mathbb C^JCJ, with Czα=μαzαCz_\alpha=\mu_\alpha z_\alphaCzα​=μα​zα​; orthonormality uses ∑xv(x)‾w(x)\sum_x\overline{v(x)}w(x)∑x​v(x)​w(x). For every α\alphaα with μα≠0\mu_\alpha\ne0μα​=0, form Mα,ij=zα(i,j)M_{\alpha,ij}=z_\alpha(i,j)Mα,ij​=zα​(i,j) and the two Hermitian matrices Qα,false=Mα+Mα†Q_{\alpha,\mathrm{false}}=M_\alpha+M_\alpha^\daggerQα,false​=Mα​+Mα†​ and Qα,true=iMα−iMα†Q_{\alpha,\mathrm{true}}=\mathrm iM_\alpha-\mathrm iM_\alpha^\daggerQα,true​=iMα​−iMα†​. For a Hermitian matrix QQQ, let n+(Q),n−(Q),n0(Q)n_+(Q),n_-(Q),n_0(Q)n+​(Q),n−​(Q),n0​(Q) count its strictly positive, strictly negative, and zero eigenvalues, respectively, with multiplicities. testBound is the following element of N∪{∞}\mathbb N\cup\{\infty\}N∪{∞}:

inf⁡α∈J, μα≠0t∈{false,true}(min⁡{n+(Qα,t),n−(Qα,t)}+n0(Qα,t)).\inf_{\substack{\alpha\in J,\ \mu_\alpha\ne0\\ t\in\{\mathrm{false},\mathrm{true}\}}} \left(\min\{n_+(Q_{\alpha,t}),n_-(Q_{\alpha,t})\}+n_0(Q_{\alpha,t})\right).α∈J, μα​=0t∈{false,true}​inf​(min{n+​(Qα,t​),n−​(Qα,t​)}+n0​(Qα,t​)).

For a nonempty indexing set this is the minimum of the displayed natural numbers. For an empty indexing set it is ∞\infty∞, including when m=0m=0m=0 or when all μα\mu_\alphaμα​ are zero.

QAlgorithms.Papers.Independent.Intake100.P46.unitaryChannelProjector

For arbitrary types III and OOO and any complex matrix UUU with rows indexed by OOO and columns indexed by III, this defines a complex matrix JJJ with rows and columns indexed by I×OI\times OI×O, whose entries are

J(i,o),(j,q)=Uo,i Uq,j‾(i,j∈I, o,q∈O).J_{(i,o),(j,q)}=U_{o,i}\,\overline{U_{q,j}} \qquad(i,j\in I,\ o,q\in O).J(i,o),(j,q)​=Uo,i​Uq,j​​(i,j∈I, o,q∈O).

Neither index type is required to be finite or nonempty, and no reversibility or normalization condition is imposed on UUU.

QAlgorithms.Papers.Independent.Intake100.P46.validSubspaceProjector

For any six positive integers d0,…,d5d_0,\ldots,d_5d0​,…,d5​ and any complex matrix WWW indexed by Bd=∏k=05{0,…,dk−1}B_d=\prod_{k=0}^{5}\{0,\ldots,d_k-1\}Bd​=∏k=05​{0,…,dk​−1}, define, for a subset s⊆{0,…,5}s\subseteq\{0,\ldots,5\}s⊆{0,…,5}, the matrix Rs(W)R_s(W)Rs​(W) to have entry zero unless xi=yix_i=y_ixi​=yi​ for every i∈si\in si∈s, and otherwise to have entry

Rs(W)x,y=1∏i∈sdi∑z∈Bdzi=xi for every i∉sWz,z[s;y],R_s(W)_{x,y} = \frac{1}{\prod_{i\in s}d_i} \sum_{\substack{z\in B_d\\z_i=x_i\text{ for every }i\notin s}} W_{z,z[s;y]},Rs​(W)x,y​=∏i∈s​di​1​z∈Bd​zi​=xi​ for every i∈/s​∑​Wz,z[s;y]​,

where z[s;y]i=ziz[s;y]_i=z_iz[s;y]i​=zi​ for i∈si\in si∈s and z[s;y]i=yiz[s;y]_i=y_iz[s;y]i​=yi​ otherwise. The definition assigns to WWW the matrix

L(W)=W−R{5}(W)+R{2,5}(W)+R{4,5}(W)−R{2,4,5}(W)−R{1,2,5}(W)+R{1,2,4,5}(W)−R{3,4,5}(W)+R{2,3,4,5}(W)−R{1,2,3,4,5}(W)+R{0,1,2,3,4,5}(W).\begin{aligned} L(W)={}&W-R_{\{5\}}(W)+R_{\{2,5\}}(W)+R_{\{4,5\}}(W) -R_{\{2,4,5\}}(W)-R_{\{1,2,5\}}(W)\\ &+R_{\{1,2,4,5\}}(W)-R_{\{3,4,5\}}(W) +R_{\{2,3,4,5\}}(W)-R_{\{1,2,3,4,5\}}(W) +R_{\{0,1,2,3,4,5\}}(W). \end{aligned}L(W)=​W−R{5}​(W)+R{2,5}​(W)+R{4,5}​(W)−R{2,4,5}​(W)−R{1,2,5}​(W)+R{1,2,4,5}​(W)−R{3,4,5}​(W)+R{2,3,4,5}​(W)−R{1,2,3,4,5}​(W)+R{0,1,2,3,4,5}​(W).​

No additional condition is imposed on WWW.

QAlgorithms.Papers.Independent.Intake100.P46.vectorOuter

For any index type III and any two functions v,w:I→Cv,w:I\to\mathbb Cv,w:I→C, this definition produces the complex matrix indexed by I×II\times II×I whose entries are

Mx,y=v(x) w(y)‾(x,y∈I).M_{x,y}=v(x)\,\overline{w(y)} \qquad(x,y\in I).Mx,y​=v(x)w(y)​(x,y∈I).

The index type need not be finite or nonempty, and neither function is subject to a normalization or other hypothesis.

QAlgorithms.Papers.Independent.Intake100.P46.vectorizedComplement

For any six positive integers d0,…,d5d_0,\ldots,d_5d0​,…,d5​, put B=∏i=05{0,…,di−1}B=\prod_{i=0}^{5}\{0,\ldots,d_i-1\}B=∏i=05​{0,…,di​−1}. For a complex matrix XXX indexed by BBB and a subset S⊆{0,…,5}S\subseteq\{0,\ldots,5\}S⊆{0,…,5}, define y[S←z]y[S\leftarrow z]y[S←z] to have coordinate ziz_izi​ for i∈Si\in Si∈S and yiy_iyi​ otherwise, and set

(RSX)xy={1∏i∈Sdi∑z∈Bzi=xi for all i∉SXz, y[S←z],xi=yi for all i∈S,0,otherwise.(R_SX)_{xy}= \begin{cases} \displaystyle \frac{1}{\prod_{i\in S}d_i} \sum_{\substack{z\in B\\z_i=x_i\text{ for all }i\notin S}} X_{z,\,y[S\leftarrow z]}, &x_i=y_i\text{ for all }i\in S,\\ 0,&\text{otherwise}. \end{cases}(RS​X)xy​=⎩⎨⎧​∏i∈S​di​1​z∈Bzi​=xi​ for all i∈/S​∑​Xz,y[S←z]​,0,​xi​=yi​ for all i∈S,otherwise.​

Define the following explicit linear expression in XXX:

D(X)=R{5}X−R{2,5}X−R{4,5}X+R{2,4,5}X+R{1,2,5}X−R{1,2,4,5}X+R{3,4,5}X−R{2,3,4,5}X+R{1,2,3,4,5}X−R{0,1,2,3,4,5}X.\begin{aligned} D(X)={}&R_{\{5\}}X-R_{\{2,5\}}X-R_{\{4,5\}}X +R_{\{2,4,5\}}X+R_{\{1,2,5\}}X\\ &-R_{\{1,2,4,5\}}X+R_{\{3,4,5\}}X -R_{\{2,3,4,5\}}X\\ &+R_{\{1,2,3,4,5\}}X-R_{\{0,1,2,3,4,5\}}X. \end{aligned}D(X)=​R{5}​X−R{2,5}​X−R{4,5}​X+R{2,4,5}​X+R{1,2,5}​X−R{1,2,4,5}​X+R{3,4,5}​X−R{2,3,4,5}​X+R{1,2,3,4,5}​X−R{0,1,2,3,4,5}​X.​

For p,q∈Bp,q\in Bp,q∈B, let Ep,qE_{p,q}Ep,q​ be the matrix with entry 111 at row ppp, column qqq, and 000 elsewhere. The definition gives the complex matrix indexed by B×BB\times BB×B with entries

V(a1,a2),(b1,b2)=(D(Eb2,b1))a2,a1.V_{(a_1,a_2),(b_1,b_2)} =\bigl(D(E_{b_2,b_1})\bigr)_{a_2,a_1}.V(a1​,a2​),(b1​,b2​)​=(D(Eb2​,b1​​))a2​,a1​​.

All six dimensions are positive, so the denominators in the displayed replacement formula are nonzero.

QAlgorithms.Papers.Independent.Intake100.P46.zeroCount

For any finite type III with decidable equality, any complex matrix CCC indexed by I×II\times II×I, and a supplied proof hCh_ChC​ that CCC is Hermitian, let λi∈R\lambda_i\in\mathbb Rλi​∈R, i∈Ii\in Ii∈I, be the eigenvalues supplied by the Hermitian spectral construction associated with hCh_ChC​. This definition returns

#{i∈I:λi=0}.\#\{i\in I:\lambda_i=0\}.#{i∈I:λi​=0}.

It counts indices, including every occurrence of a repeated zero eigenvalue. If III is empty, the count is 000.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 2026

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

View graph

Get started

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

About Prove2Me

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

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me