Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Asymptotic teleportation scheme as a universal programmable quantum processor

Definition
QAlgorithms_Papers_Independent_Extend50_P38

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

prove2quantum

The objects the formalized statements of Asymptotic teleportation scheme as a universal programmable quantum processor (arXiv:0807.4568) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Ports: PDF p.2: the computational configurations of N d-dimensional ports.
  • AC: PDF p.2: Alice's ports together with the input (or the relabelled output).
  • ResourceRegister: PDF p.2: all of Alice's and Bob's N-port resource configurations. This is distinct from the accepted single-pair register Claimed50.P17.AB.
  • ValidResource: PDF p.2: a resource operator O is normalized by Tr(OO†)=d^N.
  • resourceVector: PDF p.2: coordinates of (O tensor I)|phi+>^{tensor N}.
  • resourceDensity: PDF p.2: the normalized pure resource density when ValidResource holds.
  • insertPort: PDF p.2: insert the retained port value into the other Bob configurations.
  • processor: PDF p.2: Alice measures A,C and Bob retains B_i without a correction. This is the entrywise partial trace of the Lueders measurement sum. Cyclicity on traced registers replaces the two square roots of the effect by the effect itself. The definition accepts mixed program densities as required by PDF pp.1,4.
  • teleport: PDF p.2: the teleportation channel using the pure resource specified by O.
  • signals: PDF p.2 Eq.(1): the phi+ signal d^{-(N-1)} P+{A_i B} tensor I{other A}. The coefficient is d^{-N}, since each nonzero entry of P+ is 1/d.
  • resourceLift: PDF p.2 Eq.(2): O tensor I on the resource-signal space. Renew46.P20.aliceLift instead adds a leading Bob identity to an Alice/input effect.
  • teleportationObjective: PDF p.2 Eq.(2): the scalar teleportationObjective, with every signal physically specified.
  • supportedInvSqrt: PDF p.2: the supported inverse square root; zero on the kernel.
  • rawSrm: PDF p.2: uncompleted square-root effects for the given signal family.
  • srmCompletion: PDF p.2: the equal kernel completion Delta, necessary to obtain a POVM.
  • srm: PDF p.2: the normalized N-outcome SRM, including Delta.
  • singletResource: PDF pp.2–3: N singlets, A and B registers grouped together.
  • singletSignals: PDF p.3: singlet signals; their local projections are P-_{B A_i}.
  • singletSrmChannel: PDF p.3: the actual singlet-resource SRM teleportation map. Support21.P19.qubitChannel is a noiseless communication resource, not this channel.
  • qubitClosedF: PDF p.3: exact closed sum; all signed numerators are real, never Nat subtraction.
  • qubitAverage: PDF p.3: f is the Haar-average fidelity of the physical qubit channel.
  • spinBit: PDF p.3: twice the magnetic number of |0> is -1, that of |1> is +1.
  • finalSpin: PDF p.3: twice the total spin at the end of the accepted sequential coupling path. The frozen path stores each doubled spin in Fin (n+1); its step condition gives the same nonnegative paths as the source, since the kth spin cannot exceed k.
  • ValidMagnetic: PDF p.3: the magnetic numbers present in a spin-r/2 representation.
  • coupling: PDF p.3: real Clebsch–Gordan coefficients for coupling spin p/2 with spin 1/2. Arguments m and q are twice the old magnetic number and new total spin. This fixes one standard real phase convention; alpha-dependent global signs are immaterial.
  • spinVector: PDF p.3, Appendix A: recursively coupled Phi, as the product of the coupling coefficients along alpha. The final magnetic number m is doubled.
  • coupledVector: PDF p.3 Eq.(3): couple Phi on A to B, whose output coordinate is last. The source writes B first; this is only a permutation of tensor coordinates.
  • CoupledSpinLabel: PDF p.3 Eq.(3): every allowed path, coupled-spin branch, and doubled magnetic number. The lower branch is absent when the Alice spin is zero.
  • lambdaMinus: PDF p.3: the two signal-sum eigenvalues, parameterized by actual spin j.
  • lambdaPlus: PDF p.3: lambda^+_j.
  • singletSpinBranch: PDF p.6 Eq.(B1): the two actual spectral branch operators constructed from the coupled vectors. false is rhoMinus (total spin j+1/2), true is rhoPlus (total spin j-1/2). All magnetic numbers occur once, including the endpoints; the nonexistent j=0 lower branch is omitted.
  • overlapCoefficient: PDF p.3 Eq.(5): weights s/(2s+1) and (s+1)/(2s+1), without square roots. At s=0 the absent lower branch has zero weight.
  • xi: PDF p.3 Eq.(4): xi at port i, with the other n qubits in their sequential spin basis.
  • PortPrimalFeasible: PDF p.4 Eq.(6): port-teleportation joint primal feasibility, allowing singular X. Unlike SDP.PrimalFeasible this includes both X and N positive effects with an exact sum.
  • primalValue: PDF p.4 Eq.(6): primal teleportationObjective.
  • bobTrace: PDF p.4: trace out the last (Bob) qudit in the dual constraint.
  • PortDualFeasible: PDF p.4: port-teleportation dual feasibility; a is real and Omega is Hermitian. Unlike SDP.DualFeasible this uses an operator variable and a partial-trace constraint.
  • separableOperator: PDF p.4: the explicitly separable resource |0>_A^{tensor N} tensor product_i |e_i>_B, expressed in the O parametrization; e labels orthogonal computational output states.
  • program: PDF pp.1,4: a CPTP operation is applied to all Bob ports in a program density. The accepted tensor-superoperator definition includes entangled/off-diagonal inputs.
  • stateFidelity: PDF p.4: two-state squared Uhlmann fidelity (distinct from channel entanglement fidelity).
  • programmedAverage: PDF p.4: average over pure inputs of fidelity to the desired processed output.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Defs_QuditChannelFidelities
import Definitions.Def_QAlgorithms_Papers_Independent_Frontier18_P14
import Definitions.Def_QAlgorithms_Papers_Independent_Renew46_P01

/-!
Statements from Ishizaka–Hiroshima, arXiv:0807.4568v2. All page numbers are PDF pages.
Paper-local definitions implement the physical registers, selection channel, completed SRM,
and an explicit sequentially coupled spin basis using accepted spin paths and singlet amplitudes. No claim is made for trace-decreasing
programs or for the false general multiple-vector subtraction assertion on p.4.
-/

noncomputable section

open scoped Matrix ComplexConjugate ComplexOrder
open Filter MeasureTheory

namespace QAlgorithms.Papers.Independent.Extend50.P38

attribute [local instance] Classical.propDecidable Classical.decEq

-- Pinned accepted definitions; neither is re-declared in this module.
open QAlgorithms.Papers.Independent.Frontier18.P14 (singlet)
open QAlgorithms.Papers.Independent.Renew46.P01 (SpinPath)

/-- PDF p.2: the computational configurations of N d-dimensional ports. -/
abbrev Ports (d N : ℕ) := Fin N → Fin d

/-- PDF p.2: Alice's ports together with the input (or the relabelled output). -/
abbrev AC (d N : ℕ) := Ports d N × Fin d

/-- PDF p.2: all of Alice's and Bob's N-port resource configurations.
This is distinct from the accepted single-pair register Claimed50.P17.AB. -/
abbrev ResourceRegister (d N : ℕ) := Ports d N × Ports d N

/-- PDF p.2: a resource operator O is normalized by Tr(OO†)=d^N. -/
def ValidResource {d N : ℕ} (O : Matrix (Ports d N) (Ports d N) ℂ) : Prop :=
  (O * Oᴴ).trace = (d : ℂ) ^ N

/-- PDF p.2: coordinates of (O tensor I)|phi+>^{tensor N}. -/
def resourceVector {d N : ℕ} (O : Matrix (Ports d N) (Ports d N) ℂ) :
    EuclideanSpace ℂ (ResourceRegister d N) :=
  WithLp.toLp 2 fun z => O z.1 z.2 / (Real.sqrt ((d : ℝ) ^ N) : ℂ)

/-- PDF p.2: the normalized pure resource density when ValidResource holds. -/
def resourceDensity {d N : ℕ} (O : Matrix (Ports d N) (Ports d N) ℂ) :
    Matrix (ResourceRegister d N) (ResourceRegister d N) ℂ := pureDensity (resourceVector O)

/-- PDF p.2: insert the retained port value into the other Bob configurations. -/
def insertPort {d N : ℕ} (i : Fin N)
    (z : {j : Fin N // j ≠ i} → Fin d) (b : Fin d) : Ports d N :=
  fun j => if h : j = i then b else z ⟨j, h⟩

/-- PDF p.2: Alice measures A,C and Bob retains B_i without a correction.
This is the entrywise partial trace of the Lueders measurement sum. Cyclicity on
traced registers replaces the two square roots of the effect by the effect itself.
The definition accepts mixed program densities as required by PDF pp.1,4. -/
def processor {d N : ℕ} (M : Fin N → Matrix (AC d N) (AC d N) ℂ)
    (R : Matrix (ResourceRegister d N) (ResourceRegister d N) ℂ) : Superop (Fin d) (Fin d) :=
  fun X => Matrix.of fun b c =>
    ∑ i, ∑ a : Ports d N, ∑ a' : Ports d N, ∑ u : Fin d, ∑ v : Fin d,
      ∑ z : {j : Fin N // j ≠ i} → Fin d,
        M i (a', v) (a, u) *
          R (a, insertPort i z b) (a', insertPort i z c) * X u v

/-- PDF p.2: the teleportation channel using the pure resource specified by O. -/
def teleport {d N : ℕ} (O : Matrix (Ports d N) (Ports d N) ℂ)
    (M : Fin N → Matrix (AC d N) (AC d N) ℂ) : Superop (Fin d) (Fin d) :=
  processor M (resourceDensity O)

/-- PDF p.2 Eq.(1): the phi+ signal d^{-(N-1)} P+_{A_i B} tensor I_{other A}.
The coefficient is d^{-N}, since each nonzero entry of P+ is 1/d. -/
def signals (d N : ℕ) (i : Fin N) : Matrix (AC d N) (AC d N) ℂ :=
  Matrix.of fun x y =>
    if x.1 i = x.2 ∧ y.1 i = y.2 ∧ (∀ j, j ≠ i → x.1 j = y.1 j)
    then (((d : ℝ) ^ N)⁻¹ : ℂ) else 0

/-- PDF p.2 Eq.(2): O tensor I on the resource-signal space.
Renew46.P20.aliceLift instead adds a leading Bob identity to an Alice/input effect. -/
def resourceLift {d N : ℕ} (O : Matrix (Ports d N) (Ports d N) ℂ) :
    Matrix (AC d N) (AC d N) ℂ := Matrix.kronecker O 1

/-- PDF p.2 Eq.(2): the scalar teleportationObjective, with every signal physically specified. -/
def teleportationObjective {d N : ℕ} (O : Matrix (Ports d N) (Ports d N) ℂ)
    (M : Fin N → Matrix (AC d N) (AC d N) ℂ) : ℝ :=
  (∑ i, (M i * (resourceLift O * signals d N i * (resourceLift O)ᴴ)).trace.re) /
    (d : ℝ) ^ 2

/-- PDF p.2: the supported inverse square root; zero on the kernel. -/
def supportedInvSqrt {I : Type*} [Fintype I] [DecidableEq I]
    (A : Matrix I I ℂ) : Matrix I I ℂ := cfc (fun t : ℝ => (Real.sqrt t)⁻¹) A

/-- PDF p.2: uncompleted square-root effects for the given signal family. -/
def rawSrm {N : ℕ} {I : Type*} [Fintype I] [DecidableEq I]
    (S : Fin N → Matrix I I ℂ) (i : Fin N) : Matrix I I ℂ :=
  supportedInvSqrt (∑ j, S j) * S i * supportedInvSqrt (∑ j, S j)

/-- PDF p.2: the equal kernel completion Delta, necessary to obtain a POVM. -/
def srmCompletion {N : ℕ} {I : Type*} [Fintype I] [DecidableEq I]
    (S : Fin N → Matrix I I ℂ) : Matrix I I ℂ :=
  ((N : ℂ)⁻¹) • (1 - ∑ i, rawSrm S i)

/-- PDF p.2: the normalized N-outcome SRM, including Delta. -/
def srm {N : ℕ} {I : Type*} [Fintype I] [DecidableEq I]
    (S : Fin N → Matrix I I ℂ) (i : Fin N) : Matrix I I ℂ :=
  rawSrm S i + srmCompletion S

/-- PDF pp.2–3: N singlets, A and B registers grouped together. -/
def singletResource (N : ℕ) : Matrix (ResourceRegister 2 N) (ResourceRegister 2 N) ℂ :=
  pureDensity (WithLp.toLp 2 fun z : ResourceRegister 2 N => ∏ i, singlet (z.1 i, z.2 i))

/-- PDF p.3: singlet signals; their local projections are P-_{B A_i}. -/
def singletSignals (N : ℕ) (i : Fin N) : Matrix (AC 2 N) (AC 2 N) ℂ :=
  Matrix.of fun x y =>
    if ∀ j, j ≠ i → x.1 j = y.1 j
    then (((2 : ℝ) ^ (N - 1))⁻¹ : ℂ) *
      singlet (x.2, x.1 i) * conj (singlet (y.2, y.1 i)) else 0

/-- PDF p.3: the actual singlet-resource SRM teleportation map.
Support21.P19.qubitChannel is a noiseless communication resource, not this channel. -/
def singletSrmChannel (N : ℕ) : Superop (Fin 2) (Fin 2) :=
  processor (srm (singletSignals N)) (singletResource N)

/-- PDF p.3: exact closed sum; all signed numerators are real, never Nat subtraction. -/
def qubitClosedF (N : ℕ) : ℝ :=
  (∑ k ∈ Finset.range (N + 1),
    (((N : ℝ) - 2 * (k : ℝ) - 1) / Real.sqrt ((k : ℝ) + 1) +
     ((N : ℝ) - 2 * (k : ℝ) + 1) / Real.sqrt ((N : ℝ) - (k : ℝ) + 1)) ^ 2 *
       (N.choose k : ℝ)) / (2 : ℝ) ^ (N + 3)

/-- PDF p.3: f is the Haar-average fidelity of the physical qubit channel. -/
def qubitAverage (N : ℕ) : ℝ := QuditFidelity.averageFidelity 2 (by decide) (singletSrmChannel N)

/-- PDF p.3: twice the magnetic number of |0> is -1, that of |1> is +1. -/
def spinBit (b : Fin 2) : ℤ := if b = 0 then -1 else 1

/-- PDF p.3: twice the total spin at the end of the accepted sequential coupling path.
The frozen path stores each doubled spin in Fin (n+1); its step condition gives the
same nonnegative paths as the source, since the kth spin cannot exceed k. -/
def finalSpin {n : ℕ} (p : SpinPath n) : ℕ := (p.val (Fin.last n)).val

/-- PDF p.3: the magnetic numbers present in a spin-r/2 representation. -/
def ValidMagnetic (r : ℕ) (m : ℤ) : Prop :=
  -(r : ℤ) ≤ m ∧ m ≤ (r : ℤ) ∧ (m + (r : ℤ)) % 2 = 0

/-- PDF p.3: real Clebsch–Gordan coefficients for coupling spin p/2 with spin 1/2.
Arguments m and q are twice the old magnetic number and new total spin.
This fixes one standard real phase convention; alpha-dependent global signs are immaterial. -/
def coupling (p : ℕ) (m : ℤ) (q : ℕ) (b : Fin 2) : ℝ :=
  if ValidMagnetic p m ∧ ValidMagnetic q (m + spinBit b) then
    if q = p + 1 then
      if b = 0 then Real.sqrt (((p : ℝ) - (m : ℝ) + 2) / (2 * ((p : ℝ) + 1)))
      else Real.sqrt (((p : ℝ) + (m : ℝ) + 2) / (2 * ((p : ℝ) + 1)))
    else if p = q + 1 then
      if b = 0 then Real.sqrt (((p : ℝ) + (m : ℝ)) / (2 * ((p : ℝ) + 1)))
      else -Real.sqrt (((p : ℝ) - (m : ℝ)) / (2 * ((p : ℝ) + 1)))
    else 0
  else 0

/-- PDF p.3, Appendix A: recursively coupled Phi, as the product of the coupling
coefficients along alpha. The final magnetic number m is doubled. -/
def spinVector {n : ℕ} (p : SpinPath n) (m : ℤ) : EuclideanSpace ℂ (Ports 2 n) :=
  WithLp.toLp 2 fun x =>
    if (∑ k, spinBit (x k)) = m then
      ∏ k : Fin n,
        (coupling (p.val k.castSucc).val
          (∑ l ∈ Finset.univ.filter (fun l : Fin n => l.val < k.val), spinBit (x l))
          (p.val k.succ).val (x k) : ℂ)
    else 0

/-- PDF p.3 Eq.(3): couple Phi on A to B, whose output coordinate is last.
The source writes B first; this is only a permutation of tensor coordinates. -/
def coupledVector {n : ℕ} (p : SpinPath n) (q : ℕ) (m : ℤ) :
    EuclideanSpace ℂ (AC 2 n) :=
  WithLp.toLp 2 fun x =>
    spinVector p (m - spinBit x.2) x.1 *
      (coupling (finalSpin p) (m - spinBit x.2) q x.2 : ℂ)

/-- PDF p.3 Eq.(3): every allowed path, coupled-spin branch, and doubled magnetic
number. The lower branch is absent when the Alice spin is zero. -/
abbrev CoupledSpinLabel (N : ℕ) :=
  {l : SpinPath N × ℕ × ℤ //
    (l.2.1 = finalSpin l.1 + 1 ∨ finalSpin l.1 = l.2.1 + 1) ∧
      ValidMagnetic l.2.1 l.2.2}

/-- PDF p.3: the two signal-sum eigenvalues, parameterized by actual spin j. -/
def lambdaMinus (N : ℕ) (j : ℝ) : ℝ := ((N : ℝ) / 2 - j) / (2 : ℝ) ^ N

/-- PDF p.3: lambda^+_j. -/
def lambdaPlus (N : ℕ) (j : ℝ) : ℝ := ((N : ℝ) / 2 + j + 1) / (2 : ℝ) ^ N

/-- PDF p.6 Eq.(B1): the two actual spectral branch operators constructed from
the coupled vectors. false is rhoMinus (total spin j+1/2), true is rhoPlus
(total spin j-1/2). All magnetic numbers occur once, including the endpoints;
the nonexistent j=0 lower branch is omitted. -/
def singletSpinBranch (N : ℕ) (lowerTotalSpin : Bool) : Matrix (AC 2 N) (AC 2 N) ℂ :=
  ∑ p : SpinPath N,
    if lowerTotalSpin = true ∧ finalSpin p = 0 then 0 else
      let q := if lowerTotalSpin then finalSpin p - 1 else finalSpin p + 1
      let eigenvalue := if lowerTotalSpin then lambdaPlus N ((finalSpin p : ℝ) / 2)
        else lambdaMinus N ((finalSpin p : ℝ) / 2)
      (eigenvalue : ℂ) • ∑ k : Fin (q + 1),
        pureDensity (coupledVector p q (2 * (k.val : ℤ) - (q : ℤ)))

/-- PDF p.3 Eq.(5): weights s/(2s+1) and (s+1)/(2s+1), without square roots.
At s=0 the absent lower branch has zero weight. -/
def overlapCoefficient (N : ℕ) (s : ℝ) : ℝ :=
  (Real.sqrt (lambdaMinus N (s - 1 / 2)))⁻¹ * s / (2 * s + 1) +
  (Real.sqrt (lambdaPlus N (s + 1 / 2)))⁻¹ * (s + 1) / (2 * s + 1)

/-- PDF p.3 Eq.(4): xi at port i, with the other n qubits in their sequential spin basis. -/
def xi {n : ℕ} (i : Fin (n + 1)) (p : SpinPath n) (m : ℤ) :
    EuclideanSpace ℂ (AC 2 (n + 1)) :=
  WithLp.toLp 2 fun x => singlet (x.2, x.1 i) *
    spinVector p m (fun k => x.1 (i.succAbove k))

/-- PDF p.4 Eq.(6): port-teleportation joint primal feasibility, allowing singular X.
Unlike SDP.PrimalFeasible this includes both X and N positive effects with an exact sum. -/
def PortPrimalFeasible {d N : ℕ} (X : Matrix (Ports d N) (Ports d N) ℂ)
    (T : Fin N → Matrix (AC d N) (AC d N) ℂ) : Prop :=
  X.PosSemidef ∧ X.trace = (d : ℂ) ^ N ∧
    (∀ i, (T i).PosSemidef) ∧ ∑ i, T i = resourceLift X

/-- PDF p.4 Eq.(6): primal teleportationObjective. -/
def primalValue {d N : ℕ} (T : Fin N → Matrix (AC d N) (AC d N) ℂ) : ℝ :=
  (∑ i, (T i * signals d N i).trace.re) / (d : ℝ) ^ 2

/-- PDF p.4: trace out the last (Bob) qudit in the dual constraint. -/
def bobTrace {d N : ℕ} (W : Matrix (AC d N) (AC d N) ℂ) :
    Matrix (Ports d N) (Ports d N) ℂ := Matrix.of fun a b => ∑ c, W (a, c) (b, c)

/-- PDF p.4: port-teleportation dual feasibility; a is real and Omega is Hermitian.
Unlike SDP.DualFeasible this uses an operator variable and a partial-trace constraint. -/
def PortDualFeasible {d N : ℕ} (W : Matrix (AC d N) (AC d N) ℂ) (a : ℝ) : Prop :=
  W.IsHermitian ∧ (∀ i, (W - signals d N i).PosSemidef) ∧
    ((a : ℂ) • (1 : Matrix (Ports d N) (Ports d N) ℂ) - bobTrace W).PosSemidef

/-- PDF p.4: the explicitly separable resource |0>_A^{tensor N} tensor product_i |e_i>_B,
expressed in the O parametrization; e labels orthogonal computational output states. -/
def separableOperator {d N : ℕ} (hd : 0 < d) (e : Fin N ↪ Fin d) :
    Matrix (Ports d N) (Ports d N) ℂ :=
  Matrix.of fun x y =>
    if (∀ i, x i = ⟨0, hd⟩) ∧ (∀ i, y i = e i)
    then (Real.sqrt ((d : ℝ) ^ N) : ℂ) else 0

/-- PDF pp.1,4: a CPTP operation is applied to all Bob ports in a program density.
The accepted tensor-superoperator definition includes entangled/off-diagonal inputs. -/
def program {d N : ℕ} (E : Superop (Fin d) (Fin d))
    (R : Matrix (ResourceRegister d N) (ResourceRegister d N) ℂ) : Matrix (ResourceRegister d N) (ResourceRegister d N) ℂ :=
  idTensorSuperop (piSuperop (fun _ : Fin N => E)) R

/-- PDF p.4: two-state squared Uhlmann fidelity (distinct from channel entanglement fidelity). -/
def stateFidelity {I : Type*} [Fintype I] [DecidableEq I]
    (R S : Matrix I I ℂ) : ℝ := rootFidelity R S ^ 2

/-- PDF p.4: average over pure inputs of fidelity to the desired processed output. -/
def programmedAverage {d N : ℕ} (hd : 0 < d) (E : Superop (Fin d) (Fin d))
    (M : Fin N → Matrix (AC d N) (AC d N) ℂ) (R : Matrix (ResourceRegister d N) (ResourceRegister d N) ℂ) : ℝ :=
  ∫ v, stateFidelity (E (pureDensity v))
    (processor M (program E R) (pureDensity v)) ∂QuditFidelity.haarPureStateLaw d hd

/-- Sanity: the retained coordinate is precisely b. PDF p.2. -/
example {d N : ℕ} (i : Fin N) (z : {j : Fin N // j ≠ i} → Fin d) (b : Fin d) :
    insertPort i z b i = b := by simp [insertPort]

/-- Sanity: the zero program produces the zero output; no hidden normalization. PDF pp.1,4. -/
example {d N : ℕ} (M : Fin N → Matrix (AC d N) (AC d N) ℂ) (X : Matrix (Fin d) (Fin d) ℂ) :
    processor M 0 X = 0 := by ext b c; simp [processor]

/-- Sanity: absent outcomes give the zero map, and positive N is required below. PDF p.2. -/
example {d : ℕ} (R : Matrix (ResourceRegister d 0) (ResourceRegister d 0) ℂ) (M : Fin 0 → Matrix (AC d 0) (AC d 0) ℂ) :
    processor M R = fun _ => 0 := by funext X; ext b c; simp [processor]

/-- Sanity: inverse square root sends the zero eigenvalue to zero. PDF p.2. -/
example : (Real.sqrt (0 : ℝ))⁻¹ = 0 := by simp

/-- Sanity: neither singlet has an equal-bit component. PDF pp.2–3. -/
example : singlet (0, 0) = 0 ∧ singlet (1, 1) = 0 := by norm_num [singlet]

/-- Sanity: the one-port singlet and triplet eigenvalues are 1 and 0. PDF p.3. -/
example : lambdaMinus 1 (1 / 2) = 0 ∧ lambdaPlus 1 (1 / 2) = 1 := by
  norm_num [lambdaMinus, lambdaPlus]

/-- Sanity: a negative magnetic number outside the representation is excluded. PDF p.3. -/
example : ¬ ValidMagnetic 0 (-1) := by norm_num [ValidMagnetic]

/-- Sanity: coupling the zero-spin vacuum to a down qubit has unit coefficient. PDF p.3. -/
example : coupling 0 0 1 0 = 1 := by norm_num [coupling, ValidMagnetic, spinBit]

end QAlgorithms.Papers.Independent.Extend50.P38
Source
Asymptotic teleportation scheme as a universal programmable quantum processor, arXiv:0807.4568v2, https://arxiv.org/abs/0807.4568v2
Read-back

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

QAlgorithms.Papers.Independent.Extend50.P38.AC

For any natural numbers d,Nd,Nd,N, this denotes [d]N×[d][d]^N\times[d][d]N×[d], where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}: an element is a pair (a,u)(a,u)(a,u) consisting of an NNN-tuple aaa of labels in [d][d][d] and one further label u∈[d]u\in[d]u∈[d]. This set is empty when d=0d=0d=0; when N=0N=0N=0, the tuple component is the unique empty tuple.

QAlgorithms.Papers.Independent.Extend50.P38.CoupledSpinLabel

For every natural number NNN, including N=0N=0N=0, this defines the type of triples (p,q,m)(p,q,m)(p,q,m) with the following properties: p=(p0,…,pN)p=(p_0,\ldots,p_N)p=(p0​,…,pN​) is a sequence of integers in {0,…,N}\{0,\ldots,N\}{0,…,N}, with p0=0p_0=0p0​=0 and, for every 0≤k<N0\le k<N0≤k<N, either pk+1=pk+1p_{k+1}=p_k+1pk+1​=pk​+1 or pk=pk+1+1p_k=p_{k+1}+1pk​=pk+1​+1; qqq is a natural number satisfying q=pN+1q=p_N+1q=pN​+1 or pN=q+1p_N=q+1pN​=q+1; and mmm is an integer satisfying

−q≤m≤q,m+q≡0(mod2).-q\le m\le q,\qquad m+q\equiv0\pmod2.−q≤m≤q,m+q≡0(mod2).

Thus the endpoint pNp_NpN​ is what the definition calls the final spin. When N=0N=0N=0, the path has the single entry p0=0p_0=0p0​=0, and the allowed pairs (q,m)(q,m)(q,m) are precisely (1,−1)(1,-1)(1,−1) and (1,1)(1,1)(1,1).

QAlgorithms.Papers.Independent.Extend50.P38.PortDualFeasible

For arbitrary natural numbers d,Nd,Nd,N, let PPP be the set of length-NNN strings over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and let A=P×{0,…,d−1}A=P\times\{0,\ldots,d-1\}A=P×{0,…,d−1}. Given a complex matrix WWW indexed by A2A^2A2 and a real number aaa, define SiS_iSi​, for 0≤i<N0\le i<N0≤i<N, by

(Si)(x,u),(y,v)={(dN)−1xi=u, yi=v, and xj=yj for every j≠i,0otherwise,(S_i)_{(x,u),(y,v)}= \begin{cases} (d^N)^{-1}&x_i=u,\ y_i=v,\ \text{and }x_j=y_j\text{ for every }j\ne i,\\ 0&\text{otherwise}, \end{cases}(Si​)(x,u),(y,v)​={(dN)−10​xi​=u, yi​=v, and xj​=yj​ for every j=i,otherwise,​

using the real inverse with 0−1=00^{-1}=00−1=0, viewed in C\mathbb CC. This predicate means exactly

W=W†,W−Si⪰0 for every i,aIP−B⪰0,Bx,y=∑c=0d−1W(x,c),(y,c).W=W^\dagger,\qquad W-S_i\succeq0\ \text{for every }i,\qquad aI_P-B\succeq0, \quad B_{x,y}=\sum_{c=0}^{d-1}W_{(x,c),(y,c)}.W=W†,W−Si​⪰0 for every i,aIP​−B⪰0,Bx,y​=c=0∑d−1​W(x,c),(y,c)​.

Here IPI_PIP​ is the identity indexed by PPP, and ⪰0\succeq0⪰0 means positive semidefinite. No separate sign assumption on aaa is imposed. When N=0N=0N=0, the conditions involving SiS_iSi​ are vacuous; when d=0<Nd=0<Nd=0<N, all matrix indexing sets are empty and the predicate holds for every real aaa.

QAlgorithms.Papers.Independent.Extend50.P38.PortPrimalFeasible

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} be the set of length-NNN strings with symbols in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and let A=P×{0,…,d−1}A=P\times\{0,\ldots,d-1\}A=P×{0,…,d−1}. Given a complex matrix XXX indexed by P×PP\times PP×P and a family of complex matrices TiT_iTi​ indexed by A×AA\times AA×A, one for each i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, this predicate means exactly

X⪰0,tr⁡X=dN,Ti⪰0 for every i,∑i=0N−1Ti=X⊗Id.X\succeq0,\qquad \operatorname{tr}X=d^N,\qquad T_i\succeq0\ \text{for every }i,\qquad \sum_{i=0}^{N-1}T_i=X\otimes I_d.X⪰0,trX=dN,Ti​⪰0 for every i,i=0∑N−1​Ti​=X⊗Id​.

Here ⪰0\succeq0⪰0 means positive semidefinite, the trace equation is an equality in C\mathbb CC, and (X⊗Id)(a,u),(b,v)=Xa,bδu,v(X\otimes I_d)_{(a,u),(b,v)}=X_{a,b}\delta_{u,v}(X⊗Id​)(a,u),(b,v)​=Xa,b​δu,v​. Neither ddd nor NNN is assumed positive. When N=0N=0N=0, PPP has one element, d0=1d^0=1d0=1, and the last equation is 0=X⊗Id0=X\otimes I_d0=X⊗Id​; together with the trace equation this is impossible when d>0d>0d>0. When d=0<Nd=0<Nd=0<N, both indexing sets are empty and all these conditions hold for the resulting empty matrices.

QAlgorithms.Papers.Independent.Extend50.P38.Ports

For any natural numbers d,Nd,Nd,N, this denotes the set [d]N[d]^N[d]N of functions from [N]={0,…,N−1}[N]=\{0,\ldots,N-1\}[N]={0,…,N−1} to [d]={0,…,d−1}[d]=\{0,\ldots,d-1\}[d]={0,…,d−1}. When N=0N=0N=0, it contains exactly the empty function, including when d=0d=0d=0; when d=0d=0d=0 and N>0N>0N>0, it is empty.

QAlgorithms.Papers.Independent.Extend50.P38.ResourceRegister

For any natural numbers d,Nd,Nd,N, this denotes [d]N×[d]N[d]^N\times[d]^N[d]N×[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}: an element is a pair of NNN-tuples of labels in [d][d][d]. When N=0N=0N=0, this set is a singleton even if d=0d=0d=0; when d=0d=0d=0 and N>0N>0N>0, it is empty.

QAlgorithms.Papers.Independent.Extend50.P38.ValidMagnetic

For every natural number rrr and every integer mmm, this defines the proposition

−r≤m≤rand(m+r) mod 2=0.-r\leq m\leq r \quad\text{and}\quad (m+r)\bmod2=0.−r≤m≤rand(m+r)mod2=0.

Thus mmm must lie in the closed integer interval from −r-r−r to rrr and have the same parity as rrr. When r=0r=0r=0, the proposition holds exactly when m=0m=0m=0.

QAlgorithms.Papers.Independent.Extend50.P38.ValidResource

For any natural numbers d,Nd,Nd,N and any complex matrix OOO whose rows and columns are indexed by P=[d]NP=[d]^NP=[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this predicate means exactly

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

where O†O^\daggerO† is the conjugate transpose and the right side is regarded as a complex number; equivalently, ∑a,b∈P∣Oa,b∣2=dN\sum_{a,b\in P}|O_{a,b}|^2=d^N∑a,b∈P​∣Oa,b​∣2=dN. No positivity, unitarity, or invertibility of OOO is required. If N=0N=0N=0, then PPP is a singleton and the condition is that the sole entry of OOO has modulus 111, including when d=0d=0d=0 because 00=10^0=100=1; if d=0d=0d=0 and N>0N>0N>0, both sides are zero.

QAlgorithms.Papers.Independent.Extend50.P38.bobTrace

For arbitrary natural numbers d,Nd,Nd,N, let PPP be the set of length-NNN strings over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}. For any complex matrix WWW indexed by (P×{0,…,d−1})2(P\times\{0,\ldots,d-1\})^2(P×{0,…,d−1})2, this defines a complex matrix indexed by P2P^2P2, with entries

bobTrace⁡(W)a,b=∑c=0d−1W(a,c),(b,c).\operatorname{bobTrace}(W)_{a,b} =\sum_{c=0}^{d-1}W_{(a,c),(b,c)}.bobTrace(W)a,b​=c=0∑d−1​W(a,c),(b,c)​.

There are no Hermiticity, positivity, or trace assumptions on WWW. The definition includes N=0N=0N=0, when PPP consists of the empty string and the output has its single entry equal to tr⁡W\operatorname{tr}WtrW. For d=0d=0d=0, the sum is empty and every output entry is zero.

QAlgorithms.Papers.Independent.Extend50.P38.coupledVector

For every natural number nnn, a path p=(p0,…,pn)p=(p_0,\ldots,p_n)p=(p0​,…,pn​) taking values in {0,…,n}\{0,\ldots,n\}{0,…,n}, starting at zero and changing by exactly one at each step, every natural number qqq, and every integer mmm, this defines a complex Euclidean vector indexed by pairs (y,b)∈{0,1}n×{0,1}(y,b)\in\{0,1\}^n\times\{0,1\}(y,b)∈{0,1}n×{0,1}. Set σb=2b−1\sigma_b=2b-1σb​=2b−1, Sk(y)=∑ℓ<kσyℓS_k(y)=\sum_{\ell<k}\sigma_{y_\ell}Sk​(y)=∑ℓ<k​σyℓ​​, and u=m−σbu=m-\sigma_bu=m−σb​. For natural numbers r,tr,tr,t, an integer vvv, and β∈{0,1}\beta\in\{0,1\}β∈{0,1}, define c(r,v,t,β)=0c(r,v,t,\beta)=0c(r,v,t,β)=0 unless −r≤v≤r-r\le v\le r−r≤v≤r, v+rv+rv+r is even, −t≤v+σβ≤t-t\le v+\sigma_\beta\le t−t≤v+σβ​≤t, and v+σβ+tv+\sigma_\beta+tv+σβ​+t is even; when these conditions hold, set

c(r,v,t,β)={r+2+σβv2(r+1)t=r+1,(−1)βr−σβv2(r+1)r=t+1,0otherwise.c(r,v,t,\beta)= \begin{cases} \sqrt{\dfrac{r+2+\sigma_\beta v}{2(r+1)}}&t=r+1,\\ (-1)^\beta\sqrt{\dfrac{r-\sigma_\beta v}{2(r+1)}}&r=t+1,\\ 0&\text{otherwise}. \end{cases}c(r,v,t,β)=⎩⎨⎧​2(r+1)r+2+σβ​v​​(−1)β2(r+1)r−σβ​v​​0​t=r+1,r=t+1,otherwise.​

The coordinate is

coupledVector⁡(p,q,m)(y,b)={(∏k=0n−1c(pk,Sk(y),pk+1,yk))c(pn,u,q,b)Sn(y)=u,0otherwise,\operatorname{coupledVector}(p,q,m)(y,b)= \begin{cases} \displaystyle \left(\prod_{k=0}^{n-1}c(p_k,S_k(y),p_{k+1},y_k)\right)c(p_n,u,q,b) &S_n(y)=u,\\ 0&\text{otherwise}, \end{cases}coupledVector(p,q,m)(y,b)=⎩⎨⎧​(k=0∏n−1​c(pk​,Sk​(y),pk+1​,yk​))c(pn​,u,q,b)0​Sn​(y)=u,otherwise,​

viewed in C\mathbb CC. There are no additional admissibility or normalization assumptions on q,mq,mq,m. The definition includes n=0n=0n=0, with an empty product equal to 111 and an empty sum equal to 000.

QAlgorithms.Papers.Independent.Extend50.P38.coupling

For natural numbers p,qp,qp,q, an integer mmm, and b∈{0,1}b\in\{0,1\}b∈{0,1}, set σb=−1\sigma_b=-1σb​=−1 when b=0b=0b=0 and σb=1\sigma_b=1σb​=1 when b=1b=1b=1. Call an integer uuu admissible for a natural number rrr when −r≤u≤r-r\le u\le r−r≤u≤r and u+ru+ru+r is even. The real number defined by this declaration is

coupling⁡(p,m,q,b)={p−m+22(p+1)q=p+1, b=0,p+m+22(p+1)q=p+1, b=1,p+m2(p+1)p=q+1, b=0,−p−m2(p+1)p=q+1, b=1,0otherwise,\operatorname{coupling}(p,m,q,b)= \begin{cases} \sqrt{\dfrac{p-m+2}{2(p+1)}} & q=p+1,\ b=0,\\ \sqrt{\dfrac{p+m+2}{2(p+1)}} & q=p+1,\ b=1,\\ \sqrt{\dfrac{p+m}{2(p+1)}} & p=q+1,\ b=0,\\ -\sqrt{\dfrac{p-m}{2(p+1)}} & p=q+1,\ b=1,\\ 0 & \text{otherwise}, \end{cases}coupling(p,m,q,b)=⎩⎨⎧​2(p+1)p−m+2​​2(p+1)p+m+2​​2(p+1)p+m​​−2(p+1)p−m​​0​q=p+1, b=0,q=p+1, b=1,p=q+1, b=0,p=q+1, b=1,otherwise,​

where every displayed nonzero branch additionally requires that mmm be admissible for ppp and m+σbm+\sigma_bm+σb​ be admissible for qqq; if either requirement fails, the value is zero. The definition includes p=0p=0p=0 and q=0q=0q=0, and its denominator 2(p+1)2(p+1)2(p+1) is always positive.

QAlgorithms.Papers.Independent.Extend50.P38.finalSpin

For every natural number nnn and every path p=(p0,…,pn)p=(p_0,\ldots,p_n)p=(p0​,…,pn​) of integers in {0,…,n}\{0,\ldots,n\}{0,…,n} satisfying p0=0p_0=0p0​=0 and, for each k<nk<nk<n, either pk+1=pk+1p_{k+1}=p_k+1pk+1​=pk​+1 or pk=pk+1+1p_k=p_{k+1}+1pk​=pk+1​+1, this defines the natural number pnp_npn​. The case n=0n=0n=0 is included: the path has its single value p0=0p_0=0p0​=0, and the defined number is 000.

QAlgorithms.Papers.Independent.Extend50.P38.insertPort

For any natural numbers d,Nd,Nd,N, any i∈[N]i\in[N]i∈[N], any function z:[N]∖{i}→[d]z:[N]\setminus\{i\}\to[d]z:[N]∖{i}→[d], and any b∈[d]b\in[d]b∈[d], where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this defines the tuple ιi(z,b)∈[d]N\iota_i(z,b)\in[d]^Nιi​(z,b)∈[d]N by

ιi(z,b)j={b,j=i,z(j),j≠i.\iota_i(z,b)_j= \begin{cases} b,&j=i,\\ z(j),&j\ne i. \end{cases}ιi​(z,b)j​={b,z(j),​j=i,j=i.​

Supplying iii and bbb requires N>0N>0N>0 and d>0d>0d>0; when N=1N=1N=1, the domain of zzz is empty.

QAlgorithms.Papers.Independent.Extend50.P38.lambdaMinus

For every natural number NNN, including N=0N=0N=0, and every real number jjj, this defines the real number

λ−(N,j)=N/2−j2N.\lambda_-(N,j)=\frac{N/2-j}{2^N}.λ−​(N,j)=2NN/2−j​.

The denominator is always positive; there is no restriction on jjj, and no nonnegativity condition is imposed on the resulting value. At N=0N=0N=0, the value is −j-j−j.

QAlgorithms.Papers.Independent.Extend50.P38.lambdaPlus

For every natural number NNN, including N=0N=0N=0, and every real number jjj, this defines the real number

λ+(N,j)=N/2+j+12N.\lambda_+(N,j)=\frac{N/2+j+1}{2^N}.λ+​(N,j)=2NN/2+j+1​.

The denominator is always positive; there is no restriction on jjj, and no nonnegativity condition is imposed on the resulting value. At N=0N=0N=0, the value is j+1j+1j+1.

QAlgorithms.Papers.Independent.Extend50.P38.overlapCoefficient

For every natural number NNN, including zero, and every real number sss, this defines

overlapCoefficient⁡(N,s)=(N/2−s+1/22N)−1s2s+1+(N/2+s+3/22N)−1s+12s+1.\operatorname{overlapCoefficient}(N,s)= \left(\sqrt{\frac{N/2-s+1/2}{2^N}}\right)^{-1}\frac{s}{2s+1} + \left(\sqrt{\frac{N/2+s+3/2}{2^N}}\right)^{-1}\frac{s+1}{2s+1}.overlapCoefficient(N,s)=(2NN/2−s+1/2​​)−12s+1s​+(2NN/2+s+3/2​​)−12s+1s+1​.

No positivity or nonzero-denominator hypotheses are imposed. The real square-root function used here returns zero on negative inputs, and the inverse of zero is defined as zero. Thus a term whose square-root input is nonpositive contributes zero, and at s=−1/2s=-1/2s=−1/2 both divisions by 2s+1=02s+1=02s+1=0 give zero, so the defined value is zero.

QAlgorithms.Papers.Independent.Extend50.P38.primalValue

For arbitrary natural numbers d,Nd,Nd,N, let PPP be the set of length-NNN strings over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and let A=P×{0,…,d−1}A=P\times\{0,\ldots,d-1\}A=P×{0,…,d−1}. Given any family of complex matrices TiT_iTi​ indexed by A×AA\times AA×A, for 0≤i<N0\le i<N0≤i<N, define matrices SiS_iSi​ by

(Si)(a,u),(b,v)={(dN)−1ai=u, bi=v, and aj=bj for every j≠i,0otherwise,(S_i)_{(a,u),(b,v)}= \begin{cases} (d^N)^{-1}&a_i=u,\ b_i=v,\ \text{and }a_j=b_j\text{ for every }j\ne i,\\ 0&\text{otherwise}, \end{cases}(Si​)(a,u),(b,v)​={(dN)−10​ai​=u, bi​=v, and aj​=bj​ for every j=i,otherwise,​

where the real scalar is viewed as complex. This declaration defines

primalValue⁡(T)=∑i=0N−1Re⁡tr⁡(TiSi)d2.\operatorname{primalValue}(T)= \frac{\displaystyle\sum_{i=0}^{N-1}\operatorname{Re}\operatorname{tr}(T_iS_i)}{d^2}.primalValue(T)=d2i=0∑N−1​Retr(Ti​Si​)​.

No positivity, normalization, or feasibility conditions on TTT are required. Both zero parameters are included: the value is zero when N=0N=0N=0, by the empty sum, and also when d=0d=0d=0, because real division by zero is defined as zero.

QAlgorithms.Papers.Independent.Extend50.P38.processor

For any natural numbers d,Nd,Nd,N, put P=[d]NP=[d]^NP=[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}. Given any family of complex matrices MiM_iMi​ indexed by P×[d]P\times[d]P×[d], one for each i∈[N]i\in[N]i∈[N], and any complex matrix RRR indexed by P×PP\times PP×P, this defines a function PM,R\mathcal P_{M,R}PM,R​ from complex [d]×[d][d]\times[d][d]×[d] matrices to complex [d]×[d][d]\times[d][d]×[d] matrices by

(PM,R(X))b,c=∑i∈[N]∑a,a′∈P∑u,v∈[d]∑z:[N]∖{i}→[d](Mi)(a′,v),(a,u)R(a,ιi(z,b)),(a′,ιi(z,c))Xu,v,\bigl(\mathcal P_{M,R}(X)\bigr)_{b,c} = \sum_{i\in[N]}\sum_{a,a'\in P}\sum_{u,v\in[d]} \sum_{z:[N]\setminus\{i\}\to[d]} (M_i)_{(a',v),(a,u)} R_{(a,\iota_i(z,b)),(a',\iota_i(z,c))} X_{u,v},(PM,R​(X))b,c​=i∈[N]∑​a,a′∈P∑​u,v∈[d]∑​z:[N]∖{i}→[d]∑​(Mi​)(a′,v),(a,u)​R(a,ιi​(z,b)),(a′,ιi​(z,c))​Xu,v​,

where ιi(z,b)\iota_i(z,b)ιi​(z,b) is the tuple equal to bbb at iii and to z(j)z(j)z(j) at every j≠ij\ne ij=i. There are no positivity or normalization hypotheses on MiM_iMi​ or RRR, and being a channel is not required by the output type, which is simply a function between matrix spaces. When N=0N=0N=0, the outer sum is empty and the output is zero; when d=0d=0d=0, the input and output matrices have empty index sets.

QAlgorithms.Papers.Independent.Extend50.P38.program

For all 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 let EEE be any function from complex d×dd\times dd×d matrices to complex d×dd\times dd×d matrices. For any complex matrix RRR indexed by P×PP\times PP×P, the definition produces the matrix RER^ERE, also indexed by P×PP\times PP×P, whose entries are

R(a,b),(a′,b′)E=∑x,x′∈PR(a,x),(a′,x′)∏i=0N−1[E(exi,xi′)]bi,bi′,R^E_{(a,b),(a',b')} = \sum_{x,x'\in P}R_{(a,x),(a',x')} \prod_{i=0}^{N-1} \bigl[E(e_{x_i,x'_i})\bigr]_{b_i,b'_i},R(a,b),(a′,b′)E​=x,x′∈P∑​R(a,x),(a′,x′)​i=0∏N−1​[E(exi​,xi′​​)]bi​,bi′​​,

where eu,ve_{u,v}eu,v​ is the d×dd\times dd×d matrix with entry 111 at (u,v)(u,v)(u,v) and 000 elsewhere. Thus the first port register supplies the block indices, while the second is transformed using this matrix-unit formula. There is no assumption that EEE is linear or a channel, or that RRR is a density matrix. Both d=0d=0d=0 and N=0N=0N=0 are included; when N=0N=0N=0, PPP is a singleton and the empty product is 111, so the result equals RRR.

QAlgorithms.Papers.Independent.Extend50.P38.programmedAverage

For natural numbers d,Nd,Nd,N with a specified hypothesis d>0d>0d>0, put P={0,…,d−1}{0,…,N−1}P=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}P={0,…,d−1}{0,…,N−1}. Let EEE be any function on complex d×dd\times dd×d matrices, let MiM_iMi​, 0≤i<N0\le i<N0≤i<N, be arbitrary complex matrices indexed by P×{0,…,d−1}P\times\{0,\ldots,d-1\}P×{0,…,d−1}, and let RRR be an arbitrary complex matrix indexed by P×PP\times PP×P. Define the programmed matrix by

R(a,b),(a′,b′)E=∑x,x′∈PR(a,x),(a′,x′)∏i=0N−1[E(exi,xi′)]bi,bi′.R^E_{(a,b),(a',b')} = \sum_{x,x'\in P}R_{(a,x),(a',x')} \prod_{i=0}^{N-1}[E(e_{x_i,x'_i})]_{b_i,b'_i}.R(a,b),(a′,b′)E​=x,x′∈P∑​R(a,x),(a′,x′)​i=0∏N−1​[E(exi​,xi′​​)]bi​,bi′​​.

For any such matrix QQQ, define the processor output on a d×dd\times dd×d matrix XXX by

[PM,Q(X)]bc=∑i=0N−1∑a,a′∈P∑u,v=0d−1∑z:{j:j≠i}→{0,…,d−1}(Mi)(a′,v),(a,u)Q(a,ιi(z,b)),(a′,ιi(z,c))Xuv,[\mathcal P_{M,Q}(X)]_{bc} = \sum_{i=0}^{N-1}\sum_{a,a'\in P}\sum_{u,v=0}^{d-1} \sum_{z:\{j:j\ne i\}\to\{0,\ldots,d-1\}} (M_i)_{(a',v),(a,u)} Q_{(a,\iota_i(z,b)),(a',\iota_i(z,c))}X_{uv},[PM,Q​(X)]bc​=i=0∑N−1​a,a′∈P∑​u,v=0∑d−1​z:{j:j=i}→{0,…,d−1}∑​(Mi​)(a′,v),(a,u)​Q(a,ιi​(z,b)),(a′,ιi​(z,c))​Xuv​,

where ιi(z,b)\iota_i(z,b)ιi​(z,b) equals bbb at port iii and equals zjz_jzj​ elsewhere. Let μd\mu_dμd​ be the pushforward of normalized Haar measure on U(d)U(d)U(d) under U↦Ue0U\mapsto Ue_0U↦Ue0​, where e0e_0e0​ is the first coordinate unit vector. The defined value is

∫Cd[Re⁡tr⁡E(vv†) PM,RE(vv†) E(vv†)]2 dμd(v),\int_{\mathbb C^d} \left[ \operatorname{Re}\operatorname{tr} \sqrt{ \sqrt{E(vv^\dagger)}\, \mathcal P_{M,R^E}(vv^\dagger)\, \sqrt{E(vv^\dagger)} } \right]^2\,d\mu_d(v),∫Cd​[RetrE(vv†)​PM,RE​(vv†)E(vv†)​​]2dμd​(v),

with square roots interpreted through continuous functional calculus. No channel, positivity, normalization, POVM, measurability, or integrability assumptions are imposed on E,M,RE,M,RE,M,R; the integral is the total integral used in the definition. The case N=0N=0N=0 is included.

QAlgorithms.Papers.Independent.Extend50.P38.qubitAverage

For every natural number NNN, this defines the real number

∫Re⁡tr⁡ ⁣(vv∗ K(vv∗)) dμ(v),\int \operatorname{Re}\operatorname{tr}\!\left(vv^*\,K(vv^*)\right)\,d\mu(v),∫Retr(vv∗K(vv∗))dμ(v),

where μ\muμ is the image of normalized Haar measure on the complex unitary group U(2)U(2)U(2) under U↦Ue0U\mapsto Ue_0U↦Ue0​, with e0=(1,0)e_0=(1,0)e0​=(1,0). The matrix function KKK is specified as follows: let PN={0,1}{0,…,N−1}P_N=\{0,1\}^{\{0,\ldots,N-1\}}PN​={0,1}{0,…,N−1}, let s(0,1)=1/2s(0,1)=1/\sqrt2s(0,1)=1/2​, s(1,0)=−1/2s(1,0)=-1/\sqrt2s(1,0)=−1/2​, and let sss vanish otherwise; set R(a,b),(a′,b′)=∏js(aj,bj) ∏js(aj′,bj′)‾R_{(a,b),(a',b')}=\prod_j s(a_j,b_j)\,\overline{\prod_j s(a'_j,b'_j)}R(a,b),(a′,b′)​=∏j​s(aj​,bj​)∏j​s(aj′​,bj′​)​. Define (Si)(a,u),(a′,v)=2−(N−1)s(u,ai)s(v,ai′)‾(S_i)_{(a,u),(a',v)}=2^{-(N-1)}s(u,a_i)\overline{s(v,a'_i)}(Si​)(a,u),(a′,v)​=2−(N−1)s(u,ai​)s(v,ai′​)​ if aaa and a′a'a′ agree away from iii, and zero otherwise; set F=f(∑iSi)F=f(\sum_iS_i)F=f(∑i​Si​) by real continuous functional calculus with f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1, zero for t≤0t\leq0t≤0, and set Mi=FSiF+N−1(Id⁡−∑jFSjF)M_i=FS_iF+N^{-1}(\operatorname{Id}-\sum_jFS_jF)Mi​=FSi​F+N−1(Id−∑j​FSj​F). If ιi(z,b)\iota_i(z,b)ιi​(z,b) inserts bbb at position iii into a string zzz on the remaining positions, then

K(X)bc=∑i=0N−1 ∑a,a′∈PN ∑u,v′∈{0,1} ∑z(Mi)(a′,v′),(a,u)R(a,ιi(z,b)),(a′,ιi(z,c)) Xuv′.K(X)_{bc} = \sum_{i=0}^{N-1}\ \sum_{a,a'\in P_N}\ \sum_{u,v'\in\{0,1\}}\ \sum_z (M_i)_{(a',v'),(a,u)} R_{(a,\iota_i(z,b)),(a',\iota_i(z,c))}\,X_{uv'}.K(X)bc​=i=0∑N−1​ a,a′∈PN​∑​ u,v′∈{0,1}∑​ z∑​(Mi​)(a′,v′),(a,u)​R(a,ιi​(z,b)),(a′,ιi​(z,c))​Xuv′​.

For N=0N=0N=0, this function KKK is zero, so the defined average is zero.

QAlgorithms.Papers.Independent.Extend50.P38.qubitClosedF

For every natural number NNN, including N=0N=0N=0, this defines the real number

12N+3∑k=0N(Nk)(N−2k−1k+1+N−2k+1N−k+1)2.\frac{1}{2^{N+3}} \sum_{k=0}^{N} \binom Nk \left( \frac{N-2k-1}{\sqrt{k+1}} + \frac{N-2k+1}{\sqrt{N-k+1}} \right)^2.2N+31​k=0∑N​(kN​)(k+1​N−2k−1​+N−k+1​N−2k+1​)2.

All arithmetic inside the parentheses is real arithmetic after converting NNN and kkk to real numbers. Throughout the summation, both square-root denominators are strictly positive. At N=0N=0N=0, the value is 000.

QAlgorithms.Papers.Independent.Extend50.P38.rawSrm

For every natural number NNN, every finite type III with decidable equality, every family of complex I×II\times II×I matrices (Sj)j=0N−1(S_j)_{j=0}^{N-1}(Sj​)j=0N−1​, and every index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, this defines

FSiF,F=f ⁣(∑j=0N−1Sj),f(t)=(t)−1,F S_i F,\qquad F=f\!\left(\sum_{j=0}^{N-1}S_j\right),\qquad f(t)=(\sqrt t)^{-1},FSi​F,F=f(j=0∑N−1​Sj​),f(t)=(t​)−1,

where fff is applied through the real continuous functional calculus, with f(t)=0f(t)=0f(t)=0 for t≤0t\leq0t≤0 and the calculus returning zero on non-Hermitian matrices. The matrices SjS_jSj​ need not be positive or Hermitian. The type III may be empty; when N=0N=0N=0, there is no possible index iii.

QAlgorithms.Papers.Independent.Extend50.P38.resourceDensity

For any natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by P=[d]NP=[d]^NP=[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this defines the complex matrix ROR_ORO​ indexed by P×PP\times PP×P by

RO((a,b),(a′,b′))=(Oa,bdN)(Oa′,b′dN)‾.R_O\bigl((a,b),(a',b')\bigr) = \left(\frac{O_{a,b}}{\sqrt{d^N}}\right) \overline{\left(\frac{O_{a',b'}}{\sqrt{d^N}}\right)}.RO​((a,b),(a′,b′))=(dN​Oa,b​​)(dN​Oa′,b′​​)​.

Thus it is the outer product of the vector with coordinates Oa,b/dNO_{a,b}/\sqrt{d^N}Oa,b​/dN​ and its conjugate. No normalization condition on OOO is assumed, so trace 111 is not part of this definition. Division by zero is zero; when d=0,N>0d=0,N>0d=0,N>0, the matrix has an empty index set, while for N=0N=0N=0 its sole entry is the squared modulus of the sole entry of OOO.

QAlgorithms.Papers.Independent.Extend50.P38.resourceLift

For any natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by P=[d]NP=[d]^NP=[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this defines LO=O⊗IdL_O=O\otimes I_dLO​=O⊗Id​, a complex matrix indexed by P×[d]P\times[d]P×[d]. Explicitly,

(LO)(a,u),(a′,v)={Oa,a′,u=v,0,u≠v.(L_O)_{(a,u),(a',v)} = \begin{cases} O_{a,a'},&u=v,\\ 0,&u\ne v. \end{cases}(LO​)(a,u),(a′,v)​={Oa,a′​,0,​u=v,u=v.​

No condition on OOO is assumed. When d=0d=0d=0, this matrix has an empty index set; when N=0N=0N=0, it is the sole entry of OOO multiplied by IdI_dId​.

QAlgorithms.Papers.Independent.Extend50.P38.resourceVector

For any natural numbers d,Nd,Nd,N and any complex matrix OOO indexed by P=[d]NP=[d]^NP=[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this defines the vector vOv_OvO​ in the complex Euclidean space indexed by P×PP\times PP×P through

vO(a,b)=Oa,bdN.v_O(a,b)=\frac{O_{a,b}}{\sqrt{d^N}}.vO​(a,b)=dN​Oa,b​​.

The square root is the real square root, embedded in C\mathbb CC. No condition on OOO or positivity assumption on d,Nd,Nd,N is imposed, and no unit norm is asserted. Division by zero uses the convention that its value is zero; for d=0,N>0d=0,N>0d=0,N>0, the coordinate set is empty. For N=0N=0N=0, the denominator is 111, including when d=0d=0d=0.

QAlgorithms.Papers.Independent.Extend50.P38.separableOperator

For natural numbers d,Nd,Nd,N, a hypothesis d>0d>0d>0, and an injection e:{0,…,N−1}↪{0,…,d−1}e:\{0,\ldots,N-1\}\hookrightarrow\{0,\ldots,d-1\}e:{0,…,N−1}↪{0,…,d−1}, this defines a complex matrix indexed by length-NNN strings x,yx,yx,y over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, whose entries are

separableOperator⁡(d,e)x,y={dNxi=0 and yi=e(i) for every 0≤i<N,0otherwise.\operatorname{separableOperator}(d,e)_{x,y}= \begin{cases} \sqrt{d^N}&x_i=0\text{ and }y_i=e(i)\text{ for every }0\le i<N,\\ 0&\text{otherwise}. \end{cases}separableOperator(d,e)x,y​={dN​0​xi​=0 and yi​=e(i) for every 0≤i<N,otherwise.​

The displayed square root is real and then viewed as complex. The injection is part of the input and can exist only when N≤dN\le dN≤d; no such input exists when N>dN>dN>d. The case N=0N=0N=0 is included: there is one empty string, both coordinate conditions are vacuous, and the resulting one-by-one matrix has entry 111.

QAlgorithms.Papers.Independent.Extend50.P38.signals

For any natural numbers d,Nd,Nd,N and any i∈[N]i\in[N]i∈[N], where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this defines the complex matrix SiS_iSi​ indexed by [d]N×[d][d]^N\times[d][d]N×[d] through

(Si)(a,u),(a′,v)={(dN)−1,ai=u,ai′=v,aj=aj′ for every j≠i,0,otherwise.(S_i)_{(a,u),(a',v)} = \begin{cases} (d^N)^{-1},& a_i=u,\quad a'_i=v,\quad a_j=a'_j\text{ for every }j\ne i,\\ 0,&\text{otherwise}. \end{cases}(Si​)(a,u),(a′,v)​={(dN)−1,0,​ai​=u,ai′​=v,aj​=aj′​ for every j=i,otherwise.​

The inverse on the first branch is taken in R\mathbb RR and then embedded in C\mathbb CC, with 0−1=00^{-1}=00−1=0. There is no iii to supply when N=0N=0N=0; if d=0d=0d=0 and N>0N>0N>0, the matrix index set is empty.

QAlgorithms.Papers.Independent.Extend50.P38.singletResource

For every natural number NNN, let PNP_NPN​ be the set of functions {0,…,N−1}→{0,1}\{0,\ldots,N-1\}\to\{0,1\}{0,…,N−1}→{0,1}, and define s(0,1)=1/2s(0,1)=1/\sqrt2s(0,1)=1/2​, s(1,0)=−1/2s(1,0)=-1/\sqrt2s(1,0)=−1/2​, and s(0,0)=s(1,1)=0s(0,0)=s(1,1)=0s(0,0)=s(1,1)=0. This defines a complex matrix RRR indexed by PN×PNP_N\times P_NPN​×PN​, whose entries are

R(a,b),(a′,b′)=(∏i=0N−1s(ai,bi))(∏i=0N−1s(ai′,bi′))‾.R_{(a,b),(a',b')} = \left(\prod_{i=0}^{N-1}s(a_i,b_i)\right) \overline{\left(\prod_{i=0}^{N-1}s(a'_i,b'_i)\right)}.R(a,b),(a′,b′)​=(i=0∏N−1​s(ai​,bi​))(i=0∏N−1​s(ai′​,bi′​))​.

Thus it is the outer product of the vector with coefficient ∏is(ai,bi)\prod_i s(a_i,b_i)∏i​s(ai​,bi​) with itself. When N=0N=0N=0, both products are 111, the indexing set has one element, and RRR is the one-entry matrix [1][1][1].

QAlgorithms.Papers.Independent.Extend50.P38.singletSignals

For every natural number NNN and every i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, let PN={0,1}{0,…,N−1}P_N=\{0,1\}^{\{0,\ldots,N-1\}}PN​={0,1}{0,…,N−1} and define s(0,1)=1/2s(0,1)=1/\sqrt2s(0,1)=1/2​, s(1,0)=−1/2s(1,0)=-1/\sqrt2s(1,0)=−1/2​, and s(0,0)=s(1,1)=0s(0,0)=s(1,1)=0s(0,0)=s(1,1)=0. This defines the complex matrix SiS_iSi​ indexed by PN×{0,1}P_N\times\{0,1\}PN​×{0,1} with entries

(Si)(a,u),(a′,v)={2−(N−1)s(u,ai) s(v,ai′)‾,aj=aj′ for every j≠i,0,otherwise.(S_i)_{(a,u),(a',v)} = \begin{cases} 2^{-(N-1)}s(u,a_i)\,\overline{s(v,a'_i)}, & a_j=a'_j\text{ for every }j\ne i,\\ 0,&\text{otherwise}. \end{cases}(Si​)(a,u),(a′,v)​={2−(N−1)s(u,ai​)s(v,ai′​)​,0,​aj​=aj′​ for every j=i,otherwise.​

The subtraction N−1N-1N−1 in the definition is natural-number subtraction; an index iii exists only when N≥1N\geq1N≥1, so it then agrees with ordinary subtraction. For N=0N=0N=0, there is no index iii.

QAlgorithms.Papers.Independent.Extend50.P38.singletSpinBranch

For every natural number NNN and Boolean choice ℓ\ellℓ, this defines a complex matrix on the finite index set AN={0,1}N×{0,1}\mathcal A_N=\{0,1\}^N\times\{0,1\}AN​={0,1}N×{0,1}. The paths being summed over are all sequences p=(p0,…,pN)p=(p_0,\ldots,p_N)p=(p0​,…,pN​) with pk∈{0,…,N}p_k\in\{0,\ldots,N\}pk​∈{0,…,N}, p0=0p_0=0p0​=0, and adjacent entries differing by one; write r=pNr=p_Nr=pN​. To specify the vectors in the matrix, put σ(0)=−1\sigma(0)=-1σ(0)=−1, σ(1)=1\sigma(1)=1σ(1)=1, and call an integer MMM admissible for a natural number hhh when −h≤M≤h-h\le M\le h−h≤M≤h and M+h≡0(mod2)M+h\equiv0\pmod2M+h≡0(mod2). Define the real coefficient C(h,M;q,b)C(h,M;q,b)C(h,M;q,b) to be zero unless MMM is admissible for hhh and M+σ(b)M+\sigma(b)M+σ(b) is admissible for qqq; when both conditions hold, define it by

C(h,M;q,b)={h−M+22(h+1),q=h+1, b=0,h+M+22(h+1),q=h+1, b=1,h+M2(h+1),h=q+1, b=0,−h−M2(h+1),h=q+1, b=1,0,otherwise.C(h,M;q,b)= \begin{cases} \sqrt{\dfrac{h-M+2}{2(h+1)}},&q=h+1,\ b=0,\\ \sqrt{\dfrac{h+M+2}{2(h+1)}},&q=h+1,\ b=1,\\ \sqrt{\dfrac{h+M}{2(h+1)}},&h=q+1,\ b=0,\\ -\sqrt{\dfrac{h-M}{2(h+1)}},&h=q+1,\ b=1,\\ 0,&\text{otherwise}. \end{cases}C(h,M;q,b)=⎩⎨⎧​2(h+1)h−M+2​​,2(h+1)h+M+2​​,2(h+1)h+M​​,−2(h+1)h−M​​,0,​q=h+1, b=0,q=h+1, b=1,h=q+1, b=0,h=q+1, b=1,otherwise.​

For a∈{0,1}Na\in\{0,1\}^Na∈{0,1}N, let Mk(a)=∑j<kσ(aj)M_k(a)=\sum_{j<k}\sigma(a_j)Mk​(a)=∑j<k​σ(aj​), and define the complex vector vp,Mv_{p,M}vp,M​ by

vp,M(a)={∏k=0N−1C(pk,Mk(a);pk+1,ak),MN(a)=M,0,MN(a)≠M.v_{p,M}(a)= \begin{cases} \displaystyle\prod_{k=0}^{N-1}C(p_k,M_k(a);p_{k+1},a_k),&M_N(a)=M,\\ 0,&M_N(a)\ne M. \end{cases}vp,M​(a)=⎩⎨⎧​k=0∏N−1​C(pk​,Mk​(a);pk+1​,ak​),0,​MN​(a)=M,MN​(a)=M.​

Define wp,q,m(a,b)=vp,m−σ(b)(a) C(r,m−σ(b);q,b)w_{p,q,m}(a,b)=v_{p,m-\sigma(b)}(a)\,C(r,m-\sigma(b);q,b)wp,q,m​(a,b)=vp,m−σ(b)​(a)C(r,m−σ(b);q,b), with real coefficients viewed as complex numbers, and let ww∗ww^*ww∗ denote the matrix with entry w(x)w(y)‾w(x)\overline{w(y)}w(x)w(y)​. The matrix defined by the declaration is

{∑pN−r2N+1∑k=0r+1wp,r+1, 2k−(r+1)wp,r+1, 2k−(r+1)∗,ℓ=false,∑pr>0N+r+22N+1∑k=0r−1wp,r−1, 2k−(r−1)wp,r−1, 2k−(r−1)∗,ℓ=true.\begin{cases} \displaystyle \sum_p \frac{N-r}{2^{N+1}} \sum_{k=0}^{r+1} w_{p,r+1,\,2k-(r+1)}w_{p,r+1,\,2k-(r+1)}^*, &\ell=\mathrm{false},\\[6pt] \displaystyle \sum_{\substack{p\\r>0}}\frac{N+r+2}{2^{N+1}} \sum_{k=0}^{r-1} w_{p,r-1,\,2k-(r-1)}w_{p,r-1,\,2k-(r-1)}^*, &\ell=\mathrm{true}. \end{cases}⎩⎨⎧​p∑​2N+1N−r​k=0∑r+1​wp,r+1,2k−(r+1)​wp,r+1,2k−(r+1)∗​,pr>0​∑​2N+1N+r+2​k=0∑r−1​wp,r−1,2k−(r−1)​wp,r−1,2k−(r−1)∗​,​ℓ=false,ℓ=true.​

The second case omits every path whose endpoint is zero; its subtraction r−1r-1r−1 is natural-number subtraction. Empty products in the vector formulas equal one. At N=0N=0N=0, both Boolean choices give the zero matrix. This declaration defines the matrix without asserting any further property of it.

QAlgorithms.Papers.Independent.Extend50.P38.singletSrmChannel

For every natural number NNN, this defines a function KKK from complex 2×22\times22×2 matrices to complex 2×22\times22×2 matrices as follows. Write PN={0,1}{0,…,N−1}P_N=\{0,1\}^{\{0,\ldots,N-1\}}PN​={0,1}{0,…,N−1}, let s(0,1)=1/2s(0,1)=1/\sqrt2s(0,1)=1/2​, s(1,0)=−1/2s(1,0)=-1/\sqrt2s(1,0)=−1/2​, and let sss vanish on the other two pairs. Define R(a,b),(a′,b′)=∏js(aj,bj) ∏js(aj′,bj′)‾R_{(a,b),(a',b')}=\prod_j s(a_j,b_j)\,\overline{\prod_j s(a'_j,b'_j)}R(a,b),(a′,b′)​=∏j​s(aj​,bj​)∏j​s(aj′​,bj′​)​, and define (Si)(a,u),(a′,v)=2−(N−1)s(u,ai)s(v,ai′)‾(S_i)_{(a,u),(a',v)}=2^{-(N-1)}s(u,a_i)\overline{s(v,a'_i)}(Si​)(a,u),(a′,v)​=2−(N−1)s(u,ai​)s(v,ai′​)​ when aj=aj′a_j=a'_jaj​=aj′​ for every j≠ij\ne ij=i, and zero otherwise. Set F=f(∑iSi)F=f(\sum_iS_i)F=f(∑i​Si​) through the real continuous functional calculus, with f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1, zero for t≤0t\leq0t≤0, and set Mi=FSiF+N−1(Id⁡−∑jFSjF)M_i=FS_iF+N^{-1}(\operatorname{Id}-\sum_jFS_jF)Mi​=FSi​F+N−1(Id−∑j​FSj​F). For z:{j:j≠i}→{0,1}z:\{j:j\ne i\}\to\{0,1\}z:{j:j=i}→{0,1}, let ιi(z,b)\iota_i(z,b)ιi​(z,b) be the string equal to bbb at iii and to zjz_jzj​ elsewhere. The defined function is

K(X)bc=∑i=0N−1 ∑a,a′∈PN ∑u,v∈{0,1} ∑z(Mi)(a′,v),(a,u)R(a,ιi(z,b)),(a′,ιi(z,c)) Xuv.K(X)_{bc} = \sum_{i=0}^{N-1}\ \sum_{a,a'\in P_N}\ \sum_{u,v\in\{0,1\}}\ \sum_z (M_i)_{(a',v),(a,u)} R_{(a,\iota_i(z,b)),(a',\iota_i(z,c))}\,X_{uv}.K(X)bc​=i=0∑N−1​ a,a′∈PN​∑​ u,v∈{0,1}∑​ z∑​(Mi​)(a′,v),(a,u)​R(a,ιi​(z,b)),(a′,ιi​(z,c))​Xuv​.

The definition specifies this function without asserting a channel property. When N=0N=0N=0, the outer sum is empty and K(X)=0K(X)=0K(X)=0 for every XXX.

QAlgorithms.Papers.Independent.Extend50.P38.spinBit

For every b∈{0,1}b\in\{0,1\}b∈{0,1}, this defines an integer equal to −1-1−1 when b=0b=0b=0 and equal to 111 when b=1b=1b=1.

QAlgorithms.Papers.Independent.Extend50.P38.spinVector

For every natural number nnn, a path p=(p0,…,pn)p=(p_0,\ldots,p_n)p=(p0​,…,pn​) with each pk∈{0,…,n}p_k\in\{0,\ldots,n\}pk​∈{0,…,n}, p0=0p_0=0p0​=0, and adjacent values differing by exactly one, and every integer mmm, this defines a complex Euclidean vector indexed by strings x=(x0,…,xn−1)∈{0,1}nx=(x_0,\ldots,x_{n-1})\in\{0,1\}^nx=(x0​,…,xn−1​)∈{0,1}n. Put σb=2b−1\sigma_b=2b-1σb​=2b−1 for b∈{0,1}b\in\{0,1\}b∈{0,1}, Sk(x)=∑ℓ<kσxℓS_k(x)=\sum_{\ell<k}\sigma_{x_\ell}Sk​(x)=∑ℓ<k​σxℓ​​, and call uuu admissible for r∈Nr\in\mathbb Nr∈N when −r≤u≤r-r\le u\le r−r≤u≤r and u+ru+ru+r is even. Define the real factor

c(r,u,t,b)={r+2+σbu2(r+1)t=r+1, u admissible for r, u+σb admissible for t,(−1)br−σbu2(r+1)r=t+1, u admissible for r, u+σb admissible for t,0otherwise.c(r,u,t,b)= \begin{cases} \sqrt{\dfrac{r+2+\sigma_bu}{2(r+1)}}& t=r+1,\ u\text{ admissible for }r,\ u+\sigma_b\text{ admissible for }t,\\ (-1)^b\sqrt{\dfrac{r-\sigma_bu}{2(r+1)}}& r=t+1,\ u\text{ admissible for }r,\ u+\sigma_b\text{ admissible for }t,\\ 0&\text{otherwise}. \end{cases}c(r,u,t,b)=⎩⎨⎧​2(r+1)r+2+σb​u​​(−1)b2(r+1)r−σb​u​​0​t=r+1, u admissible for r, u+σb​ admissible for t,r=t+1, u admissible for r, u+σb​ admissible for t,otherwise.​

The vector’s coordinate is

spinVector⁡(p,m)(x)={∏k=0n−1c(pk,Sk(x),pk+1,xk)Sn(x)=m,0otherwise,\operatorname{spinVector}(p,m)(x)= \begin{cases} \displaystyle\prod_{k=0}^{n-1}c(p_k,S_k(x),p_{k+1},x_k)&S_n(x)=m,\\ 0&\text{otherwise}, \end{cases}spinVector(p,m)(x)=⎩⎨⎧​k=0∏n−1​c(pk​,Sk​(x),pk+1​,xk​)0​Sn​(x)=m,otherwise,​

with the real product viewed as a complex number. No restriction on mmm or normalization hypothesis is imposed. For n=0n=0n=0, the unique coordinate is 111 if m=0m=0m=0, and 000 otherwise.

QAlgorithms.Papers.Independent.Extend50.P38.srm

For every natural number NNN, every finite type III with decidable equality, every family of complex I×II\times II×I matrices (Sj)j=0N−1(S_j)_{j=0}^{N-1}(Sj​)j=0N−1​, and every i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, this defines

Mi=FSiF+1N(Id⁡I−∑j=0N−1FSjF),F=f ⁣(∑j=0N−1Sj),f(t)=(t)−1.M_i=F S_i F+\frac1N\left(\operatorname{Id}_I-\sum_{j=0}^{N-1}F S_j F\right), \qquad F=f\!\left(\sum_{j=0}^{N-1}S_j\right),\qquad f(t)=(\sqrt t)^{-1}.Mi​=FSi​F+N1​(IdI​−j=0∑N−1​FSj​F),F=f(j=0∑N−1​Sj​),f(t)=(t​)−1.

Here fff is applied through the real continuous functional calculus, equals zero for t≤0t\leq0t≤0, and gives the zero matrix when its matrix argument is non-Hermitian. No positivity or normalization of the family is assumed. Empty III is allowed; when N=0N=0N=0, there is no index iii at which to evaluate this definition.

QAlgorithms.Papers.Independent.Extend50.P38.srmCompletion

For every natural number NNN, every finite type III with decidable equality, and every family of complex I×II\times II×I matrices (Si)i=0N−1(S_i)_{i=0}^{N-1}(Si​)i=0N−1​, this defines

1N(Id⁡I−∑i=0N−1FSiF),F=f ⁣(∑j=0N−1Sj),f(t)=(t)−1,\frac1N\left(\operatorname{Id}_I-\sum_{i=0}^{N-1}F S_i F\right), \qquad F=f\!\left(\sum_{j=0}^{N-1}S_j\right),\qquad f(t)=(\sqrt t)^{-1},N1​(IdI​−i=0∑N−1​FSi​F),F=f(j=0∑N−1​Sj​),f(t)=(t​)−1,

where the scalar 1/N1/N1/N is taken in C\mathbb CC and fff is applied through the real continuous functional calculus. The scalar function is zero for t≤0t\leq0t≤0, and this calculus returns zero on non-Hermitian matrices. No positivity assumptions are imposed. Empty III is allowed; for N=0N=0N=0, the sums are empty and the totalized reciprocal 1/0=01/0=01/0=0 makes the defined matrix zero.

QAlgorithms.Papers.Independent.Extend50.P38.stateFidelity

For every finite index type III, equipped with decidable equality, and arbitrary complex matrices R,SR,SR,S indexed by III, the definition is

F(R,S)=[Re⁡tr⁡R S R]2,F(R,S) = \left[ \operatorname{Re}\operatorname{tr} \sqrt{\sqrt R\,S\,\sqrt R} \right]^2,F(R,S)=[RetrR​SR​​]2,

where each square root denotes application of the real function t↦tt\mapsto\sqrt tt↦t​ through the continuous functional calculus. The square is taken after extracting the real part of the trace. Neither matrix is assumed positive semidefinite or normalized; the functional-calculus expressions are the total expressions used by the definition. The index type may be empty, in which case the trace, and hence this value, is zero.

QAlgorithms.Papers.Independent.Extend50.P38.supportedInvSqrt

For any finite type III with decidable equality and any complex matrix AAA indexed by I×II\times II×I, this defines the matrix obtained by applying the real continuous functional calculus to AAA with scalar function f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1. Here the real square root and reciprocal are totalized, so f(t)=1/tf(t)=1/\sqrt tf(t)=1/t​ for t>0t>0t>0 and f(t)=0f(t)=0f(t)=0 for t≤0t\leq0t≤0. For Hermitian AAA, this applies fff to its eigenvalues; for non-Hermitian AAA, the real functional calculus returns the zero matrix. No positivity or invertibility assumption is imposed, and III may be empty.

QAlgorithms.Papers.Independent.Extend50.P38.teleport

For any natural numbers d,Nd,Nd,N, put P=[d]NP=[d]^NP=[d]N, where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}. Given any complex matrix OOO indexed by PPP and any family of complex matrices MiM_iMi​ indexed by P×[d]P\times[d]P×[d] for i∈[N]i\in[N]i∈[N], this defines a function TO,M\mathcal T_{O,M}TO,M​ on complex [d]×[d][d]\times[d][d]×[d] matrices by

(TO,M(X))b,c=∑i∈[N]∑a,a′∈P∑u,v∈[d]∑z:[N]∖{i}→[d](Mi)(a′,v),(a,u)Oa,ιi(z,b)dN (Oa′,ιi(z,c)dN)‾Xu,v,\bigl(\mathcal T_{O,M}(X)\bigr)_{b,c} = \sum_{i\in[N]}\sum_{a,a'\in P}\sum_{u,v\in[d]} \sum_{z:[N]\setminus\{i\}\to[d]} (M_i)_{(a',v),(a,u)} \frac{O_{a,\iota_i(z,b)}}{\sqrt{d^N}}\, \overline{\left(\frac{O_{a',\iota_i(z,c)}}{\sqrt{d^N}}\right)} X_{u,v},(TO,M​(X))b,c​=i∈[N]∑​a,a′∈P∑​u,v∈[d]∑​z:[N]∖{i}→[d]∑​(Mi​)(a′,v),(a,u)​dN​Oa,ιi​(z,b)​​(dN​Oa′,ιi​(z,c)​​)​Xu,v​,

where ιi(z,b)\iota_i(z,b)ιi​(z,b) equals bbb at iii and z(j)z(j)z(j) elsewhere. No resource normalization, measurement condition, or channel condition is assumed. Division by zero is zero. When N=0N=0N=0, the output is zero because the sum over iii is empty; when d=0d=0d=0, the input and output index sets are empty.

QAlgorithms.Papers.Independent.Extend50.P38.teleportationObjective

For any natural numbers d,Nd,Nd,N, any complex matrix OOO indexed by P=[d]NP=[d]^NP=[d]N, and any family of complex matrices MiM_iMi​ indexed by P×[d]P\times[d]P×[d] for i∈[N]i\in[N]i∈[N], where [r]={0,…,r−1}[r]=\{0,\ldots,r-1\}[r]={0,…,r−1}, this defines the real number

1d2∑i∈[N]Re⁡tr⁡ ⁣(MiLOSiLO†).\frac{1}{d^2}\sum_{i\in[N]} \operatorname{Re}\operatorname{tr}\!\left(M_iL_OS_iL_O^\dagger\right).d21​i∈[N]∑​Retr(Mi​LO​Si​LO†​).

Here (LO)(a,u),(a′,v)=Oa,a′(L_O)_{(a,u),(a',v)}=O_{a,a'}(LO​)(a,u),(a′,v)​=Oa,a′​ when u=vu=vu=v and is zero otherwise; (Si)(a,u),(a′,v)=(dN)−1(S_i)_{(a,u),(a',v)}=(d^N)^{-1}(Si​)(a,u),(a′,v)​=(dN)−1 when ai=ua_i=uai​=u, ai′=va'_i=vai′​=v, and aj=aj′a_j=a'_jaj​=aj′​ for every j≠ij\ne ij=i, and is zero otherwise; and †\dagger† denotes conjugate transpose. No normalization, positivity, or unitarity hypotheses are imposed on OOO or MiM_iMi​. All inverses and division use zero at a zero denominator, so the objective is zero when d=0d=0d=0; it is also zero when N=0N=0N=0 because the sum is empty.

QAlgorithms.Papers.Independent.Extend50.P38.xi

For every natural number nnn, an index i∈{0,…,n}i\in\{0,\ldots,n\}i∈{0,…,n}, a path p=(p0,…,pn)p=(p_0,\ldots,p_n)p=(p0​,…,pn​) taking values in {0,…,n}\{0,\ldots,n\}{0,…,n}, starting at zero and changing by exactly one at each step, and every integer mmm, this defines a complex Euclidean vector indexed by (x,b)∈{0,1}n+1×{0,1}(x,b)\in\{0,1\}^{n+1}\times\{0,1\}(x,b)∈{0,1}n+1×{0,1}. Delete coordinate iii from xxx while preserving the order of the remaining coordinates to obtain y∈{0,1}ny\in\{0,1\}^ny∈{0,1}n; explicitly, yk=xky_k=x_kyk​=xk​ for k<ik<ik<i and yk=xk+1y_k=x_{k+1}yk​=xk+1​ for k≥ik\ge ik≥i. Set σβ=2β−1\sigma_\beta=2\beta-1σβ​=2β−1, Sk(y)=∑ℓ<kσyℓS_k(y)=\sum_{\ell<k}\sigma_{y_\ell}Sk​(y)=∑ℓ<k​σyℓ​​, and define c(r,u,t,β)=0c(r,u,t,\beta)=0c(r,u,t,β)=0 unless −r≤u≤r-r\le u\le r−r≤u≤r, u+ru+ru+r is even, −t≤u+σβ≤t-t\le u+\sigma_\beta\le t−t≤u+σβ​≤t, and u+σβ+tu+\sigma_\beta+tu+σβ​+t is even; under those conditions, let

c(r,u,t,β)={r+2+σβu2(r+1)t=r+1,(−1)βr−σβu2(r+1)r=t+1,0otherwise.c(r,u,t,\beta)= \begin{cases} \sqrt{\dfrac{r+2+\sigma_\beta u}{2(r+1)}}&t=r+1,\\ (-1)^\beta\sqrt{\dfrac{r-\sigma_\beta u}{2(r+1)}}&r=t+1,\\ 0&\text{otherwise}. \end{cases}c(r,u,t,β)=⎩⎨⎧​2(r+1)r+2+σβ​u​​(−1)β2(r+1)r−σβ​u​​0​t=r+1,r=t+1,otherwise.​

Writing s(0,1)=1/2s(0,1)=1/\sqrt2s(0,1)=1/2​, s(1,0)=−1/2s(1,0)=-1/\sqrt2s(1,0)=−1/2​, and s(0,0)=s(1,1)=0s(0,0)=s(1,1)=0s(0,0)=s(1,1)=0, the coordinate is

ξ(i,p,m)(x,b)={s(b,xi)∏k=0n−1c(pk,Sk(y),pk+1,yk)Sn(y)=m,0otherwise.\xi(i,p,m)(x,b)= \begin{cases} \displaystyle s(b,x_i)\prod_{k=0}^{n-1}c(p_k,S_k(y),p_{k+1},y_k)&S_n(y)=m,\\ 0&\text{otherwise}. \end{cases}ξ(i,p,m)(x,b)=⎩⎨⎧​s(b,xi​)k=0∏n−1​c(pk​,Sk​(y),pk+1​,yk​)0​Sn​(y)=m,otherwise.​

No normalization or admissibility assumption on mmm is imposed. When n=0n=0n=0, necessarily i=0i=0i=0, and this coordinate is s(b,x0)s(b,x_0)s(b,x0​) if m=0m=0m=0, and zero otherwise.

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