Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Multiport based teleportation -- transmission of a large amount of quantum information

Definition
QAlgorithms_Papers_Independent_Extend50_P17

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

prove2quantum

The objects the formalized statements of Multiport based teleportation -- transmission of a large amount of quantum information (arXiv:2008.00856) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • MPBTRegister: PDF pp.2–3: the product computational basis of n d-level particles.
  • MPBTPortSelection: PDF pp.2–3: distinct ordered ports, with reversed input order as in Eq.(27).
  • AliceBasis: PDF p.3: Alice's ports together with the k input/reference systems.
  • AliceOp: PDF p.3: matrices on the actual Alice/input space.
  • outcomeCount: PDF p.2: the number of ordered outcomes; equals k! choose(N,k) when k≤N.
  • pairingWord: PDF pp.8–10, Eq.(27): the product of disjoint swaps, rightmost acting first.
  • mpbtWordOperator: PDF pp.8–10: unnormalized partially transposed permutation word W(a). The crossed second coordinates implement transpose on precisely the last k factors.
  • mpbtSignal: PDF pp.2–3, Eq.(2), and p.8, Eq.(25): normalized signals, of trace one.
  • signalSum: PDF p.4, Eq.(6): sum of normalized signals; not Definition 4's unscaled sum.
  • unscaledSum: PDF p.8, Definition 4: unscaled sum of words R=d^N rho.
  • normalizedSum: PDF p.4, Lemma 1: normalize by the actual trace, without assuming invertibility.
  • supportInverseSqrt: PDF p.4, Eq.(6): spectral inverse square root, zero on the kernel.
  • rawSRM: PDF p.4, Eq.(6): SRM on the support of the signal sum.
  • completedSRM: PDF p.4, support convention: uniformly distribute the kernel projector among outcomes.
  • discrimination: PDF p.4, Eq.(5): discrimination success with equal prior over normalized signals.
  • mpbtFidelity: PDF p.3, Eq.(3): entanglement fidelity for the fixed EPR resource and completed SRM. This is the overlap with k reference EPR pairs, not root or average-state mpbtFidelity.
  • binomialBound: PDF p.4, Eq.(9): the stronger binomial-ratio lower bound.
  • powerBound: PDF p.4, Eq.(9): the weaker power lower bound. Subtractions are in the reals.
  • packagedLower: PDF pp.4–5, Eq.(12): the displayed packaged lower estimate, not its actual fidelity.
  • packagedFidelity: PDF pp.4–5, Eq.(11): actual fixed-resource SRM packaged fidelity.
  • packagedOptimalFidelity: PDF pp.4–5, Eq.(13): exact optimal packaged qubit fidelity, with equal packages.
  • accumulated: PDF p.9, Notation 5: accumulate L_s ... L_1 on port indices. At step s the swap is (a_s, accumulated(b_s)); equal endpoints give identity.
  • collisionCount: PDF p.10, Eq.(38): sum of the Kronecker deltas in the contraction factor.
  • portAction: PDF pp.8–10: untransposed port permutation, with the last k factors fixed.
  • eprResource: PDF pp.2–3: the N shared normalized EPR pairs, in Alice/Bob product coordinates.
  • mpbtSelectedPorts: PDF pp.2–3: ordered output selection matching the reversed list in Eq.(27).
  • mpbtBranchChannel: PDF pp.2–3, Eq.(1): a branch of the physical teleportation channel. Alice is traced out; Bob traces unselected ports and only reorders mpbtSelectedPorts ports. The bilinear coordinate contraction uses the effect E, so it agrees with the sqrt(E) instrument after Alice's register is discarded.
  • Conclusive: PDF p.3, Eq.(4): physical conclusive schemes. The failure effect is I-sum(E_i). Every mpbtBranchChannel is p_i times the identity channel on ALL matrix units, hence also on arbitrary reference-entangled inputs. The explicit probability interval is redundant physically and keeps every optimization set bounded on bad parameters.
  • mpbtSuccessProbability: PDF p.3: optimal conclusive success for the fixed maximally entangled resource. Zero mpbtSuccessProbability is included explicitly; every other feasible value lies in [0,1]. This is an operational optimization, not the scalar formula to be proved.
  • optimizedSuccess: PDF p.6, Eq.(17) context: optimize BOTH shared density matrix and conclusive effects. Mixed resources are allowed; linearity makes this equivalent to optimizing pure resources.
  • packagedSuccess: PDF p.6, Table 3: all independent fixed-resource single-qubit packages must succeed.
  • packagedOptimalSuccess: PDF p.6, Table 3: all independent resource-optimized packages must succeed.
  • integerChoose: PDF p.14, Eq.(67): binomial coefficient zero outside its integer range.
  • branchingExpression: PDF p.14, Eq.(67): binomial-difference expression, with s=m/2-r, j=(m+k)/2-t. The difference is in R; negative integer arguments are NOT truncated to zero indices.
  • lowerAdded: PDF pp.13–14: count lower-row additions among the first q boxes of a path word.
  • branchingPaths: PDF pp.13–14: count ACTUAL box-addition paths between two-row shapes. True adds to the lower row, false to the upper; every intermediate shape is valid.
  • qubitFidelityExpression: PDF p.14, Eq.(68): the canonical qubit fidelity expression, indexed by lower-row lengths. The outer r is a shape of N-k and inner t a shape of N, so both spin parities are fixed.
  • qubitSuccessExpression: PDF p.6, Eq.(14), and p.14, Eq.(71): correct weighted qubit success formula.
  • gaussianLimit: PDF pp.6,16, Eqs.(15),(76),(77): the Gaussian limiting function, with x squared.
  • elementary: PDF p.12: corrected ELEMENTARY symmetric polynomial in x_0,...,x_(k-1). The printed weak inequality in Eq.(55) would instead include squares and is incompatible with (56).
  • boundVariables: PDF p.12, Eqs.(56)–(57): x_s=1/(d²+N-s-1), zero-based consistently.
  • symmetricBound: PDF p.12, Eq.(56): the elementary-symmetric expansion of the lower bound.
  • PackageSchedule: PDF pp.5–6: physical integer schedules for equal packages, N→∞.
  • Scales: PDF pp.5–6: integer interpretation of k~a N^alpha.
  • RegimeLimit: PDF pp.5–6: the three regimes of a packaged protocol's critical exponent.
  • examplePortA: PDF p.12, Example 14, Eqs.(58)–(59): a=(3,4), b=(4,3) in one-based notation.
  • examplePortB: PDF p.12, Example 14: reversed lists have the same selected port set.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_TensorPermutationRepresentations
import Definitions.Def_QAlgorithms_Defs_Information

/-!
Statements from arXiv:2008.00856v3. Paper-local definitions have complete bodies.
Coordinates use Alice's N ports followed by k input/reference factors. Source
lists a_1,...,a_k are zero-based embeddings; a_1 is paired with the last factor.
The two inconsistent finite-size Gaussian sandwiches are deferred in HARD.md.
Compilation is pending the authorized mechanical handoff.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P17

open Filter MeasureTheory
open scoped BigOperators Matrix ComplexOrder Matrix.Norms.L2Operator

attribute [local instance] Classical.propDecidable

/-- PDF pp.2–3: the product computational basis of n d-level particles. -/
abbrev MPBTRegister (d n : ℕ) := Fin n → Fin d

/-- PDF pp.2–3: distinct ordered ports, with reversed input order as in Eq.(27). -/
abbrev MPBTPortSelection (N k : ℕ) := Fin k ↪ Fin N

/-- PDF p.3: Alice's ports together with the k input/reference systems. -/
abbrev AliceBasis (d N k : ℕ) := MPBTRegister d N × MPBTRegister d k

/-- PDF p.3: matrices on the actual Alice/input space. -/
abbrev AliceOp (d N k : ℕ) := Matrix (AliceBasis d N k) (AliceBasis d N k) ℂ

/-- PDF p.2: the number of ordered outcomes; equals k! choose(N,k) when k≤N. -/
def outcomeCount (N k : ℕ) : ℕ := Fintype.card (MPBTPortSelection N k)

/-- PDF pp.8–10, Eq.(27): the product of disjoint swaps, rightmost acting first. -/
def pairingWord {N k : ℕ} (a : MPBTPortSelection N k) : Equiv.Perm (Fin (N + k)) :=
  (List.ofFn fun i : Fin k =>
    Equiv.swap (Fin.castAdd k (a i)) (Fin.natAdd N (Fin.rev i))).prod

/-- PDF pp.8–10: unnormalized partially transposed permutation word W(a).
The crossed second coordinates implement transpose on precisely the last k factors. -/
def mpbtWordOperator (d N k : ℕ) (a : MPBTPortSelection N k) : AliceOp d N k :=
  fun x y => QAlgorithms.Schur.tensorPermutation d (N + k) (pairingWord a)
    (Fin.append x.1 y.2) (Fin.append y.1 x.2)

/-- PDF pp.2–3, Eq.(2), and p.8, Eq.(25): normalized signals, of trace one. -/
def mpbtSignal (d N k : ℕ) (a : MPBTPortSelection N k) : AliceOp d N k :=
  ((d : ℂ) ^ N)⁻¹ • mpbtWordOperator d N k a

/-- PDF p.4, Eq.(6): sum of normalized signals; not Definition 4's unscaled sum. -/
def signalSum (d N k : ℕ) : AliceOp d N k := ∑ a, mpbtSignal d N k a

/-- PDF p.8, Definition 4: unscaled sum of words R=d^N rho. -/
def unscaledSum (d N k : ℕ) : AliceOp d N k := ∑ a, mpbtWordOperator d N k a

/-- PDF p.4, Lemma 1: normalize by the actual trace, without assuming invertibility. -/
def normalizedSum (d N k : ℕ) : AliceOp d N k :=
  (signalSum d N k).trace⁻¹ • signalSum d N k

/-- PDF p.4, Eq.(6): spectral inverse square root, zero on the kernel. -/
def supportInverseSqrt (d N k : ℕ) : AliceOp d N k :=
  cfc (fun x : ℝ => (Real.sqrt x)⁻¹) (signalSum d N k)

/-- PDF p.4, Eq.(6): SRM on the support of the signal sum. -/
def rawSRM (d N k : ℕ) (a : MPBTPortSelection N k) : AliceOp d N k :=
  supportInverseSqrt d N k * mpbtSignal d N k a * supportInverseSqrt d N k

/-- PDF p.4, support convention: uniformly distribute the kernel projector among outcomes. -/
def completedSRM (d N k : ℕ) (a : MPBTPortSelection N k) : AliceOp d N k :=
  rawSRM d N k a + ((outcomeCount N k : ℂ)⁻¹) • (1 - ∑ b, rawSRM d N k b)

/-- PDF p.4, Eq.(5): discrimination success with equal prior over normalized signals. -/
def discrimination (d N k : ℕ) : ℝ :=
  (outcomeCount N k : ℝ)⁻¹ *
    ∑ a, (completedSRM d N k a * mpbtSignal d N k a).trace.re

/-- PDF p.3, Eq.(3): entanglement fidelity for the fixed EPR resource and completed SRM.
This is the overlap with k reference EPR pairs, not root or average-state mpbtFidelity. -/
def mpbtFidelity (d N k : ℕ) : ℝ :=
  ((d : ℝ) ^ (2 * k))⁻¹ *
    ∑ a, (completedSRM d N k a * mpbtSignal d N k a).trace.re

/-- PDF p.4, Eq.(9): the stronger binomial-ratio lower bound. -/
def binomialBound (d N k : ℕ) : ℝ :=
  (N.choose k : ℝ) / ((d ^ 2 + N - 1).choose k : ℝ)

/-- PDF p.4, Eq.(9): the weaker power lower bound. Subtractions are in the reals. -/
def powerBound (d N k : ℕ) : ℝ :=
  (1 - ((d : ℝ)^2 - 1) / ((d : ℝ)^2 + N - k)) ^ k

/-- PDF pp.4–5, Eq.(12): the displayed packaged lower estimate, not its actual fidelity. -/
def packagedLower (N k : ℕ) : ℝ := (1 - 3 * (k : ℝ) / (4 * N)) ^ k

/-- PDF pp.4–5, Eq.(11): actual fixed-resource SRM packaged fidelity. -/
def packagedFidelity (N k : ℕ) : ℝ := mpbtFidelity 2 (N / k) 1 ^ k

/-- PDF pp.4–5, Eq.(13): exact optimal packaged qubit fidelity, with equal packages. -/
def packagedOptimalFidelity (N k : ℕ) : ℝ :=
  Real.cos (Real.pi / ((N / k : ℕ) + 2 : ℝ)) ^ (2 * k)

/-- PDF p.9, Notation 5: accumulate L_s ... L_1 on port indices.
At step s the swap is (a_s, accumulated(b_s)); equal endpoints give identity. -/
def accumulated {N k : ℕ} (a b : MPBTPortSelection N k) (s : ℕ) : Equiv.Perm (Fin N) :=
  ((List.ofFn fun i : Fin k => (a i, b i)).take s).foldl
    (fun p ab => Equiv.swap ab.1 (p ab.2) * p) 1

/-- PDF p.10, Eq.(38): sum of the Kronecker deltas in the contraction factor. -/
def collisionCount {N k : ℕ} (a b : MPBTPortSelection N k) : ℕ :=
  ∑ i : Fin k, if a i = accumulated a b i.val (b i) then 1 else 0

/-- PDF pp.8–10: untransposed port permutation, with the last k factors fixed. -/
def portAction (d N k : ℕ) (p : Equiv.Perm (Fin N)) : AliceOp d N k :=
  fun y x => if y.1 = x.1 ∘ p.symm ∧ y.2 = x.2 then 1 else 0

/-- PDF pp.2–3: the N shared normalized EPR pairs, in Alice/Bob product coordinates. -/
def eprResource (d N : ℕ) :
    Matrix (MPBTRegister d N × MPBTRegister d N) (MPBTRegister d N × MPBTRegister d N) ℂ :=
  fun x y => if x.1 = x.2 ∧ y.1 = y.2 then ((d : ℂ)^N)⁻¹ else 0

/-- PDF pp.2–3: ordered output selection matching the reversed list in Eq.(27). -/
def mpbtSelectedPorts {d N k : ℕ} (a : MPBTPortSelection N k) (b : MPBTRegister d N) : MPBTRegister d k :=
  fun i => b (a (Fin.rev i))

/-- PDF pp.2–3, Eq.(1): a branch of the physical teleportation channel.
Alice is traced out; Bob traces unselected ports and only reorders mpbtSelectedPorts ports.
The bilinear coordinate contraction uses the effect E, so it agrees with the
sqrt(E) instrument after Alice's register is discarded. -/
def mpbtBranchChannel {d N k : ℕ}
    (omega : Matrix (MPBTRegister d N × MPBTRegister d N) (MPBTRegister d N × MPBTRegister d N) ℂ)
    (a : MPBTPortSelection N k) (E : AliceOp d N k)
    (X : Matrix (MPBTRegister d k) (MPBTRegister d k) ℂ) :
    Matrix (MPBTRegister d k) (MPBTRegister d k) ℂ :=
  fun u v => ∑ b : MPBTRegister d N, ∑ bp : MPBTRegister d N,
    if mpbtSelectedPorts a b = u ∧ mpbtSelectedPorts a bp = v ∧
      (∀ j : Fin N, j ∉ Set.range a → b j = bp j) then
      ∑ x : MPBTRegister d N, ∑ xp : MPBTRegister d N,
        ∑ c : MPBTRegister d k, ∑ cp : MPBTRegister d k,
          E (xp, cp) (x, c) * omega (x, b) (xp, bp) * X c cp
    else 0

/-- PDF p.3, Eq.(4): physical conclusive schemes. The failure effect is I-sum(E_i).
Every mpbtBranchChannel is p_i times the identity channel on ALL matrix units, hence also
on arbitrary reference-entangled inputs. The explicit probability interval is
redundant physically and keeps every optimization set bounded on bad parameters. -/
def Conclusive {d N k : ℕ}
    (omega : Matrix (MPBTRegister d N × MPBTRegister d N) (MPBTRegister d N × MPBTRegister d N) ℂ)
    (E : MPBTPortSelection N k → AliceOp d N k) (p : MPBTPortSelection N k → ℝ) : Prop :=
  (∀ a, (E a).PosSemidef) ∧ (1 - ∑ a, E a).PosSemidef ∧
  (∀ a, 0 ≤ p a) ∧ (∑ a, p a) ≤ 1 ∧
  ∀ a X, mpbtBranchChannel omega a (E a) X = (p a : ℂ) • X

/-- PDF p.3: optimal conclusive success for the fixed maximally entangled resource.
Zero mpbtSuccessProbability is included explicitly; every other feasible value lies in [0,1].
This is an operational optimization, not the scalar formula to be proved. -/
def mpbtSuccessProbability (d N k : ℕ) : ℝ :=
  sSup (insert 0 {q : ℝ | ∃ (E : MPBTPortSelection N k → AliceOp d N k)
    (p : MPBTPortSelection N k → ℝ), Conclusive (eprResource d N) E p ∧ q = ∑ a, p a})

/-- PDF p.6, Eq.(17) context: optimize BOTH shared density matrix and conclusive effects.
Mixed resources are allowed; linearity makes this equivalent to optimizing pure resources. -/
def optimizedSuccess (d N k : ℕ) : ℝ :=
  sSup (insert 0 {q : ℝ | ∃
    (omega : Matrix (MPBTRegister d N × MPBTRegister d N) (MPBTRegister d N × MPBTRegister d N) ℂ)
    (E : MPBTPortSelection N k → AliceOp d N k) (p : MPBTPortSelection N k → ℝ),
    QAlgorithms.IsDensityMatrix omega ∧ Conclusive omega E p ∧ q = ∑ a, p a})

/-- PDF p.6, Table 3: all independent fixed-resource single-qubit packages must succeed. -/
def packagedSuccess (N k : ℕ) : ℝ := mpbtSuccessProbability 2 (N / k) 1 ^ k

/-- PDF p.6, Table 3: all independent resource-optimized packages must succeed. -/
def packagedOptimalSuccess (N k : ℕ) : ℝ := optimizedSuccess 2 (N / k) 1 ^ k

/-- PDF p.14, Eq.(67): binomial coefficient zero outside its integer range. -/
def integerChoose (k : ℕ) (z : ℤ) : ℝ :=
  if 0 ≤ z then (k.choose z.toNat : ℝ) else 0

/-- PDF p.14, Eq.(67): binomial-difference expression, with s=m/2-r, j=(m+k)/2-t.
The difference is in R; negative integer arguments are NOT truncated to zero indices. -/
def branchingExpression (m k r t : ℕ) : ℝ :=
  integerChoose k ((t : ℤ) - r) - integerChoose k ((m : ℤ) + k - r - t + 1)

/-- PDF pp.13–14: count lower-row additions among the first q boxes of a path word. -/
def lowerAdded {k : ℕ} (w : Fin k → Bool) (q : ℕ) : ℕ :=
  (Finset.univ.filter fun i : Fin k => i.val < q ∧ w i = true).card

/-- PDF pp.13–14: count ACTUAL box-addition paths between two-row shapes.
True adds to the lower row, false to the upper; every intermediate shape is valid. -/
def branchingPaths (m k r t : ℕ) : ℕ :=
  (Finset.univ.filter fun w : Fin k → Bool =>
    r + lowerAdded w k = t ∧
    ∀ q ∈ Finset.range (k + 1), 2 * (r + lowerAdded w q) ≤ m + q).card

/-- PDF p.14, Eq.(68): the canonical qubit fidelity expression, indexed by lower-row lengths.
The outer r is a shape of N-k and inner t a shape of N, so both spin parities are fixed. -/
def qubitFidelityExpression (N k : ℕ) : ℝ :=
  ((2 : ℝ) ^ (N + 2 * k))⁻¹ *
    ∑ r ∈ Finset.range ((N - k) / 2 + 1),
      (∑ t ∈ (Finset.range (N / 2 + 1)).filter
          (fun t => r ≤ t ∧ t ≤ r + k ∧ r + t ≤ N),
        branchingExpression (N - k) k r t *
          Real.sqrt (((N - 2 * t + 1 : ℕ) : ℝ)^2 * (N.factorial : ℝ) /
            ((t.factorial : ℝ) * ((N - t + 1).factorial : ℝ)))) ^ 2

/-- PDF p.6, Eq.(14), and p.14, Eq.(71): correct weighted qubit success formula. -/
def qubitSuccessExpression (N k : ℕ) : ℝ :=
  ((2 : ℝ)^N * (N + 1))⁻¹ *
    ∑ r ∈ Finset.range ((N - k) / 2 + 1),
      ((N - k - 2 * r + 1 : ℕ) : ℝ)^2 * ((N + 1).choose r : ℝ)

/-- PDF pp.6,16, Eqs.(15),(76),(77): the Gaussian limiting function, with x squared. -/
def gaussianLimit (a : ℝ) : ℝ :=
  2 * ∫ x in Set.Ioi (0 : ℝ), x^2 / Real.sqrt (2 * Real.pi) *
    Real.exp (-((x + a)^2) / 2)

/-- PDF p.12: corrected ELEMENTARY symmetric polynomial in x_0,...,x_(k-1).
The printed weak inequality in Eq.(55) would instead include squares and is incompatible with (56). -/
def elementary {k : ℕ} (x : Fin k → ℝ) (l : ℕ) : ℝ :=
  ∑ S ∈ (Finset.univ : Finset (Fin k)).powersetCard l, ∏ i ∈ S, x i

/-- PDF p.12, Eqs.(56)–(57): x_s=1/(d²+N-s-1), zero-based consistently. -/
def boundVariables (d N k : ℕ) (s : Fin k) : ℝ :=
  ((d : ℝ)^2 + N - s.val - 1)⁻¹

/-- PDF p.12, Eq.(56): the elementary-symmetric expansion of the lower bound. -/
def symmetricBound (d N k : ℕ) : ℝ :=
  ∑ l ∈ Finset.range (k + 1), (-1 : ℝ)^l * ((d : ℝ)^2 - 1)^l *
    elementary (boundVariables d N k) l

/-- PDF pp.5–6: physical integer schedules for equal packages, N→∞. -/
def PackageSchedule (N k : ℕ → ℕ) : Prop :=
  Tendsto N atTop atTop ∧ ∀ᶠ t in atTop, 1 ≤ k t ∧ k t ≤ N t ∧ k t ∣ N t

/-- PDF pp.5–6: integer interpretation of k~a N^alpha. -/
def Scales (N k : ℕ → ℕ) (a alpha : ℝ) : Prop :=
  Tendsto (fun t => (k t : ℝ) / (N t : ℝ)^alpha) atTop (nhds a)

/-- PDF pp.5–6: the three regimes of a packaged protocol's critical exponent. -/
def RegimeLimit (N k : ℕ → ℕ) (value : ℕ → ℕ → ℝ)
    (alpha criticalValue boundary : ℝ) : Prop :=
  (alpha < criticalValue → Tendsto (fun t => value (N t) (k t)) atTop (nhds 1)) ∧
  (alpha = criticalValue → Tendsto (fun t => value (N t) (k t)) atTop (nhds boundary)) ∧
  (criticalValue < alpha → Tendsto (fun t => value (N t) (k t)) atTop (nhds 0))

example : integerChoose 3 (-1) = 0 := by norm_num [integerChoose]

example {N k : ℕ} (a b : MPBTPortSelection N k) : accumulated a b 0 = 1 := by
  simp [accumulated]

example : branchingPaths 0 0 0 0 = 1 := by
  simp [branchingPaths, lowerAdded]

example (d : ℕ) : binomialBound d 2 0 = 1 := by
  simp [binomialBound]

example {d N k : ℕ}
    (omega : Matrix (MPBTRegister d N × MPBTRegister d N) (MPBTRegister d N × MPBTRegister d N) ℂ)
    (a : MPBTPortSelection N k) (E : AliceOp d N k) : mpbtBranchChannel omega a E 0 = 0 := by
  ext u v
  simp [mpbtBranchChannel]

example : branchingExpression 1 1 0 0 = 1 := by
  have hzero : Nat.choose 1 (Int.toNat 3) = 0 :=
    Nat.choose_eq_zero_of_lt (by decide)
  norm_num [branchingExpression, integerChoose, hzero]

example : branchingExpression 1 1 0 1 = 1 := by
  have hzero : Nat.choose 1 (Int.toNat 2) = 0 :=
    Nat.choose_eq_zero_of_lt (by decide)
  norm_num [branchingExpression, integerChoose, hzero]

/-- PDF p.12, Example 14, Eqs.(58)–(59): a=(3,4), b=(4,3) in one-based notation. -/
def examplePortA : MPBTPortSelection 4 2 := ⟨![2, 3], by decide⟩

/-- PDF p.12, Example 14: reversed lists have the same selected port set. -/
def examplePortB : MPBTPortSelection 4 2 := ⟨![3, 2], by decide⟩

end QAlgorithms.Papers.Independent.Extend50.P17
Source
Multiport based teleportation -- transmission of a large amount of quantum information, arXiv:2008.00856v3, https://arxiv.org/abs/2008.00856v3
Read-back

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

QAlgorithms.Papers.Independent.Extend50.P17.AliceBasis

For any natural numbers d,N,kd,N,kd,N,k, AliceBasis(d,N,k)\mathrm{AliceBasis}(d,N,k)AliceBasis(d,N,k) is the set of pairs (u,v)(u,v)(u,v), 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 v:{0,…,k−1}→{0,…,d−1}v:\{0,\ldots,k-1\}\to\{0,\ldots,d-1\}v:{0,…,k−1}→{0,…,d−1}. A function with no positions is uniquely determined; consequently, when d=0d=0d=0, this basis has one element if N=k=0N=k=0N=k=0, and is empty otherwise.

QAlgorithms.Papers.Independent.Extend50.P17.AliceOp

For any natural numbers d,N,kd,N,kd,N,k, AliceOp(d,N,k)\mathrm{AliceOp}(d,N,k)AliceOp(d,N,k) is the type of all complex matrices whose rows and columns are indexed by pairs (u,v)(u,v)(u,v), 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 v:{0,…,k−1}→{0,…,d−1}v:\{0,\ldots,k-1\}\to\{0,\ldots,d-1\}v:{0,…,k−1}→{0,…,d−1}. No Hermitian, positivity, or normalization condition is imposed. If d=0d=0d=0 and N+k>0N+k>0N+k>0, the index set is empty and there is exactly one such matrix; if N=k=0N=k=0N=k=0, these are 1×11\times11×1 matrices, even when d=0d=0d=0.

QAlgorithms.Papers.Independent.Extend50.P17.Conclusive

For arbitrary natural numbers d,N,kd,N,kd,N,k, let Rs={0,…,d−1}{0,…,s−1}R_s=\{0,\ldots,d-1\}^{\{0,\ldots,s-1\}}Rs​={0,…,d−1}{0,…,s−1} and let A\mathcal AA be the set of injections from {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} to {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}. Given a complex matrix ω\omegaω indexed by RN×RNR_N\times R_NRN​×RN​, a family of complex matrices EaE_aEa​ indexed by RN×RkR_N\times R_kRN​×Rk​, and real numbers pap_apa​, this predicate means that every EaE_aEa​ is positive semidefinite, I−∑a∈AEaI-\sum_{a\in\mathcal A}E_aI−∑a∈A​Ea​ is positive semidefinite, every pa≥0p_a\ge0pa​≥0, ∑a∈Apa≤1\sum_{a\in\mathcal A}p_a\le1∑a∈A​pa​≤1, and, for every a∈Aa\in\mathcal Aa∈A, every complex matrix XXX indexed by RkR_kRk​, and every u,v∈Rku,v\in R_ku,v∈Rk​,

∑b,b′∈RNba(k−1−i)=ui, ba(k−1−i)′=vi ∀i<kbj=bj′ ∀j∉a({0,…,k−1}) ∑x,x′∈RN ∑c,c′∈Rk(Ea)(x′,c′),(x,c) ω(x,b),(x′,b′) Xc,c′=paXu,v.\sum_{\substack{b,b'\in R_N\\ b_{a(k-1-i)}=u_i,\ b'_{a(k-1-i)}=v_i\ \forall i<k\\ b_j=b'_j\ \forall j\notin a(\{0,\ldots,k-1\})}} \ \sum_{x,x'\in R_N}\ \sum_{c,c'\in R_k} (E_a)_{(x',c'),(x,c)} \,\omega_{(x,b),(x',b')} \,X_{c,c'} = p_aX_{u,v}.b,b′∈RN​ba(k−1−i)​=ui​, ba(k−1−i)′​=vi​ ∀i<kbj​=bj′​ ∀j∈/a({0,…,k−1})​∑​ x,x′∈RN​∑​ c,c′∈Rk​∑​(Ea​)(x′,c′),(x,c)​ω(x,b),(x′,b′)​Xc,c′​=pa​Xu,v​.

The predicate imposes no positivity or trace condition on ω\omegaω. It includes k=0k=0k=0 and empty register sets. If k>Nk>Nk>N, then A\mathcal AA is empty: all conditions quantified over aaa are vacuous, both family sums are zero, and the remaining matrix condition is that III is positive semidefinite.

QAlgorithms.Papers.Independent.Extend50.P17.MPBTPortSelection

For any natural numbers N,kN,kN,k, MPBTPortSelection(N,k)\mathrm{MPBTPortSelection}(N,k)MPBTPortSelection(N,k) is the set of injective functions a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1}. The positions in the domain are labeled, so their order is part of the selection. For k=0k=0k=0, this set has one element; for k>Nk>Nk>N, it is empty.

QAlgorithms.Papers.Independent.Extend50.P17.MPBTRegister

For any natural numbers d,nd,nd,n, MPBTRegister(d,n)\mathrm{MPBTRegister}(d,n)MPBTRegister(d,n) is the set of functions {0,…,n−1}→{0,…,d−1}\{0,\ldots,n-1\}\to\{0,\ldots,d-1\}{0,…,n−1}→{0,…,d−1}. Thus a register assigns one of ddd values to each of nnn positions. When n=0n=0n=0, there is exactly one such function, including when d=0d=0d=0; when d=0<nd=0<nd=0<n, there are none.

QAlgorithms.Papers.Independent.Extend50.P17.PackageSchedule

For arbitrary functions N,k:N→NN,k:\mathbb N\to\mathbb NN,k:N→N, this is the proposition that N(t)→+∞N(t)\to+\inftyN(t)→+∞ as t→∞t\to\inftyt→∞, and that there exists a natural-number threshold TTT such that, for every t≥Tt\ge Tt≥T,

1≤k(t)≤N(t)andk(t)∣N(t).1\le k(t)\le N(t) \qquad\text{and}\qquad k(t)\mid N(t).1≤k(t)≤N(t)andk(t)∣N(t).

Here N(t)→+∞N(t)\to+\inftyN(t)→+∞ means that for every natural number BBB, eventually N(t)≥BN(t)\ge BN(t)≥B. No restrictions are imposed on the finitely many indices before the eventual conditions hold.

QAlgorithms.Papers.Independent.Extend50.P17.RegimeLimit

For arbitrary functions N,k:N→NN,k:\mathbb N\to\mathbb NN,k:N→N, an arbitrary function v:N×N→Rv:\mathbb N\times\mathbb N\to\mathbb Rv:N×N→R, and arbitrary real numbers α,c,b\alpha,c,bα,c,b, this is the conjunction

α<c ⟹ lim⁡t→∞v(N(t),k(t))=1,α=c ⟹ lim⁡t→∞v(N(t),k(t))=b,c<α ⟹ lim⁡t→∞v(N(t),k(t))=0.\begin{aligned} \alpha<c&\ \Longrightarrow\ \lim_{t\to\infty}v(N(t),k(t))=1,\\ \alpha=c&\ \Longrightarrow\ \lim_{t\to\infty}v(N(t),k(t))=b,\\ c<\alpha&\ \Longrightarrow\ \lim_{t\to\infty}v(N(t),k(t))=0. \end{aligned}α<cα=cc<α​ ⟹ t→∞lim​v(N(t),k(t))=1, ⟹ t→∞lim​v(N(t),k(t))=b, ⟹ t→∞lim​v(N(t),k(t))=0.​

Here ccc is the argument named criticalValue and bbb is the argument named boundary. No growth, divisibility, or scaling assumptions are included. Exactly one comparison holds for the fixed real numbers α,c\alpha,cα,c, and the other two implications have false antecedents.

QAlgorithms.Papers.Independent.Extend50.P17.Scales

For arbitrary functions N,k:N→NN,k:\mathbb N\to\mathbb NN,k:N→N and arbitrary real numbers a,αa,\alphaa,α, this is the proposition

lim⁡t→∞k(t)N(t)α=a,\lim_{t\to\infty}\frac{k(t)}{N(t)^\alpha}=a,t→∞lim​N(t)αk(t)​=a,

where the natural-number values are converted to real numbers before taking the real power and quotient. There is no assumption that NNN tends to infinity, that either sequence is positive, or that aaa or α\alphaα is positive. The operations are total: 00=10^0=100=1, 0α=00^\alpha=00α=0 for α≠0\alpha\ne0α=0, and division by zero equals zero.

QAlgorithms.Papers.Independent.Extend50.P17.accumulated

For any natural numbers N,kN,kN,k, injections a,b:{0,…,k−1}↪{0,…,N−1}a,b:\{0,\ldots,k-1\}\hookrightarrow\{0,\ldots,N-1\}a,b:{0,…,k−1}↪{0,…,N−1}, and natural number sss, this defines a permutation of {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1} as follows: start with p0=idp_0=\mathrm{id}p0​=id, and for i=0,…,min⁡(s,k)−1i=0,\ldots,\min(s,k)-1i=0,…,min(s,k)−1, set

pi+1=(a(i)    pi(b(i)))∘pi.p_{i+1}=(a(i)\;\;p_i(b(i)))\circ p_i.pi+1​=(a(i)pi​(b(i)))∘pi​.

The result is pmin⁡(s,k)p_{\min(s,k)}pmin(s,k)​; the transposition exchanges the two displayed positions and is the identity if they coincide. Thus s=0s=0s=0 or k=0k=0k=0 gives the identity, and s≥ks\geq ks≥k processes all kkk pairs. Existence of the injection parameters requires k≤Nk\leq Nk≤N, including N=k=0N=k=0N=k=0.

QAlgorithms.Papers.Independent.Extend50.P17.binomialBound

For any natural numbers d,N,kd,N,kd,N,k, this defines the real number

(Nk)(max⁡(d2+N−1, 0)k).\frac{\binom Nk}{\binom{\max(d^2+N-1,\,0)}k}.(kmax(d2+N−1,0)​)(kN​)​.

The subtraction in the lower binomial coefficient is natural-number subtraction, truncated at zero, and the binomial coefficients are computed as natural numbers before conversion to real numbers. There are no restrictions such as k≤Nk\leq Nk≤N or d>0d>0d>0. A binomial coefficient is zero when its lower argument exceeds its upper argument, and real division by zero is defined to be zero; for k=0k=0k=0, the value is 111.

QAlgorithms.Papers.Independent.Extend50.P17.boundVariables

For all natural numbers d,N,kd,N,kd,N,k and every index s∈{0,…,k−1}s\in\{0,\ldots,k-1\}s∈{0,…,k−1}, this defines the real number

1d2+N−s−1.\frac{1}{d^2+N-s-1}.d2+N−s−11​.

The arithmetic in the denominator takes place in R\mathbb RR, so subtraction is not truncated and the denominator may be negative or zero; its reciprocal is defined to be zero when the denominator is zero. When k=0k=0k=0, there are no indices sss.

QAlgorithms.Papers.Independent.Extend50.P17.branchingExpression

For arbitrary natural numbers m,k,r,tm,k,r,tm,k,r,t, this definition gives the real number

Ck(t−r)−Ck(m+k−r−t+1),Ck(z)={(kz),0≤z≤k,0,otherwise,C_k(t-r)-C_k(m+k-r-t+1), \qquad C_k(z)= \begin{cases} \binom{k}{z},&0\le z\le k,\\ 0,&\text{otherwise}, \end{cases}Ck​(t−r)−Ck​(m+k−r−t+1),Ck​(z)={(zk​),0,​0≤z≤k,otherwise,​

where the arguments of CkC_kCk​ and all additions and subtractions inside those arguments are computed in the integers. Thus negative arguments are retained as negative and give zero rather than being truncated to zero before evaluating the binomial coefficient. No restrictions relating m,k,r,tm,k,r,tm,k,r,t are imposed, and zero values of any of these parameters are included.

QAlgorithms.Papers.Independent.Extend50.P17.branchingPaths

For arbitrary natural numbers m,k,r,tm,k,r,tm,k,r,t, this definition counts the Boolean words w:{0,…,k−1}→{false,true}w:\{0,\ldots,k-1\}\to\{\mathrm{false},\mathrm{true}\}w:{0,…,k−1}→{false,true} such that

r+#{i<k:wi=true}=tand2(r+#{i<k:i<q, wi=true})≤m+qfor every q=0,…,k.r+\#\{i<k:w_i=\mathrm{true}\}=t \quad\text{and}\quad 2\left(r+\#\{i<k:i<q,\ w_i=\mathrm{true}\}\right)\le m+q \quad\text{for every }q=0,\ldots,k.r+#{i<k:wi​=true}=tand2(r+#{i<k:i<q, wi​=true})≤m+qfor every q=0,…,k.

All counts and arithmetic here are in the natural numbers. The prefix condition includes both q=0q=0q=0, which requires 2r≤m2r\le m2r≤m, and q=kq=kq=k, which together with the endpoint condition requires 2t≤m+k2t\le m+k2t≤m+k. There are no additional assumptions on the parameters; if no word satisfies the conditions, the count is zero. When k=0k=0k=0, the count is 111 exactly when r=tr=tr=t and 2r≤m2r\le m2r≤m, and is 000 otherwise.

QAlgorithms.Papers.Independent.Extend50.P17.collisionCount

For any natural numbers N,kN,kN,k and injections a,b:{0,…,k−1}↪{0,…,N−1}a,b:\{0,\ldots,k-1\}\hookrightarrow\{0,\ldots,N-1\}a,b:{0,…,k−1}↪{0,…,N−1}, define permutations p0=idp_0=\mathrm{id}p0​=id and

pi+1=(a(i)    pi(b(i)))∘pi(0≤i<k),p_{i+1}=(a(i)\;\;p_i(b(i)))\circ p_i\qquad(0\leq i<k),pi+1​=(a(i)pi​(b(i)))∘pi​(0≤i<k),

where the transposition is the identity when its two positions coincide. This declaration defines the natural number

∑i=0k−1{1,a(i)=pi(b(i)),0,a(i)≠pi(b(i)).\sum_{i=0}^{k-1} \begin{cases} 1,&a(i)=p_i(b(i)),\\ 0,&a(i)\neq p_i(b(i)). \end{cases}i=0∑k−1​{1,0,​a(i)=pi​(b(i)),a(i)=pi​(b(i)).​

Thus each comparison uses the permutation obtained after processing precisely the earlier indices. Existence of a,ba,ba,b requires k≤Nk\leq Nk≤N, and when k=0k=0k=0, including N=k=0N=k=0N=k=0, the sum is zero.

QAlgorithms.Papers.Independent.Extend50.P17.completedSRM

For any natural numbers d,N,kd,N,kd,N,k and injection a:{0,…,k−1}↪{0,…,N−1}a:\{0,\ldots,k-1\}\hookrightarrow\{0,\ldots,N-1\}a:{0,…,k−1}↪{0,…,N−1}, this defines the complex matrix

Ea=Ra+q−1(I−∑bRb),E_a=R_a+q^{-1}\left(I-\sum_b R_b\right),Ea​=Ra​+q−1(I−b∑​Rb​),

where qqq is the number of these injections, its inverse is taken in C\mathbb CC, and the matrices are indexed by B={0,…,d−1}N×{0,…,d−1}kB=\{0,\ldots,d-1\}^{N}\times\{0,\ldots,d-1\}^{k}B={0,…,d−1}N×{0,…,d−1}k. To specify RbR_bRb​, let πb\pi_bπb​ be the product, in increasing order of i<ki<ki<k, of transpositions exchanging positions b(i)b(i)b(i) and N+k−1−iN+k-1-iN+k−1−i. For x=(u,c)x=(u,c)x=(u,c) and y=(v,e)y=(v,e)y=(v,e), let Wb(x,y)W_b(x,y)Wb​(x,y) be 111 when u∥e=(v∥c)∘πb−1u\mathbin{\|}e=(v\mathbin{\|}c)\circ\pi_b^{-1}u∥e=(v∥c)∘πb−1​, and 000 otherwise, with ∥\mathbin{\|}∥ denoting concatenation. Set Sb=(dN)−1WbS_b=(d^N)^{-1}W_bSb​=(dN)−1Wb​, S=∑bSbS=\sum_b S_bS=∑b​Sb​, F=f(S)F=f(S)F=f(S) by functional calculus for f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1, and Rb=FSbFR_b=F S_b FRb​=FSb​F. Every sum ranges over all injections of the stated type, and III is the identity on BBB. Square root is zero on nonpositive real arguments, and inverses of zero are zero. The parameters may be zero; existence of aaa requires k≤Nk\leq Nk≤N, and for k=0k=0k=0 there is one empty injection.

QAlgorithms.Papers.Independent.Extend50.P17.discrimination

For any natural numbers d,N,kd,N,kd,N,k, this defines the real number

q−1∑aRe⁡tr⁡(EaSa),q^{-1}\sum_a \operatorname{Re}\operatorname{tr}(E_aS_a),q−1a∑​Retr(Ea​Sa​),

where aaa ranges over all injections from {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} to {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}, and qqq is their number, interpreted as a real number in the prefactor. The matrices are indexed by B={0,…,d−1}N×{0,…,d−1}kB=\{0,\ldots,d-1\}^{N}\times\{0,\ldots,d-1\}^{k}B={0,…,d−1}N×{0,…,d−1}k. For each aaa, let πa\pi_aπa​ be the product, in increasing order of i<ki<ki<k, of transpositions exchanging a(i)a(i)a(i) and N+k−1−iN+k-1-iN+k−1−i, and let Wa((u,c),(v,e))W_a((u,c),(v,e))Wa​((u,c),(v,e)) equal 111 if u∥e=(v∥c)∘πa−1u\mathbin{\|}e=(v\mathbin{\|}c)\circ\pi_a^{-1}u∥e=(v∥c)∘πa−1​, and 000 otherwise, where ∥\mathbin{\|}∥ means concatenation. Define Sa=(dN)−1WaS_a=(d^N)^{-1}W_aSa​=(dN)−1Wa​, S=∑aSaS=\sum_a S_aS=∑a​Sa​, F=f(S)F=f(S)F=f(S) by functional calculus with f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1, Ra=FSaFR_a=F S_a FRa​=FSa​F, and Ea=Ra+q−1(I−∑bRb)E_a=R_a+q^{-1}(I-\sum_b R_b)Ea​=Ra​+q−1(I−∑b​Rb​), with this latter inverse taken in C\mathbb CC. Square root is zero on nonpositive real arguments, and all inverses of zero are zero. Zero parameters are allowed; if k>Nk>Nk>N, there are no injections, the sum is empty, and the defined value is zero.

QAlgorithms.Papers.Independent.Extend50.P17.elementary

For every natural number kkk, every real family x=(xi)0≤i<kx=(x_i)_{0\le i<k}x=(xi​)0≤i<k​, and every natural number lll, this defines

∑S⊆{0,…,k−1}∣S∣=l∏i∈Sxi.\sum_{\substack{S\subseteq\{0,\ldots,k-1\}\\|S|=l}} \prod_{i\in S}x_i.S⊆{0,…,k−1}∣S∣=l​∑​i∈S∏​xi​.

The empty product is 111, so the value for l=0l=0l=0 is 111, including when k=0k=0k=0; when l>kl>kl>k, the sum is empty and its value is 000.

QAlgorithms.Papers.Independent.Extend50.P17.eprResource

For any natural numbers d,Nd,Nd,N, let R={0,…,d−1}{0,…,N−1}R=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}R={0,…,d−1}{0,…,N−1} be the set of length-NNN registers. This definition gives the complex matrix ω\omegaω indexed by R×RR\times RR×R with entries

ω(a,b),(a′,b′)={(dN)−1,a=b and a′=b′,0,otherwise.\omega_{(a,b),(a',b')}= \begin{cases} (d^N)^{-1},&a=b\text{ and }a'=b',\\ 0,&\text{otherwise}. \end{cases}ω(a,b),(a′,b′)​={(dN)−1,0,​a=b and a′=b′,otherwise.​

The inverse is taken in C\mathbb CC, where 0−1=00^{-1}=00−1=0. When N=0N=0N=0, RRR is a singleton and this is the 1×11\times11×1 matrix with entry 111, including when d=0d=0d=0 because 00=10^0=100=1. When d=0<Nd=0<Nd=0<N, RRR is empty and the matrix has no entries.

QAlgorithms.Papers.Independent.Extend50.P17.examplePortA

This defines the injection from {0,1}\{0,1\}{0,1} into {0,1,2,3}\{0,1,2,3\}{0,1,2,3} that sends 000 to 222 and 111 to 333.

QAlgorithms.Papers.Independent.Extend50.P17.examplePortB

This defines the injection from {0,1}\{0,1\}{0,1} into {0,1,2,3}\{0,1,2,3\}{0,1,2,3} that sends 000 to 333 and 111 to 222.

QAlgorithms.Papers.Independent.Extend50.P17.gaussianLimit

For every real number aaa, with no sign restriction, this defines

2∫(0,∞)x22πexp⁡ ⁣(−(x+a)22) dx,2\int_{(0,\infty)} \frac{x^2}{\sqrt{2\pi}} \exp\!\left(-\frac{(x+a)^2}{2}\right)\,dx,2∫(0,∞)​2π​x2​exp(−2(x+a)2​)dx,

where the integral is the Lebesgue integral over the strictly positive real numbers.

QAlgorithms.Papers.Independent.Extend50.P17.integerChoose

For every natural number kkk and integer zzz, this definition gives the real number (kz)\binom{k}{z}(zk​) when z≥0z\ge0z≥0, interpreting zzz as a natural number, and gives 000 when z<0z<0z<0. The natural binomial coefficient is zero when z>kz>kz>k, so the value is zero outside 0≤z≤k0\le z\le k0≤z≤k. In particular, for k=0k=0k=0 it is 111 at z=0z=0z=0 and 000 at every other integer.

QAlgorithms.Papers.Independent.Extend50.P17.lowerAdded

For any natural number kkk, Boolean word w:{0,…,k−1}→{false,true}w:\{0,\ldots,k-1\}\to\{\mathrm{false},\mathrm{true}\}w:{0,…,k−1}→{false,true}, and natural number qqq, this definition counts the indices iii satisfying both i<qi<qi<q and wi=truew_i=\mathrm{true}wi​=true:

#{ i∈{0,…,k−1}:i<q, wi=true }.\#\{\,i\in\{0,\ldots,k-1\}:i<q,\ w_i=\mathrm{true}\,\}.#{i∈{0,…,k−1}:i<q, wi​=true}.

There is no assumption that q≤kq\le kq≤k: when q≥kq\ge kq≥k it counts all true entries of www, while q=0q=0q=0 or k=0k=0k=0 gives zero.

QAlgorithms.Papers.Independent.Extend50.P17.mpbtBranchChannel

For arbitrary natural numbers d,N,kd,N,kd,N,k, put Rs={0,…,d−1}{0,…,s−1}R_s=\{0,\ldots,d-1\}^{\{0,\ldots,s-1\}}Rs​={0,…,d−1}{0,…,s−1}. Given any complex matrix ω\omegaω indexed by RN×RNR_N\times R_NRN​×RN​, any injection a:{0,…,k−1}↪{0,…,N−1}a:\{0,\ldots,k-1\}\hookrightarrow\{0,\ldots,N-1\}a:{0,…,k−1}↪{0,…,N−1}, any complex matrix EEE indexed by RN×RkR_N\times R_kRN​×Rk​, and any complex matrix XXX indexed by RkR_kRk​, define sa(b)∈Rks_a(b)\in R_ksa​(b)∈Rk​ by sa(b)i=ba(k−1−i)s_a(b)_i=b_{a(k-1-i)}sa​(b)i​=ba(k−1−i)​. The resulting matrix, indexed by RkR_kRk​, has entries

Bω,a,E(X)u,v=∑b,b′∈RNsa(b)=u, sa(b′)=vbj=bj′ for every j∉a({0,…,k−1}) ∑x,x′∈RN ∑c,c′∈RkE(x′,c′),(x,c) ω(x,b),(x′,b′) Xc,c′.B_{\omega,a,E}(X)_{u,v} = \sum_{\substack{b,b'\in R_N\\ s_a(b)=u,\ s_a(b')=v\\ b_j=b'_j\ \text{for every }j\notin a(\{0,\ldots,k-1\})}} \ \sum_{x,x'\in R_N}\ \sum_{c,c'\in R_k} E_{(x',c'),(x,c)}\, \omega_{(x,b),(x',b')}\, X_{c,c'}.Bω,a,E​(X)u,v​=b,b′∈RN​sa​(b)=u, sa​(b′)=vbj​=bj′​ for every j∈/a({0,…,k−1})​∑​ x,x′∈RN​∑​ c,c′∈Rk​∑​E(x′,c′),(x,c)​ω(x,b),(x′,b′)​Xc,c′​.

No positivity, trace, or normalization assumptions are imposed on ω,E,X\omega,E,Xω,E,X. Empty sums are zero, and R0R_0R0​ is a singleton. In particular, k=0k=0k=0 gives a matrix indexed by that singleton, with the outer sum restricted to b=b′b=b'b=b′; if k>Nk>Nk>N, there is no possible argument aaa.

QAlgorithms.Papers.Independent.Extend50.P17.mpbtFidelity

For any natural numbers d,N,kd,N,kd,N,k, this defines the real number

(d2k)−1∑aRe⁡tr⁡(EaSa),(d^{2k})^{-1}\sum_a \operatorname{Re}\operatorname{tr}(E_aS_a),(d2k)−1a∑​Retr(Ea​Sa​),

where aaa ranges over all injections from {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} to {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}. The matrices are indexed by B={0,…,d−1}N×{0,…,d−1}kB=\{0,\ldots,d-1\}^{N}\times\{0,\ldots,d-1\}^{k}B={0,…,d−1}N×{0,…,d−1}k. For each aaa, let πa\pi_aπa​ be the product, in increasing order of i<ki<ki<k, of transpositions exchanging a(i)a(i)a(i) and N+k−1−iN+k-1-iN+k−1−i, and define Wa((u,c),(v,e))W_a((u,c),(v,e))Wa​((u,c),(v,e)) to be 111 when u∥e=(v∥c)∘πa−1u\mathbin{\|}e=(v\mathbin{\|}c)\circ\pi_a^{-1}u∥e=(v∥c)∘πa−1​, and 000 otherwise, where ∥\mathbin{\|}∥ means concatenation. Set Sa=(dN)−1WaS_a=(d^N)^{-1}W_aSa​=(dN)−1Wa​, S=∑aSaS=\sum_a S_aS=∑a​Sa​, F=f(S)F=f(S)F=f(S) by functional calculus with f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1, Ra=FSaFR_a=F S_a FRa​=FSa​F, and Ea=Ra+q−1(I−∑bRb)E_a=R_a+q^{-1}(I-\sum_bR_b)Ea​=Ra​+q−1(I−∑b​Rb​), where qqq is the number of injections and its inverse here is taken in C\mathbb CC. Square root is zero on nonpositive real arguments, and inverses of zero are zero. All zero parameters are included, with 00=10^0=100=1; if k>Nk>Nk>N, the sum is empty and the value is zero.

QAlgorithms.Papers.Independent.Extend50.P17.mpbtSelectedPorts

For arbitrary natural numbers d,N,kd,N,kd,N,k, an injection a:{0,…,k−1}↪{0,…,N−1}a:\{0,\ldots,k-1\}\hookrightarrow\{0,\ldots,N-1\}a:{0,…,k−1}↪{0,…,N−1}, and a register b:{0,…,N−1}→{0,…,d−1}b:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}b:{0,…,N−1}→{0,…,d−1}, this definition returns the length-kkk register whose iiith entry is

b(a(k−1−i))(0≤i<k).b\bigl(a(k-1-i)\bigr)\qquad(0\le i<k).b(a(k−1−i))(0≤i<k).

Thus the selected coordinates are listed in reverse order of their indices in aaa. When k=0k=0k=0, the result is the unique empty register; when k>Nk>Nk>N, no such injection aaa exists.

QAlgorithms.Papers.Independent.Extend50.P17.mpbtSignal

For any natural numbers d,N,kd,N,kd,N,k and injection a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1}, mpbtSignal(d,N,k,a)\mathrm{mpbtSignal}(d,N,k,a)mpbtSignal(d,N,k,a) is the complex matrix whose entry at row (u,v)(u,v)(u,v) and column (u′,v′)(u',v')(u′,v′), with u,u′u,u'u,u′ length-NNN functions and v,v′v,v'v,v′ length-kkk functions taking values in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, is ((d:C)N)−1((d:\mathbb C)^N)^{-1}((d:C)N)−1 if u(j)=u′(j)u(j)=u'(j)u(j)=u′(j) outside the image of aaa and u(a(i))=v(k−1−i)u(a(i))=v(k-1-i)u(a(i))=v(k−1−i), u′(a(i))=v′(k−1−i)u'(a(i))=v'(k-1-i)u′(a(i))=v′(k−1−i) for every i<ki<ki<k, and is 000 otherwise. The scalar uses total complex inversion: it is 000 when d=0<Nd=0<Nd=0<N, and 111 when N=0N=0N=0, including d=0d=0d=0, since 00=10^0=100=1. No argument aaa exists when k>Nk>Nk>N.

QAlgorithms.Papers.Independent.Extend50.P17.mpbtSuccessProbability

For any natural numbers d,N,kd,N,kd,N,k, let Rs={0,…,d−1}{0,…,s−1}R_s=\{0,\ldots,d-1\}^{\{0,\ldots,s-1\}}Rs​={0,…,d−1}{0,…,s−1} and let A\mathcal AA be the set of injections from {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} to {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}. This definition is the real supremum of {0}\{0\}{0} together with all numbers ∑a∈Apa\sum_{a\in\mathcal A}p_a∑a∈A​pa​ arising from families of complex matrices EaE_aEa​ indexed by RN×RkR_N\times R_kRN​×Rk​ and real numbers pap_apa​ such that EaE_aEa​ and I−∑aEaI-\sum_aE_aI−∑a​Ea​ are positive semidefinite, pa≥0p_a\ge0pa​≥0, ∑apa≤1\sum_ap_a\le1∑a​pa​≤1, and, for every a∈Aa\in\mathcal Aa∈A, every complex matrix XXX indexed by RkR_kRk​, and every u,v∈Rku,v\in R_ku,v∈Rk​,

(dN)−1∑b,b′∈RNba(k−1−i)=ui, ba(k−1−i)′=vi ∀i<kbj=bj′ ∀j∉a({0,…,k−1}) ∑c,c′∈Rk(Ea)(b′,c′),(b,c)Xc,c′=paXu,v.(d^N)^{-1} \sum_{\substack{b,b'\in R_N\\ b_{a(k-1-i)}=u_i,\ b'_{a(k-1-i)}=v_i\ \forall i<k\\ b_j=b'_j\ \forall j\notin a(\{0,\ldots,k-1\})}} \ \sum_{c,c'\in R_k} (E_a)_{(b',c'),(b,c)}X_{c,c'} = p_aX_{u,v}.(dN)−1b,b′∈RN​ba(k−1−i)​=ui​, ba(k−1−i)′​=vi​ ∀i<kbj​=bj′​ ∀j∈/a({0,…,k−1})​∑​ c,c′∈Rk​∑​(Ea​)(b′,c′),(b,c)​Xc,c′​=pa​Xu,v​.

Here the coefficient is the complex inverse, with 0−1=00^{-1}=00−1=0; this formula uses the resource matrix whose entry at ((x,b),(x′,b′))((x,b),(x',b'))((x,b),(x′,b′)) is (dN)−1(d^N)^{-1}(dN)−1 when x=bx=bx=b and x′=b′x'=b'x′=b′, and zero otherwise. The supremum set contains 000 and lies in [0,1][0,1][0,1]. All zero parameters are allowed, with R0R_0R0​ a singleton and empty sums zero; when k>Nk>Nk>N, the injection set is empty and the value is 000.

QAlgorithms.Papers.Independent.Extend50.P17.mpbtWordOperator

For any natural numbers d,N,kd,N,kd,N,k and injection a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1}, mpbtWordOperator(d,N,k,a)\mathrm{mpbtWordOperator}(d,N,k,a)mpbtWordOperator(d,N,k,a) is the complex matrix indexed by pairs x=(u,v)x=(u,v)x=(u,v), where uuu is a length-NNN function and vvv is a length-kkk function, both taking values in {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}. Its entry at row (u,v)(u,v)(u,v) and column (u′,v′)(u',v')(u′,v′) is 111 precisely when u(j)=u′(j)u(j)=u'(j)u(j)=u′(j) for every jjj outside the image of aaa, and, for every i∈{0,…,k−1}i\in\{0,\ldots,k-1\}i∈{0,…,k−1}, both u(a(i))=v(k−1−i)u(a(i))=v(k-1-i)u(a(i))=v(k−1−i) and u′(a(i))=v′(k−1−i)u'(a(i))=v'(k-1-i)u′(a(i))=v′(k−1−i); otherwise the entry is 000. Equivalently, the concatenation of uuu with v′v'v′ must equal the concatenation of u′u'u′ with vvv precomposed with the inverse of the permutation exchanging a(i)a(i)a(i) with N+k−1−iN+k-1-iN+k−1−i for every iii. When k=0k=0k=0, this matrix is the identity on the length-NNN functions. No argument aaa exists when k>Nk>Nk>N, and the matrix index set is empty when d=0d=0d=0 and N+k>0N+k>0N+k>0.

QAlgorithms.Papers.Independent.Extend50.P17.normalizedSum

For any natural numbers d,N,kd,N,kd,N,k, let SSS be the complex matrix indexed by pairs (u,v)(u,v)(u,v) of length-NNN and length-kkk functions into {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, whose entry S(u,v),(u′,v′)S_{(u,v),(u',v')}S(u,v),(u′,v′)​ is ((d:C)N)−1((d:\mathbb C)^N)^{-1}((d:C)N)−1 times the number of injections a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1} such that u(j)=u′(j)u(j)=u'(j)u(j)=u′(j) outside the image of aaa and u(a(i))=v(k−1−i)u(a(i))=v(k-1-i)u(a(i))=v(k−1−i), u′(a(i))=v′(k−1−i)u'(a(i))=v'(k-1-i)u′(a(i))=v′(k−1−i) for every i<ki<ki<k. Then normalizedSum(d,N,k)=(tr⁡S)−1S\mathrm{normalizedSum}(d,N,k)=(\operatorname{tr}S)^{-1}SnormalizedSum(d,N,k)=(trS)−1S, where tr⁡S\operatorname{tr}StrS is the sum of its diagonal entries and inversion is in C\mathbb CC. No nonzero-trace hypothesis is required: if the trace is zero, the result is the zero matrix. The count is zero when k>Nk>Nk>N; also, 0−1=00^{-1}=00−1=0 and 00=10^0=100=1 in the defining scalar.

QAlgorithms.Papers.Independent.Extend50.P17.optimizedSuccess

For any natural numbers d,N,kd,N,kd,N,k, let Rs={0,…,d−1}{0,…,s−1}R_s=\{0,\ldots,d-1\}^{\{0,\ldots,s-1\}}Rs​={0,…,d−1}{0,…,s−1} and let A\mathcal AA be the set of injections from {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} to {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}. This definition is the real supremum of {0}\{0\}{0} together with all numbers ∑a∈Apa\sum_{a\in\mathcal A}p_a∑a∈A​pa​ for which there exist a positive semidefinite complex matrix ω\omegaω indexed by RN×RNR_N\times R_NRN​×RN​ with tr⁡ω=1\operatorname{tr}\omega=1trω=1, complex matrices EaE_aEa​ indexed by RN×RkR_N\times R_kRN​×Rk​, and real numbers pap_apa​, satisfying: every EaE_aEa​ and I−∑aEaI-\sum_aE_aI−∑a​Ea​ are positive semidefinite, every pa≥0p_a\ge0pa​≥0, ∑apa≤1\sum_ap_a\le1∑a​pa​≤1, and, for every a∈Aa\in\mathcal Aa∈A, every complex matrix XXX indexed by RkR_kRk​, and every u,v∈Rku,v\in R_ku,v∈Rk​,

∑b,b′∈RNba(k−1−i)=ui, ba(k−1−i)′=vi ∀i<kbj=bj′ ∀j∉a({0,…,k−1}) ∑x,x′∈RN ∑c,c′∈Rk(Ea)(x′,c′),(x,c) ω(x,b),(x′,b′) Xc,c′=paXu,v.\sum_{\substack{b,b'\in R_N\\ b_{a(k-1-i)}=u_i,\ b'_{a(k-1-i)}=v_i\ \forall i<k\\ b_j=b'_j\ \forall j\notin a(\{0,\ldots,k-1\})}} \ \sum_{x,x'\in R_N}\ \sum_{c,c'\in R_k} (E_a)_{(x',c'),(x,c)} \,\omega_{(x,b),(x',b')} \,X_{c,c'} = p_aX_{u,v}.b,b′∈RN​ba(k−1−i)​=ui​, ba(k−1−i)′​=vi​ ∀i<kbj​=bj′​ ∀j∈/a({0,…,k−1})​∑​ x,x′∈RN​∑​ c,c′∈Rk​∑​(Ea​)(x′,c′),(x,c)​ω(x,b),(x′,b′)​Xc,c′​=pa​Xu,v​.

The supremum set contains 000 and lies in [0,1][0,1][0,1]. Zero parameters are included and R0R_0R0​ is a singleton. When k>Nk>Nk>N, the value is 000 because the family of outcomes is empty. When d=0<Nd=0<Nd=0<N, the resource index set is empty, so its matrix trace is zero and the required trace-one resource does not exist; the inserted 000 still makes the value 000.

QAlgorithms.Papers.Independent.Extend50.P17.outcomeCount

For any natural numbers N,kN,kN,k, outcomeCount(N,k)\mathrm{outcomeCount}(N,k)outcomeCount(N,k) is the number of injective functions from {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} to {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}. It counts labeled selections, and equals N(N−1)⋯(N−k+1)N(N-1)\cdots(N-k+1)N(N−1)⋯(N−k+1) when k≤Nk\le Nk≤N, with the empty product equal to 111 when k=0k=0k=0; it equals 000 when k>Nk>Nk>N.

QAlgorithms.Papers.Independent.Extend50.P17.packagedFidelity

For any natural numbers N,kN,kN,k, let M=⌊N/k⌋M=\lfloor N/k\rfloorM=⌊N/k⌋ when k>0k>0k>0, and let M=0M=0M=0 when k=0k=0k=0, following natural-number division by zero. This defines

(14∑j=0M−1Re⁡tr⁡(EjSj))k.\left(\frac14\sum_{j=0}^{M-1}\operatorname{Re}\operatorname{tr}(E_jS_j)\right)^k.(41​j=0∑M−1​Retr(Ej​Sj​))k.

Here the matrices are indexed by pairs (u,c)(u,c)(u,c), with u:{0,…,M−1}→{0,1}u:\{0,\ldots,M-1\}\to\{0,1\}u:{0,…,M−1}→{0,1} and c∈{0,1}c\in\{0,1\}c∈{0,1}; Sj((u,c),(v,e))=2−MS_j((u,c),(v,e))=2^{-M}Sj​((u,c),(v,e))=2−M if uj=cu_j=cuj​=c, vj=ev_j=evj​=e, and uℓ=vℓu_\ell=v_\elluℓ​=vℓ​ for every ℓ≠j\ell\neq jℓ=j, and is zero otherwise. Set S=∑j=0M−1SjS=\sum_{j=0}^{M-1}S_jS=∑j=0M−1​Sj​, F=f(S)F=f(S)F=f(S) by functional calculus with f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1, Rj=FSjFR_j=F S_jFRj​=FSj​F, and Ej=Rj+M−1(I−∑ℓ=0M−1Rℓ)E_j=R_j+M^{-1}(I-\sum_{\ell=0}^{M-1}R_\ell)Ej​=Rj​+M−1(I−∑ℓ=0M−1​Rℓ​), with the inverse in the matrix formula taken in C\mathbb CC. Square root is zero on nonpositive real arguments, and inversion of zero is zero. No divisibility condition is imposed on N,kN,kN,k; for k=0k=0k=0 the defined value is 111, and for 0<N+1≤k0<N+1\leq k0<N+1≤k the sum is empty and the value is zero.

QAlgorithms.Papers.Independent.Extend50.P17.packagedLower

For any natural numbers N,kN,kN,k, this defines the real number

(1−3k4N)k,\left(1-\frac{3k}{4N}\right)^k,(1−4N3k​)k,

with all arithmetic inside the parentheses performed in R\mathbb RR. There are no restrictions on NNN or kkk. Division by zero is zero, so the value is 111 when N=0N=0N=0; the zeroth-power convention also makes it 111 when k=0k=0k=0.

QAlgorithms.Papers.Independent.Extend50.P17.packagedOptimalFidelity

For any natural numbers N,kN,kN,k, this defines

cos⁡ ⁣(πM+2)2k,\cos\!\left(\frac{\pi}{M+2}\right)^{2k},cos(M+2π​)2k,

where M=N/kM=N/kM=N/k is computed by natural-number division, so M=⌊N/k⌋M=\lfloor N/k\rfloorM=⌊N/k⌋ for k>0k>0k>0 and M=0M=0M=0 for k=0k=0k=0, and M+2M+2M+2 is then interpreted as a real number. No positivity or divisibility assumptions are imposed. The denominator is always at least 222, and when k=0k=0k=0 the value is 111.

QAlgorithms.Papers.Independent.Extend50.P17.packagedOptimalSuccess

For arbitrary natural numbers N,kN,kN,k, let M=NdivkM=N\mathbin{\mathrm{div}}kM=Ndivk, where this is ⌊N/k⌋\lfloor N/k\rfloor⌊N/k⌋ for k>0k>0k>0 and 000 for k=0k=0k=0, and put R={0,1}{0,…,M−1}R=\{0,1\}^{\{0,\ldots,M-1\}}R={0,1}{0,…,M−1}. This definition is SkS^kSk, where SSS is the real supremum of {0}\{0\}{0} together with all sums ∑j=0M−1pj\sum_{j=0}^{M-1}p_j∑j=0M−1​pj​ for which there exist a positive semidefinite complex matrix ω\omegaω indexed by R×RR\times RR×R with tr⁡ω=1\operatorname{tr}\omega=1trω=1, real numbers pj≥0p_j\ge0pj​≥0, and complex matrices EjE_jEj​ indexed by R×{0,1}R\times\{0,1\}R×{0,1}, such that every EjE_jEj​ and I−∑jEjI-\sum_jE_jI−∑j​Ej​ are positive semidefinite, ∑jpj≤1\sum_jp_j\le1∑j​pj​≤1, and, for every j<Mj<Mj<M, every complex 2×22\times22×2 matrix XXX, and every u,v∈{0,1}u,v\in\{0,1\}u,v∈{0,1},

∑b,b′∈Rbj=u, bj′=vbh=bh′ ∀h≠j ∑x,x′∈R ∑c,c′∈{0,1}(Ej)(x′,c′),(x,c) ω(x,b),(x′,b′) Xc,c′=pjXu,v.\sum_{\substack{b,b'\in R\\b_j=u,\ b'_j=v\\b_h=b'_h\ \forall h\ne j}} \ \sum_{x,x'\in R}\ \sum_{c,c'\in\{0,1\}} (E_j)_{(x',c'),(x,c)} \,\omega_{(x,b),(x',b')} \,X_{c,c'} = p_jX_{u,v}.b,b′∈Rbj​=u, bj′​=vbh​=bh′​ ∀h=j​∑​ x,x′∈R∑​ c,c′∈{0,1}∑​(Ej​)(x′,c′),(x,c)​ω(x,b),(x′,b′)​Xc,c′​=pj​Xu,v​.

One-coordinate registers and one-port injections are identified with their coordinate values and selected ports, respectively. No divisibility or positivity condition on N,kN,kN,k is assumed. When k=0k=0k=0, the value is 111 by the zeroth-power convention; when k>0k>0k>0 and N<kN<kN<k, the outcome family is empty, the supremum is 000, and the value is 000.

QAlgorithms.Papers.Independent.Extend50.P17.packagedSuccess

For arbitrary natural numbers N,kN,kN,k, let M=NdivkM=N\mathbin{\mathrm{div}}kM=Ndivk, using natural-number division, so M=⌊N/k⌋M=\lfloor N/k\rfloorM=⌊N/k⌋ for k>0k>0k>0 and M=0M=0M=0 for k=0k=0k=0, and put R={0,1}{0,…,M−1}R=\{0,1\}^{\{0,\ldots,M-1\}}R={0,1}{0,…,M−1}. This definition is SkS^kSk, where SSS is the real supremum of {0}\{0\}{0} together with all sums ∑j=0M−1pj\sum_{j=0}^{M-1}p_j∑j=0M−1​pj​ for which there exist real numbers pj≥0p_j\ge0pj​≥0 and complex matrices EjE_jEj​ indexed by R×{0,1}R\times\{0,1\}R×{0,1}, with every EjE_jEj​ and I−∑jEjI-\sum_jE_jI−∑j​Ej​ positive semidefinite and ∑jpj≤1\sum_jp_j\le1∑j​pj​≤1, such that, for every j<Mj<Mj<M, every complex 2×22\times22×2 matrix XXX, and every u,v∈{0,1}u,v\in\{0,1\}u,v∈{0,1},

2−M∑b,b′∈Rbj=u, bj′=vbh=bh′ ∀h≠j ∑c,c′∈{0,1}(Ej)(b′,c′),(b,c)Xc,c′=pjXu,v.2^{-M} \sum_{\substack{b,b'\in R\\b_j=u,\ b'_j=v\\b_h=b'_h\ \forall h\ne j}} \ \sum_{c,c'\in\{0,1\}} (E_j)_{(b',c'),(b,c)}X_{c,c'} = p_jX_{u,v}.2−Mb,b′∈Rbj​=u, bj′​=vbh​=bh′​ ∀h=j​∑​ c,c′∈{0,1}∑​(Ej​)(b′,c′),(b,c)​Xc,c′​=pj​Xu,v​.

Here a one-coordinate register is identified with its coordinate value, and a one-port injection is identified with its selected port jjj; the coefficient comes from the resource matrix with entry 2−M2^{-M}2−M when its two registers agree at both row and column, and zero otherwise. No divisibility or positivity condition on N,kN,kN,k is assumed. For k=0k=0k=0 the result is 111, including the convention 00=10^0=100=1; for k>0k>0k>0 and N<kN<kN<k, there are no ports in the inner optimization, so the result is 000.

QAlgorithms.Papers.Independent.Extend50.P17.pairingWord

For any natural numbers N,kN,kN,k and any injection a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1}, pairingWord(a)\mathrm{pairingWord}(a)pairingWord(a) is the permutation of {0,…,N+k−1}\{0,\ldots,N+k-1\}{0,…,N+k−1} given by τ0τ1⋯τk−1\tau_0\tau_1\cdots\tau_{k-1}τ0​τ1​⋯τk−1​, where τi\tau_iτi​ exchanges positions a(i)a(i)a(i) and N+k−1−iN+k-1-iN+k−1−i and fixes every other position. Permutation multiplication is composition, so the rightmost factor acts first. These exchanges are disjoint because aaa is injective. When k=0k=0k=0, the product is the identity permutation; when k>Nk>Nk>N, no such argument aaa exists.

QAlgorithms.Papers.Independent.Extend50.P17.portAction

For any natural numbers d,N,kd,N,kd,N,k and permutation ppp of {0,…,N−1}\{0,\ldots,N-1\}{0,…,N−1}, this defines a complex matrix indexed by B={0,…,d−1}N×{0,…,d−1}kB=\{0,\ldots,d-1\}^{N}\times\{0,\ldots,d-1\}^{k}B={0,…,d−1}N×{0,…,d−1}k, whose entry in row y=(v,e)y=(v,e)y=(v,e) and column x=(u,c)x=(u,c)x=(u,c) is

{1,v=u∘p−1 and e=c,0,otherwise.\begin{cases} 1,&v=u\circ p^{-1}\ \text{and}\ e=c,\\ 0,&\text{otherwise}. \end{cases}{1,0,​v=u∘p−1 and e=c,otherwise.​

No positivity assumptions are imposed. When d=0d=0d=0 and N+k>0N+k>0N+k>0, the indexing set is empty; when N=k=0N=k=0N=k=0, it has one element even if d=0d=0d=0, and the matrix is the one-entry matrix (1)(1)(1).

QAlgorithms.Papers.Independent.Extend50.P17.powerBound

For any natural numbers d,N,kd,N,kd,N,k, this defines

(1−d2−1d2+N−k)k∈R,\left(1-\frac{d^2-1}{d^2+N-k}\right)^k\in\mathbb R,(1−d2+N−kd2−1​)k∈R,

where d,N,kd,N,kd,N,k are converted to real numbers before the subtractions and division. No positivity or size restrictions are imposed, so the denominator may be zero or negative. Division by zero is zero, making the value 111 whenever the denominator is zero; when k=0k=0k=0, the value is also 111.

QAlgorithms.Papers.Independent.Extend50.P17.qubitFidelityExpression

For every pair of natural numbers N,kN,kN,k, this defines the real number

2−(N+2k)∑r=0⌊(N\dotminusk)/2⌋(∑0≤t≤⌊N/2⌋r≤t, t≤r+k, r+t≤NBN\dotminusk,k(r,t)((N\dotminus2t)+1)2N!t! ((N\dotminust)+1)!)2,2^{-(N+2k)} \sum_{r=0}^{\lfloor(N\dotminus k)/2\rfloor} \left( \sum_{\substack{0\le t\le\lfloor N/2\rfloor\\r\le t,\ t\le r+k,\ r+t\le N}} B_{N\dotminus k,k}(r,t) \sqrt{\frac{((N\dotminus 2t)+1)^2N!}{t!\,((N\dotminus t)+1)!}} \right)^2,2−(N+2k)r=0∑⌊(N\dotminusk)/2⌋​​0≤t≤⌊N/2⌋r≤t, t≤r+k, r+t≤N​∑​BN\dotminusk,k​(r,t)t!((N\dotminust)+1)!((N\dotminus2t)+1)2N!​​​2,

where u\dotminusv=max⁡(u−v,0)u\dotminus v=\max(u-v,0)u\dotminusv=max(u−v,0) denotes natural-number subtraction,

Bm,k(r,t)=Ck(t−r)−Ck(m+k−r−t+1),Ck(z)={(kz),z∈Z, z≥0,0,z<0.B_{m,k}(r,t)=C_k(t-r)-C_k(m+k-r-t+1), \qquad C_k(z)= \begin{cases} \binom{k}{z},&z\in\mathbb Z,\ z\ge0,\\ 0,&z<0. \end{cases}Bm,k​(r,t)=Ck​(t−r)−Ck​(m+k−r−t+1),Ck​(z)={(zk​),0,​z∈Z, z≥0,z<0.​

The arguments of CkC_kCk​ use integer subtraction, and (kz)=0\binom{k}{z}=0(zk​)=0 when z>kz>kz>k. No assumption k≤Nk\le Nk≤N or positivity assumption is imposed; N=0N=0N=0, k=0k=0k=0, and k>Nk>Nk>N are included, with empty inner sums equal to zero.

QAlgorithms.Papers.Independent.Extend50.P17.qubitSuccessExpression

For every pair of natural numbers N,kN,kN,k, this defines

12N(N+1)∑r=0⌊(N\dotminusk)/2⌋(((N\dotminusk)\dotminus2r)+1)2(N+1r),\frac{1}{2^N(N+1)} \sum_{r=0}^{\lfloor(N\dotminus k)/2\rfloor} \bigl(((N\dotminus k)\dotminus 2r)+1\bigr)^2 \binom{N+1}{r},2N(N+1)1​r=0∑⌊(N\dotminusk)/2⌋​(((N\dotminusk)\dotminus2r)+1)2(rN+1​),

as a real number, where u\dotminusv=max⁡(u−v,0)u\dotminus v=\max(u-v,0)u\dotminusv=max(u−v,0). All subtractions inside the squared natural-number expression occur before conversion to real numbers. The definition includes N=0N=0N=0, k=0k=0k=0, and k>Nk>Nk>N, without additional restrictions.

QAlgorithms.Papers.Independent.Extend50.P17.rawSRM

For any natural numbers d,N,kd,N,kd,N,k and injection a:{0,…,k−1}↪{0,…,N−1}a:\{0,\ldots,k-1\}\hookrightarrow\{0,\ldots,N-1\}a:{0,…,k−1}↪{0,…,N−1}, this defines a complex matrix Ra=FSaFR_a=F S_a FRa​=FSa​F indexed by B={0,…,d−1}N×{0,…,d−1}kB=\{0,\ldots,d-1\}^{N}\times\{0,\ldots,d-1\}^{k}B={0,…,d−1}N×{0,…,d−1}k. Here πa\pi_aπa​ is the product, in increasing order of i<ki<ki<k, of the transpositions exchanging positions a(i)a(i)a(i) and N+k−1−iN+k-1-iN+k−1−i; for x=(u,c),y=(v,e)∈Bx=(u,c),y=(v,e)\in Bx=(u,c),y=(v,e)∈B, define Wa(x,y)W_a(x,y)Wa​(x,y) to be 111 if u∥e=(v∥c)∘πa−1u\mathbin{\|}e=(v\mathbin{\|}c)\circ\pi_a^{-1}u∥e=(v∥c)∘πa−1​, and 000 otherwise, where ∥\mathbin{\|}∥ denotes concatenation. Then Sa=(dN)−1WaS_a=(d^N)^{-1}W_aSa​=(dN)−1Wa​, with the scalar interpreted in C\mathbb CC, S=∑bSbS=\sum_b S_bS=∑b​Sb​, where bbb ranges over all such injections, and F=f(S)F=f(S)F=f(S) is defined by functional calculus with f(t)=(t)−1f(t)=(\sqrt t)^{-1}f(t)=(t​)−1 for real ttt. Real square root is zero for t≤0t\leq0t≤0, and inversion of zero is zero. No positivity assumption on d,N,kd,N,kd,N,k is imposed; the injection parameter can exist only when k≤Nk\leq Nk≤N, and when k=0k=0k=0 it is the unique empty injection.

QAlgorithms.Papers.Independent.Extend50.P17.signalSum

For any natural numbers d,N,kd,N,kd,N,k, signalSum(d,N,k)\mathrm{signalSum}(d,N,k)signalSum(d,N,k) is the sum over all injections a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1} of the following complex matrices: at row (u,v)(u,v)(u,v) and column (u′,v′)(u',v')(u′,v′), with u,u′u,u'u,u′ length-NNN functions and v,v′v,v'v,v′ length-kkk functions into {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, the summand is ((d:C)N)−1((d:\mathbb C)^N)^{-1}((d:C)N)−1 when u(j)=u′(j)u(j)=u'(j)u(j)=u′(j) outside the image of aaa and u(a(i))=v(k−1−i)u(a(i))=v(k-1-i)u(a(i))=v(k−1−i), u′(a(i))=v′(k−1−i)u'(a(i))=v'(k-1-i)u′(a(i))=v′(k−1−i) for every i<ki<ki<k, and is 000 otherwise. The sum is the zero matrix when k>Nk>Nk>N. When k=0k=0k=0, it is ((d:C)N)−1((d:\mathbb C)^N)^{-1}((d:C)N)−1 times the identity. Inversion at zero is 000, while the scalar is 111 when N=0N=0N=0, even if d=0d=0d=0.

QAlgorithms.Papers.Independent.Extend50.P17.supportInverseSqrt

For any natural numbers d,N,kd,N,kd,N,k, let SSS be the complex matrix indexed by pairs (u,v)(u,v)(u,v) of length-NNN and length-kkk functions into {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, whose entry S(u,v),(u′,v′)S_{(u,v),(u',v')}S(u,v),(u′,v′)​ is ((d:C)N)−1((d:\mathbb C)^N)^{-1}((d:C)N)−1 times the number of injections a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1} satisfying u(j)=u′(j)u(j)=u'(j)u(j)=u′(j) outside the image of aaa and u(a(i))=v(k−1−i)u(a(i))=v(k-1-i)u(a(i))=v(k−1−i), u′(a(i))=v′(k−1−i)u'(a(i))=v'(k-1-i)u′(a(i))=v′(k−1−i) for every i<ki<ki<k. Then supportInverseSqrt(d,N,k)\mathrm{supportInverseSqrt}(d,N,k)supportInverseSqrt(d,N,k) is the real continuous functional calculus of SSS for the function f(x)=(x)−1f(x)=(\sqrt{x})^{-1}f(x)=(x​)−1. Here the real square root is 000 for x≤0x\le0x≤0, and inversion at zero is 000, so f(x)=1/xf(x)=1/\sqrt{x}f(x)=1/x​ for x>0x>0x>0 and f(x)=0f(x)=0f(x)=0 for x≤0x\le0x≤0. For Hermitian SSS, this applies fff to each eigenvalue; the total functional calculus returns zero when its applicability conditions fail. No positivity or invertibility hypothesis is imposed. The injection count is zero for k>Nk>Nk>N, and the defining scalar uses 0−1=00^{-1}=00−1=0 and 00=10^0=100=1.

QAlgorithms.Papers.Independent.Extend50.P17.symmetricBound

For all natural numbers d,N,kd,N,kd,N,k, this defines the real number

∑l=0k(−1)l(d2−1)l∑S⊆{0,…,k−1}∣S∣=l∏s∈S1d2+N−s−1.\sum_{l=0}^{k}(-1)^l(d^2-1)^l \sum_{\substack{S\subseteq\{0,\ldots,k-1\}\\|S|=l}} \prod_{s\in S}\frac{1}{d^2+N-s-1}.l=0∑k​(−1)l(d2−1)lS⊆{0,…,k−1}∣S∣=l​∑​s∈S∏​d2+N−s−11​.

All arithmetic in the factors is real arithmetic, each zero denominator has reciprocal zero, and empty products equal 111. There are no positivity or size assumptions on d,N,kd,N,kd,N,k; in particular, the value for k=0k=0k=0 is 111.

QAlgorithms.Papers.Independent.Extend50.P17.unscaledSum

For any natural numbers d,N,kd,N,kd,N,k, unscaledSum(d,N,k)\mathrm{unscaledSum}(d,N,k)unscaledSum(d,N,k) is the complex matrix whose entry at row (u,v)(u,v)(u,v) and column (u′,v′)(u',v')(u′,v′), with u,u′u,u'u,u′ length-NNN functions and v,v′v,v'v,v′ length-kkk functions into {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, is the number of injections a:{0,…,k−1}→{0,…,N−1}a:\{0,\ldots,k-1\}\to\{0,\ldots,N-1\}a:{0,…,k−1}→{0,…,N−1} satisfying u(j)=u′(j)u(j)=u'(j)u(j)=u′(j) outside the image of aaa and u(a(i))=v(k−1−i)u(a(i))=v(k-1-i)u(a(i))=v(k−1−i), u′(a(i))=v′(k−1−i)u'(a(i))=v'(k-1-i)u′(a(i))=v′(k−1−i) for every i<ki<ki<k, with that number regarded as a complex number. For k>Nk>Nk>N, the sum has no terms and is the zero matrix; for k=0k=0k=0, it is the identity. When d=0d=0d=0 and N+k>0N+k>0N+k>0, there are no row or column indices.

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