Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Some remarks on port-based teleportation

Definition
QAlgorithms_Papers_Independent_Intakenext100_P53

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

prove2quantum

The objects the formalized statements of Some remarks on port-based teleportation (arXiv:1506.01555) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Ports
  • AC
  • PortComplement
  • spinSinglet: PDF p.2, Eq.(2): normalized physical spin-zero singlet. The printed second spin label m is corrected to -m, as forced by the stated spin-zero convention and the physical angular-momentum decomposition on the same page.
  • singletDensity: PDF p.2, Eq.(2): singlet projector.
  • insertPort: Ordered insertion of one port into its complement.
  • singletInsert: PDF p.2, Eq.(4): isometric insertion of the A_i,C singlet.
  • portProjector: PDF p.2, Eq.(4): P^-_(A_i,C) tensor I_rest.
  • pbtSignal: PDF p.2, Eq.(4): normalized signal; used with N>=1,d>=2.
  • pbtRho: PDF p.2, Eq.(5): physical signal sum.
  • liftA: PDF p.2: O acts on Alice's ports and leaves C unchanged.
  • resource: PDF p.2, Eq.(1): resource amplitude after applying O to A.
  • NormalizedResource: PDF p.2, Eq.(1): exact resource normalization.
  • DeterministicPOVM: PDF p.2: Alice's deterministic measurement on AC.
  • ProbabilisticPOVM: PDF p.3: none is failure, some i is successful port i.
  • pbtChannelBranch: PDF pp.2,4: induced unnormalized reference-B branch for input T on R,C. The effect determines the branch after Alice's registers are discarded.
  • pbtBranch: PDF pp.3-4: normalized reference-singlet experiment.
  • selectPort: Physical marginal retaining the reference and selected output port.
  • pbtBranchProbability: PDF p.4: outcome probability in the reference-singlet experiment.
  • pbtFidelity: PDF p.2, Eq.(3): operational entanglement fidelity of port selection.
  • codingState: PDF p.4, Eq.(20): state measured when Bob sends B_k, renamed C.
  • codingProbability: PDF p.4: actual coding outcome probability.
  • ExactProbabilistic: PDF p.4: Choi equation for faithful successful branches, including zero probabilities without division. For these CP branches it characterizes p_i times the identity channel, also on inputs entangled with a reference.
  • pbtSuccessProbability: PDF p.4: total exact-teleportation success probability.
  • srm: PDF p.3, Eq.(12): SRM on the support.
  • completedSRM: PDF p.3, Eqs.(12)-(13): deterministic completion.
  • probabilisticSRM: PDF p.3: separate probabilistic failure effect.
  • conditionalFidelity: PDF pp.4-5, Eq.(23): normalized conditional singlet overlap. Uses below have strictly positive branch probability.
  • SymmetricPorts: PDF pp.4-5: symmetry conditions imposed on the actual protocol.
  • maximumSpinVector: PDF p.6, A7: equal-port sum with every complementary spin at its highest weight; normalization uses its actual Euclidean norm.
  • quditSpinZ: PDF p.2: physical spin-s z component, s=(d-1)/2.
  • quditSpinRaise: PDF p.2: raising matrix in the m=s-r convention.
  • spinX: Physical Cartesian x component.
  • quditSpinY: Physical Cartesian y component.
  • quditOnWire: A spin operator on a named wire of an ordered finite register.
  • quditCollective: PDF p.2: physical collective angular momentum on any complement or port register.
  • quditCasimir: PDF p.2: the actual squared total angular momentum.
  • totalComponent: PDF p.2: addition of the C spin to all A spins.
  • totalCasimir: PDF p.2: actual squared angular momentum on AC.
  • casimirProjector: PDF p.2, Eqs.(7)-(8): spectral projector for twice-spin t. Impossible sectors have zero projector; no abstract decomposition is assumed.
  • magneticProjector: Physical z-component slice; r=0,...,t corresponds to m=t/2-r.
  • rhoSpinBlock: PDF p.2, Eq.(8): spin block constructed by singlet insertion of the actual complementary-register spin projectors.
  • rhoSpinMagnetic: PDF p.6, Eq.(A2): physical total-spin and magnetic block.
  • qubitSpins: PDF p.3: parity-correct twice-spin labels for N qubits.
  • qubitSectorDimension: PDF p.3, Eq.(14): intrinsic physical sector dimension h_N(t/2).
  • deterministicResource: PDF p.3, Eq.(14), normalized correction: numerator 2^(N+2), not the printed 2^(N+1). The intrinsic sector dimension fixes this uniquely already at N=1. The malformed printed combinatorial shorthand is not used.
  • probabilisticResource: PDF p.3, Eq.(15): explicit probabilistic resource, including the parity-correct minimum spin. No optimality is built into this definition.
  • transformedSRM: The SRM for the actual transformed signals O sigma_i O†.
  • qutritResourceSquare: PDF p.7, Eq.(B3): actual qutrit two-port resource square.
  • qutritResource: PDF p.7: the positive square root of X, not an arbitrary filter.
  • qutritTransformedEffect: PDF p.7, Eq.(B5): transformed success effects with corrected factor 9/10.
  • qutritPairKet: Computational ket of the two physical qutrit A ports, highest spin label first.
  • qutritHighest: PDF p.6, B1: the three highest-weight total-spin-one vectors, with the phase convention in which the A_1,C singlet matrix carries (-1)^(J+J'). J=0,1,2 is the physical A-spin. Lower magnetic vectors are generated below.
  • qutritCoupled: PDF p.6, B1: actual coupled basis; r=0,1,2 represents m=1,0,-1.
  • qutritFrame: PDF p.6: the physical three-column block frame at one magnetic number.
  • qutritFullFrame: All nine coupled vectors, not a postulated abstract matrix basis.
  • qutritBlock: PDF p.6, Eq.(B2): the exact spin-one magnetic block.
  • qutritKernelVector: PDF p.7, Eq.(B7), corrected: sqrt(5), not 5, in the normalized null vector.
  • RealSpinBasis: PDF p.6, A1-A4: a real orthonormal basis of the actual complementary spin/magnetic slice. Completeness refers to spectral projectors of the physical angular momenta, not to a postulated abstract block.
  • swapPorts: PDF p.6, A4: the physical port swap, leaving C untouched.
  • gramFrame: PDF p.6, A1,A4: all xi vectors are constructed from one basis by swaps.
  • pbtGram: PDF p.6, A3: actual Gram matrix.
  • complementSwap: PDF p.6, A5: swap of two wires inside the base complement. Used only when neither swapped wire is i0, so the complement is invariant.
  • gramSynthesis: PDF p.6, A6: synthesized physical vector. No coefficient is divided by its port norm, so zero-norm port components remain harmless.
  • acDicke: PDF p.3, Eqs.(17)-(18): maximal-spin Dicke vectors on A,C.
  • bdDicke: PDF p.3, Eq.(16): same symmetric spin vector on D,B.
  • Refinement: PDF p.3, Eq.(18): e0 and the two signs for each positive integer m. This is a full refinement precisely in the odd-N regime used below.
  • refinementVector: PDF p.3, Eq.(18): explicit e_m^+, e_m^-, e0, with false denoting +.
  • refinementEffect: PDF pp.3-4: sequential failure then rank-one refinement effect on AC.
  • recoveryMeasurement: PDF p.4: the same complete Alice measurement for both of Bob's choices.
  • recoverBranch: PDF p.4: B-only unitary action, with an inert arbitrary reference.
  • onePortBell: One-port coordinates for the N=1 Bell-measurement specialization.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P07
import Definitions.Def_QAlgorithms_Papers_Independent_Next46_P39

/-!
Ishizaka, arXiv:1506.01555v2. Locators are PDF pages.
Registers are ordered A,C and D,B. A spin label r means m=(d-1)/2-r.
Local definitions have complete bodies; compilation is pending batch handoff.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P53

open scoped Classical ComplexConjugate ComplexOrder Matrix Matrix.Norms.L2Operator

-- Accepted generic matrix and positive-operator interfaces. The support is the
-- orthogonal range projection; all uses below are on positive physical rho.
open QAlgorithms.Papers.Independent.Information100.P21 (Op)
open QAlgorithms.Papers.Independent.Information100.P07 (support)
open QAlgorithms.Papers.Independent.Next46.P39 (inverseSqrt)

abbrev Ports (d N : ℕ) := Fin N → Fin d

abbrev AC (d N : ℕ) := Ports d N × Fin d

abbrev PortComplement (d N : ℕ) (i : Fin N) := {j : Fin N // j ≠ i} → Fin d

/-- PDF p.2, Eq.(2): normalized physical spin-zero singlet. The printed
second spin label m is corrected to -m, as forced by the stated spin-zero
convention and the physical angular-momentum decomposition on the same page. -/
def spinSinglet (d : ℕ) : EuclideanSpace ℂ (Fin d × Fin d) :=
  WithLp.toLp 2 fun x => if x.2 = Fin.rev x.1 then
    (-1 : ℂ) ^ x.1.val / (Real.sqrt d : ℂ) else 0

/-- PDF p.2, Eq.(2): singlet projector. -/
def singletDensity (d : ℕ) : Op (Fin d × Fin d) := QAlgorithms.pureDensity (spinSinglet d)

/-- Ordered insertion of one port into its complement. -/
def insertPort {d N : ℕ} (i : Fin N) (a : Fin d) (r : PortComplement d N i) : Ports d N :=
  fun j => if h : j = i then a else r ⟨j, h⟩

/-- PDF p.2, Eq.(4): isometric insertion of the A_i,C singlet. -/
def singletInsert {d N : ℕ} (i : Fin N) : Matrix (AC d N) (PortComplement d N i) ℂ :=
  fun x r => spinSinglet d (x.1 i, x.2) *
    if (fun j : {j : Fin N // j ≠ i} => x.1 j.val) = r then 1 else 0

/-- PDF p.2, Eq.(4): P^-_(A_i,C) tensor I_rest. -/
def portProjector {d N : ℕ} (i : Fin N) : Op (AC d N) :=
  singletInsert i * (singletInsert i)ᴴ

/-- PDF p.2, Eq.(4): normalized signal; used with N>=1,d>=2. -/
def pbtSignal (d N : ℕ) (i : Fin N) : Op (AC d N) :=
  ((d : ℂ) ^ (N - 1))⁻¹ • portProjector i

/-- PDF p.2, Eq.(5): physical signal sum. -/
def pbtRho (d N : ℕ) : Op (AC d N) := ∑ i, pbtSignal d N i

/-- PDF p.2: O acts on Alice's ports and leaves C unchanged. -/
def liftA {d N : ℕ} (O : Op (Ports d N)) : Op (AC d N) :=
  Matrix.kronecker O (1 : Op (Fin d))

/-- PDF p.2, Eq.(1): resource amplitude after applying O to A. -/
def resource {d N : ℕ} (O : Op (Ports d N)) :
    EuclideanSpace ℂ (Ports d N × Ports d N) :=
  WithLp.toLp 2 fun x => ∑ a : Ports d N, O x.1 a * ∏ i, spinSinglet d (a i, x.2 i)

/-- PDF p.2, Eq.(1): exact resource normalization. -/
def NormalizedResource {d N : ℕ} (O : Op (Ports d N)) : Prop :=
  Matrix.trace (Oᴴ * O) = (d : ℂ) ^ N

/-- PDF p.2: Alice's deterministic measurement on AC. -/
def DeterministicPOVM {d N : ℕ} (E : Fin N → Op (AC d N)) : Prop :=
  (∀ i, (E i).PosSemidef) ∧ ∑ i, E i = 1

/-- PDF p.3: none is failure, some i is successful port i. -/
def ProbabilisticPOVM {d N : ℕ} (E : Option (Fin N) → Op (AC d N)) : Prop :=
  (∀ i, (E i).PosSemidef) ∧ ∑ i, E i = 1

/-- PDF pp.2,4: induced unnormalized reference-B branch for input T on R,C.
The effect determines the branch after Alice's registers are discarded. -/
def pbtChannelBranch {d N : ℕ} {R : Type*} [Fintype R]
    (O : Op (Ports d N)) (E : Op (AC d N)) (T : Op (R × Fin d)) :
    Op (R × Ports d N) :=
  fun x y => ∑ a : Ports d N, ∑ b : Ports d N, ∑ c : Fin d, ∑ e : Fin d,
    E (b, e) (a, c) * resource O (a, x.2) * conj (resource O (b, y.2)) *
      T (x.1, c) (y.1, e)

/-- PDF pp.3-4: normalized reference-singlet experiment. -/
def pbtBranch {d N : ℕ} (O : Op (Ports d N)) (E : Op (AC d N)) :
    Op (Fin d × Ports d N) := pbtChannelBranch O E (singletDensity d)

/-- Physical marginal retaining the reference and selected output port. -/
def selectPort {d N : ℕ} {R : Type*} [Fintype R]
    (i : Fin N) (T : Op (R × Ports d N)) : Op (R × Fin d) :=
  fun x y => ∑ r : PortComplement d N i, T (x.1, insertPort i x.2 r) (y.1, insertPort i y.2 r)

/-- PDF p.4: outcome probability in the reference-singlet experiment. -/
def pbtBranchProbability {d N : ℕ} (O : Op (Ports d N)) (E : Op (AC d N)) : ℝ :=
  (Matrix.trace (pbtBranch O E)).re

/-- PDF p.2, Eq.(3): operational entanglement fidelity of port selection. -/
def pbtFidelity {d N : ℕ} (O : Op (Ports d N)) (E : Fin N → Op (AC d N)) : ℝ :=
  ∑ i, (Matrix.trace (singletDensity d * selectPort i (pbtBranch O (E i)))).re

/-- PDF p.4, Eq.(20): state measured when Bob sends B_k, renamed C. -/
def codingState {d N : ℕ} (O : Op (Ports d N)) (k : Fin N) : Op (AC d N) :=
  fun x y => ∑ r : PortComplement d N k,
    resource O (x.1, insertPort k x.2 r) * conj (resource O (y.1, insertPort k y.2 r))

/-- PDF p.4: actual coding outcome probability. -/
def codingProbability {d N : ℕ} (O : Op (Ports d N))
    (E : Op (AC d N)) (k : Fin N) : ℝ := QAlgorithms.effectProb E (codingState O k)

/-- PDF p.4: Choi equation for faithful successful branches, including zero
probabilities without division. For these CP branches it characterizes p_i
times the identity channel, also on inputs entangled with a reference. -/
def ExactProbabilistic {d N : ℕ} (O : Op (Ports d N))
    (E : Option (Fin N) → Op (AC d N)) : Prop :=
  NormalizedResource O ∧ ProbabilisticPOVM E ∧
    ∀ i, selectPort i (pbtBranch O (E (some i))) =
      (pbtBranchProbability O (E (some i)) : ℂ) • singletDensity d

/-- PDF p.4: total exact-teleportation success probability. -/
def pbtSuccessProbability {d N : ℕ} (O : Op (Ports d N))
    (E : Option (Fin N) → Op (AC d N)) : ℝ :=
  ∑ i, pbtBranchProbability O (E (some i))

/-- PDF p.3, Eq.(12): SRM on the support. -/
def srm (d N : ℕ) (i : Fin N) : Op (AC d N) :=
  inverseSqrt (pbtRho d N) * pbtSignal d N i * inverseSqrt (pbtRho d N)

/-- PDF p.3, Eqs.(12)-(13): deterministic completion. -/
def completedSRM (d N : ℕ) (i : Fin N) : Op (AC d N) :=
  srm d N i + (N : ℂ)⁻¹ • (1 - support (pbtRho d N))

/-- PDF p.3: separate probabilistic failure effect. -/
def probabilisticSRM (d N : ℕ) : Option (Fin N) → Op (AC d N)
  | none => 1 - support (pbtRho d N)
  | some i => srm d N i

/-- PDF pp.4-5, Eq.(23): normalized conditional singlet overlap.
Uses below have strictly positive branch probability. -/
def conditionalFidelity {d N : ℕ} (O : Op (Ports d N))
    (E : Op (AC d N)) (k : Fin N) : ℝ :=
  (Matrix.trace (singletDensity d * selectPort k (pbtBranch O E))).re /
    pbtBranchProbability O E

/-- PDF pp.4-5: symmetry conditions imposed on the actual protocol. -/
def SymmetricPorts {d N : ℕ} (O : Op (Ports d N))
    (E : Fin N → Op (AC d N)) (Fother : ℝ) : Prop :=
  (∀ i, pbtBranchProbability O (E i) = (N : ℝ)⁻¹) ∧
  (∀ i, conditionalFidelity O (E i) i = pbtFidelity O E) ∧
  ∀ i k, i ≠ k → conditionalFidelity O (E i) k = Fother

example : spinSinglet 2 (0, 0) = 0 := by simp [spinSinglet, Fin.rev]

example : spinSinglet 2 (0, 1) = (Real.sqrt 2 : ℂ)⁻¹ := by simp [spinSinglet, Fin.rev]

example : spinSinglet 2 (1, 0) = -(Real.sqrt 2 : ℂ)⁻¹ := by simp [spinSinglet, Fin.rev, div_eq_mul_inv]

example {d N : ℕ} (i : Fin N) (a : Fin d) (r : PortComplement d N i) :
    insertPort i a r i = a := by simp [insertPort]

example {I : Type*} [Fintype I] [DecidableEq I] : inverseSqrt (0 : Op I) = 0 := by
  simp [inverseSqrt, cfc_zero]

example (d N : ℕ) : probabilisticSRM d N none = 1 - support (pbtRho d N) := rfl

/-- PDF p.6, A7: equal-port sum with every complementary spin at its
highest weight; normalization uses its actual Euclidean norm. -/
def maximumSpinVector (d N : ℕ) : EuclideanSpace ℂ (AC d N) :=
  let v : EuclideanSpace ℂ (AC d N) := ∑ i : Fin N,
    WithLp.toLp 2 fun x => ∑ r : PortComplement d N i,
      singletInsert i x r * (if ∀ j, (r j).val = 0 then 1 else 0)
  (‖v‖⁻¹ : ℂ) • v

/-- PDF p.2: physical spin-s z component, s=(d-1)/2. -/
def quditSpinZ (d : ℕ) : Op (Fin d) :=
  Matrix.diagonal fun r => ((((d : ℝ) - 1) / 2 - r.val : ℝ) : ℂ)

/-- PDF p.2: raising matrix in the m=s-r convention. -/
def quditSpinRaise (d : ℕ) : Op (Fin d) :=
  fun r t => if t.val = r.val + 1 then
    (Real.sqrt (((r.val : ℝ) + 1) * ((d : ℝ) - 1 - r.val)) : ℂ) else 0

/-- Physical Cartesian x component. -/
def spinX (d : ℕ) : Op (Fin d) := (1 / 2 : ℂ) • (quditSpinRaise d + (quditSpinRaise d)ᴴ)

/-- Physical Cartesian y component. -/
def quditSpinY (d : ℕ) : Op (Fin d) :=
  (1 / (2 * Complex.I) : ℂ) • (quditSpinRaise d - (quditSpinRaise d)ᴴ)

/-- A spin operator on a named wire of an ordered finite register. -/
def quditOnWire (d : ℕ) {W : Type*} [Fintype W] [DecidableEq W]
    (q : W) (M : Op (Fin d)) : Op (W → Fin d) :=
  fun x y => M (x q) (y q) * ∏ r ∈ Finset.univ.erase q, if x r = y r then 1 else 0

/-- PDF p.2: physical collective angular momentum on any complement or port register. -/
def quditCollective (d : ℕ) (W : Type*) [Fintype W] [DecidableEq W]
    (M : Op (Fin d)) : Op (W → Fin d) := ∑ q, quditOnWire d q M

/-- PDF p.2: the actual squared total angular momentum. -/
def quditCasimir (d : ℕ) (W : Type*) [Fintype W] [DecidableEq W] : Op (W → Fin d) :=
  quditCollective d W (spinX d) ^ 2 + quditCollective d W (quditSpinY d) ^ 2 +
    quditCollective d W (quditSpinZ d) ^ 2

/-- PDF p.2: addition of the C spin to all A spins. -/
def totalComponent (d N : ℕ) (M : Op (Fin d)) : Op (AC d N) :=
  Matrix.kronecker (quditCollective d (Fin N) M) (1 : Op (Fin d)) +
    Matrix.kronecker (1 : Op (Ports d N)) M

/-- PDF p.2: actual squared angular momentum on AC. -/
def totalCasimir (d N : ℕ) : Op (AC d N) :=
  totalComponent d N (spinX d) ^ 2 + totalComponent d N (quditSpinY d) ^ 2 +
    totalComponent d N (quditSpinZ d) ^ 2

/-- PDF p.2, Eqs.(7)-(8): spectral projector for twice-spin t. Impossible
sectors have zero projector; no abstract decomposition is assumed. -/
def casimirProjector {I : Type*} [Fintype I] [DecidableEq I] (K : Op I) (t : ℕ) : Op I :=
  cfc (fun x : ℝ => if x = (t : ℝ) / 2 * ((t : ℝ) / 2 + 1) then 1 else 0) K

/-- Physical z-component slice; r=0,...,t corresponds to m=t/2-r. -/
def magneticProjector {I : Type*} [Fintype I] [DecidableEq I]
    (Z : Op I) (t r : ℕ) : Op I :=
  cfc (fun x : ℝ => if x = (t : ℝ) / 2 - r then 1 else 0) Z

/-- PDF p.2, Eq.(8): spin block constructed by singlet insertion of the
actual complementary-register spin projectors. -/
def rhoSpinBlock (d N t : ℕ) : Op (AC d N) :=
  ((d : ℂ) ^ (N - 1))⁻¹ • ∑ i : Fin N,
    singletInsert (d := d) i *
      casimirProjector (quditCasimir d {j : Fin N // j ≠ i}) t *
      (singletInsert (d := d) i)ᴴ

/-- PDF p.6, Eq.(A2): physical total-spin and magnetic block. -/
def rhoSpinMagnetic (d N t r : ℕ) : Op (AC d N) :=
  rhoSpinBlock d N t * magneticProjector (totalComponent d N (quditSpinZ d)) t r

/-- PDF p.3: parity-correct twice-spin labels for N qubits. -/
def qubitSpins (N : ℕ) : Finset ℕ :=
  (Finset.range (N + 1)).filter fun t => t % 2 = N % 2

/-- PDF p.3, Eq.(14): intrinsic physical sector dimension h_N(t/2). -/
def qubitSectorDimension (N t : ℕ) : ℝ :=
  (Matrix.trace (casimirProjector (quditCasimir 2 (Fin N)) t)).re

/-- PDF p.3, Eq.(14), normalized correction: numerator 2^(N+2), not the
printed 2^(N+1). The intrinsic sector dimension fixes this uniquely already
at N=1. The malformed printed combinatorial shorthand is not used. -/
def deterministicResource (N : ℕ) : Op (Ports 2 N) :=
  ∑ t ∈ qubitSpins N,
    ((Real.sqrt ((2 : ℝ) ^ (N + 2) / (qubitSectorDimension N t * ((N : ℝ) + 2))) *
      Real.sin (Real.pi * ((t : ℝ) + 1) / ((N : ℝ) + 2)) : ℝ) : ℂ) •
      casimirProjector (quditCasimir 2 (Fin N)) t

/-- PDF p.3, Eq.(15): explicit probabilistic resource, including the
parity-correct minimum spin. No optimality is built into this definition. -/
def probabilisticResource (N : ℕ) : Op (Ports 2 N) :=
  (Real.sqrt ((2 : ℝ) ^ N / (∑ t ∈ qubitSpins N, ((t : ℝ) + 1) ^ 2)) : ℂ) •
    ∑ t ∈ qubitSpins N,
      (Real.sqrt (((t : ℝ) + 1) ^ 2 / qubitSectorDimension N t) : ℂ) •
        casimirProjector (quditCasimir 2 (Fin N)) t

/-- The SRM for the actual transformed signals O sigma_i O†. -/
def transformedSRM {d N : ℕ} (O : Op (Ports d N)) (i : Fin N) : Op (AC d N) :=
  let A := liftA O
  let R := A * pbtRho d N * Aᴴ
  inverseSqrt R * (A * pbtSignal d N i * Aᴴ) * inverseSqrt R

example (d : ℕ) : quditCollective d (Fin 0) (quditSpinZ d) = 0 := by simp [quditCollective]

example : qubitSpins 1 = {1} := by decide

/-- PDF p.7, Eq.(B3): actual qutrit two-port resource square. -/
def qutritResourceSquare : Op (Ports 3 2) :=
  (6 / 5 : ℂ) • casimirProjector (quditCasimir 3 (Fin 2)) 0 +
  (3 / 5 : ℂ) • casimirProjector (quditCasimir 3 (Fin 2)) 2 +
  (6 / 5 : ℂ) • casimirProjector (quditCasimir 3 (Fin 2)) 4

/-- PDF p.7: the positive square root of X, not an arbitrary filter. -/
def qutritResource : Op (Ports 3 2) := cfc Real.sqrt qutritResourceSquare

/-- PDF p.7, Eq.(B5): transformed success effects with corrected factor 9/10. -/
def qutritTransformedEffect (i : Fin 2) : Op (AC 3 2) := (9 / 10 : ℂ) • portProjector i

/-- Computational ket of the two physical qutrit A ports, highest spin label first. -/
def qutritPairKet (a b : Fin 3) : EuclideanSpace ℂ (Ports 3 2) :=
  QAlgorithms.ket (![a, b] : Ports 3 2)

/-- PDF p.6, B1: the three highest-weight total-spin-one vectors, with the
phase convention in which the A_1,C singlet matrix carries (-1)^(J+J').
J=0,1,2 is the physical A-spin. Lower magnetic vectors are generated below. -/
def qutritHighest (J : Fin 3) : EuclideanSpace ℂ (AC 3 2) :=
  match J.val with
  | 0 => (Real.sqrt 3 : ℂ)⁻¹ • QAlgorithms.tensorVec
      (qutritPairKet 0 2 - qutritPairKet 1 1 + qutritPairKet 2 0) (QAlgorithms.ket 0)
  | 1 => (- (1 / 2 : ℂ)) •
      (QAlgorithms.tensorVec (qutritPairKet 0 1 - qutritPairKet 1 0) (QAlgorithms.ket 1) -
       QAlgorithms.tensorVec (qutritPairKet 0 2 - qutritPairKet 2 0) (QAlgorithms.ket 0))
  | _ => (Real.sqrt (3 / 5 : ℝ) : ℂ) •
      QAlgorithms.tensorVec (qutritPairKet 0 0) (QAlgorithms.ket 2) -
      (Real.sqrt (3 / 20 : ℝ) : ℂ) •
      QAlgorithms.tensorVec (qutritPairKet 0 1 + qutritPairKet 1 0) (QAlgorithms.ket 1) +
      (Real.sqrt (1 / 60 : ℝ) : ℂ) •
      QAlgorithms.tensorVec (qutritPairKet 0 2 + qutritPairKet 2 0 +
        (2 : ℂ) • qutritPairKet 1 1) (QAlgorithms.ket 0)

/-- PDF p.6, B1: actual coupled basis; r=0,1,2 represents m=1,0,-1. -/
def qutritCoupled (r J : Fin 3) : EuclideanSpace ℂ (AC 3 2) :=
  ((Real.sqrt 2 : ℂ) ^ r.val)⁻¹ •
    QAlgorithms.act ((totalComponent 3 2 ((quditSpinRaise 3)ᴴ)) ^ r.val) (qutritHighest J)

/-- PDF p.6: the physical three-column block frame at one magnetic number. -/
def qutritFrame (r : Fin 3) : Matrix (AC 3 2) (Fin 3) ℂ :=
  fun x J => qutritCoupled r J x

/-- All nine coupled vectors, not a postulated abstract matrix basis. -/
def qutritFullFrame : Matrix (AC 3 2) (Fin 3 × Fin 3) ℂ :=
  fun x rJ => qutritCoupled rJ.1 rJ.2 x

/-- PDF p.6, Eq.(B2): the exact spin-one magnetic block. -/
def qutritBlock : Op (Fin 3) :=
  (2 / 27 : ℂ) • !![1, 0, (Real.sqrt 5 : ℂ); 0, 3, 0; (Real.sqrt 5 : ℂ), 0, 5]

/-- PDF p.7, Eq.(B7), corrected: sqrt(5), not 5, in the normalized null vector. -/
def qutritKernelVector (r : Fin 3) : EuclideanSpace ℂ (AC 3 2) :=
  (Real.sqrt 6 : ℂ)⁻¹ •
    ((Real.sqrt 5 : ℂ) • qutritCoupled r 0 - qutritCoupled r 2)

example : qutritHighest 0 = (Real.sqrt 3 : ℂ)⁻¹ • QAlgorithms.tensorVec
    (qutritPairKet 0 2 - qutritPairKet 1 1 + qutritPairKet 2 0) (QAlgorithms.ket 0) := rfl

/-- PDF p.6, A1-A4: a real orthonormal basis of the actual complementary
spin/magnetic slice. Completeness refers to spectral projectors of the
physical angular momenta, not to a postulated abstract block. -/
structure RealSpinBasis (d N t r : ℕ) (i0 : Fin N) (A : Type*)
    [Fintype A] [DecidableEq A] where
  frame : Matrix (PortComplement d N i0) A ℂ
  real_entries : ∀ x a, (frame x a).im = 0
  orthonormal : frameᴴ * frame = 1
  complete : frame * frameᴴ =
    casimirProjector (quditCasimir d {j : Fin N // j ≠ i0}) t *
      magneticProjector (quditCollective d {j : Fin N // j ≠ i0} (quditSpinZ d)) t r

/-- PDF p.6, A4: the physical port swap, leaving C untouched. -/
def swapPorts {d N : ℕ} (i k : Fin N) : Op (Ports d N) :=
  fun x y => if x = (fun j => y (Equiv.swap i k j)) then 1 else 0

/-- PDF p.6, A1,A4: all xi vectors are constructed from one basis by swaps. -/
def gramFrame {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
    (B : RealSpinBasis d N t r i0 A) : Matrix (AC d N) (Fin N × A) ℂ :=
  fun x ia => (liftA (swapPorts (d := d) i0 ia.1) *
    singletInsert (d := d) i0 * B.frame) x ia.2

/-- PDF p.6, A3: actual Gram matrix. -/
def pbtGram {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
    (B : RealSpinBasis d N t r i0 A) : Op (Fin N × A) :=
  (gramFrame B)ᴴ * gramFrame B

/-- PDF p.6, A5: swap of two wires inside the base complement. Used only
when neither swapped wire is i0, so the complement is invariant. -/
def complementSwap {d N : ℕ} (i0 i k : Fin N) : Op (PortComplement d N i0) :=
  fun x y => ∏ j : {j : Fin N // j ≠ i0},
    if h : Equiv.swap i k j.val ≠ i0 then
      if x j = y ⟨Equiv.swap i k j.val, h⟩ then 1 else 0
    else 0

/-- PDF p.6, A6: synthesized physical vector. No coefficient is divided by
its port norm, so zero-norm port components remain harmless. -/
def gramSynthesis {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
    (B : RealSpinBasis d N t r i0 A) (c : EuclideanSpace ℂ (Fin N × A)) :
    EuclideanSpace ℂ (AC d N) :=
  WithLp.toLp 2 (Matrix.mulVec (gramFrame B) (WithLp.ofLp c))

example {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
    (B : RealSpinBasis d N t r i0 A) : gramSynthesis B 0 = 0 := by
  simp [gramSynthesis]

/-- PDF p.3, Eqs.(17)-(18): maximal-spin Dicke vectors on A,C. -/
def acDicke (N k : ℕ) : EuclideanSpace ℂ (AC 2 N) :=
  WithLp.toLp 2 fun x =>
    if (∑ i : Fin N, (x.1 i).val) + x.2.val = k then
      (Real.sqrt (Nat.choose (N + 1) k) : ℂ)⁻¹ else 0

/-- PDF p.3, Eq.(16): same symmetric spin vector on D,B. -/
def bdDicke (N k : ℕ) : EuclideanSpace ℂ (Fin 2 × Ports 2 N) :=
  WithLp.toLp 2 fun x => acDicke N k (x.2, x.1)

/-- PDF p.3, Eq.(18): e0 and the two signs for each positive integer m.
This is a full refinement precisely in the odd-N regime used below. -/
abbrev Refinement (N : ℕ) := Unit ⊕ (Fin ((N + 1) / 2) × Bool)

/-- PDF p.3, Eq.(18): explicit e_m^+, e_m^-, e0, with false denoting +. -/
def refinementVector (N : ℕ) : Refinement N → EuclideanSpace ℂ (AC 2 N)
  | Sum.inl _ => acDicke N ((N + 1) / 2)
  | Sum.inr (m, sign) => (Real.sqrt 2 : ℂ)⁻¹ •
      (acDicke N ((N + 1) / 2 - (m.val + 1)) +
        (if sign then (-1 : ℂ) else 1) • acDicke N ((N + 1) / 2 + (m.val + 1)))

/-- PDF pp.3-4: sequential failure then rank-one refinement effect on AC. -/
def refinementEffect (N : ℕ) (z : Refinement N) : Op (AC 2 N) :=
  let P0 := probabilisticSRM 2 N none
  P0 * QAlgorithms.pureDensity (refinementVector N z) * P0

/-- PDF p.4: the same complete Alice measurement for both of Bob's choices. -/
def recoveryMeasurement (N : ℕ) : Fin N ⊕ Refinement N → Op (AC 2 N)
  | Sum.inl i => srm 2 N i
  | Sum.inr z => refinementEffect N z

/-- PDF p.4: B-only unitary action, with an inert arbitrary reference. -/
def recoverBranch {N : ℕ} {R : Type*} [Fintype R] [DecidableEq R]
    (U : Op (Ports 2 N)) (T : Op (R × Ports 2 N)) : Op (R × Ports 2 N) :=
  let V := Matrix.kronecker (1 : Op R) U
  V * T * Vᴴ

/-- One-port coordinates for the N=1 Bell-measurement specialization. -/
def onePortBell (sign : Bool) (parallel : Bool) : EuclideanSpace ℂ (AC 2 1) :=
  WithLp.toLp 2 fun x =>
    if (if parallel then x.2 = x.1 0 else x.2 = Fin.rev (x.1 0)) then
      (if sign then (-1 : ℂ) ^ (x.1 0).val else 1) / (Real.sqrt 2 : ℂ) else 0

example (N : ℕ) : refinementVector N (Sum.inl ()) = acDicke N ((N + 1) / 2) := rfl

end QAlgorithms.Papers.Independent.Intakenext100.P53
Source
Some remarks on port-based teleportation, arXiv:1506.01555v2, https://arxiv.org/abs/1506.01555v2
Read-back

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

QAlgorithms.Papers.Independent.Intakenext100.P53.AC

For any natural numbers d,Nd,Nd,N, AC⁡(d,N)\operatorname{AC}(d,N)AC(d,N) is the set of pairs (a,c)(a,c)(a,c), where a:{0,…,N−1}→{0,…,d−1}a:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}a:{0,…,N−1}→{0,…,d−1} and c∈{0,…,d−1}c\in\{0,\ldots,d-1\}c∈{0,…,d−1}. It is empty when d=0d=0d=0; when N=0N=0N=0, the first component is the unique empty assignment and the second component is any of the ddd labels.

QAlgorithms.Papers.Independent.Intakenext100.P53.DeterministicPOVM

For arbitrary natural numbers d,Nd,Nd,N, put P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1} and A=P×{0,…,d−1}A=P\times\{0,\ldots,d-1\}A=P×{0,…,d−1}. A family of complex matrices EiE_iEi​ indexed by AAA, with i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, satisfies this condition exactly when every EiE_iEi​ is positive semidefinite and

∑i=0N−1Ei=IA.\sum_{i=0}^{N-1}E_i=I_A.i=0∑N−1​Ei​=IA​.

For N=0N=0N=0, the sum is zero, so the condition requires 0=IA0=I_A0=IA​; this is impossible when d>0d>0d>0. When d=0d=0d=0, AAA is empty and the condition holds for the unique family of empty matrices.

QAlgorithms.Papers.Independent.Intakenext100.P53.ExactProbabilistic

For arbitrary natural numbers d,Nd,Nd,N, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, and A=P×DA=P\times DA=P×D. Given a complex matrix OOO on PPP and matrices E∅,EiE_{\varnothing},E_iE∅​,Ei​ on AAA, with i<Ni<Ni<N, define

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j<Nsd(hj,zj),s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j<N}s_d(h_j,z_j),sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j<N∏​sd​(hj​,zj​), (Bi)(u,z),(v,w)=∑a,b∈P∑c,e∈D(Ei)(b,e),(a,c) rO(a,z)rO(b,w)‾sd(u,c)sd(v,e)‾,(B_i)_{(u,z),(v,w)} = \sum_{a,b\in P}\sum_{c,e\in D} (E_i)_{(b,e),(a,c)}\,r_O(a,z)\overline{r_O(b,w)} s_d(u,c)\overline{s_d(v,e)},(Bi​)(u,z),(v,w)​=a,b∈P∑​c,e∈D∑​(Ei​)(b,e),(a,c)​rO​(a,z)rO​(b,w)​sd​(u,c)sd​(v,e)​,

and S(u,a),(v,b)=sd(u,a)sd(v,b)‾S_{(u,a),(v,b)}=s_d(u,a)\overline{s_d(v,b)}S(u,a),(v,b)​=sd​(u,a)sd​(v,b)​. The condition is the conjunction of

tr⁡(O†O)=dN,E∅⪰0,Ei⪰0 for every i<N,E∅+∑i<NEi=IA,\operatorname{tr}(O^\dagger O)=d^N,\qquad E_{\varnothing}\succeq0,\quad E_i\succeq0\ \text{for every }i<N,\qquad E_{\varnothing}+\sum_{i<N}E_i=I_A,tr(O†O)=dN,E∅​⪰0,Ei​⪰0 for every i<N,E∅​+i<N∑​Ei​=IA​,

and, for every i<Ni<Ni<N and u,a,v,b∈Du,a,v,b\in Du,a,v,b∈D,

∑r:{j<N:j≠i}→D(Bi)(u,ιi(a,r)),(v,ιi(b,r))=(Re⁡tr⁡Bi)S(u,a),(v,b),\sum_{r:\{j<N:j\ne i\}\to D} (B_i)_{(u,\iota_i(a,r)),(v,\iota_i(b,r))} = \bigl(\operatorname{Re}\operatorname{tr}B_i\bigr) S_{(u,a),(v,b)},r:{j<N:j=i}→D∑​(Bi​)(u,ιi​(a,r)),(v,ιi​(b,r))​=(RetrBi​)S(u,a),(v,b)​,

where ιi(a,r)\iota_i(a,r)ιi​(a,r) inserts aaa at iii and agrees with rrr elsewhere. The condition imposes this last equality only on the outcomes indexed by iii, and allows their trace weights to be zero. For N=0N=0N=0, those equalities are vacuous and the measurement condition reduces to E∅=IAE_{\varnothing}=I_AE∅​=IA​. For d=0d=0d=0, the measurement matrices and branch equalities are empty, while the displayed normalization condition on OOO remains required.

QAlgorithms.Papers.Independent.Intakenext100.P53.NormalizedResource

For natural numbers d,Nd,Nd,N, including zero, let P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1} be the set of port configurations, and let OOO be any complex matrix indexed by PPP. The condition is

tr⁡(O†O)=dN,\operatorname{tr}(O^\dagger O)=d^N,tr(O†O)=dN,

as an equality of complex numbers. No positivity or unitarity of OOO is required. When N=0N=0N=0, PPP is a singleton and the condition says that the sole entry of OOO has squared modulus 111, including when d=0d=0d=0, since 00=10^0=100=1. When d=0<Nd=0<Nd=0<N, PPP is empty and the condition holds for its unique empty matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.PortComplement

For any natural numbers d,Nd,Nd,N and any index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, PortComplement⁡(d,N,i)\operatorname{PortComplement}(d,N,i)PortComplement(d,N,i) is the set of functions from {j∈{0,…,N−1}:j≠i}\{j\in\{0,\ldots,N-1\}:j\ne i\}{j∈{0,…,N−1}:j=i} to {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}. The index iii requires N>0N>0N>0. When N=1N=1N=1, this function set consists of the unique empty assignment, even if d=0d=0d=0; when N>1N>1N>1 and d=0d=0d=0, it is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.Ports

For any natural numbers d,Nd,Nd,N, Ports⁡(d,N)\operatorname{Ports}(d,N)Ports(d,N) is the set of functions {0,…,N−1}→{0,…,d−1}\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}{0,…,N−1}→{0,…,d−1}, or equivalently assignments of one of ddd labels to each of NNN positions. When N=0N=0N=0 it contains exactly the empty assignment, including when d=0d=0d=0; when d=0d=0d=0 and N>0N>0N>0 it is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.ProbabilisticPOVM

For arbitrary natural numbers d,Nd,Nd,N, put P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1} and A=P×{0,…,d−1}A=P\times\{0,\ldots,d-1\}A=P×{0,…,d−1}. A family of complex matrices indexed by AAA, with labels consisting of one additional label ∅\varnothing∅ and the labels i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, satisfies this condition exactly when every matrix is positive semidefinite and

E∅+∑i=0N−1Ei=IA.E_{\varnothing}+\sum_{i=0}^{N-1}E_i=I_A.E∅​+i=0∑N−1​Ei​=IA​.

There is no further condition on the additional outcome. When N=0N=0N=0, this requires E∅=IAE_{\varnothing}=I_AE∅​=IA​. When d=0d=0d=0, AAA is empty and all these conditions hold for the empty matrices.

QAlgorithms.Papers.Independent.Intakenext100.P53.RealSpinBasis

For arbitrary natural numbers d,N,t,rd,N,t,rd,N,t,r, a selected index i0∈{0,…,N−1}i_0\in\{0,\ldots,N-1\}i0​∈{0,…,N−1}, and any finite type AAA equipped with decidable equality, this structure consists of a complex matrix FFF whose rows are functions {j∈{0,…,N−1}:j≠i0}→{0,…,d−1}\{j\in\{0,\ldots,N-1\}:j\ne i_0\}\to\{0,\ldots,d-1\}{j∈{0,…,N−1}:j=i0​}→{0,…,d−1} and whose columns are indexed by AAA, together with the following requirements. Every entry of FFF has imaginary part zero, F†F=IAF^\dagger F=I_AF†F=IA​, and

FF†=1{t2(t2+1)}(K) 1{t2−r}(ZW).FF^\dagger= \mathbf1_{\{\frac t2(\frac t2+1)\}}(K)\, \mathbf1_{\{\frac t2-r\}}(Z_W).FF†=1{2t​(2t​+1)}​(K)1{2t​−r}​(ZW​).

Here W={j∈{0,…,N−1}:j≠i0}W=\{j\in\{0,\ldots,N-1\}:j\ne i_0\}W={j∈{0,…,N−1}:j=i0​}; on Cd\mathbb C^dCd, define Zj,j=(d−1)/2−jZ_{j,j}=(d-1)/2-jZj,j​=(d−1)/2−j with other entries zero, and define (S+)j,k=(j+1)(d−1−j)(S_+)_{j,k}=\sqrt{(j+1)(d-1-j)}(S+​)j,k​=(j+1)(d−1−j)​ when k=j+1k=j+1k=j+1, and 000 otherwise. Set X=(S++S+†)/2X=(S_++S_+^\dagger)/2X=(S+​+S+†​)/2 and Y=(S+−S+†)/(2i)Y=(S_+-S_+^\dagger)/(2\mathrm i)Y=(S+​−S+†​)/(2i). For each M∈{X,Y,Z}M\in\{X,Y,Z\}M∈{X,Y,Z}, its action on wire q∈Wq\in Wq∈W has entries

(M(q))x,y=Mx(q),y(q)∏u∈Wu≠q1{x(u)=y(u)},(M^{(q)})_{x,y}=M_{x(q),y(q)} \prod_{\substack{u\in W\\u\ne q}}\mathbf1_{\{x(u)=y(u)\}},(M(q))x,y​=Mx(q),y(q)​u∈Wu=q​∏​1{x(u)=y(u)}​,

and XW=∑q∈WX(q)X_W=\sum_{q\in W}X^{(q)}XW​=∑q∈W​X(q), YW=∑q∈WY(q)Y_W=\sum_{q\in W}Y^{(q)}YW​=∑q∈W​Y(q), ZW=∑q∈WZ(q)Z_W=\sum_{q\in W}Z^{(q)}ZW​=∑q∈W​Z(q), and K=XW2+YW2+ZW2K=X_W^2+Y_W^2+Z_W^2K=XW2​+YW2​+ZW2​. The two indicator functions in the requirement are applied by spectral calculus, selecting precisely the displayed real eigenvalues. All natural-number parameters may be zero except that supplying i0i_0i0​ requires N>0N>0N>0; AAA may be empty, rrr is unrestricted relative to ttt, and when N=1N=1N=1 the row-index set consists of the unique function on the empty set.

QAlgorithms.Papers.Independent.Intakenext100.P53.Refinement

For each natural number NNN, this abbreviates the disjoint union of a singleton and the set of pairs (m,σ)(m,\sigma)(m,σ) with 0≤m<⌊(N+1)/2⌋0\le m<\lfloor(N+1)/2\rfloor0≤m<⌊(N+1)/2⌋ and σ∈{false,true}\sigma\in\{\mathrm{false},\mathrm{true}\}σ∈{false,true}. Its cardinality is 1+2⌊(N+1)/2⌋1+2\lfloor(N+1)/2\rfloor1+2⌊(N+1)/2⌋. Integer division is used in (N+1)/2(N+1)/2(N+1)/2; no parity restriction is imposed on NNN, and for N=0N=0N=0 only the singleton remains.

QAlgorithms.Papers.Independent.Intakenext100.P53.SymmetricPorts

For natural numbers d,Nd,Nd,N, an arbitrary complex matrix OOO on P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}, matrices EiE_iEi​ on H=P×{0,…,d−1}H=P\times\{0,\ldots,d-1\}H=P×{0,…,d−1} for i<Ni<Ni<N, and a real number FotherF_{\mathrm{other}}Fother​, define

s(a,c)={(−1)a/d,c=d−1−a,0,otherwise,Σ=ss†,ΨO(x,y)=∑uOx,u∏js(uj,yj),s(a,c)= \begin{cases}(-1)^a/\sqrt d,&c=d-1-a,\\0,&\text{otherwise},\end{cases} \quad \Sigma=ss^\dagger, \quad \Psi_O(x,y)=\sum_uO_{x,u}\prod_js(u_j,y_j),s(a,c)={(−1)a/d​,0,​c=d−1−a,otherwise,​Σ=ss†,ΨO​(x,y)=u∑​Ox,u​j∏​s(uj​,yj​),

and, for every matrix AAA on HHH,

(BA)(a,x),(b,y)=∑u,v,c,eA(v,e),(u,c)ΨO(u,x)ΨO(v,y)‾s(a,c)s(b,e)‾.(B_A)_{(a,x),(b,y)} =\sum_{u,v,c,e}A_{(v,e),(u,c)} \Psi_O(u,x)\overline{\Psi_O(v,y)}s(a,c)\overline{s(b,e)}.(BA​)(a,x),(b,y)​=u,v,c,e∑​A(v,e),(u,c)​ΨO​(u,x)ΨO​(v,y)​s(a,c)s(b,e)​.

Here u,v,x,y∈Pu,v,x,y\in Pu,v,x,y∈P and a,b,c,e<da,b,c,e<da,b,c,e<d. Define QkBAQ_kB_AQk​BA​ by tracing out all ports other than kkk:

(QkBA)(a,c),(b,e)=∑r:{j:j≠k}→{0,…,d−1}(BA)(a,ins⁡k(c,r)),(b,ins⁡k(e,r)).(Q_kB_A)_{(a,c),(b,e)} =\sum_{r:\{j:j\ne k\}\to\{0,\ldots,d-1\}} (B_A)_{(a,\operatorname{ins}_k(c,r)),(b,\operatorname{ins}_k(e,r))}.(Qk​BA​)(a,c),(b,e)​=r:{j:j=k}→{0,…,d−1}∑​(BA​)(a,insk​(c,r)),(b,insk​(e,r))​.

Put bi=Re⁡tr⁡(BEi)b_i=\operatorname{Re}\operatorname{tr}(B_{E_i})bi​=Retr(BEi​​), fik=Re⁡tr⁡(ΣQkBEi)/bif_{ik}=\operatorname{Re}\operatorname{tr}(\Sigma Q_kB_{E_i})/b_ifik​=Retr(ΣQk​BEi​​)/bi​, and F=∑iRe⁡tr⁡(ΣQiBEi)F=\sum_i\operatorname{Re}\operatorname{tr}(\Sigma Q_iB_{E_i})F=∑i​Retr(ΣQi​BEi​​), with division by zero defined as zero. The declared predicate means exactly

(∀i<N, bi=N−1)∧(∀i<N, fii=F)∧(∀i,k<N, i≠k⇒fik=Fother).(\forall i<N,\ b_i=N^{-1}) \quad\land\quad (\forall i<N,\ f_{ii}=F) \quad\land\quad (\forall i,k<N,\ i\ne k\Rightarrow f_{ik}=F_{\mathrm{other}}).(∀i<N, bi​=N−1)∧(∀i<N, fii​=F)∧(∀i,k<N, i=k⇒fik​=Fother​).

No normalization or positivity assumptions are part of this predicate. When N=0N=0N=0, all three conditions are vacuous; when N=1N=1N=1, the last condition places no restriction on FotherF_{\mathrm{other}}Fother​.

QAlgorithms.Papers.Independent.Intakenext100.P53.acDicke

For every pair of natural numbers N,kN,kN,k, this defines a complex Euclidean vector on pairs (u,h)(u,h)(u,h), where u:{0,…,N−1}→{0,1}u:\{0,\ldots,N-1\}\to\{0,1\}u:{0,…,N−1}→{0,1} and h∈{0,1}h\in\{0,1\}h∈{0,1}, by

DN,k(u,h)={1(N+1k),∑i<Nu(i)+h=k,0,otherwise.D_{N,k}(u,h)= \begin{cases} \displaystyle\frac1{\sqrt{\binom{N+1}{k}}}, &\displaystyle\sum_{i<N}u(i)+h=k,\\[4pt] 0,&\text{otherwise}. \end{cases}DN,k​(u,h)=⎩⎨⎧​(kN+1​)​1​,0,​i<N∑​u(i)+h=k,otherwise.​

The values u(i)u(i)u(i) and hhh in the sum are their integer representatives. Both N=0N=0N=0 and arbitrary kkk are included; if k>N+1k>N+1k>N+1, no coordinate satisfies the condition and the vector is zero. Inverses are total, with 0−1=00^{-1}=00−1=0.

QAlgorithms.Papers.Independent.Intakenext100.P53.bdDicke

For every pair of natural numbers N,kN,kN,k, this defines a complex Euclidean vector on pairs (h,u)(h,u)(h,u), where h∈{0,1}h\in\{0,1\}h∈{0,1} and u:{0,…,N−1}→{0,1}u:\{0,\ldots,N-1\}\to\{0,1\}u:{0,…,N−1}→{0,1}, by

D~N,k(h,u)={1(N+1k),∑i<Nu(i)+h=k,0,otherwise.\widetilde D_{N,k}(h,u)= \begin{cases} \displaystyle\frac1{\sqrt{\binom{N+1}{k}}}, &\displaystyle\sum_{i<N}u(i)+h=k,\\[4pt] 0,&\text{otherwise}. \end{cases}DN,k​(h,u)=⎩⎨⎧​(kN+1​)​1​,0,​i<N∑​u(i)+h=k,otherwise.​

Thus the scalar coordinate is placed before the NNN-port assignment in the indexing. The definition permits N=0N=0N=0 and every natural kkk; for k>N+1k>N+1k>N+1 the vector is zero, and the inverse of zero is interpreted as zero.

QAlgorithms.Papers.Independent.Intakenext100.P53.casimirProjector

For every finite type III equipped with decidable equality, every complex matrix KKK indexed by I×II\times II×I, and every natural number ttt, this defines

Pt(K)=ft(K),ft(x)={1,x=t2(t2+1),0,otherwise,P_t(K)=f_t(K), \qquad f_t(x)= \begin{cases} 1,&x=\dfrac t2\left(\dfrac t2+1\right),\\ 0,&\text{otherwise}, \end{cases}Pt​(K)=ft​(K),ft​(x)=⎩⎨⎧​1,0,​x=2t​(2t​+1),otherwise,​

using the total real continuous functional calculus. For Hermitian KKK, this selects its eigenspace with eigenvalue t2(t2+1)\frac t2(\frac t2+1)2t​(2t​+1), giving zero if that eigenvalue is absent. No Hermitian hypothesis is required by the definition; the functional calculus returns zero for non-Hermitian KKK. The definition includes t=0t=0t=0, which selects eigenvalue zero, and empty III, which gives the empty matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.codingProbability

For natural numbers d,Nd,Nd,N, a chosen index k<Nk<Nk<N, and arbitrary complex matrices OOO on P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1} and EEE on P×DP\times DP×D, where D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, define

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j<Nsd(hj,zj),s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j<N}s_d(h_j,z_j),sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j<N∏​sd​(hj​,zj​),

and

C(a,u),(b,v)=∑r:{j<N:j≠k}→DrO(a,ιk(u,r)) rO(b,ιk(v,r))‾,C_{(a,u),(b,v)} = \sum_{r:\{j<N:j\ne k\}\to D} r_O(a,\iota_k(u,r))\, \overline{r_O(b,\iota_k(v,r))},C(a,u),(b,v)​=r:{j<N:j=k}→D∑​rO​(a,ιk​(u,r))rO​(b,ιk​(v,r))​,

where ιk(u,r)\iota_k(u,r)ιk​(u,r) inserts uuu at position kkk. The declared real number is Re⁡tr⁡(EC)\operatorname{Re}\operatorname{tr}(EC)Retr(EC). Neither normalization of OOO nor any positivity or upper bound on EEE is assumed. A chosen kkk cannot exist for N=0N=0N=0; when d=0d=0d=0, the trace is empty and the value is zero.

QAlgorithms.Papers.Independent.Intakenext100.P53.codingState

For natural numbers d,Nd,Nd,N, a chosen index k<Nk<Nk<N, and any complex matrix OOO on P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, where D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, define

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j<Nsd(hj,zj).s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j<N}s_d(h_j,z_j).sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j<N∏​sd​(hj​,zj​).

The declaration defines the complex matrix CCC on P×DP\times DP×D by

C(a,u),(b,v)=∑r:{j<N:j≠k}→DrO(a,ιk(u,r)) rO(b,ιk(v,r))‾,C_{(a,u),(b,v)} = \sum_{r:\{j<N:j\ne k\}\to D} r_O(a,\iota_k(u,r))\, \overline{r_O(b,\iota_k(v,r))},C(a,u),(b,v)​=r:{j<N:j=k}→D∑​rO​(a,ιk​(u,r))rO​(b,ιk​(v,r))​,

where ιk(u,r)\iota_k(u,r)ιk​(u,r) has value uuu at kkk and agrees with rrr elsewhere. No normalization or other condition on OOO is assumed. The index kkk excludes N=0N=0N=0; for N=1N=1N=1, the sum contains the single empty complement configuration. For d=0d=0d=0, the matrix has an empty index set.

QAlgorithms.Papers.Independent.Intakenext100.P53.complementSwap

For arbitrary natural numbers d,Nd,Nd,N and indices i0,i,k<Ni_0,i,k<Ni0​,i,k<N, this defines a complex matrix CCC indexed by assignments x,y:{j<N:j≠i0}→{0,…,d−1}x,y:\{j<N:j\ne i_0\}\to\{0,\ldots,d-1\}x,y:{j<N:j=i0​}→{0,…,d−1}. Let τ\tauτ exchange iii and kkk, acting as the identity elsewhere. Then Cx,y=1C_{x,y}=1Cx,y​=1 precisely when, for every j≠i0j\ne i_0j=i0​, both τ(j)≠i0\tau(j)\ne i_0τ(j)=i0​ and x(j)=y(τ(j))x(j)=y(\tau(j))x(j)=y(τ(j)) hold; otherwise Cx,y=0C_{x,y}=0Cx,y​=0. This is the literal product of these 000–111 factors over j≠i0j\ne i_0j=i0​, with an empty product equal to 111. No assumption requires i,ki,ki,k to differ from i0i_0i0​ or from each other: if i=ki=ki=k, the matrix is the identity; if exactly one of i,ki,ki,k equals i0i_0i0​, every entry is zero because one factor sends a complementary site to i0i_0i0​. The indices exclude N=0N=0N=0, but d=0d=0d=0 is allowed; when N=1N=1N=1, the complementary assignment space is a singleton and the product is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.completedSRM

For natural numbers d,Nd,Nd,N and i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, write P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}, H=P×{0,…,d−1}H=P\times\{0,\ldots,d-1\}H=P×{0,…,d−1}, and Rj={0,…,d−1}{k:k≠j}R_j=\{0,\ldots,d-1\}^{\{k:k\ne j\}}Rj​={0,…,d−1}{k:k=j}. Define

s(a,c)={(−1)a/d,c=d−1−a,0,otherwise,Jj((x,c),r)=s(xj,c)1{x∣k≠j=r},σj=(dN−1)−1JjJj†,ρ=∑jσj.s(a,c)= \begin{cases}(-1)^a/\sqrt d,&c=d-1-a,\\0,&\text{otherwise},\end{cases} \quad J_j((x,c),r)=s(x_j,c)\mathbf1_{\{x|_{k\ne j}=r\}}, \quad \sigma_j=(d^{N-1})^{-1}J_jJ_j^\dagger, \quad \rho=\sum_j\sigma_j.s(a,c)={(−1)a/d​,0,​c=d−1−a,otherwise,​Jj​((x,c),r)=s(xj​,c)1{x∣k=j​=r}​,σj​=(dN−1)−1Jj​Jj†​,ρ=j∑​σj​.

Here N−1N-1N−1 uses natural-number subtraction. Let K=(ρ)−1K=(\sqrt{\rho})^{-1}K=(ρ​)−1 mean functional calculus with the scalar function x↦(x)−1x\mapsto(\sqrt x)^{-1}x↦(x​)−1, taking the inverse of zero to be zero, and let Πρ\Pi_\rhoΠρ​ be the orthogonal projection onto the range of ρ\rhoρ. The declaration defines

completedSRM⁡(d,N,i)=KσiK+1N(IH−Πρ),\operatorname{completedSRM}(d,N,i) =K\sigma_iK+\frac1N(I_H-\Pi_\rho),completedSRM(d,N,i)=Kσi​K+N1​(IH​−Πρ​),

with the scalar 1/N1/N1/N interpreted in C\mathbb CC. No index iii exists for N=0N=0N=0; d=0d=0d=0 is allowed and gives an empty matrix index set. This definition itself imposes no additional hypotheses.

QAlgorithms.Papers.Independent.Intakenext100.P53.conditionalFidelity

For natural numbers d,Nd,Nd,N, an arbitrary complex matrix OOO on P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}, an arbitrary complex matrix EEE on H=P×{0,…,d−1}H=P\times\{0,\ldots,d-1\}H=P×{0,…,d−1}, and a port k<Nk<Nk<N, define

s(a,c)={(−1)a/d,c=d−1−a,0,otherwise,Σ(a,c),(b,e)=s(a,c)s(b,e)‾,ΨO(x,y)=∑u∈POx,u∏j=0N−1s(uj,yj).s(a,c)= \begin{cases}(-1)^a/\sqrt d,&c=d-1-a,\\0,&\text{otherwise},\end{cases} \qquad \Sigma_{(a,c),(b,e)}=s(a,c)\overline{s(b,e)}, \qquad \Psi_O(x,y)=\sum_{u\in P}O_{x,u}\prod_{j=0}^{N-1}s(u_j,y_j).s(a,c)={(−1)a/d​,0,​c=d−1−a,otherwise,​Σ(a,c),(b,e)​=s(a,c)s(b,e)​,ΨO​(x,y)=u∈P∑​Ox,u​j=0∏N−1​s(uj​,yj​).

Let BEB_EBE​, indexed by {0,…,d−1}×P\{0,\ldots,d-1\}\times P{0,…,d−1}×P, be

(BE)(a,x),(b,y)=∑u,v∈P∑c,e=0d−1E(v,e),(u,c)ΨO(u,x)ΨO(v,y)‾ s(a,c)s(b,e)‾.(B_E)_{(a,x),(b,y)} =\sum_{u,v\in P}\sum_{c,e=0}^{d-1} E_{(v,e),(u,c)}\Psi_O(u,x)\overline{\Psi_O(v,y)} \,s(a,c)\overline{s(b,e)}.(BE​)(a,x),(b,y)​=u,v∈P∑​c,e=0∑d−1​E(v,e),(u,c)​ΨO​(u,x)ΨO​(v,y)​s(a,c)s(b,e)​.

For an assignment rrr to all ports except kkk, let ins⁡k(c,r)\operatorname{ins}_k(c,r)insk​(c,r) insert ccc at port kkk, and define

(QkBE)(a,c),(b,e)=∑r(BE)(a,ins⁡k(c,r)),(b,ins⁡k(e,r)).(Q_kB_E)_{(a,c),(b,e)} =\sum_r(B_E)_{(a,\operatorname{ins}_k(c,r)),(b,\operatorname{ins}_k(e,r))}.(Qk​BE​)(a,c),(b,e)​=r∑​(BE​)(a,insk​(c,r)),(b,insk​(e,r))​.

The declaration defines the real number

conditionalFidelity⁡(O,E,k)=Re⁡tr⁡(ΣQkBE)Re⁡tr⁡(BE).\operatorname{conditionalFidelity}(O,E,k) =\frac{\operatorname{Re}\operatorname{tr}(\Sigma Q_kB_E)} {\operatorname{Re}\operatorname{tr}(B_E)}.conditionalFidelity(O,E,k)=Retr(BE​)Retr(ΣQk​BE​)​.

It assumes neither normalization of OOO nor positivity of EEE. Division is total: a zero denominator gives value zero. The port argument excludes N=0N=0N=0, while d=0d=0d=0 remains permitted.

QAlgorithms.Papers.Independent.Intakenext100.P53.deterministicResource

For every natural number NNN, the declaration defines a complex matrix on {0,1}[N]\{0,1\}^{[N]}{0,1}[N] by

ONdet=∑0≤t≤Nt≡N(mod2)2N+2DN,t(N+2) sin⁡ ⁣(π(t+1)N+2)PN,t.O_N^{\mathrm{det}} =\sum_{\substack{0\le t\le N\\t\equiv N\;(\mathrm{mod}\;2)}} \sqrt{\frac{2^{N+2}}{D_{N,t}(N+2)}}\, \sin\!\left(\frac{\pi(t+1)}{N+2}\right)P_{N,t}.ONdet​=0≤t≤Nt≡N(mod2)​∑​DN,t​(N+2)2N+2​​sin(N+2π(t+1)​)PN,t​.

Here PN,t=1{(t/2)(t/2+1)}(CN)P_{N,t}=\mathbf1_{\{(t/2)(t/2+1)\}}(C_N)PN,t​=1{(t/2)(t/2+1)}​(CN​), defined by continuous functional calculus, DN,t=Re⁡tr⁡PN,tD_{N,t}=\operatorname{Re}\operatorname{tr}P_{N,t}DN,t​=RetrPN,t​, and CN=∑α=x,y,z(∑j∈[N]Jα(j))2C_N=\sum_{\alpha=x,y,z}(\sum_{j\in[N]}J_\alpha^{(j)})^2CN​=∑α=x,y,z​(∑j∈[N]​Jα(j)​)2, where Jx=12(0110)J_x=\frac12\begin{pmatrix}0&1\\1&0\end{pmatrix}Jx​=21​(01​10​), Jy=12(0−ii0)J_y=\frac12\begin{pmatrix}0&-\mathrm i\\ \mathrm i&0\end{pmatrix}Jy​=21​(0i​−i0​), Jz=12diag⁡(1,−1)J_z=\frac12\operatorname{diag}(1,-1)Jz​=21​diag(1,−1), and the superscript jjj means action on that site with identities elsewhere. The real coefficients are embedded into C\mathbb CC. The definition has no positivity assumption on NNN; it includes N=0N=0N=0, for which the matrix is 2\sqrt22​ times the identity on the one-dimensional configuration space. All divisions use the total field operation, so division by zero returns zero, and the real square root returns zero on nonpositive inputs.

QAlgorithms.Papers.Independent.Intakenext100.P53.gramFrame

For natural numbers d,N,t,rd,N,t,rd,N,t,r, a distinguished index i0∈{0,…,N−1}i_0\in\{0,\ldots,N-1\}i0​∈{0,…,N−1}, and a finite type AAA with decidable equality, let BBB be the specified real spin basis, with matrix F=B.frameF=B.\mathrm{frame}F=B.frame indexed by assignments v:{j<N:j≠i0}→{0,…,d−1}v:\{j<N:j\ne i_0\}\to\{0,\ldots,d-1\}v:{j<N:j=i0​}→{0,…,d−1} and by a∈Aa\in Aa∈A. Its assumptions are that every entry of FFF is real, F†F=IF^\dagger F=IF†F=I, and FF†FF^\daggerFF† equals the product of the complementary system’s spin-t/2t/2t/2 Casimir projector and its magnetic projector for value t/2−rt/2-rt/2−r. Explicitly, the single-site matrices used here are Zjj=(d−1)/2−jZ_{jj}=(d-1)/2-jZjj​=(d−1)/2−j, Lj,j+1=(j+1)(d−1−j)L_{j,j+1}=\sqrt{(j+1)(d-1-j)}Lj,j+1​=(j+1)(d−1−j)​ with all other entries zero, X=(L+L†)/2X=(L+L^\dagger)/2X=(L+L†)/2, and Y=(L−L†)/(2i)Y=(L-L^\dagger)/(2i)Y=(L−L†)/(2i); on the complementary sites, the Casimir is (∑jX(j))2+(∑jY(j))2+(∑jZ(j))2(\sum_jX^{(j)})^2+(\sum_jY^{(j)})^2+(\sum_jZ^{(j)})^2(∑j​X(j))2+(∑j​Y(j))2+(∑j​Z(j))2, and the magnetic operator is ∑jZ(j)\sum_jZ^{(j)}∑j​Z(j). The two projectors are obtained by applying the indicator functions of {(t/2)(t/2+1)}\{(t/2)(t/2+1)\}{(t/2)(t/2+1)} and {t/2−r}\{t/2-r\}{t/2−r}, respectively, through functional calculus. The declaration defines a complex matrix GGG whose rows are pairs (u,c)(u,c)(u,c), where u:{0,…,N−1}→{0,…,d−1}u:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}u:{0,…,N−1}→{0,…,d−1} and c<dc<dc<d, and whose columns are (i,a)∈{0,…,N−1}×A(i,a)\in\{0,\ldots,N-1\}\times A(i,a)∈{0,…,N−1}×A. If τi\tau_iτi​ exchanges i0i_0i0​ and iii, then

G(u,c),(i,a)={(−1)u(i)d F (j↦u(τi(j))),a,c=d−1−u(i),0,otherwise.G_{(u,c),(i,a)} = \begin{cases} \dfrac{(-1)^{u(i)}}{\sqrt d}\, F_{\,\left(j\mapsto u(\tau_i(j))\right),a}, &c=d-1-u(i),\\[4pt] 0,&\text{otherwise}. \end{cases}G(u,c),(i,a)​=⎩⎨⎧​d​(−1)u(i)​F(j↦u(τi​(j))),a​,0,​c=d−1−u(i),otherwise.​

The assignment indexing FFF in this formula has domain {j<N:j≠i0}\{j<N:j\ne i_0\}{j<N:j=i0​}. Equivalently, the construction inserts the vector with coordinates (−1)j/d(-1)^j/\sqrt d(−1)j/d​ on pairs (j,d−1−j)(j,d-1-j)(j,d−1−j) at port i0i_0i0​, then exchanges ports i0i_0i0​ and iii. There are no positivity or admissibility restrictions on d,t,rd,t,rd,t,r beyond the supplied basis assumptions; i0i_0i0​ excludes N=0N=0N=0, while AAA may be empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.gramSynthesis

For natural numbers d,N,t,rd,N,t,rd,N,t,r, a distinguished port i0<Ni_0<Ni0​<N, a finite type AAA with decidable equality, a real spin basis BBB, and any complex Euclidean vector ccc indexed by {0,…,N−1}×A\{0,\ldots,N-1\}\times A{0,…,N−1}×A, this defines the vector g=Gcg=Gcg=Gc indexed by (u,h)(u,h)(u,h) with u:{0,…,N−1}→{0,…,d−1}u:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}u:{0,…,N−1}→{0,…,d−1} and h<dh<dh<d:

g(u,h)=∑i<N∑a∈AG(u,h),(i,a)c(i,a).g(u,h)=\sum_{i<N}\sum_{a\in A}G_{(u,h),(i,a)}c(i,a).g(u,h)=i<N∑​a∈A∑​G(u,h),(i,a)​c(i,a).

Writing F=B.frameF=B.\mathrm{frame}F=B.frame and τi\tau_iτi​ for the exchange of i0i_0i0​ and iii, the coefficient G(u,h),(i,a)G_{(u,h),(i,a)}G(u,h),(i,a)​ equals (−1)u(i)Fj↦u(τi(j)),a/d(-1)^{u(i)}F_{j\mapsto u(\tau_i(j)),a}/\sqrt d(−1)u(i)Fj↦u(τi​(j)),a​/d​ when h=d−1−u(i)h=d-1-u(i)h=d−1−u(i), and equals zero otherwise, with the assignment indexing FFF restricted to j≠i0j\ne i_0j=i0​. The supplied basis has real entries, satisfies F†F=IF^\dagger F=IF†F=I, and satisfies FF†=PtQt,rFF^\dagger=P_tQ_{t,r}FF†=Pt​Qt,r​ on the complementary sites, where PtP_tPt​ projects onto Casimir value (t/2)(t/2+1)(t/2)(t/2+1)(t/2)(t/2+1) and Qt,rQ_{t,r}Qt,r​ onto magnetic value t/2−rt/2-rt/2−r. These are functional-calculus projectors for the Casimir (∑jX(j))2+(∑jY(j))2+(∑jZ(j))2(\sum_jX^{(j)})^2+(\sum_jY^{(j)})^2+(\sum_jZ^{(j)})^2(∑j​X(j))2+(∑j​Y(j))2+(∑j​Z(j))2 and magnetic operator ∑jZ(j)\sum_jZ^{(j)}∑j​Z(j), formed from Zjj=(d−1)/2−jZ_{jj}=(d-1)/2-jZjj​=(d−1)/2−j, Lj,j+1=(j+1)(d−1−j)L_{j,j+1}=\sqrt{(j+1)(d-1-j)}Lj,j+1​=(j+1)(d−1−j)​ with all other entries zero, X=(L+L†)/2X=(L+L^\dagger)/2X=(L+L†)/2, and Y=(L−L†)/(2i)Y=(L-L^\dagger)/(2i)Y=(L−L†)/(2i). No normalization is required of ccc, and no further restrictions are placed on d,t,rd,t,rd,t,r; AAA may be empty, in which case the synthesized vector is zero.

QAlgorithms.Papers.Independent.Intakenext100.P53.insertPort

For any natural numbers d,Nd,Nd,N, index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, label a∈{0,…,d−1}a\in\{0,\ldots,d-1\}a∈{0,…,d−1}, and assignment r:{j∈{0,…,N−1}:j≠i}→{0,…,d−1}r:\{j\in\{0,\ldots,N-1\}:j\ne i\}\to\{0,\ldots,d-1\}r:{j∈{0,…,N−1}:j=i}→{0,…,d−1}, insertPort⁡(i,a,r)\operatorname{insertPort}(i,a,r)insertPort(i,a,r) is the assignment on all NNN positions that equals aaa at iii and equals r(j)r(j)r(j) at every j≠ij\ne ij=i. These arguments require N>0N>0N>0 and d>0d>0d>0; for N=1N=1N=1, rrr is the empty assignment.

QAlgorithms.Papers.Independent.Intakenext100.P53.liftA

For any natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by assignments {0,…,N−1}→{0,…,d−1}\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}{0,…,N−1}→{0,…,d−1}, liftA⁡(O)\operatorname{liftA}(O)liftA(O) is the matrix on pairs (a,c)(a,c)(a,c) of such an assignment and an additional label c∈{0,…,d−1}c\in\{0,\ldots,d-1\}c∈{0,…,d−1} whose entry at row (a,c)(a,c)(a,c) and column (b,e)(b,e)(b,e) is Oa,bO_{a,b}Oa,b​ if c=ec=ec=e and zero otherwise. Thus it is the Kronecker product of OOO with the d×dd\times dd×d identity. No condition is imposed on OOO; N=0N=0N=0 is allowed, and d=0d=0d=0 gives an empty output matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.magneticProjector

For every finite type III equipped with decidable equality, every complex matrix ZZZ indexed by I×II\times II×I, and all natural numbers t,rt,rt,r, this defines

Pt,r(Z)=ft,r(Z),ft,r(x)={1,x=t2−r,0,otherwise,P_{t,r}(Z)=f_{t,r}(Z), \qquad f_{t,r}(x)= \begin{cases} 1,&x=\dfrac t2-r,\\ 0,&\text{otherwise}, \end{cases}Pt,r​(Z)=ft,r​(Z),ft,r​(x)=⎩⎨⎧​1,0,​x=2t​−r,otherwise,​

using the total real continuous functional calculus. For Hermitian ZZZ, this selects its eigenspace with eigenvalue t2−r\frac t2-r2t​−r, giving zero if that eigenvalue is absent. No Hermitian hypothesis is imposed, and the functional calculus returns zero for non-Hermitian ZZZ. There is no restriction relating rrr to ttt: the subtraction is real subtraction and the selected value may be negative. Empty III gives the empty matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.maximumSpinVector

For arbitrary natural numbers d,Nd,Nd,N, let P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1} and H=P×{0,…,d−1}H=P\times\{0,\ldots,d-1\}H=P×{0,…,d−1}. Define

s(a,c)={(−1)a/d,c=d−1−a,0,otherwise.s(a,c)= \begin{cases} (-1)^a/\sqrt d,&c=d-1-a,\\ 0,&\text{otherwise}. \end{cases}s(a,c)={(−1)a/d​,0,​c=d−1−a,otherwise.​

The declaration first forms the vector v∈CHv\in\mathbb C^Hv∈CH whose coordinates are

v(x,c)=∑i=0N−1s(xi,c) 1{∀j≠i, xj=0},v(x,c)=\sum_{i=0}^{N-1} s(x_i,c)\, \mathbf1_{\{\forall j\ne i,\ x_j=0\}},v(x,c)=i=0∑N−1​s(xi​,c)1{∀j=i, xj​=0}​,

equivalently summing, for each iii, the singlet-insertion matrix against the indicator of the all-zero assignment on the remaining ports. It then defines

maximumSpinVector⁡(d,N)=∥v∥−1v.\operatorname{maximumSpinVector}(d,N)=\|v\|^{-1}v.maximumSpinVector(d,N)=∥v∥−1v.

There are no positivity assumptions on ddd or NNN. The inverse of zero is zero, so the result is zero whenever v=0v=0v=0, including N=0N=0N=0 and d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakenext100.P53.onePortBell

For each pair of Boolean values sign\mathrm{sign}sign and parallel\mathrm{parallel}parallel, this defines a vector in the complex Euclidean space indexed by (a,c)(a,c)(a,c), where a:{0}→{0,1}a:\{0\}\to\{0,1\}a:{0}→{0,1} is a single port and c∈{0,1}c\in\{0,1\}c∈{0,1}. Its coefficient at (a,c)(a,c)(a,c) is zero unless c=a(0)c=a(0)c=a(0) when parallel=true\mathrm{parallel}=\mathrm{true}parallel=true, or c=1−a(0)c=1-a(0)c=1−a(0) when parallel=false\mathrm{parallel}=\mathrm{false}parallel=false; on those supported indices its coefficient is 1/21/\sqrt21/2​ when sign=false\mathrm{sign}=\mathrm{false}sign=false, and (−1)a(0)/2(-1)^{a(0)}/\sqrt2(−1)a(0)/2​ when sign=true\mathrm{sign}=\mathrm{true}sign=true. Equivalently, writing the port value first and ccc second, its four possible values are

Bfalse,false=∣01⟩+∣10⟩2,Btrue,false=∣01⟩−∣10⟩2,Bfalse,true=∣00⟩+∣11⟩2,Btrue,true=∣00⟩−∣11⟩2.\begin{aligned} B_{\mathrm{false},\mathrm{false}}&=\frac{|01\rangle+|10\rangle}{\sqrt2},& B_{\mathrm{true},\mathrm{false}}&=\frac{|01\rangle-|10\rangle}{\sqrt2},\\ B_{\mathrm{false},\mathrm{true}}&=\frac{|00\rangle+|11\rangle}{\sqrt2},& B_{\mathrm{true},\mathrm{true}}&=\frac{|00\rangle-|11\rangle}{\sqrt2}. \end{aligned}Bfalse,false​Bfalse,true​​=2​∣01⟩+∣10⟩​,=2​∣00⟩+∣11⟩​,​Btrue,false​Btrue,true​​=2​∣01⟩−∣10⟩​,=2​∣00⟩−∣11⟩​.​

Here ∣ac⟩|ac\rangle∣ac⟩ denotes the vector with coefficient 111 at the indicated basis index and 000 elsewhere.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtBranch

For arbitrary natural numbers d,Nd,Nd,N, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, and A=P×DA=P\times DA=P×D. Given arbitrary complex matrices OOO on PPP and EEE on AAA, set

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j=0N−1sd(hj,zj).s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j=0}^{N-1}s_d(h_j,z_j).sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j=0∏N−1​sd​(hj​,zj​).

The declaration defines the complex matrix BBB on D×PD\times PD×P by

B(u,z),(v,w)=∑a,b∈P∑c,e∈DE(b,e),(a,c) rO(a,z) rO(b,w)‾ sd(u,c) sd(v,e)‾.B_{(u,z),(v,w)} = \sum_{a,b\in P}\sum_{c,e\in D} E_{(b,e),(a,c)}\,r_O(a,z)\,\overline{r_O(b,w)}\, s_d(u,c)\,\overline{s_d(v,e)}.B(u,z),(v,w)​=a,b∈P∑​c,e∈D∑​E(b,e),(a,c)​rO​(a,z)rO​(b,w)​sd​(u,c)sd​(v,e)​.

Thus the matrix supplied as the input to the branch construction has entries sd(u,c)sd(v,e)‾s_d(u,c)\overline{s_d(v,e)}sd​(u,c)sd​(v,e)​. No normalization or positivity assumptions are imposed on OOO or EEE. The parameters may be zero; for d=0d=0d=0, the resulting matrix has an empty index set.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtBranchProbability

For arbitrary natural numbers d,Nd,Nd,N, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, and A=P×DA=P\times DA=P×D. Given arbitrary complex matrices OOO on PPP and EEE on AAA, define

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j=0N−1sd(hj,zj).s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j=0}^{N-1}s_d(h_j,z_j).sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j=0∏N−1​sd​(hj​,zj​).

The declared real number is

Re⁡ ⁣(∑u∈D∑z∈P∑a,b∈P∑c,e∈DE(b,e),(a,c) rO(a,z) rO(b,z)‾ sd(u,c) sd(u,e)‾),\operatorname{Re}\!\left( \sum_{u\in D}\sum_{z\in P} \sum_{a,b\in P}\sum_{c,e\in D} E_{(b,e),(a,c)}\,r_O(a,z)\,\overline{r_O(b,z)}\, s_d(u,c)\,\overline{s_d(u,e)} \right),Re​u∈D∑​z∈P∑​a,b∈P∑​c,e∈D∑​E(b,e),(a,c)​rO​(a,z)rO​(b,z)​sd​(u,c)sd​(u,e)​​,

the real part of the trace of the corresponding branch matrix. No assumptions require this number to lie between zero and one. The definition includes N=0N=0N=0; when d=0d=0d=0, the sum is empty and the value is zero.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtChannelBranch

For arbitrary natural numbers d,Nd,Nd,N, any finite type RRR, possibly empty, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, and A=P×DA=P\times DA=P×D. Given arbitrary complex matrices OOO on PPP, EEE on AAA, and TTT on R×DR\times DR×D, define

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j=0N−1sd(hj,zj).s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j=0}^{N-1}s_d(h_j,z_j).sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j=0∏N−1​sd​(hj​,zj​).

The declaration defines the complex matrix BBB on R×PR\times PR×P by

B(u,z),(v,w)=∑a,b∈P∑c,e∈DE(b,e),(a,c) rO(a,z) rO(b,w)‾ T(u,c),(v,e).B_{(u,z),(v,w)} = \sum_{a,b\in P}\sum_{c,e\in D} E_{(b,e),(a,c)}\,r_O(a,z)\,\overline{r_O(b,w)}\, T_{(u,c),(v,e)}.B(u,z),(v,w)​=a,b∈P∑​c,e∈D∑​E(b,e),(a,c)​rO​(a,z)rO​(b,w)​T(u,c),(v,e)​.

There are no normalization, positivity, or measurement assumptions on the arguments. Empty sums are zero and empty products are one; in particular, if d=0d=0d=0, the sums over c,ec,ec,e are empty and BBB is zero.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtFidelity

For arbitrary natural numbers d,Nd,Nd,N, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, and A=P×DA=P\times DA=P×D. Given any complex matrix OOO on PPP and any family EiE_iEi​ of complex matrices on AAA, indexed by i<Ni<Ni<N, set

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j<Nsd(hj,zj).s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j<N}s_d(h_j,z_j).sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j<N∏​sd​(hj​,zj​).

For each i<Ni<Ni<N, define matrices BiB_iBi​ on D×PD\times PD×P and CiC_iCi​ on D×DD\times DD×D by

(Bi)(u,z),(v,w)=∑a,b∈P∑c,e∈D(Ei)(b,e),(a,c) rO(a,z)rO(b,w)‾sd(u,c)sd(v,e)‾,(B_i)_{(u,z),(v,w)} = \sum_{a,b\in P}\sum_{c,e\in D} (E_i)_{(b,e),(a,c)}\,r_O(a,z)\overline{r_O(b,w)} s_d(u,c)\overline{s_d(v,e)},(Bi​)(u,z),(v,w)​=a,b∈P∑​c,e∈D∑​(Ei​)(b,e),(a,c)​rO​(a,z)rO​(b,w)​sd​(u,c)sd​(v,e)​, (Ci)(u,a),(v,b)=∑r:{j<N:j≠i}→D(Bi)(u,ιi(a,r)),(v,ιi(b,r)),(C_i)_{(u,a),(v,b)} = \sum_{r:\{j<N:j\ne i\}\to D} (B_i)_{(u,\iota_i(a,r)),(v,\iota_i(b,r))},(Ci​)(u,a),(v,b)​=r:{j<N:j=i}→D∑​(Bi​)(u,ιi​(a,r)),(v,ιi​(b,r))​,

where ιi(a,r)\iota_i(a,r)ιi​(a,r) has value aaa at iii and agrees with rrr elsewhere. With S(u,a),(v,b)=sd(u,a)sd(v,b)‾S_{(u,a),(v,b)}=s_d(u,a)\overline{s_d(v,b)}S(u,a),(v,b)​=sd​(u,a)sd​(v,b)​, the declared real number is

∑i<NRe⁡tr⁡(SCi).\sum_{i<N}\operatorname{Re}\operatorname{tr}(SC_i).i<N∑​Retr(SCi​).

No normalization, positivity, or completeness assumptions are imposed on OOO or the EiE_iEi​. The value is zero when N=0N=0N=0 or d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtGram

For arbitrary natural numbers d,N,t,rd,N,t,rd,N,t,r, a distinguished port i0<Ni_0<Ni0​<N, a finite type AAA with decidable equality, and a supplied real spin basis BBB, this defines the matrix H=G†GH=G^\dagger GH=G†G on {0,…,N−1}×A\{0,\ldots,N-1\}\times A{0,…,N−1}×A, so that

H(i,a),(k,b)=∑u:{0,…,N−1}→{0,…,d−1} ∑c<dG(u,c),(i,a)‾ G(u,c),(k,b).H_{(i,a),(k,b)} =\sum_{u:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}}\ \sum_{c<d} \overline{G_{(u,c),(i,a)}}\,G_{(u,c),(k,b)}.H(i,a),(k,b)​=u:{0,…,N−1}→{0,…,d−1}∑​ c<d∑​G(u,c),(i,a)​​G(u,c),(k,b)​.

Here, writing F=B.frameF=B.\mathrm{frame}F=B.frame and letting τi\tau_iτi​ exchange i0i_0i0​ and iii, the entry G(u,c),(i,a)G_{(u,c),(i,a)}G(u,c),(i,a)​ is (−1)u(i)Fj↦u(τi(j)),a/d(-1)^{u(i)}F_{j\mapsto u(\tau_i(j)),a}/\sqrt d(−1)u(i)Fj↦u(τi​(j)),a​/d​ if c=d−1−u(i)c=d-1-u(i)c=d−1−u(i), and zero otherwise; the assignment indexing FFF is restricted to j≠i0j\ne i_0j=i0​. The basis assumptions are that FFF has real entries, F†F=IF^\dagger F=IF†F=I, and FF†FF^\daggerFF† is the product of the spectral projectors for complementary-site Casimir value (t/2)(t/2+1)(t/2)(t/2+1)(t/2)(t/2+1) and magnetic value t/2−rt/2-rt/2−r. These operators are built from Zjj=(d−1)/2−jZ_{jj}=(d-1)/2-jZjj​=(d−1)/2−j, Lj,j+1=(j+1)(d−1−j)L_{j,j+1}=\sqrt{(j+1)(d-1-j)}Lj,j+1​=(j+1)(d−1−j)​ with other entries zero, X=(L+L†)/2X=(L+L^\dagger)/2X=(L+L†)/2, Y=(L−L†)/(2i)Y=(L-L^\dagger)/(2i)Y=(L−L†)/(2i), the Casimir (∑jX(j))2+(∑jY(j))2+(∑jZ(j))2(\sum_jX^{(j)})^2+(\sum_jY^{(j)})^2+(\sum_jZ^{(j)})^2(∑j​X(j))2+(∑j​Y(j))2+(∑j​Z(j))2, and magnetic operator ∑jZ(j)\sum_jZ^{(j)}∑j​Z(j), using the sites j≠i0j\ne i_0j=i0​. The parameters d,t,rd,t,rd,t,r have no further restrictions; N>0N>0N>0 follows from i0i_0i0​, and an empty AAA gives an empty Gram matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtRho

For every pair of natural numbers d,Nd,Nd,N, pbtRho⁡(d,N)\operatorname{pbtRho}(d,N)pbtRho(d,N) is the complex matrix indexed by pairs (a,c)(a,c)(a,c) of an assignment a:{0,…,N−1}→{0,…,d−1}a:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}a:{0,…,N−1}→{0,…,d−1} and a label c∈{0,…,d−1}c\in\{0,\ldots,d-1\}c∈{0,…,d−1}. Its entry at row (a,c)(a,c)(a,c) and column (b,e)(b,e)(b,e) is the sum over all i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1} of (dN−1)−1(−1)a(i)+b(i)/d(d^{N-1})^{-1}(-1)^{a(i)+b(i)}/d(dN−1)−1(−1)a(i)+b(i)/d when c=d−1−a(i)c=d-1-a(i)c=d−1−a(i), e=d−1−b(i)e=d-1-b(i)e=d−1−b(i), and a(j)=b(j)a(j)=b(j)a(j)=b(j) for every j≠ij\ne ij=i, with zero contributed otherwise. Natural-number subtraction is truncated at zero and complex inversion sends zero to zero. When N=0N=0N=0, the sum is empty and the result is the zero matrix; when d=0d=0d=0, its index set is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtSignal

For any natural numbers d,Nd,Nd,N and index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, pbtSignal⁡(d,N,i)\operatorname{pbtSignal}(d,N,i)pbtSignal(d,N,i) is the complex matrix indexed by pairs (a,c)(a,c)(a,c) of an NNN-position assignment aaa of labels in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} and one additional label ccc. Its entry at row (a,c)(a,c)(a,c) and column (b,e)(b,e)(b,e) is (dN−1)−1(−1)a(i)+b(i)/d(d^{N-1})^{-1}(-1)^{a(i)+b(i)}/d(dN−1)−1(−1)a(i)+b(i)/d if c=d−1−a(i)c=d-1-a(i)c=d−1−a(i), e=d−1−b(i)e=d-1-b(i)e=d−1−b(i), and a(j)=b(j)a(j)=b(j)a(j)=b(j) for every j≠ij\ne ij=i, and is zero otherwise. Here N−1N-1N−1 is natural-number subtraction, truncated at zero, and the reciprocal is taken in C\mathbb CC, where 0−1=00^{-1}=00−1=0. The argument iii requires N>0N>0N>0; when d=0d=0d=0, the matrix has no entries.

QAlgorithms.Papers.Independent.Intakenext100.P53.pbtSuccessProbability

For arbitrary natural numbers d,Nd,Nd,N, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1}, P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}, and A=P×DA=P\times DA=P×D. Given any complex matrix OOO on PPP and any family of complex matrices E∅,EiE_{\varnothing},E_iE∅​,Ei​ on AAA, with i<Ni<Ni<N, set

sd(u,v)={(−1)u/d,v=d−1−u,0,otherwise,rO(a,z)=∑h∈POa,h∏j<Nsd(hj,zj).s_d(u,v)= \begin{cases} (-1)^u/\sqrt d,&v=d-1-u,\\ 0,&\text{otherwise}, \end{cases} \qquad r_O(a,z)=\sum_{h\in P}O_{a,h}\prod_{j<N}s_d(h_j,z_j).sd​(u,v)={(−1)u/d​,0,​v=d−1−u,otherwise,​rO​(a,z)=h∈P∑​Oa,h​j<N∏​sd​(hj​,zj​).

The declared real number is

∑i<NRe⁡ ⁣(∑u∈D∑z∈P∑a,b∈P∑c,e∈D(Ei)(b,e),(a,c) rO(a,z)rO(b,z)‾sd(u,c)sd(u,e)‾).\sum_{i<N}\operatorname{Re}\!\left( \sum_{u\in D}\sum_{z\in P} \sum_{a,b\in P}\sum_{c,e\in D} (E_i)_{(b,e),(a,c)}\,r_O(a,z)\overline{r_O(b,z)} s_d(u,c)\overline{s_d(u,e)} \right).i<N∑​Re​u∈D∑​z∈P∑​a,b∈P∑​c,e∈D∑​(Ei​)(b,e),(a,c)​rO​(a,z)rO​(b,z)​sd​(u,c)sd​(u,e)​​.

Thus it sums the real traces of the branch matrices for the outcomes i<Ni<Ni<N; E∅E_{\varnothing}E∅​ does not enter the expression. No normalization, positivity, completeness, or exactness condition is assumed. The value is zero when N=0N=0N=0 or d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakenext100.P53.portProjector

For any natural numbers d,Nd,Nd,N and index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, portProjector⁡(i)\operatorname{portProjector}(i)portProjector(i) is the complex matrix on pairs (a,c)(a,c)(a,c), where aaa assigns a label in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} to each of the NNN positions and ccc is another such label. Its entry at row (a,c)(a,c)(a,c) and column (b,e)(b,e)(b,e) is (−1)a(i)+b(i)/d(-1)^{a(i)+b(i)}/d(−1)a(i)+b(i)/d if c=d−1−a(i)c=d-1-a(i)c=d−1−a(i), e=d−1−b(i)e=d-1-b(i)e=d−1−b(i), and a(j)=b(j)a(j)=b(j)a(j)=b(j) for every j≠ij\ne ij=i, and is zero otherwise. This is the product of the matrix with entries (−1)a(i)/d(-1)^{a(i)}/\sqrt d(−1)a(i)/d​ when c=d−1−a(i)c=d-1-a(i)c=d−1−a(i) and the remaining assignment matches its column, and its conjugate transpose. The index iii requires N>0N>0N>0; for d=0d=0d=0, the resulting matrix is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.probabilisticResource

For every natural number NNN, the declaration defines a complex matrix on {0,1}[N]\{0,1\}^{[N]}{0,1}[N] by

ONprob=2N∑0≤t≤Nt≡N(mod2)(t+1)2 ∑0≤t≤Nt≡N(mod2)(t+1)2DN,t PN,t.O_N^{\mathrm{prob}} =\sqrt{\frac{2^N} {\displaystyle\sum_{\substack{0\le t\le N\\t\equiv N\;(\mathrm{mod}\;2)}}(t+1)^2}}\, \sum_{\substack{0\le t\le N\\t\equiv N\;(\mathrm{mod}\;2)}} \sqrt{\frac{(t+1)^2}{D_{N,t}}}\,P_{N,t}.ONprob​=0≤t≤Nt≡N(mod2)​∑​(t+1)22N​​0≤t≤Nt≡N(mod2)​∑​DN,t​(t+1)2​​PN,t​.

Here PN,t=1{(t/2)(t/2+1)}(CN)P_{N,t}=\mathbf1_{\{(t/2)(t/2+1)\}}(C_N)PN,t​=1{(t/2)(t/2+1)}​(CN​) is obtained by continuous functional calculus, DN,t=Re⁡tr⁡PN,tD_{N,t}=\operatorname{Re}\operatorname{tr}P_{N,t}DN,t​=RetrPN,t​, and CN=∑α=x,y,z(∑j∈[N]Jα(j))2C_N=\sum_{\alpha=x,y,z}(\sum_{j\in[N]}J_\alpha^{(j)})^2CN​=∑α=x,y,z​(∑j∈[N]​Jα(j)​)2, with single-site matrices Jx=12(0110)J_x=\frac12\begin{pmatrix}0&1\\1&0\end{pmatrix}Jx​=21​(01​10​), Jy=12(0−ii0)J_y=\frac12\begin{pmatrix}0&-\mathrm i\\ \mathrm i&0\end{pmatrix}Jy​=21​(0i​−i0​), and Jz=12diag⁡(1,−1)J_z=\frac12\operatorname{diag}(1,-1)Jz​=21​diag(1,−1); the site operators act as identities elsewhere. All displayed coefficients are real and then embedded into C\mathbb CC. The summation set always contains NNN, including when N=0N=0N=0; at N=0N=0N=0, the resulting matrix is the identity on the one-dimensional configuration space. Division by zero is defined to be zero, and the real square root is zero on nonpositive inputs.

QAlgorithms.Papers.Independent.Intakenext100.P53.probabilisticSRM

For arbitrary natural numbers d,Nd,Nd,N, let P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}, H=P×{0,…,d−1}H=P\times\{0,\ldots,d-1\}H=P×{0,…,d−1}, and Ri={0,…,d−1}{j:j≠i}R_i=\{0,\ldots,d-1\}^{\{j:j\ne i\}}Ri​={0,…,d−1}{j:j=i}. Put

s(a,c)={(−1)a/d,c=d−1−a,0,otherwise,Ji((x,c),r)=s(xi,c)1{x∣j≠i=r},σi=(dN−1)−1JiJi†,ρ=∑iσi.s(a,c)= \begin{cases}(-1)^a/\sqrt d,&c=d-1-a,\\0,&\text{otherwise},\end{cases} \quad J_i((x,c),r)=s(x_i,c)\mathbf1_{\{x|_{j\ne i}=r\}}, \quad \sigma_i=(d^{N-1})^{-1}J_iJ_i^\dagger, \quad \rho=\sum_i\sigma_i.s(a,c)={(−1)a/d​,0,​c=d−1−a,otherwise,​Ji​((x,c),r)=s(xi​,c)1{x∣j=i​=r}​,σi​=(dN−1)−1Ji​Ji†​,ρ=i∑​σi​.

The subtraction N−1N-1N−1 is truncated at zero. Let Πρ\Pi_\rhoΠρ​ be the orthogonal projection onto the range of ρ\rhoρ, and let KKK be the functional-calculus value of x↦(x)−1x\mapsto(\sqrt x)^{-1}x↦(x​)−1 at ρ\rhoρ, with 0−1=00^{-1}=00−1=0. The declaration defines a matrix-valued function with one outcome labelled “none” and one outcome labelled “some iii” for each port:

Enone=IH−Πρ,Esome i=KσiK.E_{\mathrm{none}}=I_H-\Pi_\rho, \qquad E_{\mathrm{some}\ i}=K\sigma_iK.Enone​=IH​−Πρ​,Esome i​=Kσi​K.

For N=0N=0N=0, there are no “some” outcomes, ρ=0\rho=0ρ=0, and the “none” matrix is IHI_HIH​. The definition also permits d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakenext100.P53.qubitSectorDimension

For arbitrary natural numbers N,tN,tN,t, let Jx=12(0110)J_x=\frac12\begin{pmatrix}0&1\\1&0\end{pmatrix}Jx​=21​(01​10​), Jy=12(0−ii0)J_y=\frac12\begin{pmatrix}0&-\mathrm i\\ \mathrm i&0\end{pmatrix}Jy​=21​(0i​−i0​), and Jz=12diag⁡(1,−1)J_z=\frac12\operatorname{diag}(1,-1)Jz​=21​diag(1,−1), and, on C{0,1}[N]\mathbb C^{\{0,1\}^{[N]}}C{0,1}[N], define

CN=(∑j∈[N]Jx(j))2+(∑j∈[N]Jy(j))2+(∑j∈[N]Jz(j))2.C_N=\left(\sum_{j\in[N]}J_x^{(j)}\right)^2+ \left(\sum_{j\in[N]}J_y^{(j)}\right)^2+ \left(\sum_{j\in[N]}J_z^{(j)}\right)^2.CN​=​j∈[N]∑​Jx(j)​​2+​j∈[N]∑​Jy(j)​​2+​j∈[N]∑​Jz(j)​​2.

Each Jα(j)J_\alpha^{(j)}Jα(j)​ acts on site jjj and as the identity on the other sites. The declaration defines the real number Re⁡tr⁡Pt\operatorname{Re}\operatorname{tr}P_tRetrPt​, where Pt=1{(t/2)(t/2+1)}(CN)P_t=\mathbf1_{\{(t/2)(t/2+1)\}}(C_N)Pt​=1{(t/2)(t/2+1)}​(CN​), with the indicator function applied by continuous functional calculus. There is no requirement that t≤Nt\le Nt≤N or that ttt have the parity of NNN; an absent spectral value gives Pt=0P_t=0Pt​=0. For N=0N=0N=0, the configuration space has one element and CN=0C_N=0CN​=0, so the value is 111 for t=0t=0t=0 and 000 for t>0t>0t>0.

QAlgorithms.Papers.Independent.Intakenext100.P53.qubitSpins

For every natural number NNN, the declaration defines the finite set

{ t∈N:0≤t≤N,t mod 2=N mod 2 }.\{\,t\in\mathbb N:0\le t\le N,\quad t\bmod2=N\bmod2\,\}.{t∈N:0≤t≤N,tmod2=Nmod2}.

Thus the set contains exactly the natural numbers at most NNN having the same parity as NNN, including 000 when NNN is even; for N=0N=0N=0, it is {0}\{0\}{0}.

QAlgorithms.Papers.Independent.Intakenext100.P53.quditCasimir

For every natural number ddd and every finite type WWW equipped with decidable equality, define d×dd\times dd×d matrices L,Z,X,YL,Z,X,YL,Z,X,Y by Lr,t=(r+1)(d−1−r)L_{r,t}=\sqrt{(r+1)(d-1-r)}Lr,t​=(r+1)(d−1−r)​ if t=r+1t=r+1t=r+1, and zero otherwise; Zr,t=((d−1)/2−r)Z_{r,t}=((d-1)/2-r)Zr,t​=((d−1)/2−r) if r=tr=tr=t, and zero otherwise; X=(L+L†)/2X=(L+L^\dagger)/2X=(L+L†)/2; and Y=(L−L†)/(2i)Y=(L-L^\dagger)/(2\mathrm i)Y=(L−L†)/(2i), with real arithmetic in the entries of LLL and ZZZ. For any such matrix MMM, define its configuration matrix by

CW(M)x,y=∑q∈WMx(q),y(q)∏r∈Wr≠q1{x(r)=y(r)},x,y:W→{0,…,d−1}.C_W(M)_{x,y} =\sum_{q\in W}M_{x(q),y(q)} \prod_{\substack{r\in W\\r\ne q}}\mathbf1_{\{x(r)=y(r)\}}, \qquad x,y:W\to\{0,\ldots,d-1\}.CW​(M)x,y​=q∈W∑​Mx(q),y(q)​r∈Wr=q​∏​1{x(r)=y(r)}​,x,y:W→{0,…,d−1}.

The declaration defines

Kd,W=CW(X)2+CW(Y)2+CW(Z)2,K_{d,W}=C_W(X)^2+C_W(Y)^2+C_W(Z)^2,Kd,W​=CW​(X)2+CW​(Y)2+CW​(Z)2,

where the squares are matrix products and †\dagger† denotes conjugate transpose. Empty products equal 111 and empty sums equal zero; in particular, empty WWW gives a one-dimensional zero matrix. No lower bound on ddd is assumed.

QAlgorithms.Papers.Independent.Intakenext100.P53.quditCollective

For every natural number ddd, every finite type WWW equipped with decidable equality, and every complex d×dd\times dd×d matrix MMM, this defines a matrix Cd,W(M)C_{d,W}(M)Cd,W​(M) on the configuration set W→{0,…,d−1}W\to\{0,\ldots,d-1\}W→{0,…,d−1} by

Cd,W(M)x,y=∑q∈WMx(q),y(q)∏r∈Wr≠q{1,x(r)=y(r),0,x(r)≠y(r).C_{d,W}(M)_{x,y} =\sum_{q\in W}M_{x(q),y(q)} \prod_{\substack{r\in W\\r\ne q}} \begin{cases} 1,&x(r)=y(r),\\ 0,&x(r)\ne y(r). \end{cases}Cd,W​(M)x,y​=q∈W∑​Mx(q),y(q)​r∈Wr=q​∏​{1,0,​x(r)=y(r),x(r)=y(r).​

Empty products equal 111, and an empty sum equals zero. In particular, if WWW is empty, the configuration set has one element and this is the one-dimensional zero matrix, including when d=0d=0d=0; if WWW is nonempty and d=0d=0d=0, the configuration set is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.quditOnWire

For every natural number ddd, every finite type WWW equipped with decidable equality, every q∈Wq\in Wq∈W, and every complex d×dd\times dd×d matrix MMM, this defines a complex matrix on the configuration set W→{0,…,d−1}W\to\{0,\ldots,d-1\}W→{0,…,d−1} by

(M(q))x,y=Mx(q),y(q)∏r∈Wr≠q{1,x(r)=y(r),0,x(r)≠y(r).(M^{(q)})_{x,y} =M_{x(q),y(q)} \prod_{\substack{r\in W\\r\ne q}} \begin{cases} 1,&x(r)=y(r),\\ 0,&x(r)\ne y(r). \end{cases}(M(q))x,y​=Mx(q),y(q)​r∈Wr=q​∏​{1,0,​x(r)=y(r),x(r)=y(r).​

Thus an entry is Mx(q),y(q)M_{x(q),y(q)}Mx(q),y(q)​ if the configurations agree at every position other than qqq, and is zero otherwise. An empty product is 111. The supplied qqq requires WWW to be nonempty; if d=0d=0d=0, the configuration set is consequently empty and the resulting matrix is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.quditSpinRaise

For every natural number ddd, this defines a complex matrix LdL_dLd​, with rows and columns indexed by 0,…,d−10,\ldots,d-10,…,d−1, by

(Ld)r,t={(r+1)(d−1−r),t=r+1,0,otherwise.(L_d)_{r,t}= \begin{cases} \sqrt{(r+1)(d-1-r)},&t=r+1,\\ 0,&\text{otherwise}. \end{cases}(Ld​)r,t​={(r+1)(d−1−r)​,0,​t=r+1,otherwise.​

The square root is the real square root and its value is embedded into C\mathbb CC; the subtraction inside it is real subtraction. Thus the potentially nonzero entries lie in row rrr, column r+1r+1r+1. The definition includes d=0d=0d=0, giving the empty matrix, and d=1d=1d=1, giving the zero matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.quditSpinY

For every natural number ddd, let LdL_dLd​ be the complex matrix indexed by 0,…,d−10,\ldots,d-10,…,d−1 whose entry in row rrr, column ttt is (r+1)(d−1−r)\sqrt{(r+1)(d-1-r)}(r+1)(d−1−r)​ when t=r+1t=r+1t=r+1, and is zero otherwise, using real arithmetic under the square root. This defines

Yd=12i(Ld−Ld†),Y_d=\frac{1}{2\mathrm i}(L_d-L_d^\dagger),Yd​=2i1​(Ld​−Ld†​),

where i2=−1\mathrm i^2=-1i2=−1 and †\dagger† denotes conjugate transpose. The definition includes d=0d=0d=0, giving the empty matrix, and d=1d=1d=1, giving the zero matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.quditSpinZ

For every natural number ddd, this defines a complex matrix ZdZ_dZd​, with rows and columns indexed by 0,…,d−10,\ldots,d-10,…,d−1, whose entries are

(Zd)r,t={d−12−r,r=t,0,r≠t.(Z_d)_{r,t}= \begin{cases} \dfrac{d-1}{2}-r,&r=t,\\ 0,&r\ne t. \end{cases}(Zd​)r,t​=⎩⎨⎧​2d−1​−r,0,​r=t,r=t.​

The displayed arithmetic is real arithmetic, embedded into C\mathbb CC; in particular, d−1d-1d−1 here is real subtraction. No positivity assumption on ddd is imposed: d=0d=0d=0 gives the empty matrix, and d=1d=1d=1 gives the one-dimensional zero matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritBlock

This defines the complex 3×33\times33×3 matrix, indexed in the order 0,1,20,1,20,1,2, given by

B=227(105030505).B=\frac2{27} \begin{pmatrix} 1&0&\sqrt5\\ 0&3&0\\ \sqrt5&0&5 \end{pmatrix}.B=272​​105​​030​5​05​​.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritCoupled

For every r,J∈{0,1,2}r,J\in\{0,1,2\}r,J∈{0,1,2}, this defines a vector vrJv_{rJ}vrJ​ in the complex Euclidean space with basis ∣a,b;c⟩|a,b;c\rangle∣a,b;c⟩, a,b,c∈{0,1,2}a,b,c\in\{0,1,2\}a,b,c∈{0,1,2}. Let

L=2(000100010),T=L⊗I3⊗I3+I3⊗L⊗I3+I3⊗I3⊗L,L=\sqrt2 \begin{pmatrix}0&0&0\\1&0&0\\0&1&0\end{pmatrix}, \qquad T=L\otimes I_3\otimes I_3+I_3\otimes L\otimes I_3+I_3\otimes I_3\otimes L,L=2​​010​001​000​​,T=L⊗I3​⊗I3​+I3​⊗L⊗I3​+I3​⊗I3​⊗L,

and define

h0=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3,h1=−12(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),h2=35∣0,0;2⟩−320(∣0,1;1⟩+∣1,0;1⟩)+160(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩).\begin{aligned} h_0&=(|0,2;0\rangle-|1,1;0\rangle+|2,0;0\rangle)/\sqrt3,\\ h_1&=-\tfrac12(|0,1;1\rangle-|1,0;1\rangle-|0,2;0\rangle+|2,0;0\rangle),\\ h_2&=\sqrt{\tfrac35}|0,0;2\rangle -\sqrt{\tfrac3{20}}(|0,1;1\rangle+|1,0;1\rangle) +\sqrt{\tfrac1{60}}(|0,2;0\rangle+|2,0;0\rangle+2|1,1;0\rangle). \end{aligned}h0​h1​h2​​=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3​,=−21​(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),=53​​∣0,0;2⟩−203​​(∣0,1;1⟩+∣1,0;1⟩)+601​​(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩).​

Then vrJ=(2)−rTrhJv_{rJ}=(\sqrt2)^{-r}T^rh_JvrJ​=(2​)−rTrhJ​, where matrix action is ordinary matrix-vector multiplication. In particular, r=0r=0r=0 uses T0=IT^0=IT0=I and gives v0J=hJv_{0J}=h_Jv0J​=hJ​.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritFrame

For each r∈{0,1,2}r\in\{0,1,2\}r∈{0,1,2}, this defines a 27×327\times327×3 complex matrix FrF_rFr​, with rows indexed by (a,b;c)∈{0,1,2}3(a,b;c)\in\{0,1,2\}^3(a,b;c)∈{0,1,2}3 and columns indexed by J∈{0,1,2}J\in\{0,1,2\}J∈{0,1,2}. In the corresponding computational basis, put

h0=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3,h1=−12(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),h2=35∣0,0;2⟩−320(∣0,1;1⟩+∣1,0;1⟩)+160(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩),\begin{aligned} h_0&=(|0,2;0\rangle-|1,1;0\rangle+|2,0;0\rangle)/\sqrt3,\\ h_1&=-\tfrac12(|0,1;1\rangle-|1,0;1\rangle-|0,2;0\rangle+|2,0;0\rangle),\\ h_2&=\sqrt{\tfrac35}|0,0;2\rangle -\sqrt{\tfrac3{20}}(|0,1;1\rangle+|1,0;1\rangle) +\sqrt{\tfrac1{60}}(|0,2;0\rangle+|2,0;0\rangle+2|1,1;0\rangle), \end{aligned}h0​h1​h2​​=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3​,=−21​(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),=53​​∣0,0;2⟩−203​​(∣0,1;1⟩+∣1,0;1⟩)+601​​(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩),​

let L=2(000100010)L=\sqrt2\begin{pmatrix}0&0&0\\1&0&0\\0&1&0\end{pmatrix}L=2​​010​001​000​​ and T=L⊗I3⊗I3+I3⊗L⊗I3+I3⊗I3⊗LT=L\otimes I_3\otimes I_3+I_3\otimes L\otimes I_3+I_3\otimes I_3\otimes LT=L⊗I3​⊗I3​+I3​⊗L⊗I3​+I3​⊗I3​⊗L. The definition is

(Fr)x,J=(2)−r(TrhJ)x.(F_r)_{x,J}=(\sqrt2)^{-r}(T^rh_J)_x.(Fr​)x,J​=(2​)−r(TrhJ​)x​.

Thus its columns are the three indicated vectors, including h0,h1,h2h_0,h_1,h_2h0​,h1​,h2​ themselves when r=0r=0r=0.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritFullFrame

This defines a 27×927\times927×9 complex matrix FFF, with rows indexed by x=(a,b;c)∈{0,1,2}3x=(a,b;c)\in\{0,1,2\}^3x=(a,b;c)∈{0,1,2}3 and columns indexed by ordered pairs (r,J)∈{0,1,2}2(r,J)\in\{0,1,2\}^2(r,J)∈{0,1,2}2. In this computational basis, let

h0=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3,h1=−12(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),h2=35∣0,0;2⟩−320(∣0,1;1⟩+∣1,0;1⟩)+160(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩),\begin{aligned} h_0&=(|0,2;0\rangle-|1,1;0\rangle+|2,0;0\rangle)/\sqrt3,\\ h_1&=-\tfrac12(|0,1;1\rangle-|1,0;1\rangle-|0,2;0\rangle+|2,0;0\rangle),\\ h_2&=\sqrt{\tfrac35}|0,0;2\rangle -\sqrt{\tfrac3{20}}(|0,1;1\rangle+|1,0;1\rangle) +\sqrt{\tfrac1{60}}(|0,2;0\rangle+|2,0;0\rangle+2|1,1;0\rangle), \end{aligned}h0​h1​h2​​=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3​,=−21​(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),=53​​∣0,0;2⟩−203​​(∣0,1;1⟩+∣1,0;1⟩)+601​​(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩),​

and set L=2(000100010)L=\sqrt2\begin{pmatrix}0&0&0\\1&0&0\\0&1&0\end{pmatrix}L=2​​010​001​000​​ and T=L⊗I3⊗I3+I3⊗L⊗I3+I3⊗I3⊗LT=L\otimes I_3\otimes I_3+I_3\otimes L\otimes I_3+I_3\otimes I_3\otimes LT=L⊗I3​⊗I3​+I3​⊗L⊗I3​+I3​⊗I3​⊗L. Its entries are

Fx,(r,J)=(2)−r(TrhJ)x,F_{x,(r,J)}=(\sqrt2)^{-r}(T^rh_J)_x,Fx,(r,J)​=(2​)−r(TrhJ​)x​,

with T0=IT^0=IT0=I.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritHighest

For each J∈{0,1,2}J\in\{0,1,2\}J∈{0,1,2}, this defines a vector hJh_JhJ​ in the 272727-dimensional complex Euclidean space with basis ∣a,b;c⟩|a,b;c\rangle∣a,b;c⟩, where a,b,c∈{0,1,2}a,b,c\in\{0,1,2\}a,b,c∈{0,1,2} denote the two port entries and the final register. The three cases are exactly

h0=∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩3,h1=−12(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),h2=35∣0,0;2⟩−320(∣0,1;1⟩+∣1,0;1⟩)+160(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩).\begin{aligned} h_0&=\frac{|0,2;0\rangle-|1,1;0\rangle+|2,0;0\rangle}{\sqrt3},\\ h_1&=-\frac12\bigl( |0,1;1\rangle-|1,0;1\rangle-|0,2;0\rangle+|2,0;0\rangle \bigr),\\ h_2&=\sqrt{\frac35}|0,0;2\rangle -\sqrt{\frac3{20}}\bigl(|0,1;1\rangle+|1,0;1\rangle\bigr)\\ &\hspace{1.5em} +\sqrt{\frac1{60}}\bigl(|0,2;0\rangle+|2,0;0\rangle+2|1,1;0\rangle\bigr). \end{aligned}h0​h1​h2​​=3​∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩​,=−21​(∣0,1;1⟩−∣1,0;1⟩−∣0,2;0⟩+∣2,0;0⟩),=53​​∣0,0;2⟩−203​​(∣0,1;1⟩+∣1,0;1⟩)+601​​(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩).​

Here each displayed ket has coefficient 111 at its indicated basis label and 000 at all other labels; the final case applies precisely when J=2J=2J=2.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritKernelVector

For every r∈{0,1,2}r\in\{0,1,2\}r∈{0,1,2}, this defines a vector κr\kappa_rκr​ in the complex Euclidean space with basis ∣a,b;c⟩|a,b;c\rangle∣a,b;c⟩, a,b,c∈{0,1,2}a,b,c\in\{0,1,2\}a,b,c∈{0,1,2}. Let L=2(000100010)L=\sqrt2\begin{pmatrix}0&0&0\\1&0&0\\0&1&0\end{pmatrix}L=2​​010​001​000​​, T=L⊗I3⊗I3+I3⊗L⊗I3+I3⊗I3⊗LT=L\otimes I_3\otimes I_3+I_3\otimes L\otimes I_3+I_3\otimes I_3\otimes LT=L⊗I3​⊗I3​+I3​⊗L⊗I3​+I3​⊗I3​⊗L, and

h0=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3,h2=35∣0,0;2⟩−320(∣0,1;1⟩+∣1,0;1⟩)+160(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩).\begin{aligned} h_0&=(|0,2;0\rangle-|1,1;0\rangle+|2,0;0\rangle)/\sqrt3,\\ h_2&=\sqrt{\tfrac35}|0,0;2\rangle -\sqrt{\tfrac3{20}}(|0,1;1\rangle+|1,0;1\rangle) +\sqrt{\tfrac1{60}}(|0,2;0\rangle+|2,0;0\rangle+2|1,1;0\rangle). \end{aligned}h0​h2​​=(∣0,2;0⟩−∣1,1;0⟩+∣2,0;0⟩)/3​,=53​​∣0,0;2⟩−203​​(∣0,1;1⟩+∣1,0;1⟩)+601​​(∣0,2;0⟩+∣2,0;0⟩+2∣1,1;0⟩).​

Then

κr=Tr(5 h0−h2)6 (2)r,\kappa_r=\frac{T^r(\sqrt5\,h_0-h_2)}{\sqrt6\,(\sqrt2)^r},κr​=6​(2​)rTr(5​h0​−h2​)​,

including r=0r=0r=0, when T0=IT^0=IT0=I.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritPairKet

For every a,b∈{0,1,2}a,b\in\{0,1,2\}a,b∈{0,1,2}, this defines the vector ∣a,b⟩|a,b\rangle∣a,b⟩ in the 999-dimensional complex Euclidean space indexed by functions {0,1}→{0,1,2}\{0,1\}\to\{0,1,2\}{0,1}→{0,1,2}: its coefficient at a function xxx is 111 if x(0)=ax(0)=ax(0)=a and x(1)=bx(1)=bx(1)=b, and 000 otherwise.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritResource

On the space indexed by {0,1,2}[2]\{0,1,2\}^{[2]}{0,1,2}[2], let Jz=diag⁡(1,0,−1)J_z=\operatorname{diag}(1,0,-1)Jz​=diag(1,0,−1), J+=2(010001000)J_+=\sqrt2\begin{pmatrix}0&1&0\\0&0&1\\0&0&0\end{pmatrix}J+​=2​​000​100​010​​, Jx=(J++J+†)/2J_x=(J_++J_+^\dagger)/2Jx​=(J+​+J+†​)/2, Jy=(J+−J+†)/(2i)J_y=(J_+-J_+^\dagger)/(2\mathrm i)Jy​=(J+​−J+†​)/(2i), and

C=(Jx⊗I3+I3⊗Jx)2+(Jy⊗I3+I3⊗Jy)2+(Jz⊗I3+I3⊗Jz)2.C=(J_x\otimes I_3+I_3\otimes J_x)^2+ (J_y\otimes I_3+I_3\otimes J_y)^2+ (J_z\otimes I_3+I_3\otimes J_z)^2.C=(Jx​⊗I3​+I3​⊗Jx​)2+(Jy​⊗I3​+I3​⊗Jy​)2+(Jz​⊗I3​+I3​⊗Jz​)2.

The declaration defines the constant matrix obtained by applying the real square-root function through continuous functional calculus to

65 1{0}(C)+35 1{2}(C)+65 1{6}(C).\frac65\,\mathbf1_{\{0\}}(C)+ \frac35\,\mathbf1_{\{2\}}(C)+ \frac65\,\mathbf1_{\{6\}}(C).56​1{0}​(C)+53​1{2}​(C)+56​1{6}​(C).

The spectral indicator functions in this expression are themselves applied by continuous functional calculus.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritResourceSquare

On the space indexed by two-port configurations {0,1,2}[2]\{0,1,2\}^{[2]}{0,1,2}[2], define

Jz=diag⁡(1,0,−1),J+=2(010001000),Jx=J++J+†2,Jy=J+−J+†2i,J_z=\operatorname{diag}(1,0,-1),\qquad J_+=\sqrt2\begin{pmatrix}0&1&0\\0&0&1\\0&0&0\end{pmatrix}, \qquad J_x=\frac{J_++J_+^\dagger}{2},\quad J_y=\frac{J_+-J_+^\dagger}{2\mathrm i},Jz​=diag(1,0,−1),J+​=2​​000​100​010​​,Jx​=2J+​+J+†​​,Jy​=2iJ+​−J+†​​,

and C=(Jx⊗I3+I3⊗Jx)2+(Jy⊗I3+I3⊗Jy)2+(Jz⊗I3+I3⊗Jz)2C=(J_x\otimes I_3+I_3\otimes J_x)^2+(J_y\otimes I_3+I_3\otimes J_y)^2+(J_z\otimes I_3+I_3\otimes J_z)^2C=(Jx​⊗I3​+I3​⊗Jx​)2+(Jy​⊗I3​+I3​⊗Jy​)2+(Jz​⊗I3​+I3​⊗Jz​)2. The declaration defines the constant matrix

65 1{0}(C)+35 1{2}(C)+65 1{6}(C),\frac65\,\mathbf1_{\{0\}}(C)+ \frac35\,\mathbf1_{\{2\}}(C)+ \frac65\,\mathbf1_{\{6\}}(C),56​1{0}​(C)+53​1{2}​(C)+56​1{6}​(C),

where each indicator function is applied by continuous functional calculus. The three target eigenvalues arise respectively from (t/2)(t/2+1)(t/2)(t/2+1)(t/2)(t/2+1) for t=0,2,4t=0,2,4t=0,2,4, and the rational coefficients are complex scalars.

QAlgorithms.Papers.Independent.Intakenext100.P53.qutritTransformedEffect

For each i∈{0,1}i\in\{0,1\}i∈{0,1}, this defines an operator FiF_iFi​ on the 272727-dimensional space with basis ∣a0,a1;c⟩|a_0,a_1;c\rangle∣a0​,a1​;c⟩, where a0,a1,c∈{0,1,2}a_0,a_1,c\in\{0,1,2\}a0​,a1​,c∈{0,1,2}. Define s(a,c)=(−1)a/3s(a,c)=(-1)^a/\sqrt3s(a,c)=(−1)a/3​ when c=2−ac=2-ac=2−a, and s(a,c)=0s(a,c)=0s(a,c)=0 otherwise. Its matrix entries are

(Fi)(a0,a1;c),(b0,b1;e)=910 s(ai,c)s(bi,e)‾ 1{a1−i=b1−i}.(F_i)_{(a_0,a_1;c),(b_0,b_1;e)} =\frac9{10}\,s(a_i,c)\overline{s(b_i,e)} \,\mathbf1_{\{a_{1-i}=b_{1-i}\}}.(Fi​)(a0​,a1​;c),(b0​,b1​;e)​=109​s(ai​,c)s(bi​,e)​1{a1−i​=b1−i​}​.

Thus Fi=910PiF_i=\frac9{10}P_iFi​=109​Pi​, where PiP_iPi​ places the rank-one operator associated with (∣0,2⟩−∣1,1⟩+∣2,0⟩)/3(|0,2\rangle-|1,1\rangle+|2,0\rangle)/\sqrt3(∣0,2⟩−∣1,1⟩+∣2,0⟩)/3​ on port iii and the final register, and acts as the identity on the other port.

QAlgorithms.Papers.Independent.Intakenext100.P53.recoverBranch

For every natural number NNN, every finite type RRR with decidable equality, every complex matrix UUU on the assignment space {0,…,N−1}→{0,1}\{0,\ldots,N-1\}\to\{0,1\}{0,…,N−1}→{0,1}, and every complex matrix TTT on RRR times that assignment space, this defines

(IR⊗U) T (IR⊗U)†.(I_R\otimes U)\,T\,(I_R\otimes U)^\dagger.(IR​⊗U)T(IR​⊗U)†.

Equivalently, its entry at (a,u),(b,v)(a,u),(b,v)(a,u),(b,v) is ∑x,yUu,x T(a,x),(b,y) Uv,y‾\sum_{x,y}U_{u,x}\,T_{(a,x),(b,y)}\,\overline{U_{v,y}}∑x,y​Uu,x​T(a,x),(b,y)​Uv,y​​, where x,yx,yx,y range over all NNN-port assignments. There is no assumption that UUU is unitary or that TTT is positive or normalized. Both N=0N=0N=0, when the assignment space is a singleton, and an empty RRR are allowed.

QAlgorithms.Papers.Independent.Intakenext100.P53.recoveryMeasurement

For every natural number NNN, this defines a family of complex matrices on pairs (u,h)(u,h)(u,h), with u:{0,…,N−1}→{0,1}u:\{0,\ldots,N-1\}\to\{0,1\}u:{0,…,N−1}→{0,1} and h∈{0,1}h\in\{0,1\}h∈{0,1}, indexed by the disjoint union of the ports i<Ni<Ni<N and the refinement labels. Define (Si)(u,h),v=(−1)u(i)/2(S_i)_{(u,h),v}=(-1)^{u(i)}/\sqrt2(Si​)(u,h),v​=(−1)u(i)/2​ when h=1−u(i)h=1-u(i)h=1−u(i) and v=u∣{j≠i}v=u|_{\{j\ne i\}}v=u∣{j=i}​, and zero otherwise, and set

Ai=2−(N−1)SiSi†,RN=∑i<NAi,QN=f(RN),P0=I−Πrange⁡RN,A_i=2^{-(N-1)}S_iS_i^\dagger,\qquad R_N=\sum_{i<N}A_i,\qquad Q_N=f(R_N),\qquad P_0=I-\Pi_{\operatorname{range}R_N},Ai​=2−(N−1)Si​Si†​,RN​=i<N∑​Ai​,QN​=f(RN​),P0​=I−ΠrangeRN​​,

where f(x)=(x)−1f(x)=(\sqrt x)^{-1}f(x)=(x​)−1 is applied through continuous functional calculus, with f(0)=0f(0)=0f(0)=0, and Πrange⁡RN\Pi_{\operatorname{range}R_N}ΠrangeRN​​ is the orthogonal range projector. The matrix for a port label iii is QNAiQNQ_NA_iQ_NQN​Ai​QN​; the matrix for a refinement label zzz is P0vzvz†P0P_0v_zv_z^\dagger P_0P0​vz​vz†​P0​. To specify the latter, put q=⌊(N+1)/2⌋q=\lfloor(N+1)/2\rfloorq=⌊(N+1)/2⌋ and DN,k(u,h)=1/(N+1k)D_{N,k}(u,h)=1/\sqrt{\binom{N+1}{k}}DN,k​(u,h)=1/(kN+1​)​ if ∑iu(i)+h=k\sum_i u(i)+h=k∑i​u(i)+h=k, and zero otherwise. Refinement labels comprise a singleton, with vz=DN,qv_z=D_{N,q}vz​=DN,q​, and pairs (m,σ)(m,\sigma)(m,σ) with m<qm<qm<q and Boolean σ\sigmaσ, with vz=(DN,q−(m+1)+(−1)σDN,q+(m+1))/2v_z=(D_{N,q-(m+1)}+(-1)^\sigma D_{N,q+(m+1)})/\sqrt2vz​=(DN,q−(m+1)​+(−1)σDN,q+(m+1)​)/2​, where false gives sign +1+1+1 and true gives sign −1-1−1. Natural-number subtraction is used in N−1N-1N−1 and in the vector indices. No restriction excludes N=0N=0N=0: then there are no port labels and only the singleton refinement label remains. This declaration defines the family without asserting that its sum is the identity.

QAlgorithms.Papers.Independent.Intakenext100.P53.refinementEffect

For every natural number NNN and every refinement label zzz, this defines the matrix P0vzvz†P0P_0v_zv_z^\dagger P_0P0​vz​vz†​P0​ on pairs (u,h)(u,h)(u,h) with u:{0,…,N−1}→{0,1}u:\{0,\ldots,N-1\}\to\{0,1\}u:{0,…,N−1}→{0,1} and h∈{0,1}h\in\{0,1\}h∈{0,1}. Here

RN=2−(N−1)∑i<NSiSi†,P0=I−Πrange⁡RN,R_N=2^{-(N-1)}\sum_{i<N}S_iS_i^\dagger,\qquad P_0=I-\Pi_{\operatorname{range}R_N},RN​=2−(N−1)i<N∑​Si​Si†​,P0​=I−ΠrangeRN​​,

where Πrange⁡RN\Pi_{\operatorname{range}R_N}ΠrangeRN​​ is the orthogonal projector onto the matrix range, and (Si)(u,h),v=(−1)u(i)/2(S_i)_{(u,h),v}=(-1)^{u(i)}/\sqrt2(Si​)(u,h),v​=(−1)u(i)/2​ if h=1−u(i)h=1-u(i)h=1−u(i) and v=u∣{j≠i}v=u|_{\{j\ne i\}}v=u∣{j=i}​, and is zero otherwise. The exponent N−1N-1N−1 uses natural-number subtraction. To define vzv_zvz​, put q=⌊(N+1)/2⌋q=\lfloor(N+1)/2\rfloorq=⌊(N+1)/2⌋ and let DN,k(u,h)D_{N,k}(u,h)DN,k​(u,h) equal 1/(N+1k)1/\sqrt{\binom{N+1}{k}}1/(kN+1​)​ when ∑iu(i)+h=k\sum_i u(i)+h=k∑i​u(i)+h=k and zero otherwise. The label set is the disjoint union of a singleton and the pairs (m,σ)(m,\sigma)(m,σ) with m<qm<qm<q and Boolean σ\sigmaσ; the singleton gives vz=DN,qv_z=D_{N,q}vz​=DN,q​, while a pair gives vz=(DN,q−(m+1)+(−1)σDN,q+(m+1))/2v_z=(D_{N,q-(m+1)}+(-1)^\sigma D_{N,q+(m+1)})/\sqrt2vz​=(DN,q−(m+1)​+(−1)σDN,q+(m+1)​)/2​, with (−1)false=1(-1)^{\mathrm{false}}=1(−1)false=1 and (−1)true=−1(-1)^{\mathrm{true}}=-1(−1)true=−1. The matrix vzvz†v_zv_z^\daggervz​vz†​ has entries vz(x)vz(y)‾v_z(x)\overline{v_z(y)}vz​(x)vz​(y)​. The case N=0N=0N=0 is included: RN=0R_N=0RN​=0, P0=IP_0=IP0​=I, and only the singleton label occurs.

QAlgorithms.Papers.Independent.Intakenext100.P53.refinementVector

For every natural number NNN, put q=⌊(N+1)/2⌋q=\lfloor(N+1)/2\rfloorq=⌊(N+1)/2⌋ and define DN,k(u,h)D_{N,k}(u,h)DN,k​(u,h) to be 1/(N+1k)1/\sqrt{\binom{N+1}{k}}1/(kN+1​)​ when ∑i<Nu(i)+h=k\sum_{i<N}u(i)+h=k∑i<N​u(i)+h=k, and zero otherwise, for assignments u:{0,…,N−1}→{0,1}u:\{0,\ldots,N-1\}\to\{0,1\}u:{0,…,N−1}→{0,1} and h∈{0,1}h\in\{0,1\}h∈{0,1}. This declaration assigns a vector to each element of the disjoint union consisting of a singleton and the pairs (m,σ)(m,\sigma)(m,σ) with 0≤m<q0\le m<q0≤m<q and Boolean σ\sigmaσ: the singleton receives DN,qD_{N,q}DN,q​, and (m,σ)(m,\sigma)(m,σ) receives

12(DN,q−(m+1)+{−DN,q+(m+1),σ=true,DN,q+(m+1),σ=false.).\frac1{\sqrt2} \left(D_{N,q-(m+1)}+ \begin{cases} -D_{N,q+(m+1)},&\sigma=\mathrm{true},\\ D_{N,q+(m+1)},&\sigma=\mathrm{false}. \end{cases}\right).2​1​(DN,q−(m+1)​+{−DN,q+(m+1)​,DN,q+(m+1)​,​σ=true,σ=false.​).

Subtraction in the lower index is natural-number subtraction, which truncates at zero; the bound m<qm<qm<q ensures that it does not truncate in this branch. No parity or positivity condition on NNN is assumed. For N=0N=0N=0, there are no pairs (m,σ)(m,\sigma)(m,σ), and the singleton receives D0,0D_{0,0}D0,0​.

QAlgorithms.Papers.Independent.Intakenext100.P53.resource

For any natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by assignments {0,…,N−1}→{0,…,d−1}\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}{0,…,N−1}→{0,…,d−1}, resource⁡(O)\operatorname{resource}(O)resource(O) is the complex Euclidean vector indexed by two such assignments (x,y)(x,y)(x,y), with coordinate ∑aOx,a∏i=0N−1sd(a(i),y(i))\sum_a O_{x,a}\prod_{i=0}^{N-1}s_d(a(i),y(i))∑a​Ox,a​∏i=0N−1​sd​(a(i),y(i)), where the sum ranges over all assignments aaa and sd(u,v)=(−1)u/ds_d(u,v)=(-1)^u/\sqrt dsd​(u,v)=(−1)u/d​ if v=d−1−uv=d-1-uv=d−1−u, and zero otherwise. No normalization or other condition is imposed on OOO. When N=0N=0N=0, the sum has one term and the product is empty, so the sole coordinate is O∅,∅O_{\varnothing,\varnothing}O∅,∅​, including when d=0d=0d=0; when d=0d=0d=0 and N>0N>0N>0, the vector has an empty index set.

QAlgorithms.Papers.Independent.Intakenext100.P53.rhoSpinBlock

For arbitrary natural numbers d,N,td,N,td,N,t, let [d]={0,…,d−1}[d]=\{0,\ldots,d-1\}[d]={0,…,d−1}, let Ad,N=[d][N]×[d]\mathcal A_{d,N}=[d]^{[N]}\times[d]Ad,N​=[d][N]×[d], and, for i∈[N]i\in[N]i∈[N], let Hi=[d][N]∖{i}\mathcal H_i=[d]^{[N]\setminus\{i\}}Hi​=[d][N]∖{i}. Define the singlet-insertion matrix Si:CHi→CAd,NS_i:\mathbb C^{\mathcal H_i}\to\mathbb C^{\mathcal A_{d,N}}Si​:CHi​→CAd,N​ by

(Si)(x,c),a={(−1)xi/d,c=d−1−xi and x∣[N]∖{i}=a,0,otherwise.(S_i)_{(x,c),a} =\begin{cases} (-1)^{x_i}/\sqrt d,&c=d-1-x_i\ \text{and }x|_{[N]\setminus\{i\}}=a,\\ 0,&\text{otherwise}. \end{cases}(Si​)(x,c),a​={(−1)xi​/d​,0,​c=d−1−xi​ and x∣[N]∖{i}​=a,otherwise.​

To specify the operator on the complementary ports, define single-site matrices Jz=diag⁡((d−1)/2−r)r∈[d]J_z=\operatorname{diag}((d-1)/2-r)_{r\in[d]}Jz​=diag((d−1)/2−r)r∈[d]​, (J+)rs=(r+1)(d−1−r)(J_+)_{rs}=\sqrt{(r+1)(d-1-r)}(J+​)rs​=(r+1)(d−1−r)​ when s=r+1s=r+1s=r+1, and 000 otherwise, and put Jx=(J++J+†)/2J_x=(J_++J_+^\dagger)/2Jx​=(J+​+J+†​)/2, Jy=(J+−J+†)/(2i)J_y=(J_+-J_+^\dagger)/(2\mathrm i)Jy​=(J+​−J+†​)/(2i). For a finite set WWW of sites, let Jα(W)J_\alpha^{(W)}Jα(W)​ be the sum of JαJ_\alphaJα​ acting on each site and the identity on all other sites, and let CW=(Jx(W))2+(Jy(W))2+(Jz(W))2C_W=(J_x^{(W)})^2+(J_y^{(W)})^2+(J_z^{(W)})^2CW​=(Jx(W)​)2+(Jy(W)​)2+(Jz(W)​)2. Writing Pt(C)=1{(t/2)(t/2+1)}(C)P_t(C)=\mathbf1_{\{(t/2)(t/2+1)\}}(C)Pt​(C)=1{(t/2)(t/2+1)}​(C) for the matrix obtained by continuous functional calculus with the indicated indicator function, the declaration defines

ρd,N,t=(d N−˙1)−1∑i∈[N]SiPt(C[N]∖{i})Si†,\rho_{d,N,t} =\bigl(d^{\,N\mathbin{\dot-}1}\bigr)^{-1} \sum_{i\in[N]}S_iP_t(C_{[N]\setminus\{i\}})S_i^\dagger,ρd,N,t​=(dN−˙​1)−1i∈[N]∑​Si​Pt​(C[N]∖{i}​)Si†​,

where N−˙1=max⁡(N−1,0)N\mathbin{\dot-}1=\max(N-1,0)N−˙​1=max(N−1,0), and the scalar inverse is taken in C\mathbb CC, with 0−1=00^{-1}=00−1=0. There are no lower bounds on d,N,td,N,td,N,t; in particular, N=0N=0N=0 gives an empty sum and hence the zero matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.rhoSpinMagnetic

For arbitrary natural numbers d,N,t,rd,N,t,rd,N,t,r, the declaration defines a matrix on configurations (x,c)∈[d][N]×[d](x,c)\in[d]^{[N]}\times[d](x,c)∈[d][N]×[d] by

ρd,N,t,r=[(d N−˙1)−1∑i∈[N]SiPt(C[N]∖{i})Si†]1{t/2−r}(Ztot).\rho_{d,N,t,r} =\left[\bigl(d^{\,N\mathbin{\dot-}1}\bigr)^{-1} \sum_{i\in[N]}S_iP_t(C_{[N]\setminus\{i\}})S_i^\dagger\right] \mathbf1_{\{t/2-r\}}(Z_{\mathrm{tot}}).ρd,N,t,r​=​(dN−˙​1)−1i∈[N]∑​Si​Pt​(C[N]∖{i}​)Si†​​1{t/2−r}​(Ztot​).

Here N−˙1=max⁡(N−1,0)N\mathbin{\dot-}1=\max(N-1,0)N−˙​1=max(N−1,0); SiS_iSi​ has entry (−1)xi/d(-1)^{x_i}/\sqrt d(−1)xi​/d​ from a complementary configuration aaa to (x,c)(x,c)(x,c) exactly when c=d−1−xic=d-1-x_ic=d−1−xi​ and xxx restricts to aaa away from iii, and has entry 000 otherwise. The single-site matrices are Jz=diag⁡((d−1)/2−s)s∈[d]J_z=\operatorname{diag}((d-1)/2-s)_{s\in[d]}Jz​=diag((d−1)/2−s)s∈[d]​, (J+)su=(s+1)(d−1−s)(J_+)_{su}=\sqrt{(s+1)(d-1-s)}(J+​)su​=(s+1)(d−1−s)​ if u=s+1u=s+1u=s+1 and 000 otherwise, Jx=(J++J+†)/2J_x=(J_++J_+^\dagger)/2Jx​=(J+​+J+†​)/2, and Jy=(J+−J+†)/(2i)J_y=(J_+-J_+^\dagger)/(2\mathrm i)Jy​=(J+​−J+†​)/(2i). For any finite site set WWW, CW=∑α=x,y,z(∑j∈WJα(j))2C_W=\sum_{\alpha=x,y,z}(\sum_{j\in W}J_\alpha^{(j)})^2CW​=∑α=x,y,z​(∑j∈W​Jα(j)​)2, where Jα(j)J_\alpha^{(j)}Jα(j)​ acts on site jjj and as the identity elsewhere; Pt(C)=1{(t/2)(t/2+1)}(C)P_t(C)=\mathbf1_{\{(t/2)(t/2+1)\}}(C)Pt​(C)=1{(t/2)(t/2+1)}​(C); and Ztot=(∑j∈[N]Jz(j))⊗Id+I⊗JzZ_{\mathrm{tot}}=(\sum_{j\in[N]}J_z^{(j)})\otimes I_d+I\otimes J_zZtot​=(∑j∈[N]​Jz(j)​)⊗Id​+I⊗Jz​. Both indicator functions are applied by continuous functional calculus. The definition uses the displayed order of matrix multiplication and imposes no restriction such as r≤tr\le tr≤t; a target value absent from the relevant spectrum gives the zero spectral projector. All natural-number values, including d=0d=0d=0 and N=0N=0N=0, are admitted, with inverse zero interpreted as zero; N=0N=0N=0 makes the result zero.

QAlgorithms.Papers.Independent.Intakenext100.P53.selectPort

For natural numbers d,Nd,Nd,N, any finite type RRR, possibly empty, and a chosen index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, let D={0,…,d−1}D=\{0,\ldots,d-1\}D={0,…,d−1} and P=D{0,…,N−1}P=D^{\{0,\ldots,N-1\}}P=D{0,…,N−1}. Given any complex matrix TTT on R×PR\times PR×P, the declaration defines a complex matrix CCC on R×DR\times DR×D by

C(u,a),(v,b)=∑r:{j<N:j≠i}→DT(u,ιi(a,r)),(v,ιi(b,r)),ιi(a,r)j={a,j=i,rj,j≠i.C_{(u,a),(v,b)} = \sum_{r:\{j<N:j\ne i\}\to D} T_{(u,\iota_i(a,r)),(v,\iota_i(b,r))}, \qquad \iota_i(a,r)_j= \begin{cases} a,&j=i,\\ r_j,&j\ne i. \end{cases}C(u,a),(v,b)​=r:{j<N:j=i}→D∑​T(u,ιi​(a,r)),(v,ιi​(b,r))​,ιi​(a,r)j​={a,rj​,​j=i,j=i.​

No positivity or normalization of TTT is assumed. A chosen iii cannot exist when N=0N=0N=0. When N=1N=1N=1, the complement is empty and the sum has one term, corresponding to its unique empty configuration. When d=0d=0d=0, the output index set is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.singletDensity

For every natural number ddd, singletDensity⁡(d)\operatorname{singletDensity}(d)singletDensity(d) is the complex matrix indexed by {0,…,d−1}2\{0,\ldots,d-1\}^2{0,…,d−1}2 with entries sd(a,b)sd(a′,b′)‾s_d(a,b)\overline{s_d(a',b')}sd​(a,b)sd​(a′,b′)​, where sd(a,b)=(−1)a/ds_d(a,b)=(-1)^a/\sqrt dsd​(a,b)=(−1)a/d​ when b=d−1−ab=d-1-ab=d−1−a and sd(a,b)=0s_d(a,b)=0sd​(a,b)=0 otherwise. Equivalently, its entry at row (a,b)(a,b)(a,b) and column (a′,b′)(a',b')(a′,b′) is (−1)a+a′/d(-1)^{a+a'}/d(−1)a+a′/d when both b=d−1−ab=d-1-ab=d−1−a and b′=d−1−a′b'=d-1-a'b′=d−1−a′, and is zero otherwise. For d=0d=0d=0, this is the empty matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.singletInsert

For any natural numbers d,Nd,Nd,N and index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, singletInsert⁡(i)\operatorname{singletInsert}(i)singletInsert(i) is the complex matrix whose rows are pairs (a,c)(a,c)(a,c) with a:{0,…,N−1}→{0,…,d−1}a:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}a:{0,…,N−1}→{0,…,d−1} and c∈{0,…,d−1}c\in\{0,\ldots,d-1\}c∈{0,…,d−1}, and whose columns are assignments r:{j:j≠i}→{0,…,d−1}r:\{j:j\ne i\}\to\{0,\ldots,d-1\}r:{j:j=i}→{0,…,d−1}. Its entry is (−1)a(i)/d(-1)^{a(i)}/\sqrt d(−1)a(i)/d​ if c=d−1−a(i)c=d-1-a(i)c=d−1−a(i) and a(j)=r(j)a(j)=r(j)a(j)=r(j) for every j≠ij\ne ij=i, and is zero otherwise. The index iii requires N>0N>0N>0; when d=0d=0d=0, there are no rows, and when N=1N=1N=1, there is exactly one column.

QAlgorithms.Papers.Independent.Intakenext100.P53.spinSinglet

For every natural number ddd, spinSinglet⁡(d)\operatorname{spinSinglet}(d)spinSinglet(d) is the complex Euclidean vector indexed by pairs (a,b)∈{0,…,d−1}2(a,b)\in\{0,\ldots,d-1\}^2(a,b)∈{0,…,d−1}2 whose coordinate is (−1)a/d(-1)^a/\sqrt d(−1)a/d​ if b=d−1−ab=d-1-ab=d−1−a, and 000 otherwise. When d=0d=0d=0, the index set is empty and this is the unique vector in the zero-dimensional space; there are no coordinates at which division by 0\sqrt00​ is evaluated.

QAlgorithms.Papers.Independent.Intakenext100.P53.spinX

For every natural number ddd, let LdL_dLd​ be the complex matrix indexed by 0,…,d−10,\ldots,d-10,…,d−1 whose entry in row rrr, column ttt is (r+1)(d−1−r)\sqrt{(r+1)(d-1-r)}(r+1)(d−1−r)​ when t=r+1t=r+1t=r+1, and is zero otherwise, with real arithmetic under the square root. This defines

Xd=12(Ld+Ld†),X_d=\frac12(L_d+L_d^\dagger),Xd​=21​(Ld​+Ld†​),

where †\dagger† denotes conjugate transpose. No restriction on ddd is imposed; d=0d=0d=0 gives the empty matrix and d=1d=1d=1 gives the zero matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.srm

For natural numbers d,Nd,Nd,N and an index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, let P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}, H=P×{0,…,d−1}H=P\times\{0,\ldots,d-1\}H=P×{0,…,d−1}, and Ri={0,…,d−1}{j:j≠i}R_i=\{0,\ldots,d-1\}^{\{j:j\ne i\}}Ri​={0,…,d−1}{j:j=i}. Define the vector sss and matrix JiJ_iJi​ by

s(a,c)={(−1)a/d,c=d−1−a,0,otherwise,Ji((x,c),r)=s(xi,c) 1{x∣j≠i=r}.s(a,c)= \begin{cases} (-1)^a/\sqrt d,&c=d-1-a,\\ 0,&\text{otherwise}, \end{cases} \qquad J_i((x,c),r)=s(x_i,c)\,\mathbf1_{\{x|_{j\ne i}=r\}}.s(a,c)={(−1)a/d​,0,​c=d−1−a,otherwise,​Ji​((x,c),r)=s(xi​,c)1{x∣j=i​=r}​.

Set σi=(dN−1)−1JiJi†\sigma_i=(d^{N-1})^{-1}J_iJ_i^\daggerσi​=(dN−1)−1Ji​Ji†​, where N−1N-1N−1 is natural-number subtraction, and ρ=∑j=0N−1σj\rho=\sum_{j=0}^{N-1}\sigma_jρ=∑j=0N−1​σj​. Let KKK be the matrix obtained by applying x↦(x)−1x\mapsto(\sqrt x)^{-1}x↦(x​)−1 to ρ\rhoρ through functional calculus, with 0−1=00^{-1}=00−1=0. The declaration defines the complex matrix on HHH by

srm⁡(d,N,i)=KσiK.\operatorname{srm}(d,N,i)=K\sigma_iK.srm(d,N,i)=Kσi​K.

There is no index iii when N=0N=0N=0; d=0d=0d=0 is permitted, in which case HHH is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.swapPorts

For arbitrary natural numbers d,Nd,Nd,N and any indices i,k∈{0,…,N−1}i,k\in\{0,\ldots,N-1\}i,k∈{0,…,N−1}, this defines a complex square matrix Si,kS_{i,k}Si,k​ indexed by functions x,y:{0,…,N−1}→{0,…,d−1}x,y:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}x,y:{0,…,N−1}→{0,…,d−1}, with entries

(Si,k)x,y={1,x(j)=y(τi,k(j)) for every j,0,otherwise,(S_{i,k})_{x,y}= \begin{cases} 1,&x(j)=y(\tau_{i,k}(j))\text{ for every }j,\\ 0,&\text{otherwise}, \end{cases}(Si,k​)x,y​={1,0,​x(j)=y(τi,k​(j)) for every j,otherwise,​

where τi,k\tau_{i,k}τi,k​ exchanges iii and kkk and fixes all other indices. The indices need not be distinct: when i=ki=ki=k, this is the identity matrix. Supplying either index requires N>0N>0N>0; d=0d=0d=0 is allowed and then the matrix has an empty index set.

QAlgorithms.Papers.Independent.Intakenext100.P53.totalCasimir

For all natural numbers d,Nd,Nd,N, define complex d×dd\times dd×d matrices L,Z,X,YL,Z,X,YL,Z,X,Y by Lr,t=(r+1)(d−1−r)L_{r,t}=\sqrt{(r+1)(d-1-r)}Lr,t​=(r+1)(d−1−r)​ if t=r+1t=r+1t=r+1, and zero otherwise; Zr,t=((d−1)/2−r)Z_{r,t}=((d-1)/2-r)Zr,t​=((d−1)/2−r) if r=tr=tr=t, and zero otherwise; X=(L+L†)/2X=(L+L^\dagger)/2X=(L+L†)/2; and Y=(L−L†)/(2i)Y=(L-L^\dagger)/(2\mathrm i)Y=(L−L†)/(2i), with real arithmetic in the entries of L,ZL,ZL,Z. Put P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}, and for a d×dd\times dd×d matrix MMM set

CN(M)x,y=∑q=0N−1Mx(q),y(q)∏0≤r<Nr≠q1{x(r)=y(r)},T(M)=CN(M)⊗Id+IP⊗M.C_N(M)_{x,y} =\sum_{q=0}^{N-1}M_{x(q),y(q)} \prod_{\substack{0\le r<N\\r\ne q}}\mathbf1_{\{x(r)=y(r)\}}, \qquad T(M)=C_N(M)\otimes I_d+I_P\otimes M.CN​(M)x,y​=q=0∑N−1​Mx(q),y(q)​0≤r<Nr=q​∏​1{x(r)=y(r)}​,T(M)=CN​(M)⊗Id​+IP​⊗M.

The declaration defines the matrix on P×{0,…,d−1}P\times\{0,\ldots,d-1\}P×{0,…,d−1}

Kd,Ntotal=T(X)2+T(Y)2+T(Z)2,K^{\mathrm{total}}_{d,N}=T(X)^2+T(Y)^2+T(Z)^2,Kd,Ntotal​=T(X)2+T(Y)2+T(Z)2,

using matrix squares and conjugate transpose †\dagger†. Empty products are 111 and empty sums are zero. No positivity assumptions on d,Nd,Nd,N are imposed; N=0N=0N=0 leaves the single additional ddd-dimensional factor, and d=0d=0d=0 gives an empty matrix.

QAlgorithms.Papers.Independent.Intakenext100.P53.totalComponent

For all natural numbers d,Nd,Nd,N and every complex d×dd\times dd×d matrix MMM, let P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1} and define a matrix CN(M)C_N(M)CN​(M) on PPP by

CN(M)x,y=∑q=0N−1Mx(q),y(q)∏0≤r<Nr≠q1{x(r)=y(r)}.C_N(M)_{x,y} =\sum_{q=0}^{N-1}M_{x(q),y(q)} \prod_{\substack{0\le r<N\\r\ne q}}\mathbf1_{\{x(r)=y(r)\}}.CN​(M)x,y​=q=0∑N−1​Mx(q),y(q)​0≤r<Nr=q​∏​1{x(r)=y(r)}​.

This defines the matrix on P×{0,…,d−1}P\times\{0,\ldots,d-1\}P×{0,…,d−1}

Td,N(M)=CN(M)⊗Id+IP⊗M.T_{d,N}(M)=C_N(M)\otimes I_d+I_P\otimes M.Td,N​(M)=CN​(M)⊗Id​+IP​⊗M.

Here ⊗\otimes⊗ is the Kronecker product, empty products equal 111, and empty sums equal zero. The definition allows N=0N=0N=0, in which case PPP is a singleton and the resulting matrix is MMM under that indexing; it also allows d=0d=0d=0, in which case the total indexing set is empty.

QAlgorithms.Papers.Independent.Intakenext100.P53.transformedSRM

For arbitrary natural numbers d,Nd,Nd,N, every complex matrix OOO indexed by port configurations [d][N][d]^{[N]}[d][N], and every i∈[N]i\in[N]i∈[N], let A=O⊗IdA=O\otimes I_dA=O⊗Id​. For each port jjj, define Sj:C[d][N]∖{j}→C[d][N]×[d]S_j:\mathbb C^{[d]^{[N]\setminus\{j\}}}\to\mathbb C^{[d]^{[N]}\times[d]}Sj​:C[d][N]∖{j}→C[d][N]×[d] by the entry (−1)xj/d(-1)^{x_j}/\sqrt d(−1)xj​/d​ from aaa to (x,c)(x,c)(x,c) when c=d−1−xjc=d-1-x_jc=d−1−xj​ and x∣[N]∖{j}=ax|_{[N]\setminus\{j\}}=ax∣[N]∖{j}​=a, and by 000 otherwise. Put Hj=(d max⁡(N−1,0))−1SjSj†H_j=(d^{\,\max(N-1,0)})^{-1}S_jS_j^\daggerHj​=(dmax(N−1,0))−1Sj​Sj†​, H=∑j∈[N]HjH=\sum_{j\in[N]}H_jH=∑j∈[N]​Hj​, and R=AHA†R=AHA^\daggerR=AHA†. The declaration defines

f(R) (AHiA†) f(R),f(R)=cfc⁡ ⁣(x↦(x)−1,R).f(R)\,(AH_iA^\dagger)\,f(R), \qquad f(R)=\operatorname{cfc}\!\left(x\mapsto(\sqrt x)^{-1},R\right).f(R)(AHi​A†)f(R),f(R)=cfc(x↦(x​)−1,R).

Thus the inverse-square-root function is applied by continuous functional calculus, with value zero at x=0x=0x=0, rather than requiring an invertible matrix. No normalization, positivity, or unitarity condition is imposed on OOO, and no lower bound is imposed on ddd. The argument i∈[N]i\in[N]i∈[N] cannot be supplied when N=0N=0N=0.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 2026

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

View graph

Get started

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

About Prove2Me

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

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me