Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Square-root measurements and degradation of the resource state in port-based teleportation scheme

Definition
QAlgorithms_Papers_Independent_Extend50_P04

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

prove2quantum

The objects the formalized statements of Square-root measurements and degradation of the resource state in port-based teleportation scheme (arXiv:2105.14886) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Alice: PDF p.5: Alice's N ports followed by input A0.
  • Whole: PDF pp.14,19: Alice/input followed by Bob/reference, retaining every subsystem.
  • pbtBellProjector: PDF p.5: normalized Bell projector on selected port/input, identity on spectators.
  • pbtSignal: PDF p.5, (5): actual signal state; the spectator normalization is d^{-(N-1)}.
  • signalSum: PDF p.5, (7): signal sum, of trace N rather than one.
  • inverseRoot: PDF pp.5,9: spectral inverse square root, extended by zero on the kernel.
  • supportEffect: PDF pp.5,9, (7),(29): support-only effect, before the nullspace completion.
  • pbtSupportComplement: PDF p.5, (8): missing support projection.
  • fullEffect: PDF p.5, (9): full POVM effect, including an equal share of the missing projection.
  • positiveRoot: PDF pp.10,14: positive functional-calculus square root, never an arbitrary square root.
  • transposeInput: PDF p.6, (13): transpose the input factor only, without complex conjugation.
  • pbtInputSwap: PDF p.6: the physical swap of Alice port a with the input.
  • transposedSwap: PDF p.6, (14): partially transposed swap on the actual tensor registers.
  • portPermutation: PDF p.6, (11): port permutation, with identity on input.
  • pbtCollectiveAction: PDF p.6, (10): U on every Alice port and conjugate U on input.
  • extendInput: PDF pp.5,22: extend an operation on Alice's N ports by identity on input.
  • deletePort: PDF pp.14,22: spectator coordinates in increasing order, deleting selected port a.
  • extendUnused: PDF pp.22-24: embed the (N-1)-port operation only on unconsumed Alice ports.
  • initialState: PDF pp.4,14: Bell input/reference and resource (O tensor I)|Phi+>, in all registers.
  • idealState: PDF p.14, (73), p.22: ideal pairings, with O on the unused Alice ports only.
  • pbtLuedersBranch: PDF p.14, (74): actual unnormalized branch from the full Lueders instrument.
  • normalizedBranch: PDF pp.14,19: normalize a nonzero branch; the zero vector at zero probability carries zero weight.
  • recyclingFidelity: PDF p.14, (75): Born-weighted UNSQUARED overlaps of entire ideal/output states. The physical source operations have Tr(O dagger O)=d^N, making initial/ideal vectors unit vectors.
  • nonoptimalFidelity: PDF p.14: unoptimized one-round resource has O_N=I and O_(N-1)=I.
  • irrepDimension: PDF pp.7-8: symmetric-group irrep dimension from the actual regular Young ideal.
  • pbtOneBoxSuccessor: PDF p.7: one-box branching means containment between diagrams of the specified successive sizes.
  • forbiddenDimension: PDF pp.7,10: removed height-(d+1) successor dimension, zero when no such shape occurs. Summing the independently constructed Specht dimensions avoids an unspecified theta parameter.
  • successorSum: PDF pp.11-12: sum over physical successors only; the forbidden successor is not included.
  • overlapFormula: PDF p.12, (57): explicit two-regime full-space trace expression.
  • qubitBracket: PDF pp.12-13: binomial bracket; all coefficient subtraction occurs in the reals.
  • qubitOverlapSum: PDF pp.12-13: sum with k=floor((N-1)/2); n=N-1 is used to avoid truncated N-1.
  • resourceOperation: PDF p.16, (84): resource operation from nonnegative normalized shape coefficients.
  • teleportationObjective: PDF p.5, (6): physical entanglement fidelity objective, not the recycling root fidelity.
  • IsOptimalCoefficients: PDF pp.5,16,21: coefficients selected by the actual optimized deterministic channel objective. No unspecified teleportation matrix is supplied. The zero-port case is the normalized empty resource.
  • resourceState: PDF p.17, (89): normalized entire bipartite resource, retaining both halves.
  • resourceFidelity: PDF pp.17,26: unsquared pure-state overlap between unoptimized and optimized resources.
  • qubitRaw: PDF pp.17,25: raw trigonometric entries (87)/(E5), before Euclidean normalization. The N=0 extension is the single empty shape, not division by sin(0).
  • qubitVector: PDF p.25: the explicit Euclidean normalization required after (E5).
  • qubitMatrix: PDF p.25, (E2)-(E4): concrete tridiagonal matrix, including the printed 1/4 scale. At the one-dimensional N=1 boundary use the first diagonal entry 1/4.
  • qubitCoefficient: PDF p.17: invalid successor coefficients are zero; valid terminal coefficients are retained.
  • qubitCoefficients: PDF pp.16-17: in dimension two a physical shape is uniquely labelled by its second-row length.
  • rowCoefficient: PDF p.17, (90): read the coefficient of a given second-row length from a shape vector.
  • spinFormula: PDF p.26, (G6): twice-spin t=2j indexing retains parity and integral factorial arguments. The real exponent N-2 avoids truncated natural subtraction at N=1.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_SchurWeylDecomposition
import Definitions.Def_QAlgorithms_Defs_SchurCharacters

/-!
Statements from Studzinski, Mozrzymas, Kopszak, arXiv:2105.14886v4.
All page numbers below are PDF pages. Local constructions use the fixed computational basis.
`n` in recycling statements means N-1, so there is always at least one port.
Source corrections and deferred PRIR/multiround targets are recorded in the unit artifacts.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P04

open QAlgorithms
open scoped Matrix ComplexConjugate ComplexOrder

attribute [local instance] Classical.propDecidable

/-- PDF p.5: Alice's N ports followed by input A0. -/
abbrev Alice (d N : ℕ) := (Fin N → Fin d) × Fin d

/-- PDF pp.14,19: Alice/input followed by Bob/reference, retaining every subsystem. -/
abbrev Whole (d N : ℕ) := Alice d N × Alice d N

/-- PDF p.5: normalized Bell projector on selected port/input, identity on spectators. -/
def pbtBellProjector (d N : ℕ) (a : Fin N) : Matrix (Alice d N) (Alice d N) ℂ :=
  fun x y => if x.1 a = x.2 ∧ y.1 a = y.2 ∧ ∀ i, i ≠ a → x.1 i = y.1 i
    then (d : ℂ)⁻¹ else 0

/-- PDF p.5, (5): actual signal state; the spectator normalization is d^{-(N-1)}. -/
def pbtSignal (d N : ℕ) (a : Fin N) : Matrix (Alice d N) (Alice d N) ℂ :=
  ((d : ℂ) ^ (N - 1))⁻¹ • pbtBellProjector d N a

/-- PDF p.5, (7): signal sum, of trace N rather than one. -/
def signalSum (d N : ℕ) : Matrix (Alice d N) (Alice d N) ℂ :=
  ∑ a, pbtSignal d N a

/-- PDF pp.5,9: spectral inverse square root, extended by zero on the kernel. -/
def inverseRoot (d N : ℕ) : Matrix (Alice d N) (Alice d N) ℂ :=
  cfc (fun x : ℝ => (Real.sqrt x)⁻¹) (signalSum d N)

/-- PDF pp.5,9, (7),(29): support-only effect, before the nullspace completion. -/
def supportEffect (d N : ℕ) (a : Fin N) : Matrix (Alice d N) (Alice d N) ℂ :=
  inverseRoot d N * pbtSignal d N a * inverseRoot d N

/-- PDF p.5, (8): missing support projection. -/
def pbtSupportComplement (d N : ℕ) : Matrix (Alice d N) (Alice d N) ℂ :=
  1 - ∑ a, supportEffect d N a

/-- PDF p.5, (9): full POVM effect, including an equal share of the missing projection. -/
def fullEffect (d N : ℕ) (a : Fin N) : Matrix (Alice d N) (Alice d N) ℂ :=
  supportEffect d N a + (N : ℂ)⁻¹ • pbtSupportComplement d N

/-- PDF pp.10,14: positive functional-calculus square root, never an arbitrary square root. -/
def positiveRoot {ι : Type*} [Fintype ι] [DecidableEq ι] (A : Matrix ι ι ℂ) : Matrix ι ι ℂ :=
  cfc Real.sqrt A

/-- PDF p.6, (13): transpose the input factor only, without complex conjugation. -/
def transposeInput {d N : ℕ} (A : Matrix (Alice d N) (Alice d N) ℂ) :
    Matrix (Alice d N) (Alice d N) ℂ :=
  fun x y => A (x.1, y.2) (y.1, x.2)

/-- PDF p.6: the physical swap of Alice port a with the input. -/
def pbtInputSwap (d N : ℕ) (a : Fin N) : Matrix (Alice d N) (Alice d N) ℂ :=
  fun x y => if x = (Function.update y.1 a y.2, y.1 a) then 1 else 0

/-- PDF p.6, (14): partially transposed swap on the actual tensor registers. -/
def transposedSwap (d N : ℕ) (a : Fin N) : Matrix (Alice d N) (Alice d N) ℂ :=
  transposeInput (pbtInputSwap d N a)

/-- PDF p.6, (11): port permutation, with identity on input. -/
def portPermutation (d N : ℕ) (pi : Equiv.Perm (Fin N)) : Matrix (Alice d N) (Alice d N) ℂ :=
  Matrix.kronecker (Schur.tensorPermutation d N pi) 1

/-- PDF p.6, (10): U on every Alice port and conjugate U on input. -/
def pbtCollectiveAction (d N : ℕ) (U : Matrix (Fin d) (Fin d) ℂ) :
    Matrix (Alice d N) (Alice d N) ℂ :=
  fun x y => (∏ i, U (x.1 i) (y.1 i)) * star (U x.2 y.2)

/-- PDF pp.5,22: extend an operation on Alice's N ports by identity on input. -/
def extendInput {d N : ℕ} (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ) :
    Matrix (Alice d N) (Alice d N) ℂ :=
  Matrix.kronecker O 1

/-- PDF pp.14,22: spectator coordinates in increasing order, deleting selected port a. -/
def deletePort {d n : ℕ} (a : Fin (n + 1)) (x : (Fin (n + 1) → Fin d)) : (Fin n → Fin d) :=
  fun i => x (a.succAbove i)

/-- PDF pp.22-24: embed the (N-1)-port operation only on unconsumed Alice ports. -/
def extendUnused {d n : ℕ} (a : Fin (n + 1)) (O : Matrix ((Fin n → Fin d)) ((Fin n → Fin d)) ℂ) :
    Matrix (Alice d (n + 1)) (Alice d (n + 1)) ℂ :=
  fun x y => if x.1 a = y.1 a ∧ x.2 = y.2
    then O (deletePort a x.1) (deletePort a y.1) else 0

/-- PDF pp.4,14: Bell input/reference and resource (O tensor I)|Phi+>, in all registers. -/
def initialState (d N : ℕ) (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ) :
    EuclideanSpace ℂ (Whole d N) :=
  WithLp.toLp 2 fun x => if x.1.2 = x.2.2
    then O x.1.1 x.2.1 / (Real.sqrt ((d : ℝ) ^ (N + 1)) : ℂ) else 0

/-- PDF p.14, (73), p.22: ideal pairings, with O on the unused Alice ports only. -/
def idealState (d n : ℕ) (a : Fin (n + 1)) (O : Matrix ((Fin n → Fin d)) ((Fin n → Fin d)) ℂ) :
    EuclideanSpace ℂ (Whole d (n + 1)) :=
  WithLp.toLp 2 fun x => if x.1.1 a = x.1.2 ∧ x.2.1 a = x.2.2 then
    O (deletePort a x.1.1) (deletePort a x.2.1) /
      ((d : ℂ) * (Real.sqrt ((d : ℝ) ^ n) : ℂ)) else 0

/-- PDF p.14, (74): actual unnormalized branch from the full Lueders instrument. -/
def pbtLuedersBranch (d N : ℕ) (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ) (a : Fin N) :
    EuclideanSpace ℂ (Whole d N) :=
  act (Matrix.kronecker (positiveRoot (fullEffect d N a)) 1) (initialState d N O)

/-- PDF pp.14,19: normalize a nonzero branch; the zero vector at zero probability carries zero weight. -/
def normalizedBranch (d N : ℕ) (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ) (a : Fin N) :
    EuclideanSpace ℂ (Whole d N) :=
  ((‖pbtLuedersBranch d N O a‖ : ℂ)⁻¹) • pbtLuedersBranch d N O a

/-- PDF p.14, (75): Born-weighted UNSQUARED overlaps of entire ideal/output states.
The physical source operations have Tr(O dagger O)=d^N, making initial/ideal vectors unit vectors. -/
def recyclingFidelity (d n : ℕ) (O : Matrix ((Fin (n + 1) → Fin d)) ((Fin (n + 1) → Fin d)) ℂ)
    (R : Matrix ((Fin n → Fin d)) ((Fin n → Fin d)) ℂ) : ℝ :=
  ∑ a : Fin (n + 1), ‖pbtLuedersBranch d (n + 1) O a‖ ^ 2 *
    ‖inner ℂ (idealState d n a R) (normalizedBranch d (n + 1) O a)‖

/-- PDF p.14: unoptimized one-round resource has O_N=I and O_(N-1)=I. -/
def nonoptimalFidelity (d n : ℕ) : ℝ := recyclingFidelity d n 1 1

/-- PDF pp.7-8: symmetric-group irrep dimension from the actual regular Young ideal. -/
def irrepDimension {d N : ℕ} (mu : Schur.Partition d N) : ℕ :=
  Module.finrank ℂ (Schur.spechtSpace mu)

/-- PDF p.7: one-box branching means containment between diagrams of the specified successive sizes. -/
def pbtOneBoxSuccessor {d e n : ℕ} (alpha : Schur.Partition d n) (mu : Schur.Partition e (n + 1)) : Prop :=
  alpha.val ≤ mu.val

/-- PDF pp.7,10: removed height-(d+1) successor dimension, zero when no such shape occurs.
Summing the independently constructed Specht dimensions avoids an unspecified theta parameter. -/
def forbiddenDimension {d n : ℕ} (alpha : Schur.Partition d n) : ℝ :=
  ∑ theta : Schur.Partition (d + 1) (n + 1),
    if pbtOneBoxSuccessor alpha theta ∧ theta.val.colLen 0 = d + 1 then irrepDimension theta else 0

/-- PDF pp.11-12: sum over physical successors only; the forbidden successor is not included. -/
def successorSum {d n : ℕ} (alpha : Schur.Partition d n) : ℝ :=
  ∑ nu : Schur.Partition d (n + 1),
    if pbtOneBoxSuccessor alpha nu then Real.sqrt (Schur.schurDimension nu * irrepDimension nu) else 0

/-- PDF p.12, (57): explicit two-regime full-space trace expression. -/
def overlapFormula (d n : ℕ) : ℝ :=
  ∑ alpha : Schur.Partition d n,
    if alpha.val.colLen 0 < d then (successorSum alpha) ^ 2 / (n + 1 : ℝ)
    else Real.sqrt (irrepDimension alpha) * (successorSum alpha) ^ 2 /
      (Real.sqrt ((n + 1 : ℝ) * irrepDimension alpha - forbiddenDimension alpha) *
        Real.sqrt (n + 1 : ℝ))

/-- PDF pp.12-13: binomial bracket; all coefficient subtraction occurs in the reals. -/
def qubitBracket (N l : ℕ) : ℝ :=
  ((N : ℝ) - 2 * l + 1) * Real.sqrt ((Nat.choose (N + 1) l : ℝ) / (N + 1 : ℝ)) +
  ((N : ℝ) - 2 * l - 1) * Real.sqrt ((Nat.choose (N + 1) (l + 1) : ℝ) / (N + 1 : ℝ))

/-- PDF pp.12-13: sum with k=floor((N-1)/2); n=N-1 is used to avoid truncated N-1. -/
def qubitOverlapSum (n : ℕ) : ℝ :=
  ∑ l ∈ Finset.range (n / 2 + 1),
    Real.sqrt (((n + 2 : ℝ) - l) * (l + 1 : ℝ) / (n + 2 : ℝ)) *
      qubitBracket (n + 1) l ^ 2

/-- PDF p.16, (84): resource operation from nonnegative normalized shape coefficients. -/
def resourceOperation (d N : ℕ) (v : Schur.Partition d N → ℝ) :
    Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ :=
  (Real.sqrt ((d : ℝ) ^ N) : ℂ) • ∑ mu,
    ((v mu / Real.sqrt (irrepDimension mu * Schur.schurDimension mu) : ℝ) : ℂ) •
      Schur.isotypicProjector mu

/-- PDF p.5, (6): physical entanglement fidelity objective, not the recycling root fidelity. -/
def teleportationObjective (d N : ℕ) (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ)
    (M : Fin N → Matrix (Alice d N) (Alice d N) ℂ) : ℝ :=
  (∑ a, ((extendInput O)ᴴ * M a * extendInput O * pbtSignal d N a).trace.re) / (d : ℝ) ^ 2

/-- PDF pp.5,16,21: coefficients selected by the actual optimized deterministic channel objective.
No unspecified teleportation matrix is supplied. The zero-port case is the normalized empty resource. -/
def IsOptimalCoefficients (d N : ℕ) (v : Schur.Partition d N → ℝ) : Prop :=
  (∀ mu, 0 ≤ v mu) ∧ (∑ mu, v mu ^ 2) = 1 ∧
    (0 < N → ∀ (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ)
      (M : Fin N → Matrix (Alice d N) (Alice d N) ℂ),
      (Oᴴ * O).trace = (d : ℂ) ^ N →
      (∀ a, (M a).PosSemidef) → (∑ a, M a) = 1 →
      teleportationObjective d N O M ≤
        teleportationObjective d N (resourceOperation d N v) (fullEffect d N))

/-- PDF p.17, (89): normalized entire bipartite resource, retaining both halves. -/
def resourceState (d N : ℕ) (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ) :
    EuclideanSpace ℂ ((Fin N → Fin d) × (Fin N → Fin d)) :=
  WithLp.toLp 2 fun x => O x.1 x.2 / (Real.sqrt ((d : ℝ) ^ N) : ℂ)

/-- PDF pp.17,26: unsquared pure-state overlap between unoptimized and optimized resources. -/
def resourceFidelity (d N : ℕ) (O : Matrix ((Fin N → Fin d)) ((Fin N → Fin d)) ℂ) : ℝ :=
  ‖inner ℂ (resourceState d N 1) (resourceState d N O)‖

/-- PDF pp.17,25: raw trigonometric entries (87)/(E5), before Euclidean normalization.
The N=0 extension is the single empty shape, not division by sin(0). -/
def qubitRaw (N : ℕ) (l : Fin (N / 2 + 1)) : ℝ :=
  if N = 0 then 1 else
  if N % 2 = 0 then
    (-1 : ℝ) ^ (N / 2 - l.val) *
      (Real.sin ((((N : ℝ) + 2) / 2 - l.val) * N * Real.pi / (N + 2)) -
        Real.sin (((N : ℝ) / 2 - l.val) * N * Real.pi / (N + 2))) /
      Real.sin ((N : ℝ) * Real.pi / (N + 2))
  else
    (-1 : ℝ) ^ ((N - 1) / 2 - l.val) *
      Real.sin ((((N : ℝ) + 1) / 2 - l.val) * N * Real.pi / (N + 2)) /
      Real.sin ((N : ℝ) * Real.pi / (N + 2))

/-- PDF p.25: the explicit Euclidean normalization required after (E5). -/
def qubitVector (N : ℕ) (l : Fin (N / 2 + 1)) : ℝ :=
  qubitRaw N l / Real.sqrt (∑ j, qubitRaw N j ^ 2)

/-- PDF p.25, (E2)-(E4): concrete tridiagonal matrix, including the printed 1/4 scale.
At the one-dimensional N=1 boundary use the first diagonal entry 1/4. -/
def qubitMatrix (N : ℕ) : Matrix (Fin (N / 2 + 1)) (Fin (N / 2 + 1)) ℝ :=
  fun i j => (1 / 4 : ℝ) * (if i = j then
    2 - (if i.val = 0 then 1 else 0) - (if N % 2 = 0 ∧ i.val = N / 2 then 1 else 0)
    else if i.val + 1 = j.val ∨ j.val + 1 = i.val then 1 else 0)

/-- PDF p.17: invalid successor coefficients are zero; valid terminal coefficients are retained. -/
def qubitCoefficient (N l : ℕ) : ℝ :=
  if h : l < N / 2 + 1 then qubitVector N ⟨l, h⟩ else 0

/-- PDF pp.16-17: in dimension two a physical shape is uniquely labelled by its second-row length. -/
def qubitCoefficients (N : ℕ) (mu : Schur.Partition 2 N) : ℝ :=
  qubitCoefficient N (mu.val.rowLen 1)

/-- PDF p.17, (90): read the coefficient of a given second-row length from a shape vector. -/
def rowCoefficient (N : ℕ) (v : Schur.Partition 2 N → ℝ) (l : ℕ) : ℝ :=
  ∑ mu, if mu.val.rowLen 1 = l then v mu else 0

/-- PDF p.26, (G6): twice-spin t=2j indexing retains parity and integral factorial arguments.
The real exponent N-2 avoids truncated natural subtraction at N=1. -/
def spinFormula (N : ℕ) : ℝ :=
  Real.sqrt ((N.factorial : ℝ) / ((2 : ℝ) ^ ((N : ℝ) - 2) * (N + 2 : ℝ))) *
    ∑ t ∈ (Finset.range (N + 1)).filter (fun t => t % 2 = N % 2),
      (t + 1 : ℝ) * Real.sin (Real.pi * (t + 1 : ℝ) / (N + 2 : ℝ)) /
        Real.sqrt ((((N - t) / 2).factorial : ℝ) * (((N + t) / 2 + 1).factorial : ℝ))

/-! Sanity examples pin indexing and total-function boundary behavior; no theorem proofs. -/

example {d N : ℕ} (M : Matrix (Alice d N) (Alice d N) ℂ) :
    transposeInput (transposeInput M) = M := rfl

example (d N : ℕ) (a : Fin N) :
    fullEffect d N a = supportEffect d N a + (N : ℂ)⁻¹ • pbtSupportComplement d N := rfl

example {d : ℕ} (x : (Fin 1 → Fin d)) (i : Fin 0) : deletePort (0 : Fin 1) x i = x ((0 : Fin 1).succAbove i) := rfl

example {d : ℕ} (O : Matrix ((Fin 0 → Fin d)) ((Fin 0 → Fin d)) ℂ)
    (x : Whole d 1) :
    idealState d 0 (0 : Fin 1) O x =
      if x.1.1 0 = x.1.2 ∧ x.2.1 0 = x.2.2 then
        O (deletePort 0 x.1.1) (deletePort 0 x.2.1) / (d : ℂ) else 0 := by
  simp [idealState]

example : qubitRaw 0 (0 : Fin 1) = 1 := by simp [qubitRaw]

example : qubitCoefficient 1 1 = 0 := by simp [qubitCoefficient]

example : qubitMatrix 1 (0 : Fin 1) 0 = (1 / 4 : ℝ) := by norm_num [qubitMatrix]

end QAlgorithms.Papers.Independent.Extend50.P04
Source
Square-root measurements and degradation of the resource state in port-based teleportation scheme, arXiv:2105.14886v4, https://arxiv.org/abs/2105.14886v4
Read-back

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

QAlgorithms.Papers.Independent.Extend50.P04.Alice

For any natural numbers d,Nd,Nd,N, including zero, Alice(d,N)\mathrm{Alice}(d,N)Alice(d,N) is the set of pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}. If d=0d=0d=0, this set is empty. If N=0N=0N=0, the function uuu is the unique empty function, so the set is naturally identified with {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}.

QAlgorithms.Papers.Independent.Extend50.P04.IsOptimalCoefficients

For arbitrary natural numbers d,Nd,Nd,N and a real function vvv on the set Pd,N\mathcal P_{d,N}Pd,N​ of Young diagrams with NNN cells and first column length at most ddd, this predicate requires v(μ)≥0v(\mu)\ge0v(μ)≥0 for every μ\muμ, ∑μ∈Pd,Nv(μ)2=1\sum_{\mu\in\mathcal P_{d,N}}v(\mu)^2=1∑μ∈Pd,N​​v(μ)2=1, and, if N>0N>0N>0, the following inequality for every complex matrix OOO on X={0,…,d−1}{0,…,N−1}X=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}X={0,…,d−1}{0,…,N−1} and every family (Ma)a=0N−1(M_a)_{a=0}^{N-1}(Ma​)a=0N−1​ of complex matrices on A=X×{0,…,d−1}A=X\times\{0,\ldots,d-1\}A=X×{0,…,d−1}:

tr⁡(O†O)=dN,Ma⪰0 for every a,∑aMa=IA⟹Td,N(O,M)≤Td,N(Rd,N(v),E).\operatorname{tr}(O^\dagger O)=d^N,\quad M_a\succeq0\ \text{for every }a,\quad \sum_aM_a=I_A \quad\Longrightarrow\quad \mathcal T_{d,N}(O,M)\le \mathcal T_{d,N}(R_{d,N}(v),E).tr(O†O)=dN,Ma​⪰0 for every a,a∑​Ma​=IA​⟹Td,N​(O,M)≤Td,N​(Rd,N​(v),E).

Here

Td,N(O,M)=∑aRe⁡tr⁡((O⊗Id)†Ma(O⊗Id)σa)d2,Ea=CσaC+1N(IA−∑bCσbC),C=h ⁣(∑aσa),h(t)=(t)−1,\mathcal T_{d,N}(O,M)= \frac{\sum_a\operatorname{Re}\operatorname{tr} ((O\otimes I_d)^\dagger M_a(O\otimes I_d)\sigma_a)}{d^2}, \qquad E_a=C\sigma_aC+\frac1N\left(I_A-\sum_bC\sigma_bC\right), \qquad C=h\!\left(\sum_a\sigma_a\right),\quad h(t)=(\sqrt t)^{-1},Td,N​(O,M)=d2∑a​Retr((O⊗Id​)†Ma​(O⊗Id​)σa​)​,Ea​=Cσa​C+N1​(IA​−b∑​Cσb​C),C=h(a∑​σa​),h(t)=(t​)−1,

where hhh is applied by continuous functional calculus. For x=(x1,x2),y=(y1,y2)∈Ax=(x_1,x_2),y=(y_1,y_2)\in Ax=(x1​,x2​),y=(y1​,y2​)∈A, the entry (σa)x,y(\sigma_a)_{x,y}(σa​)x,y​ is (dN−1)−1d−1(d^{N-1})^{-1}d^{-1}(dN−1)−1d−1 if x1(a)=x2x_1(a)=x_2x1​(a)=x2​, y1(a)=y2y_1(a)=y_2y1​(a)=y2​, and x1(i)=y1(i)x_1(i)=y_1(i)x1​(i)=y1​(i) for every i≠ai\ne ai=a, and is zero otherwise; the exponent N−1N-1N−1 uses subtraction truncated at zero. The matrix on the right is

Rd,N(v)=dN∑μ∈Pd,Nv(μ)fμmμΠμ,Πμ=fμN!∑π∈SNχμ(π−1)Tπ.R_{d,N}(v)=\sqrt{d^N}\sum_{\mu\in\mathcal P_{d,N}} \frac{v(\mu)}{\sqrt{f_\mu m_\mu}}\Pi_\mu, \qquad \Pi_\mu=\frac{f_\mu}{N!}\sum_{\pi\in S_N} \chi_\mu(\pi^{-1})T_\pi.Rd,N​(v)=dN​μ∈Pd,N​∑​fμ​mμ​​v(μ)​Πμ​,Πμ​=N!fμ​​π∈SN​∑​χμ​(π−1)Tπ​.

Here (Tπ)y,x=1(T_\pi)_{y,x}=1(Tπ​)y,x​=1 exactly when y=x∘π−1y=x\circ\pi^{-1}y=x∘π−1 and is zero otherwise. Using the fixed numbering of μ\muμ’s cells, let Rμ,CμR_\mu,C_\muRμ​,Cμ​ be its row-preserving and column-preserving permutations, and let VμV_\muVμ​ be the span in the complex Euclidean space indexed by SNS_NSN​ of ∑a∈Rμ∑b∈Cμsgn⁡(b)ehab\sum_{a\in R_\mu}\sum_{b\in C_\mu}\operatorname{sgn}(b)e_{hab}∑a∈Rμ​​∑b∈Cμ​​sgn(b)ehab​ for h∈SNh\in S_Nh∈SN​. Then fμ=dim⁡CVμf_\mu=\dim_{\mathbb C}V_\mufμ​=dimC​Vμ​, χμ(π)=tr⁡(LπPμ)\chi_\mu(\pi)=\operatorname{tr}(L_\pi P_\mu)χμ​(π)=tr(Lπ​Pμ​) with Lπeh=eπhL_\pi e_h=e_{\pi h}Lπ​eh​=eπh​ and PμP_\muPμ​ the orthogonal projection onto VμV_\muVμ​, and mμm_\mumμ​ is the number of fillings of μ\muμ by {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} weakly increasing along rows and strictly increasing down columns. Real scalars are embedded in C\mathbb CC where needed; square roots and inverses are total, with t=0\sqrt t=0t​=0 for t≤0t\le0t≤0 and 0−1=00^{-1}=00−1=0. When N=0N=0N=0, the comparison condition is vacuous, while nonnegativity and the sum-of-squares condition still apply. When d=0<Nd=0<Nd=0<N, the coefficient index set is empty, so the required sum-of-squares equality cannot hold.

QAlgorithms.Papers.Independent.Extend50.P04.Whole

For any natural numbers d,Nd,Nd,N, including zero, Whole(d,N)\mathrm{Whole}(d,N)Whole(d,N) is the set of ordered pairs ((u,s),(v,t))((u,s),(v,t))((u,s),(v,t)), where u,v:{0,…,N−1}→{0,…,d−1}u,v:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}u,v:{0,…,N−1}→{0,…,d−1} and s,t∈{0,…,d−1}s,t\in\{0,\ldots,d-1\}s,t∈{0,…,d−1}. If d=0d=0d=0, this set is empty; if N=0N=0N=0, both functions are empty and the set is naturally identified with {0,…,d−1}2\{0,\ldots,d-1\}^2{0,…,d−1}2.

QAlgorithms.Papers.Independent.Extend50.P04.deletePort

For arbitrary natural numbers d,nd,nd,n, an index a∈{0,…,n}a\in\{0,\ldots,n\}a∈{0,…,n}, and a word x:{0,…,n}→{0,…,d−1}x:\{0,\ldots,n\}\to\{0,\ldots,d-1\}x:{0,…,n}→{0,…,d−1}, this defines the word obtained by omitting coordinate aaa while preserving the order of the remaining coordinates:

(del⁡ax)(i)={x(i),i<a,x(i+1),a≤i,0≤i<n.(\operatorname{del}_a x)(i) = \begin{cases} x(i),&i<a,\\ x(i+1),&a\le i, \end{cases} \qquad 0\le i<n.(dela​x)(i)={x(i),x(i+1),​i<a,a≤i,​0≤i<n.

For n=0n=0n=0, the result is the unique empty word. For d=0d=0d=0, no such input word xxx exists, since its domain has n+1≥1n+1\ge1n+1≥1 elements.

QAlgorithms.Papers.Independent.Extend50.P04.extendInput

For arbitrary natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by words u:{0,…,N−1}→{0,…,d−1}u:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}u:{0,…,N−1}→{0,…,d−1}, this defines a complex matrix on pairs (u,s)(u,s)(u,s), with s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

O~(u,s),(v,t)={Ou,v,s=t,0,s≠t.\widetilde O_{(u,s),(v,t)} = \begin{cases} O_{u,v},&s=t,\\ 0,&s\ne t. \end{cases}O(u,s),(v,t)​={Ou,v​,0,​s=t,s=t.​

Equivalently, it is O⊗IdO\otimes I_dO⊗Id​. No property of OOO is assumed. When N=0N=0N=0, OOO is indexed by the single empty word, and the result is its sole entry times IdI_dId​; when d=0d=0d=0, the resulting matrix has an empty index set.

QAlgorithms.Papers.Independent.Extend50.P04.extendUnused

For arbitrary natural numbers d,nd,nd,n, an index a∈{0,…,n}a\in\{0,\ldots,n\}a∈{0,…,n}, and any complex matrix OOO indexed by words of length nnn over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, this defines a complex matrix indexed by pairs (u,s)(u,s)(u,s), where uuu has length n+1n+1n+1 and s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

E(u,s),(v,t)={Odel⁡au,del⁡av,u(a)=v(a) and s=t,0,otherwise.E_{(u,s),(v,t)} = \begin{cases} O_{\operatorname{del}_a u,\operatorname{del}_a v},&u(a)=v(a)\ \text{and }s=t,\\ 0,&\text{otherwise}. \end{cases}E(u,s),(v,t)​={Odela​u,dela​v​,0,​u(a)=v(a) and s=t,otherwise.​

Here (del⁡au)(i)=u(i)(\operatorname{del}_a u)(i)=u(i)(dela​u)(i)=u(i) for i<ai<ai<a and u(i+1)u(i+1)u(i+1) for i≥ai\ge ai≥a, for 0≤i<n0\le i<n0≤i<n. No property of OOO is assumed. When n=0n=0n=0, both deleted words are empty, so the result is the sole entry of OOO times the identity on the pair of remaining coordinates; when d=0d=0d=0, the resulting matrix index set is empty.

QAlgorithms.Papers.Independent.Extend50.P04.forbiddenDimension

For natural numbers d,nd,nd,n and a Young diagram α\alphaα with nnn cells and first column length at most ddd, this defines the real number

Fα=∑θ a Young diagram∣θ∣=n+1, colLen⁡θ(0)≤d+1α⊆θ, colLen⁡θ(0)=d+1fθ.F_\alpha= \sum_{\substack{\theta\text{ a Young diagram}\\ |\theta|=n+1,\ \operatorname{colLen}_\theta(0)\le d+1\\ \alpha\subseteq\theta,\ \operatorname{colLen}_\theta(0)=d+1}} f_\theta.Fα​=θ a Young diagram∣θ∣=n+1, colLenθ​(0)≤d+1α⊆θ, colLenθ​(0)=d+1​∑​fθ​.

Here fθf_\thetafθ​ is a natural number regarded as a real number: using the fixed numbering of θ\thetaθ’s cells by {0,…,n}\{0,\ldots,n\}{0,…,n}, let Rθ,Cθ⊆Sn+1R_\theta,C_\theta\subseteq S_{n+1}Rθ​,Cθ​⊆Sn+1​ consist of permutations preserving rows and columns, respectively, and define fθf_\thetafθ​ to be the complex dimension of the span of the vectors ∑a∈Rθ∑b∈Cθsgn⁡(b)ehab\sum_{a\in R_\theta}\sum_{b\in C_\theta}\operatorname{sgn}(b)e_{hab}∑a∈Rθ​​∑b∈Cθ​​sgn(b)ehab​ for h∈Sn+1h\in S_{n+1}h∈Sn+1​, inside the complex Euclidean space indexed by Sn+1S_{n+1}Sn+1​. The sum is zero if no θ\thetaθ satisfies its conditions. The parameters may be zero whenever the argument α\alphaα exists.

QAlgorithms.Papers.Independent.Extend50.P04.fullEffect

For any natural numbers d,Nd,Nd,N and any a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, let XXX consist of pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, and define

σb((u,s),(v,t))=(dN−1)−1d−1 1{u(b)=s, v(b)=t, ∀i≠b, u(i)=v(i)},R=f ⁣(∑b=0N−1σb),f(r)=(r)−1,\sigma_b((u,s),(v,t)) =(d^{N-1})^{-1}d^{-1} \,\mathbf 1_{\{u(b)=s,\ v(b)=t,\ \forall i\ne b,\ u(i)=v(i)\}}, \qquad R=f\!\left(\sum_{b=0}^{N-1}\sigma_b\right), \quad f(r)=(\sqrt r)^{-1},σb​((u,s),(v,t))=(dN−1)−1d−11{u(b)=s, v(b)=t, ∀i=b, u(i)=v(i)}​,R=f(b=0∑N−1​σb​),f(r)=(r​)−1,

using the real continuous functional calculus. Then fullEffect(d,N,a)\mathrm{fullEffect}(d,N,a)fullEffect(d,N,a) is

RσaR+1N(IX−∑b=0N−1RσbR).R\sigma_aR+\frac1N\left(I_X-\sum_{b=0}^{N-1}R\sigma_bR\right).Rσa​R+N1​(IX​−b=0∑N−1​Rσb​R).

Here IXI_XIX​ is the identity matrix, the indicator takes values zero and one, N−1N-1N−1 uses natural-number subtraction, and scalar reciprocals are in C\mathbb CC, with 0−1=00^{-1}=00−1=0; also f(r)=0f(r)=0f(r)=0 for r≤0r\le0r≤0. The parameter aaa requires N>0N>0N>0, so no such parameter exists at N=0N=0N=0; d=0d=0d=0 gives an empty index set.

QAlgorithms.Papers.Independent.Extend50.P04.idealState

For natural numbers d,nd,nd,n, an index a∈{0,…,n}a\in\{0,\ldots,n\}a∈{0,…,n}, and any complex matrix OOO indexed by words of length nnn over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, this defines a vector indexed by ((u,s),(v,t))((u,s),(v,t))((u,s),(v,t)), where u,vu,vu,v have length n+1n+1n+1 and s,t∈{0,…,d−1}s,t\in\{0,\ldots,d-1\}s,t∈{0,…,d−1}, with coordinates

ξa;(u,s),(v,t)={Odel⁡au,del⁡avddn,u(a)=s and v(a)=t,0,otherwise.\xi_{a;(u,s),(v,t)} = \begin{cases} \dfrac{O_{\operatorname{del}_a u,\operatorname{del}_a v}}{d\sqrt{d^n}}, &u(a)=s\ \text{and }v(a)=t,\\ 0,&\text{otherwise}. \end{cases}ξa;(u,s),(v,t)​=⎩⎨⎧​ddn​Odela​u,dela​v​​,0,​u(a)=s and v(a)=t,otherwise.​

Here deletion omits coordinate aaa in order: (del⁡au)(i)=u(i)(\operatorname{del}_a u)(i)=u(i)(dela​u)(i)=u(i) for i<ai<ai<a and u(i+1)u(i+1)u(i+1) for a≤i<na\le i<na≤i<n. The denominator is interpreted in C\mathbb CC, using the nonnegative real square root. There is no normalization hypothesis on OOO. The definition includes n=0n=0n=0, when deleted words are empty and d0=1d^0=1d0=1, and d=0d=0d=0, when the vector index set is empty and the vector is zero; scalar division by zero gives zero.

QAlgorithms.Papers.Independent.Extend50.P04.initialState

For natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by words of length NNN over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, this defines a vector in the complex Euclidean space indexed by pairs ((u,s),(v,t))((u,s),(v,t))((u,s),(v,t)), where u,vu,vu,v are such words and s,t∈{0,…,d−1}s,t\in\{0,\ldots,d-1\}s,t∈{0,…,d−1}, with coordinates

η(u,s),(v,t)={Ou,vdN+1,s=t,0,s≠t.\eta_{(u,s),(v,t)} = \begin{cases} \dfrac{O_{u,v}}{\sqrt{d^{N+1}}},&s=t,\\ 0,&s\ne t. \end{cases}η(u,s),(v,t)​=⎩⎨⎧​dN+1​Ou,v​​,0,​s=t,s=t.​

The square root is the nonnegative real square root, embedded into C\mathbb CC for division. No normalization or other condition on OOO is imposed. For N=0N=0N=0, the word indices are both the unique empty word and the denominator is d\sqrt dd​. For d=0d=0d=0, the vector index set is empty and the vector is zero; division by zero in the underlying scalar operations is defined to give zero.

QAlgorithms.Papers.Independent.Extend50.P04.inverseRoot

For any natural numbers d,Nd,Nd,N, let XXX consist of pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, and define the complex matrix

S((u,s),(v,t))=∑a=0N−1(dN−1)−1d−1 1{u(a)=s, v(a)=t, ∀i≠a, u(i)=v(i)}.S((u,s),(v,t)) =\sum_{a=0}^{N-1}(d^{N-1})^{-1}d^{-1} \,\mathbf 1_{\{u(a)=s,\ v(a)=t,\ \forall i\ne a,\ u(i)=v(i)\}}.S((u,s),(v,t))=a=0∑N−1​(dN−1)−1d−11{u(a)=s, v(a)=t, ∀i=a, u(i)=v(i)}​.

Then inverseRoot(d,N)\mathrm{inverseRoot}(d,N)inverseRoot(d,N) is f(S)f(S)f(S), formed using the real continuous functional calculus, where f(r)=(r)−1f(r)=(\sqrt r)^{-1}f(r)=(r​)−1. Here the indicator takes values zero and one, N−1N-1N−1 uses natural-number subtraction, and every reciprocal of zero is zero; the real square root is zero for r≤0r\le0r≤0, so f(r)=0f(r)=0f(r)=0 there. In particular, this function assigns zero to a zero eigenvalue. If N=0N=0N=0, then S=0S=0S=0 and the resulting matrix is zero; if d=0d=0d=0, the index set is empty.

QAlgorithms.Papers.Independent.Extend50.P04.irrepDimension

For natural numbers d,Nd,Nd,N, including zero, and a Young diagram μ\muμ with exactly NNN cells and first column length at most ddd, this defines a natural number fμ=dim⁡CVμf_\mu=\dim_{\mathbb C}V_\mufμ​=dimC​Vμ​ as follows. Use the fixed bijection between the cells of μ\muμ and {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1} supplied by the definition. Let RμR_\muRμ​ and CμC_\muCμ​ be the permutations of these labels that preserve, respectively, each label’s row and each label’s column. In the complex Euclidean space with standard basis (eh)h∈SN(e_h)_{h\in S_N}(eh​)h∈SN​​, set

Vμ=span⁡C{∑a∈Rμ∑b∈Cμsgn⁡(b)ehab:h∈SN}.V_\mu=\operatorname{span}_{\mathbb C} \left\{\sum_{a\in R_\mu}\sum_{b\in C_\mu}\operatorname{sgn}(b)e_{hab}:h\in S_N\right\}.Vμ​=spanC​⎩⎨⎧​a∈Rμ​∑​b∈Cμ​∑​sgn(b)ehab​:h∈SN​⎭⎬⎫​.

The defined value is the complex dimension of this subspace. For N=0N=0N=0, the empty diagram is allowed and this dimension is 111; for d=0<Nd=0<Nd=0<N, there is no diagram that can serve as the argument μ\muμ.

QAlgorithms.Papers.Independent.Extend50.P04.nonoptimalFidelity

For natural numbers d,nd,nd,n, this defines the real number

∑a=0n∥Ba∥2∣⟨ξa,∥Ba∥−1Ba⟩∣,\sum_{a=0}^{n}\|B_a\|^2 \left|\left\langle \xi_a,\|B_a\|^{-1}B_a\right\rangle\right|,a=0∑n​∥Ba​∥2​⟨ξa​,∥Ba​∥−1Ba​⟩​,

where the vectors are indexed by A×AA\times AA×A for A={0,…,d−1}{0,…,n}×{0,…,d−1}A=\{0,\ldots,d-1\}^{\{0,\ldots,n\}}\times\{0,\ldots,d-1\}A={0,…,d−1}{0,…,n}×{0,…,d−1} and are constructed as follows. For each port b∈{0,…,n}b\in\{0,\ldots,n\}b∈{0,…,n}, set

(σb)(u,s),(v,t)={(dn)−1d−1,u(b)=s, v(b)=t, and u(i)=v(i) for all i≠b,0,otherwise.(\sigma_b)_{(u,s),(v,t)} = \begin{cases} (d^n)^{-1}d^{-1},&u(b)=s,\ v(b)=t,\ \text{and }u(i)=v(i)\text{ for all }i\ne b,\\ 0,&\text{otherwise}. \end{cases}(σb​)(u,s),(v,t)​={(dn)−1d−1,0,​u(b)=s, v(b)=t, and u(i)=v(i) for all i=b,otherwise.​

Using real functional calculus, let K=f(∑bσb)K=f(\sum_b\sigma_b)K=f(∑b​σb​) for f(r)=(r)−1f(r)=(\sqrt r)^{-1}f(r)=(r​)−1 and

Eb=KσbK+1n+1(IA−∑cKσcK),Qb=g(Eb),g(r)=r.E_b=K\sigma_bK+\frac1{n+1}\left(I_A-\sum_cK\sigma_cK\right), \qquad Q_b=g(E_b),\quad g(r)=\sqrt r.Eb​=Kσb​K+n+11​(IA​−c∑​Kσc​K),Qb​=g(Eb​),g(r)=r​.

Let η(u,s),(v,t)=1/dn+2\eta_{(u,s),(v,t)}=1/\sqrt{d^{n+2}}η(u,s),(v,t)​=1/dn+2​ when u=vu=vu=v and s=ts=ts=t, and 000 otherwise, and define (Ba)x,y=∑z∈A(Qa)x,zηz,y(B_a)_{x,y}=\sum_{z\in A}(Q_a)_{x,z}\eta_{z,y}(Ba​)x,y​=∑z∈A​(Qa​)x,z​ηz,y​. Let ξa;(u,s),(v,t)=1/(ddn)\xi_{a;(u,s),(v,t)}=1/(d\sqrt{d^n})ξa;(u,s),(v,t)​=1/(ddn​) when u(a)=su(a)=su(a)=s, v(a)=tv(a)=tv(a)=t, and del⁡au=del⁡av\operatorname{del}_a u=\operatorname{del}_a vdela​u=dela​v, and 000 otherwise, where deletion omits coordinate aaa while preserving order. These formulas use identity matrices on the full-word and deleted-word index sets, respectively. The inner product is the standard complex Euclidean inner product, and its absolute value is not squared. Scalar inversion sends zero to zero, so zero branches contribute zero; real square roots return zero on negative arguments. The definition includes n=0n=0n=0, when deleted words are empty and d0=1d^0=1d0=1, and d=0d=0d=0, when the vector index set is empty and the value is zero.

QAlgorithms.Papers.Independent.Extend50.P04.normalizedBranch

For natural numbers d,Nd,Nd,N, any complex matrix OOO indexed by length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and a port a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, this defines Ba/∥Ba∥B_a/\|B_a\|Ba​/∥Ba​∥ in the complex Euclidean space indexed by A×AA\times AA×A, where A={0,…,d−1}{0,…,N−1}×{0,…,d−1}A=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}\times\{0,\ldots,d-1\}A={0,…,d−1}{0,…,N−1}×{0,…,d−1} and BaB_aBa​ is specified as follows. For each port bbb, let

(σb)(u,s),(v,t)={(dN−1)−1d−1,u(b)=s, v(b)=t, and u(i)=v(i) for all i≠b,0,otherwise.(\sigma_b)_{(u,s),(v,t)} = \begin{cases} (d^{N-1})^{-1}d^{-1},&u(b)=s,\ v(b)=t,\ \text{and }u(i)=v(i)\text{ for all }i\ne b,\\ 0,&\text{otherwise}. \end{cases}(σb​)(u,s),(v,t)​={(dN−1)−1d−1,0,​u(b)=s, v(b)=t, and u(i)=v(i) for all i=b,otherwise.​

Using real functional calculus, set K=f(∑bσb)K=f(\sum_b\sigma_b)K=f(∑b​σb​) for f(r)=(r)−1f(r)=(\sqrt r)^{-1}f(r)=(r​)−1 and

Eb=KσbK+1N(IA−∑cKσcK),Qa=g(Ea),g(r)=r.E_b=K\sigma_bK+\frac1N\left(I_A-\sum_cK\sigma_cK\right), \qquad Q_a=g(E_a),\quad g(r)=\sqrt r.Eb​=Kσb​K+N1​(IA​−c∑​Kσc​K),Qa​=g(Ea​),g(r)=r​.

Let η(u,s),(v,t)=Ou,v/dN+1\eta_{(u,s),(v,t)}=O_{u,v}/\sqrt{d^{N+1}}η(u,s),(v,t)​=Ou,v​/dN+1​ if s=ts=ts=t, and 000 otherwise, and set (Ba)x,y=∑z∈A(Qa)x,zηz,y(B_a)_{x,y}=\sum_{z\in A}(Q_a)_{x,z}\eta_{z,y}(Ba​)x,y​=∑z∈A​(Qa​)x,z​ηz,y​. The defined vector is precisely ∥Ba∥−1Ba\|B_a\|^{-1}B_a∥Ba​∥−1Ba​, with the real norm embedded in C\mathbb CC before inversion. No condition on OOO or assumption that BaB_aBa​ is nonzero is imposed: if Ba=0B_a=0Ba​=0, the result is zero because 0−1=00^{-1}=00−1=0. All real square roots return zero on negative arguments. There is no port aaa for N=0N=0N=0; when d=0d=0d=0, the vector index set is empty and the result is zero.

QAlgorithms.Papers.Independent.Extend50.P04.overlapFormula

For arbitrary natural numbers d,nd,nd,n, this defines the real number

∑α a Young diagram∣α∣=n, colLen⁡α(0)≤d{Sα2n+1,colLen⁡α(0)<d,fα Sα2(n+1)fα−Fαn+1,colLen⁡α(0)=d.\sum_{\substack{\alpha\text{ a Young diagram}\\|\alpha|=n,\ \operatorname{colLen}_\alpha(0)\le d}} \begin{cases} \dfrac{S_\alpha^2}{n+1}, &\operatorname{colLen}_\alpha(0)<d,\\[6pt] \dfrac{\sqrt{f_\alpha}\,S_\alpha^2} {\sqrt{(n+1)f_\alpha-F_\alpha}\sqrt{n+1}}, &\operatorname{colLen}_\alpha(0)=d. \end{cases}α a Young diagram∣α∣=n, colLenα​(0)≤d​∑​⎩⎨⎧​n+1Sα2​​,(n+1)fα​−Fα​​n+1​fα​​Sα2​​,​colLenα​(0)<d,colLenα​(0)=d.​

For every diagram λ\lambdaλ appearing here, fλf_\lambdafλ​ is the complex dimension of the span of ∑a∈Rλ∑b∈Cλsgn⁡(b)ehab\sum_{a\in R_\lambda}\sum_{b\in C_\lambda}\operatorname{sgn}(b)e_{hab}∑a∈Rλ​​∑b∈Cλ​​sgn(b)ehab​ over h∈S∣λ∣h\in S_{|\lambda|}h∈S∣λ∣​, inside the complex Euclidean space indexed by S∣λ∣S_{|\lambda|}S∣λ∣​; RλR_\lambdaRλ​ and CλC_\lambdaCλ​ preserve rows and columns under the fixed numbering of λ\lambdaλ’s cells. Write mλm_\lambdamλ​ for the number of fillings of λ\lambdaλ by {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} that are weakly increasing along rows and strictly increasing down columns. Then Sα=∑νmνfνS_\alpha=\sum_{\nu}\sqrt{m_\nu f_\nu}Sα​=∑ν​mν​fν​​, where ν\nuν ranges over diagrams of size n+1n+1n+1 with first column length at most ddd that contain α\alphaα, and Fα=∑θfθF_\alpha=\sum_\theta f_\thetaFα​=∑θ​fθ​, where θ\thetaθ ranges over diagrams of size n+1n+1n+1 containing α\alphaα whose first column length is exactly d+1d+1d+1. All sums are finite, and empty sums are zero. There are no positivity assumptions on the denominator expressions: real square roots of nonpositive numbers are zero, and division by zero has value zero. The definition includes d=0d=0d=0 and n=0n=0n=0.

QAlgorithms.Papers.Independent.Extend50.P04.pbtBellProjector

For any natural numbers d,Nd,Nd,N and any a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, define a complex matrix BaB_aBa​, indexed by pairs (u,s)(u,s)(u,s) 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

Ba((u,s),(v,t))={d−1,u(a)=s, v(a)=t, and u(i)=v(i) for every i≠a,0,otherwise.B_a((u,s),(v,t))= \begin{cases} d^{-1},&u(a)=s,\ v(a)=t,\ \text{and }u(i)=v(i)\text{ for every }i\ne a,\\ 0,&\text{otherwise}. \end{cases}Ba​((u,s),(v,t))={d−1,0,​u(a)=s, v(a)=t, and u(i)=v(i) for every i=a,otherwise.​

The reciprocal is taken in C\mathbb CC, with 0−1=00^{-1}=00−1=0. The parameter aaa requires N>0N>0N>0; when d=0d=0d=0, the matrix has an empty index set.

QAlgorithms.Papers.Independent.Extend50.P04.pbtCollectiveAction

For natural numbers d,Nd,Nd,N and any complex d×dd\times dd×d matrix UUU, this defines a complex matrix indexed by pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, with entries

C(u,s),(v,t)=(∏i=0N−1Uu(i),v(i))Us,t‾.C_{(u,s),(v,t)} = \left(\prod_{i=0}^{N-1}U_{u(i),v(i)}\right)\overline{U_{s,t}}.C(u,s),(v,t)​=(i=0∏N−1​Uu(i),v(i)​)Us,t​​.

There is no hypothesis that UUU is unitary. For N=0N=0N=0, the empty product is 111, so the matrix is the entrywise complex conjugate of UUU on the final coordinate; for d=0d=0d=0, its index set is empty.

QAlgorithms.Papers.Independent.Extend50.P04.pbtInputSwap

For any natural numbers d,Nd,Nd,N and any a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, define a complex matrix PaP_aPa​, indexed by pairs (u,s)(u,s)(u,s) 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

Pa((u,s),(v,t))={1,u(a)=t, s=v(a), and u(i)=v(i) for every i≠a,0,otherwise.P_a((u,s),(v,t))= \begin{cases} 1,&u(a)=t,\ s=v(a),\ \text{and }u(i)=v(i)\text{ for every }i\ne a,\\ 0,&\text{otherwise}. \end{cases}Pa​((u,s),(v,t))={1,0,​u(a)=t, s=v(a), and u(i)=v(i) for every i=a,otherwise.​

Equivalently, its entry is one exactly when uuu is obtained from vvv by replacing its value at aaa with ttt, and sss equals the original value v(a)v(a)v(a). The parameter aaa requires N>0N>0N>0; when d=0d=0d=0, the matrix has an empty index set.

QAlgorithms.Papers.Independent.Extend50.P04.pbtLuedersBranch

For natural numbers d,Nd,Nd,N, any complex matrix OOO indexed by words in X={0,…,d−1}{0,…,N−1}X=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}X={0,…,d−1}{0,…,N−1}, and an index a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, this defines a vector BaB_aBa​ on A×AA\times AA×A, where A=X×{0,…,d−1}A=X\times\{0,\ldots,d-1\}A=X×{0,…,d−1}, as follows. For each port bbb, define matrices on AAA by

(Pb)(u,s),(v,t)={d−1,u(b)=s, v(b)=t, and u(i)=v(i) for all i≠b,0,otherwise,σb=(dN−1)−1Pb.(P_b)_{(u,s),(v,t)} = \begin{cases} d^{-1},&u(b)=s,\ v(b)=t,\ \text{and }u(i)=v(i)\text{ for all }i\ne b,\\ 0,&\text{otherwise}, \end{cases} \qquad \sigma_b=(d^{N-1})^{-1}P_b.(Pb​)(u,s),(v,t)​={d−1,0,​u(b)=s, v(b)=t, and u(i)=v(i) for all i=b,otherwise,​σb​=(dN−1)−1Pb​.

Set S=∑bσbS=\sum_b\sigma_bS=∑b​σb​, K=f(S)K=f(S)K=f(S) using real functional calculus with f(r)=(r)−1f(r)=(\sqrt r)^{-1}f(r)=(r​)−1, and

Eb=KσbK+1N(IA−∑cKσcK),Qa=g(Ea),g(r)=r,E_b=K\sigma_bK+\frac1N\left(I_A-\sum_cK\sigma_cK\right), \qquad Q_a=g(E_a),\quad g(r)=\sqrt r,Eb​=Kσb​K+N1​(IA​−c∑​Kσc​K),Qa​=g(Ea​),g(r)=r​,

again using real functional calculus. Define η(u,s),(v,t)=Ou,v/dN+1\eta_{(u,s),(v,t)}=O_{u,v}/\sqrt{d^{N+1}}η(u,s),(v,t)​=Ou,v​/dN+1​ when s=ts=ts=t, and 000 otherwise. The resulting vector is

Ba=(Qa⊗IA)η,(Ba)x,y=∑z∈A(Qa)x,zηz,y.B_a=(Q_a\otimes I_A)\eta, \qquad (B_a)_{x,y}=\sum_{z\in A}(Q_a)_{x,z}\eta_{z,y}.Ba​=(Qa​⊗IA​)η,(Ba​)x,y​=z∈A∑​(Qa​)x,z​ηz,y​.

All square roots are real nonnegative square roots, with r=0\sqrt r=0r​=0 for r<0r<0r<0, and all scalar inverses send zero to zero. No condition on OOO or normalization of BaB_aBa​ is assumed. The supplied port index requires N≥1N\ge1N≥1; when d=0d=0d=0, AAA is empty and BaB_aBa​ is the zero vector.

QAlgorithms.Papers.Independent.Extend50.P04.pbtOneBoxSuccessor

For arbitrary natural numbers d,e,nd,e,nd,e,n, a Young diagram α\alphaα with nnn cells and first column length at most ddd, and a Young diagram μ\muμ with n+1n+1n+1 cells and first column length at most eee, this predicate means precisely that every cell of α\alphaα is a cell of μ\muμ. The row bounds ddd and eee need not agree. Zero values of these parameters are included whenever the required diagrams exist; in particular, n=0n=0n=0 allows α\alphaα to be the empty diagram.

QAlgorithms.Papers.Independent.Extend50.P04.pbtSignal

For any natural numbers d,Nd,Nd,N and any a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, define a complex matrix σa\sigma_aσa​, indexed by pairs (u,s)(u,s)(u,s) 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

σa((u,s),(v,t))={(dN−1)−1d−1,u(a)=s, v(a)=t, and u(i)=v(i) for every i≠a,0,otherwise.\sigma_a((u,s),(v,t))= \begin{cases} (d^{N-1})^{-1}d^{-1},& u(a)=s,\ v(a)=t,\ \text{and }u(i)=v(i)\text{ for every }i\ne a,\\ 0,&\text{otherwise}. \end{cases}σa​((u,s),(v,t))={(dN−1)−1d−1,0,​u(a)=s, v(a)=t, and u(i)=v(i) for every i=a,otherwise.​

Here N−1N-1N−1 is natural-number subtraction, which gives zero when N=0N=0N=0, and both reciprocals are in C\mathbb CC, with 0−1=00^{-1}=00−1=0. The parameter aaa requires N>0N>0N>0; when d=0d=0d=0, the matrix has an empty index set.

QAlgorithms.Papers.Independent.Extend50.P04.pbtSupportComplement

For any natural numbers d,Nd,Nd,N, let XXX consist of pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, and define

σa((u,s),(v,t))=(dN−1)−1d−1 1{u(a)=s, v(a)=t, ∀i≠a, u(i)=v(i)},R=f ⁣(∑a=0N−1σa),f(r)=(r)−1,\sigma_a((u,s),(v,t)) =(d^{N-1})^{-1}d^{-1} \,\mathbf 1_{\{u(a)=s,\ v(a)=t,\ \forall i\ne a,\ u(i)=v(i)\}}, \qquad R=f\!\left(\sum_{a=0}^{N-1}\sigma_a\right), \quad f(r)=(\sqrt r)^{-1},σa​((u,s),(v,t))=(dN−1)−1d−11{u(a)=s, v(a)=t, ∀i=a, u(i)=v(i)}​,R=f(a=0∑N−1​σa​),f(r)=(r​)−1,

where fff is applied through the real continuous functional calculus. Then pbtSupportComplement(d,N)\mathrm{pbtSupportComplement}(d,N)pbtSupportComplement(d,N) is

IX−∑a=0N−1RσaR,I_X-\sum_{a=0}^{N-1}R\sigma_aR,IX​−a=0∑N−1​Rσa​R,

where IXI_XIX​ is the identity matrix on XXX. The indicator takes values zero and one, N−1N-1N−1 uses natural-number subtraction, and reciprocals of zero are zero, with f(r)=0f(r)=0f(r)=0 for r≤0r\le0r≤0. If N=0N=0N=0, the sum is empty and the result is IXI_XIX​; if d=0d=0d=0, XXX is empty.

QAlgorithms.Papers.Independent.Extend50.P04.portPermutation

For natural numbers d,Nd,Nd,N and any permutation π\piπ of {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}, this defines a complex matrix indexed by pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

P(u,s),(v,t)={1,u=v∘π−1 and s=t,0,otherwise.P_{(u,s),(v,t)} = \begin{cases} 1,&u=v\circ\pi^{-1}\ \text{and }s=t,\\ 0,&\text{otherwise}. \end{cases}P(u,s),(v,t)​={1,0,​u=v∘π−1 and s=t,otherwise.​

Thus the word coordinates are permuted using π−1\pi^{-1}π−1, while the final coordinate is left fixed. The definition includes N=0N=0N=0, when the word is the unique empty function and this matrix is the identity on the final coordinate, and d=0d=0d=0, when the full matrix index set is empty.

QAlgorithms.Papers.Independent.Extend50.P04.positiveRoot

For any type ι\iotaι equipped with a finite enumeration and decidable equality, and any complex matrix AAA indexed by ι×ι\iota\times\iotaι×ι, positiveRoot(A)\mathrm{positiveRoot}(A)positiveRoot(A) is the matrix obtained by applying the real function r↦rr\mapsto\sqrt rr↦r​ to AAA through the real continuous functional calculus. No Hermitian or positive-semidefinite hypothesis is imposed on AAA. For Hermitian AAA, this replaces each eigenvalue rrr by its real square root, which is zero for r≤0r\le0r≤0; for non-Hermitian AAA, the total functional-calculus operation returns zero. The type ι\iotaι may be empty.

QAlgorithms.Papers.Independent.Extend50.P04.qubitBracket

For any natural numbers N,lN,lN,l, this defines the real number

(N−2l+1)(N+1l)N+1+(N−2l−1)(N+1l+1)N+1.(N-2l+1)\sqrt{\frac{\binom{N+1}{l}}{N+1}} + (N-2l-1)\sqrt{\frac{\binom{N+1}{l+1}}{N+1}}.(N−2l+1)N+1(lN+1​)​​+(N−2l−1)N+1(l+1N+1​)​​.

All subtraction in the two linear factors is real subtraction, so those factors may be negative. There is no restriction on lll relative to NNN; binomial coefficients with lower index greater than N+1N+1N+1 are zero. The case N=0N=0N=0 is included, and the denominator N+1N+1N+1 is always positive.

QAlgorithms.Papers.Independent.Extend50.P04.qubitCoefficient

For arbitrary natural numbers N,lN,lN,l, this defines

cN(l)={rN(l)∑j=0⌊N/2⌋rN(j)2,l<⌊N/2⌋+1,0,l≥⌊N/2⌋+1,c_N(l)= \begin{cases} \displaystyle \frac{r_N(l)}{\sqrt{\sum_{j=0}^{\lfloor N/2\rfloor}r_N(j)^2}}, &l<\lfloor N/2\rfloor+1,\\[3mm] 0,&l\ge\lfloor N/2\rfloor+1, \end{cases}cN​(l)=⎩⎨⎧​∑j=0⌊N/2⌋​rN​(j)2​rN​(l)​,0,​l<⌊N/2⌋+1,l≥⌊N/2⌋+1,​

where, for indices jjj in the indicated range and γ=Nπ/(N+2)\gamma=N\pi/(N+2)γ=Nπ/(N+2),

rN(j)={1,N=0,(−1)⌊N/2⌋−jsin⁡((N/2+1−j)γ)−sin⁡((N/2−j)γ)sin⁡γ,N>0 even,(−1)⌊(N−1)/2⌋−jsin⁡(((N+1)/2−j)γ)sin⁡γ,N odd.r_N(j)= \begin{cases} 1,&N=0,\\[1mm] \displaystyle (-1)^{\lfloor N/2\rfloor-j} \frac{\sin((N/2+1-j)\gamma)-\sin((N/2-j)\gamma)}{\sin\gamma}, &N>0\text{ even},\\[3mm] \displaystyle (-1)^{\lfloor(N-1)/2\rfloor-j} \frac{\sin(((N+1)/2-j)\gamma)}{\sin\gamma}, &N\text{ odd}. \end{cases}rN​(j)=⎩⎨⎧​1,(−1)⌊N/2⌋−jsinγsin((N/2+1−j)γ)−sin((N/2−j)γ)​,(−1)⌊(N−1)/2⌋−jsinγsin(((N+1)/2−j)γ)​,​N=0,N>0 even,N odd.​

The sine arguments use real arithmetic; exponent subtraction is natural-number subtraction truncated at zero. A quotient with zero denominator is defined to be zero. The definition accepts indices outside the finite vector’s range and assigns them zero; at N=0N=0N=0, it assigns 111 to l=0l=0l=0 and zero to every l>0l>0l>0.

QAlgorithms.Papers.Independent.Extend50.P04.qubitCoefficients

For every natural number NNN and every Young diagram μ\muμ with exactly NNN cells and first-column length at most 222, let lll be its zero-indexed row length μ1\mu_1μ1​, namely the length of its second row. This defines the real coefficient

cN(μ)={rN(l)∑j=0⌊N/2⌋rN(j)2,l<⌊N/2⌋+1,0,l≥⌊N/2⌋+1,c_N(\mu)= \begin{cases} \displaystyle \frac{r_N(l)}{\sqrt{\sum_{j=0}^{\lfloor N/2\rfloor}r_N(j)^2}}, &l<\lfloor N/2\rfloor+1,\\[3mm] 0,&l\ge\lfloor N/2\rfloor+1, \end{cases}cN​(μ)=⎩⎨⎧​∑j=0⌊N/2⌋​rN​(j)2​rN​(l)​,0,​l<⌊N/2⌋+1,l≥⌊N/2⌋+1,​

where, with γ=Nπ/(N+2)\gamma=N\pi/(N+2)γ=Nπ/(N+2),

rN(j)={1,N=0,(−1)⌊N/2⌋−jsin⁡((N/2+1−j)γ)−sin⁡((N/2−j)γ)sin⁡γ,N>0 even,(−1)⌊(N−1)/2⌋−jsin⁡(((N+1)/2−j)γ)sin⁡γ,N odd.r_N(j)= \begin{cases} 1,&N=0,\\[1mm] \displaystyle (-1)^{\lfloor N/2\rfloor-j} \frac{\sin((N/2+1-j)\gamma)-\sin((N/2-j)\gamma)}{\sin\gamma}, &N>0\text{ even},\\[3mm] \displaystyle (-1)^{\lfloor(N-1)/2\rfloor-j} \frac{\sin(((N+1)/2-j)\gamma)}{\sin\gamma}, &N\text{ odd}. \end{cases}rN​(j)=⎩⎨⎧​1,(−1)⌊N/2⌋−jsinγsin((N/2+1−j)γ)−sin((N/2−j)γ)​,(−1)⌊(N−1)/2⌋−jsinγsin(((N+1)/2−j)γ)​,​N=0,N>0 even,N odd.​

A Young diagram here is a finite downward-closed set of pairs of natural numbers, with row and column coordinates starting at zero. Real arithmetic is used in the sine arguments, and natural-number subtraction, truncated at zero, in the exponents. Division by zero gives zero. The empty diagram at N=0N=0N=0 is included and receives coefficient 111.

QAlgorithms.Papers.Independent.Extend50.P04.qubitMatrix

For every natural number NNN, this defines a real square matrix MNM_NMN​ whose row and column indices are 0,…,⌊N/2⌋0,\ldots,\lfloor N/2\rfloor0,…,⌊N/2⌋, by

(MN)ij=14{2−1{i=0}−1{N even and i=⌊N/2⌋},i=j,1,i≠j and (i+1=j or j+1=i),0,otherwise.(M_N)_{ij}=\frac14 \begin{cases} 2-\mathbf1_{\{i=0\}}-\mathbf1_{\{N\text{ even and }i=\lfloor N/2\rfloor\}}, &i=j,\\ 1,&i\ne j\text{ and }(i+1=j\text{ or }j+1=i),\\ 0,&\text{otherwise}. \end{cases}(MN​)ij​=41​⎩⎨⎧​2−1{i=0}​−1{N even and i=⌊N/2⌋}​,1,0,​i=j,i=j and (i+1=j or j+1=i),otherwise.​

Each indicator is 111 when its condition holds and 000 otherwise, and the diagonal subtraction is real subtraction. Both diagonal deductions apply when both conditions hold; thus at N=0N=0N=0 this is the 1×11\times11×1 zero matrix.

QAlgorithms.Papers.Independent.Extend50.P04.qubitOverlapSum

For every natural number nnn, this defines

∑l=0⌊n/2⌋(n+2−l)(l+1)n+2[(n+2−2l)(n+2l)n+2+(n−2l)(n+2l+1)n+2]2.\sum_{l=0}^{\lfloor n/2\rfloor} \sqrt{\frac{(n+2-l)(l+1)}{n+2}} \left[ (n+2-2l)\sqrt{\frac{\binom{n+2}{l}}{n+2}} + (n-2l)\sqrt{\frac{\binom{n+2}{l+1}}{n+2}} \right]^2.l=0∑⌊n/2⌋​n+2(n+2−l)(l+1)​​​(n+2−2l)n+2(ln+2​)​​+(n−2l)n+2(l+1n+2​)​​​2.

The subtraction inside this real expression is real subtraction, and ⌊n/2⌋\lfloor n/2\rfloor⌊n/2⌋ comes from natural-number division. The sum includes both endpoints; in particular, when n=0n=0n=0, it has the single term l=0l=0l=0 and its value is 222.

QAlgorithms.Papers.Independent.Extend50.P04.qubitRaw

For every natural number NNN and integer index lll with 0≤l≤⌊N/2⌋0\le l\le\lfloor N/2\rfloor0≤l≤⌊N/2⌋, this defines a real number rN(l)r_N(l)rN​(l). Writing cN=Nπ/(N+2)c_N=N\pi/(N+2)cN​=Nπ/(N+2), its value is

rN(l)={1,N=0,(−1)⌊N/2⌋−lsin⁡((N/2+1−l)cN)−sin⁡((N/2−l)cN)sin⁡cN,N>0 and N is even,(−1)⌊(N−1)/2⌋−lsin⁡(((N+1)/2−l)cN)sin⁡cN,N is odd.r_N(l)= \begin{cases} 1,&N=0,\\[2mm] \displaystyle (-1)^{\lfloor N/2\rfloor-l} \frac{\sin((N/2+1-l)c_N)-\sin((N/2-l)c_N)} {\sin c_N}, &N>0\text{ and }N\text{ is even},\\[3mm] \displaystyle (-1)^{\lfloor(N-1)/2\rfloor-l} \frac{\sin(((N+1)/2-l)c_N)}{\sin c_N}, &N\text{ is odd}. \end{cases}rN​(l)=⎩⎨⎧​1,(−1)⌊N/2⌋−lsincN​sin((N/2+1−l)cN​)−sin((N/2−l)cN​)​,(−1)⌊(N−1)/2⌋−lsincN​sin(((N+1)/2−l)cN​)​,​N=0,N>0 and N is even,N is odd.​

The divisions inside the sine arguments are real divisions; the exponents are natural numbers formed using natural-number division and subtraction, which truncates at zero. The index restriction ensures that these exponent subtractions do not underflow. When N=0N=0N=0, the only permitted index is l=0l=0l=0, and the value is 111.

QAlgorithms.Papers.Independent.Extend50.P04.qubitVector

For every natural number NNN and index 0≤l≤⌊N/2⌋0\le l\le\lfloor N/2\rfloor0≤l≤⌊N/2⌋, this defines

vN(l)=rN(l)∑j=0⌊N/2⌋rN(j)2,v_N(l)=\frac{r_N(l)} {\sqrt{\displaystyle\sum_{j=0}^{\lfloor N/2\rfloor}r_N(j)^2}},vN​(l)=j=0∑⌊N/2⌋​rN​(j)2​rN​(l)​,

where, putting c=Nπ/(N+2)c=N\pi/(N+2)c=Nπ/(N+2),

rN(j)={1,N=0,(−1)⌊N/2⌋−jsin⁡((N/2+1−j)c)−sin⁡((N/2−j)c)sin⁡c,N>0 even,(−1)⌊(N−1)/2⌋−jsin⁡(((N+1)/2−j)c)sin⁡c,N odd.r_N(j)= \begin{cases} 1,&N=0,\\[1mm] \displaystyle (-1)^{\lfloor N/2\rfloor-j} \frac{\sin((N/2+1-j)c)-\sin((N/2-j)c)}{\sin c}, &N>0\text{ even},\\[3mm] \displaystyle (-1)^{\lfloor(N-1)/2\rfloor-j} \frac{\sin(((N+1)/2-j)c)}{\sin c}, &N\text{ odd}. \end{cases}rN​(j)=⎩⎨⎧​1,(−1)⌊N/2⌋−jsincsin((N/2+1−j)c)−sin((N/2−j)c)​,(−1)⌊(N−1)/2⌋−jsincsin(((N+1)/2−j)c)​,​N=0,N>0 even,N odd.​

Here the sine arguments use real arithmetic, while the exponents use natural-number arithmetic with subtraction truncated at zero. The sum includes every index from 000 through ⌊N/2⌋\lfloor N/2\rfloor⌊N/2⌋. Division is total: if its denominator is zero, the quotient is zero. In particular, N=0N=0N=0 is included and gives v0(0)=1v_0(0)=1v0​(0)=1.

QAlgorithms.Papers.Independent.Extend50.P04.recyclingFidelity

For natural numbers d,nd,nd,n, any complex matrix OOO indexed by length-(n+1)(n+1)(n+1) words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and any complex matrix RRR indexed by length-nnn words over the same alphabet, this defines the real number

∑a=0n∥Ba∥2∣⟨ξa,∥Ba∥−1Ba⟩∣.\sum_{a=0}^{n}\|B_a\|^2 \left|\left\langle \xi_a,\|B_a\|^{-1}B_a\right\rangle\right|.a=0∑n​∥Ba​∥2​⟨ξa​,∥Ba​∥−1Ba​⟩​.

Here all vectors are indexed by A×AA\times AA×A, where A={0,…,d−1}{0,…,n}×{0,…,d−1}A=\{0,\ldots,d-1\}^{\{0,\ldots,n\}}\times\{0,\ldots,d-1\}A={0,…,d−1}{0,…,n}×{0,…,d−1}. For each b∈{0,…,n}b\in\{0,\ldots,n\}b∈{0,…,n}, define

(σb)(u,s),(v,t)={(dn)−1d−1,u(b)=s, v(b)=t, and u(i)=v(i) for all i≠b,0,otherwise.(\sigma_b)_{(u,s),(v,t)} = \begin{cases} (d^n)^{-1}d^{-1},&u(b)=s,\ v(b)=t,\ \text{and }u(i)=v(i)\text{ for all }i\ne b,\\ 0,&\text{otherwise}. \end{cases}(σb​)(u,s),(v,t)​={(dn)−1d−1,0,​u(b)=s, v(b)=t, and u(i)=v(i) for all i=b,otherwise.​

Using real functional calculus, put K=f(∑bσb)K=f(\sum_b\sigma_b)K=f(∑b​σb​) for f(r)=(r)−1f(r)=(\sqrt r)^{-1}f(r)=(r​)−1, and

Eb=KσbK+1n+1(IA−∑cKσcK),Qb=g(Eb),g(r)=r.E_b=K\sigma_bK+\frac1{n+1}\left(I_A-\sum_cK\sigma_cK\right), \qquad Q_b=g(E_b),\quad g(r)=\sqrt r.Eb​=Kσb​K+n+11​(IA​−c∑​Kσc​K),Qb​=g(Eb​),g(r)=r​.

Define η(u,s),(v,t)=Ou,v/dn+2\eta_{(u,s),(v,t)}=O_{u,v}/\sqrt{d^{n+2}}η(u,s),(v,t)​=Ou,v​/dn+2​ when s=ts=ts=t, and 000 otherwise, and (Ba)x,y=∑z∈A(Qa)x,zηz,y(B_a)_{x,y}=\sum_{z\in A}(Q_a)_{x,z}\eta_{z,y}(Ba​)x,y​=∑z∈A​(Qa​)x,z​ηz,y​. Finally, ξa;(u,s),(v,t)\xi_{a;(u,s),(v,t)}ξa;(u,s),(v,t)​ equals Rdel⁡au,del⁡av/(ddn)R_{\operatorname{del}_a u,\operatorname{del}_a v}/(d\sqrt{d^n})Rdela​u,dela​v​/(ddn​) when u(a)=su(a)=su(a)=s and v(a)=tv(a)=tv(a)=t, and equals zero otherwise; deletion omits coordinate aaa in increasing order. The inner product is the standard complex Euclidean inner product, and its absolute value is used without squaring. No normalization or other conditions on O,RO,RO,R are imposed. Scalar inversion sends zero to zero, so a zero branch has normalized vector zero and contributes zero; real square roots return zero on negative arguments. The definition includes n=0n=0n=0, with empty deleted words and d0=1d^0=1d0=1, and d=0d=0d=0, when all these vectors are zero and the resulting number is zero.

QAlgorithms.Papers.Independent.Extend50.P04.resourceFidelity

For arbitrary natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by X={0,…,d−1}{0,…,N−1}X=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}X={0,…,d−1}{0,…,N−1}, this defines the real number ∣⟨rI,rO⟩∣|\langle r_I,r_O\rangle|∣⟨rI​,rO​⟩∣, where III is the identity matrix on XXX and rB(x,y)=Bx,y/dNr_B(x,y)=B_{x,y}/\sqrt{d^N}rB​(x,y)=Bx,y​/dN​ for every matrix BBB on XXX. Thus the defined value is the magnitude of the inner product, without squaring:

∣∑x,y∈Xδx,ydN‾Ox,ydN∣.\left| \sum_{x,y\in X} \overline{\frac{\delta_{x,y}}{\sqrt{d^N}}} \frac{O_{x,y}}{\sqrt{d^N}} \right|.​x,y∈X∑​dN​δx,y​​​dN​Ox,y​​​.

No normalization condition is imposed on OOO, and division by zero gives zero. For d=0<Nd=0<Nd=0<N, the index set is empty and the value is zero; for N=0N=0N=0, the index set is a singleton and the value is the absolute value of OOO’s sole entry, including when d=0d=0d=0.

QAlgorithms.Papers.Independent.Extend50.P04.resourceOperation

For natural numbers d,Nd,Nd,N, let X={0,…,d−1}{0,…,N−1}X=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}X={0,…,d−1}{0,…,N−1}, and let Pd,N\mathcal P_{d,N}Pd,N​ be the Young diagrams with NNN cells and first column length at most ddd. For any real function vvv on Pd,N\mathcal P_{d,N}Pd,N​, this defines the complex matrix on XXX by

Rd,N(v)=dN∑μ∈Pd,Nv(μ)fμmμ Πμ,Πμ=fμN!∑π∈SNχμ(π−1)Tπ.R_{d,N}(v)=\sqrt{d^N}\sum_{\mu\in\mathcal P_{d,N}} \frac{v(\mu)}{\sqrt{f_\mu m_\mu}}\,\Pi_\mu, \qquad \Pi_\mu=\frac{f_\mu}{N!} \sum_{\pi\in S_N}\chi_\mu(\pi^{-1})T_\pi.Rd,N​(v)=dN​μ∈Pd,N​∑​fμ​mμ​​v(μ)​Πμ​,Πμ​=N!fμ​​π∈SN​∑​χμ​(π−1)Tπ​.

Here (Tπ)y,x(T_\pi)_{y,x}(Tπ​)y,x​ is 111 if y=x∘π−1y=x\circ\pi^{-1}y=x∘π−1 and 000 otherwise. Using the fixed numbering of μ\muμ’s cells, let Rμ,Cμ⊆SNR_\mu,C_\mu\subseteq S_NRμ​,Cμ​⊆SN​ preserve rows and columns, respectively, and let VμV_\muVμ​ be the complex span of ∑a∈Rμ∑b∈Cμsgn⁡(b)ehab\sum_{a\in R_\mu}\sum_{b\in C_\mu}\operatorname{sgn}(b)e_{hab}∑a∈Rμ​​∑b∈Cμ​​sgn(b)ehab​ for h∈SNh\in S_Nh∈SN​ in the complex Euclidean space indexed by SNS_NSN​. Then fμ=dim⁡CVμf_\mu=\dim_{\mathbb C}V_\mufμ​=dimC​Vμ​, χμ(π)=tr⁡(LπPμ)\chi_\mu(\pi)=\operatorname{tr}(L_\pi P_\mu)χμ​(π)=tr(Lπ​Pμ​), where (Lπ)g,h(L_\pi)_{g,h}(Lπ​)g,h​ is 111 exactly when g=πhg=\pi hg=πh and PμP_\muPμ​ is the orthogonal projection onto VμV_\muVμ​, and mμm_\mumμ​ counts fillings of μ\muμ by {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} weakly increasing along rows and strictly increasing down columns. Real scalars in these formulas are embedded in C\mathbb CC. No sign or normalization condition is imposed on vvv. Zero denominators give zero quotients, empty sums give zero matrices, and d=0d=0d=0 and N=0N=0N=0 are included, with 00=10^0=100=1 and XXX a singleton when N=0N=0N=0.

QAlgorithms.Papers.Independent.Extend50.P04.resourceState

For arbitrary natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by X={0,…,d−1}{0,…,N−1}X=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}X={0,…,d−1}{0,…,N−1}, this defines the vector rOr_OrO​ in the complex Euclidean space indexed by X×XX\times XX×X whose coordinates are

rO(x,y)=Ox,ydN.r_O(x,y)=\frac{O_{x,y}}{\sqrt{d^N}}.rO​(x,y)=dN​Ox,y​​.

No normalization or other condition is imposed on OOO. The real square root is embedded in C\mathbb CC for the division, and division by zero gives zero. When d=0<Nd=0<Nd=0<N, XXX is empty and the vector is the unique vector on an empty index set. When N=0N=0N=0, XXX is a singleton, including when d=0d=0d=0, and the denominator is 111 because d0=1d^0=1d0=1.

QAlgorithms.Papers.Independent.Extend50.P04.rowCoefficient

For every natural number NNN, every real-valued function vvv on the Young diagrams having exactly NNN cells and first-column length at most 222, and every natural number lll, this defines

RN,v(l)=∑μ: ∣μ∣=N, colLen⁡μ(0)≤2rowLen⁡μ(1)=lv(μ).R_{N,v}(l)= \sum_{\substack{\mu:\ |\mu|=N,\ \operatorname{colLen}_\mu(0)\le2\\ \operatorname{rowLen}_\mu(1)=l}}v(\mu).RN,v​(l)=μ: ∣μ∣=N, colLenμ​(0)≤2rowLenμ​(1)=l​∑​v(μ).

Young diagrams are finite downward-closed sets of pairs of natural numbers, and rowLen⁡μ(1)\operatorname{rowLen}_\mu(1)rowLenμ​(1) is the length of the second row because row indexing starts at zero. The sum includes every such diagram with that second-row length and is zero if there are none. This includes N=0N=0N=0: only the empty diagram occurs, contributing v(∅)v(\varnothing)v(∅) when l=0l=0l=0 and nothing when l>0l>0l>0.

QAlgorithms.Papers.Independent.Extend50.P04.signalSum

For any natural numbers d,Nd,Nd,N, define a complex matrix SSS, indexed by pairs (u,s)(u,s)(u,s) 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, by

S((u,s),(v,t))=∑a=0N−1(dN−1)−1d−1 1{u(a)=s, v(a)=t, ∀i≠a, u(i)=v(i)}.S((u,s),(v,t)) =\sum_{a=0}^{N-1}(d^{N-1})^{-1}d^{-1} \,\mathbf 1_{\{u(a)=s,\ v(a)=t,\ \forall i\ne a,\ u(i)=v(i)\}}.S((u,s),(v,t))=a=0∑N−1​(dN−1)−1d−11{u(a)=s, v(a)=t, ∀i=a, u(i)=v(i)}​.

The indicator is one when its condition holds and zero otherwise, N−1N-1N−1 uses natural-number subtraction, and reciprocals are in C\mathbb CC, with 0−1=00^{-1}=00−1=0. If N=0N=0N=0, the sum is empty and S=0S=0S=0; if d=0d=0d=0, its index set is empty.

QAlgorithms.Papers.Independent.Extend50.P04.spinFormula

For every natural number NNN, this defines the real number

N!2 N−2(N+2) ∑0≤t≤Nt≡N(mod2)(t+1)sin⁡ ⁣(π(t+1)N+2)(⌊N−t2⌋)!(⌊N+t2⌋+1)!.\sqrt{\frac{N!}{2^{\,N-2}(N+2)}}\, \sum_{\substack{0\le t\le N\\t\equiv N\pmod2}} \frac{(t+1)\sin\!\left(\dfrac{\pi(t+1)}{N+2}\right)} {\sqrt{\left(\left\lfloor\dfrac{N-t}{2}\right\rfloor\right)! \left(\left\lfloor\dfrac{N+t}{2}\right\rfloor+1\right)!}}.2N−2(N+2)N!​​0≤t≤Nt≡N(mod2)​∑​(⌊2N−t​⌋)!(⌊2N+t​⌋+1)!​(t+1)sin(N+2π(t+1)​)​.

The exponent N−2N-2N−2 in 2N−22^{N-2}2N−2 is a real-number subtraction and the power is a real power, so it is negative when N<2N<2N<2. By contrast, subtraction and division inside the factorial arguments are natural-number operations, with subtraction truncated at zero and division rounded down; the summation restriction t≤Nt\le Nt≤N prevents underflow in N−tN-tN−t. The case N=0N=0N=0 is included and gives 2\sqrt22​.

QAlgorithms.Papers.Independent.Extend50.P04.successorSum

For natural numbers d,nd,nd,n and a Young diagram α\alphaα with nnn cells and first column length at most ddd, this defines

Sα=∑ν a Young diagram∣ν∣=n+1, colLen⁡ν(0)≤dα⊆νmνfν.S_\alpha= \sum_{\substack{\nu\text{ a Young diagram}\\ |\nu|=n+1,\ \operatorname{colLen}_\nu(0)\le d\\ \alpha\subseteq\nu}} \sqrt{m_\nu f_\nu}.Sα​=ν a Young diagram∣ν∣=n+1, colLenν​(0)≤dα⊆ν​∑​mν​fν​​.

Here mνm_\numν​ is the number of fillings of the cells of ν\nuν by labels in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} that are weakly increasing along each row and strictly increasing down each column. To define fνf_\nufν​, use the fixed numbering of ν\nuν’s cells by {0,…,n}\{0,\ldots,n\}{0,…,n}, let Rν,Cν⊆Sn+1R_\nu,C_\nu\subseteq S_{n+1}Rν​,Cν​⊆Sn+1​ be the permutations preserving rows and columns, respectively, and take the complex dimension of the span of ∑a∈Rν∑b∈Cνsgn⁡(b)ehab\sum_{a\in R_\nu}\sum_{b\in C_\nu}\operatorname{sgn}(b)e_{hab}∑a∈Rν​​∑b∈Cν​​sgn(b)ehab​ over all h∈Sn+1h\in S_{n+1}h∈Sn+1​ in the complex Euclidean space indexed by Sn+1S_{n+1}Sn+1​. This natural number is interpreted as a real number in the displayed formula. Empty sums are zero, and d,nd,nd,n may be zero whenever α\alphaα exists.

QAlgorithms.Papers.Independent.Extend50.P04.supportEffect

For any natural numbers d,Nd,Nd,N and any a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, let XXX consist of pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, and set

σb((u,s),(v,t))=(dN−1)−1d−1 1{u(b)=s, v(b)=t, ∀i≠b, u(i)=v(i)},S=∑b=0N−1σb.\sigma_b((u,s),(v,t)) =(d^{N-1})^{-1}d^{-1} \,\mathbf 1_{\{u(b)=s,\ v(b)=t,\ \forall i\ne b,\ u(i)=v(i)\}}, \qquad S=\sum_{b=0}^{N-1}\sigma_b.σb​((u,s),(v,t))=(dN−1)−1d−11{u(b)=s, v(b)=t, ∀i=b, u(i)=v(i)}​,S=b=0∑N−1​σb​.

Define R=f(S)R=f(S)R=f(S) by the real continuous functional calculus with f(r)=(r)−1f(r)=(\sqrt r)^{-1}f(r)=(r​)−1. Then supportEffect(d,N,a)\mathrm{supportEffect}(d,N,a)supportEffect(d,N,a) is the matrix product RσaRR\sigma_aRRσa​R on XXX. The indicator takes values zero and one, natural-number subtraction is used in N−1N-1N−1, and reciprocals of zero are zero, so f(r)=0f(r)=0f(r)=0 for r≤0r\le0r≤0. The parameter aaa requires N>0N>0N>0; d=0d=0d=0 gives an empty index set.

QAlgorithms.Papers.Independent.Extend50.P04.teleportationObjective

For arbitrary natural numbers d,Nd,Nd,N, put X={0,…,d−1}{0,…,N−1}X=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}X={0,…,d−1}{0,…,N−1} and A=X×{0,…,d−1}A=X\times\{0,\ldots,d-1\}A=X×{0,…,d−1}. Given any complex matrix OOO on XXX and any family (Ma)a=0N−1(M_a)_{a=0}^{N-1}(Ma​)a=0N−1​ of complex matrices on AAA, this defines

Td,N(O,M)=1d2∑a=0N−1Re⁡tr⁡((O⊗Id)†Ma(O⊗Id)σa).\mathcal T_{d,N}(O,M)= \frac{1}{d^2}\sum_{a=0}^{N-1} \operatorname{Re}\operatorname{tr} \bigl((O\otimes I_d)^\dagger M_a(O\otimes I_d)\sigma_a\bigr).Td,N​(O,M)=d21​a=0∑N−1​Retr((O⊗Id​)†Ma​(O⊗Id​)σa​).

For x=(x1,x2)x=(x_1,x_2)x=(x1​,x2​) and y=(y1,y2)y=(y_1,y_2)y=(y1​,y2​) in AAA, the entry (σa)x,y(\sigma_a)_{x,y}(σa​)x,y​ is (dN−1)−1d−1(d^{N-1})^{-1}d^{-1}(dN−1)−1d−1 if x1(a)=x2x_1(a)=x_2x1​(a)=x2​, y1(a)=y2y_1(a)=y_2y1​(a)=y2​, and x1(i)=y1(i)x_1(i)=y_1(i)x1​(i)=y1​(i) for every i≠ai\ne ai=a, and is zero otherwise. In the exponent N−1N-1N−1, subtraction is natural-number subtraction, truncated at zero. No unitarity, positivity, or normalization assumptions are imposed on OOO or MMM. All inverses and quotients are total, with inverse zero equal to zero; consequently the objective is zero when d=0d=0d=0, and it is also zero when N=0N=0N=0 because the sum is empty.

QAlgorithms.Papers.Independent.Extend50.P04.transposeInput

For any natural numbers d,Nd,Nd,N and any complex matrix AAA indexed by pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}, define a matrix TTT on the same index set by

T((u,s),(v,t))=A((u,t),(v,s)).T((u,s),(v,t))=A((u,t),(v,s)).T((u,s),(v,t))=A((u,t),(v,s)).

Thus the definition exchanges the two final coordinates in the row and column arguments, without complex conjugation. If N=0N=0N=0, the function coordinates are empty and this is ordinary matrix transposition on the remaining coordinates; if d=0d=0d=0, the matrix index set is empty.

QAlgorithms.Papers.Independent.Extend50.P04.transposedSwap

For natural numbers d,Nd,Nd,N and an index a∈{0,…,N−1}a\in\{0,\ldots,N-1\}a∈{0,…,N−1}, this defines a complex matrix indexed by pairs (u,s)(u,s)(u,s), 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 s∈{0,…,d−1}s\in\{0,\ldots,d-1\}s∈{0,…,d−1}. Its entries are

T(u,s),(v,t)={1,u(a)=s, v(a)=t, and u(i)=v(i) for every i≠a,0,otherwise.T_{(u,s),(v,t)} = \begin{cases} 1,&u(a)=s,\ v(a)=t,\ \text{and }u(i)=v(i)\text{ for every }i\ne a,\\ 0,&\text{otherwise}. \end{cases}T(u,s),(v,t)​={1,0,​u(a)=s, v(a)=t, and u(i)=v(i) for every i=a,otherwise.​

These entries result from exchanging the two input indices in the matrix whose (u,s),(v,t)(u,s),(v,t)(u,s),(v,t) entry is 111 exactly when uuu is obtained from vvv by replacing its value at aaa with ttt, and s=v(a)s=v(a)s=v(a). There is no choice of aaa when N=0N=0N=0; when d=0d=0d=0, the resulting matrix has an empty index set.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 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