Definitions for Quantum teleportation scheme by selecting one of multiple output ports
DefinitionQAlgorithms_Papers_Independent_Intake100_P67The objects the formalized statements of Quantum teleportation scheme by selecting one of multiple output ports (arXiv:0901.2975) are stated in. Each was checked against the paper by a blind read-back and a moderator.
AC: PDF pp.1–3: the ordered Alice register and the extra input/reference qubit.singletAmp: PDF p.2: the normalized singlet amplitude, with |0> = spin down.resource: PDF p.2: normalized resource (O tensor I)|singlet>^N, allowing rectangular O.ResourceNormalized: PDF p.3, Eq.(5): exactly the normalization required of O, including singular O.transformed: PDF p.3, Eq.(3): transformed effects, with C relabelled B.portSignal: PDF p.2, Eq.(2): signal sigma(i), including the maximally mixed unused A qubits.portRho: PDF p.3, Eq.(6): the sum of the physical signal matrices.entFidelity: PDF p.3, Eq.(3): singlet entanglement fidelity of the recovered qubit.portAverageFidelity: PDF pp.2–3: normalized Haar average, f=(2F+1)/3, for deterministic protocols.IsDeterministicPortProtocol: PDF pp.2–3: input-independent resource and a full N-outcome Alice POVM. Bob's only operation is selection of the reported port.portRetainedOutput: PDF p.2, Eq.(1): one retained-port branch, written in matrix entries. Tracing out Alice makes the square-root instrument equal to contraction with its effect. No operation on the output qudit occurs.SubPOVM: PDF p.7: a sub-POVM with the positive omitted effect as failure outcome 0.IsFaithfulPortProtocol: PDF p.7: every successful branch returns every normalized unknown pure input exactly. Zero-probability branches are allowed; failure is unconstrained.IsProbabilisticPortProtocol: PDF pp.7–8: physical faithful probabilistic protocols with an input-independent resource.portSuccessProbability: PDF p.7, Eq.(44): success averaged over normalized Haar inputs, not conditional fidelity.Other: PDF pp.3–5: the actual residual wires; no fictitious negative-spin subsystem.embedTheta: PDF p.7, Eq.(45): P^-_{AiC} tensor Theta_i on the remaining A wires.PortSuccessFeasible: PDF p.7, Eqs.(5),(46): the complete success SDP feasibility constraints.successObjective: PDF p.7, Eq.(47): the success SDP objective.spins: PDF pp.3–5: legal doubled spins k=2j. Factorial arguments below are integers.spinSquare: PDF p.3: Casimir J^2 of spin-half wires, from S_i.S_j=(Swap_ij-I/2)/2. The scalar arithmetic is real, so n=0 never causes natural subtraction underflow.qubitSpinProjector: PDF pp.3–5: the spin-j projector, defined intrinsically by spectral calculus of J^2. This is the identity 11(j) on the span of all source |Phi(j,m,alpha)> vectors. Finite spectra make the indicator continuous on the spectrum. Illegal sectors are zero.totalProjector: PDF p.4: the total-spin projector on AC, the extra qubit indexed by none.lambdaMinus: PDF p.3, Eq.(7): lambda^-_j with j=k/2. Real subtraction is intentional.lambdaPlus: PDF p.3, Eq.(7): lambda^+_j with j=k/2.minusSector: PDF pp.3–4, Eqs.(8),(17): the whole eigenspace obtained by coupling j to j+1/2.plusSector: PDF pp.3–4, Eqs.(8),(17): coupling j to j-1/2; absent when j=0.rhoBlock: PDF p.4: rho(s), on the full space with zero on other total-spin sectors.xiProjector: PDF p.5, Eq.(24): projector onto singlet_{AiC} tensor the residual spin-s sector.signalBlock: PDF p.5: sigma(i)(s), including the normalization 2^{-(N-1)}.compressedScalar: PDF p.5, Eq.(26): scalar compressed moment; k=2s and y is nonzero. At s=0 the nonexistent j=-1/2 term is omitted.completedSRM: PDF p.5, Eqs.(27),(28): SRM completed uniformly on its kernel.fixedFidelity: PDF p.5, Eq.(29): exact fixed-resource entanglement fidelity.deterministicOptimumFidelity: PDF p.7, Eq.(41): the optimum singlet entanglement fidelity.deterministicOptimumAverage: PDF p.7, Eq.(42): the optimum Haar average recovered-qubit fidelity.deterministicGamma: PDF p.6, Eq.(35): gamma(j) on the legal doubled-spin range.deterministicX: PDF p.6, Eq.(34): the explicitly optimized deterministic resource X.generalizedFilter: PDF p.6, Eqs.(32)–(37): sqrt(z)rho(s)^(-1/y), after cancellation. Its branch factors are sqrt(gamma(j)/lambda_j). This agrees with the generalized SRM on nonzero sectors and defines its nonsingular s=0 endpoint without inventing y(0).generalizedCore: PDF p.6, Eq.(32): transformed generalized SRM before the excess term.generalizedEffects: PDF p.6, Eqs.(32),(39): transformed effects, including the uniform positive remainder.resourceOperator: PDF pp.3,6–8: O=sqrt(X), the positive representative of the pure resource.physicalEffects: PDF pp.3,6–8: physical measurement on the range of O, completed on its complement. For sub-POVMs use complete=false so the omitted complement is part of failure.deterministicMeasurement: PDF pp.6–7: the actual optimized deterministic POVM.fixedSuccess: PDF p.8, Eq.(50): the exact fixed-resource success probability, k=2s.probabilisticOptimumSuccess: PDF p.8, Eq.(56): fully optimized faithful qubit success probability.fixedTheta: PDF pp.7–8, Eq.(48): fixed-resource attaining Theta_i.optimalTheta: PDF p.8, Eqs.(52),(53): optimized attaining Theta_i.probabilisticX: PDF p.8, Eq.(54): optimized probabilistic resource X.probabilisticMeasurement: PDF pp.8–9: optimized physical successful effects; failure is I minus their sum.quditResource: PDF pp.5–6: the normalized positive maximally entangled qudit resource.quditSignal: PDF p.5: qudit sigma(i), with the positive maximally entangled reference.quditChannel: PDF pp.5–6: the completed qudit SRM channel, applied to arbitrary operators.bobDensity: PDF p.9: Bob's full reduced density of a pure resource.bobPortDensity: PDF p.9: Bob's one-port marginal, tracing all A and all other ports.restorePort: PDF pp.9–10: insert the selected port into a configuration of the remaining ports.postAmplitude: PDF p.2, Eq.(1), pp.9–10: the single-Kraus square-root postmeasurement vector. All Alice registers, including C, are retained.postBranchProbability: PDF pp.9–10: branch probability, the squared norm of the unnormalized postmeasurement vector.residualDensity: PDF pp.9–10: normalized density of the unused Bob ports on a successful branch. Its entropy is that of the pure residual state in the (all Alice):(unused Bob) cut. Theorems ensure a positive branch probability before using this quotient.plusAmp: PDF p.9: the two-qubit |psi^+> amplitude.twoPortResource: PDF p.9, Eq.(57): the explicit optimized two-port pure resource.xAmplitude: PDF p.9: x^+ and x^-; these are Alice states, not the unknown input.twoPortEta: PDF p.9, Eq.(58): the two orthogonal unit vectors eta^- and eta^+.swapTwo: PDF p.9: A1 <-> A2.twoPortMeasurement: PDF p.9, Eq.(58) and its exchanged branch: the two projective successful effects.twoPortResidual: PDF p.9, Eq.(59): the normalized residual vector for port 1; t labels the unused port.twoPortResidualExpanded: PDF p.9, Eq.(59), second line: the same residual expanded in Bell states.twoPortInitialEntropy: PDF pp.9–10: the exact entropy of Eq.(57), replacing the rounded printed 1.90.klmCurve: PDF p.8: the KLM success curve quoted from [17], only for the numerical comparison.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Ensemble
import Definitions.Def_QAlgorithms_Defs_QuditChannelFidelities
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P71
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P49
noncomputable section
open scoped Matrix Kronecker ComplexConjugate ComplexOrder Matrix.Norms.L2Operator
attribute [local instance] Classical.propDecidable
attribute [local instance] Classical.decEq
namespace QAlgorithms.Papers.Independent.Intake100.P67
open QAlgorithms.Papers.Independent.Information100.P71 (supportPower)
open QAlgorithms.Papers.Independent.Advance50.P49 (spinMultiplicity)
/-- PDF pp.1–3: the ordered Alice register and the extra input/reference qubit. -/
abbrev AC (N : ℕ) := Qubits N × Bool
/-- PDF p.2: the normalized singlet amplitude, with |0> = spin down. -/
def singletAmp (a b : Bool) : ℂ :=
if a = false ∧ b = true then (Real.sqrt 2 : ℂ)⁻¹
else if a = true ∧ b = false then -(Real.sqrt 2 : ℂ)⁻¹ else 0
/-- PDF p.2: normalized resource (O tensor I)|singlet>^N, allowing rectangular O. -/
def resource {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(a : Qubits NA) (b : Qubits N) : ℂ :=
∑ x : Qubits N, O a x * ∏ i, singletAmp (x i) (b i)
/-- PDF p.3, Eq.(5): exactly the normalization required of O, including singular O. -/
def ResourceNormalized {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ) : Prop :=
(Oᴴ * O).trace = (2 : ℂ) ^ N
/-- PDF p.3, Eq.(3): transformed effects, with C relabelled B. -/
def transformed {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Matrix (AC NA) (AC NA) ℂ) : Matrix (AC N) (AC N) ℂ :=
(Oᴴ ⊗ₖ (1 : Matrix Bool Bool ℂ)) * M * (O ⊗ₖ (1 : Matrix Bool Bool ℂ))
/-- PDF p.2, Eq.(2): signal sigma(i), including the maximally mixed unused A qubits. -/
def portSignal (N : ℕ) (i : Fin N) : Matrix (AC N) (AC N) ℂ :=
fun p q => if ∀ k, k ≠ i → p.1 k = q.1 k then
singletAmp (p.1 i) p.2 * conj (singletAmp (q.1 i) q.2) / (2 : ℂ) ^ (N - 1)
else 0
/-- PDF p.3, Eq.(6): the sum of the physical signal matrices. -/
def portRho (N : ℕ) : Matrix (AC N) (AC N) ℂ := ∑ i, portSignal N i
/-- PDF p.3, Eq.(3): singlet entanglement fidelity of the recovered qubit. -/
def entFidelity {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : ℝ :=
(∑ i, (transformed O (M i) * portSignal N i).trace.re) / 4
/-- PDF pp.2–3: normalized Haar average, f=(2F+1)/3, for deterministic protocols. -/
def portAverageFidelity {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : ℝ := (2 * entFidelity O M + 1) / 3
/-- PDF pp.2–3: input-independent resource and a full N-outcome Alice POVM.
Bob's only operation is selection of the reported port. -/
def IsDeterministicPortProtocol {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : Prop :=
ResourceNormalized O ∧ (∀ i, (M i).PosSemidef) ∧ ∑ i, M i = 1
/-- PDF p.2, Eq.(1): one retained-port branch, written in matrix entries.
Tracing out Alice makes the square-root instrument equal to contraction with its effect.
No operation on the output qudit occurs. -/
def portRetainedOutput {K A : Type*} [Fintype K] [Fintype A] {N : ℕ}
(R : A → (Fin N → K) → ℂ) (M : Matrix (A × K) (A × K) ℂ)
(i : Fin N) (T : Matrix K K ℂ) : Matrix K K ℂ :=
fun u v => ∑ b : Fin N → K, ∑ b' : Fin N → K,
if b i = u ∧ b' i = v ∧ (∀ k, k ≠ i → b k = b' k) then
∑ a : A, ∑ a' : A, ∑ c : K, ∑ c' : K,
R a b * conj (R a' b') * T c c' * M (a', c') (a, c)
else 0
/-- PDF p.7: a sub-POVM with the positive omitted effect as failure outcome 0. -/
def SubPOVM {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : Prop :=
ResourceNormalized O ∧ (∀ i, (M i).PosSemidef) ∧ (1 - ∑ i, M i).PosSemidef
/-- PDF p.7: every successful branch returns every normalized unknown pure input exactly.
Zero-probability branches are allowed; failure is unconstrained. -/
def IsFaithfulPortProtocol {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : Prop :=
∀ (v : EuclideanSpace ℂ Bool), IsState v → ∀ i,
∃ q : ℝ, 0 ≤ q ∧ portRetainedOutput (resource O) (M i) i (pureDensity v) =
(q : ℂ) • pureDensity v
/-- PDF pp.7–8: physical faithful probabilistic protocols with an input-independent resource. -/
def IsProbabilisticPortProtocol {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : Prop := SubPOVM O M ∧ IsFaithfulPortProtocol O M
/-- PDF p.7, Eq.(44): success averaged over normalized Haar inputs, not conditional fidelity. -/
def portSuccessProbability {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Fin N → Matrix (AC NA) (AC NA) ℂ) : ℝ :=
(∑ i, (transformed O (M i)).trace.re) / (2 : ℝ) ^ (N + 1)
/-- PDF pp.3–5: the actual residual wires; no fictitious negative-spin subsystem. -/
abbrev Other (N : ℕ) (i : Fin N) := {k : Fin N // k ≠ i}
/-- PDF p.7, Eq.(45): P^-_{AiC} tensor Theta_i on the remaining A wires. -/
def embedTheta {N : ℕ} (i : Fin N)
(T : Matrix (Other N i → Bool) (Other N i → Bool) ℂ) : Matrix (AC N) (AC N) ℂ :=
fun p q => singletAmp (p.1 i) p.2 * conj (singletAmp (q.1 i) q.2) *
T (fun k => p.1 k.1) (fun k => q.1 k.1)
/-- PDF p.7, Eqs.(5),(46): the complete success SDP feasibility constraints. -/
def PortSuccessFeasible (N : ℕ) (X : Matrix (Qubits N) (Qubits N) ℂ)
(T : (i : Fin N) → Matrix (Other N i → Bool) (Other N i → Bool) ℂ) : Prop :=
X.PosSemidef ∧ X.trace = (2 : ℂ) ^ N ∧ (∀ i, (T i).PosSemidef) ∧
(X ⊗ₖ (1 : Matrix Bool Bool ℂ) - ∑ i, embedTheta i (T i)).PosSemidef
/-- PDF p.7, Eq.(47): the success SDP objective. -/
def successObjective {N : ℕ}
(T : (i : Fin N) → Matrix (Other N i → Bool) (Other N i → Bool) ℂ) : ℝ :=
(∑ i, (T i).trace.re) / (2 : ℝ) ^ (N + 1)
/-- PDF pp.3–5: legal doubled spins k=2j. Factorial arguments below are integers. -/
def spins (n : ℕ) : Finset ℕ := (Finset.range (n + 1)).filter fun k => k % 2 = n % 2
/-- PDF p.3: Casimir J^2 of spin-half wires, from S_i.S_j=(Swap_ij-I/2)/2.
The scalar arithmetic is real, so n=0 never causes natural subtraction underflow. -/
def spinSquare (W : Type*) [Fintype W] : Matrix (W → Bool) (W → Bool) ℂ :=
(((Fintype.card W : ℝ) * (4 - Fintype.card W) / 4 : ℝ) : ℂ) • 1 +
(1 / 2 : ℂ) • ∑ i : W, ∑ j : W,
if i = j then 0 else
(fun a b => if a = b ∘ Equiv.swap i j then (1 : ℂ) else 0)
/-- PDF pp.3–5: the spin-j projector, defined intrinsically by spectral calculus of J^2.
This is the identity 11(j) on the span of all source |Phi(j,m,alpha)> vectors.
Finite spectra make the indicator continuous on the spectrum. Illegal sectors are zero. -/
def qubitSpinProjector (W : Type*) [Fintype W] (k : ℕ) : Matrix (W → Bool) (W → Bool) ℂ :=
if k ∈ spins (Fintype.card W) then
cfc (fun x : ℝ => if x = (k : ℝ) * (k + 2) / 4 then (1 : ℝ) else 0) (spinSquare W)
else 0
/-- PDF p.4: the total-spin projector on AC, the extra qubit indexed by none. -/
def totalProjector (N k : ℕ) : Matrix (AC N) (AC N) ℂ :=
fun p q => qubitSpinProjector (Option (Fin N)) k (fun w => w.elim p.2 p.1)
(fun w => w.elim q.2 q.1)
/-- PDF p.3, Eq.(7): lambda^-_j with j=k/2. Real subtraction is intentional. -/
def lambdaMinus (N k : ℕ) : ℝ := ((N : ℝ) / 2 - (k : ℝ) / 2) / (2 : ℝ) ^ N
/-- PDF p.3, Eq.(7): lambda^+_j with j=k/2. -/
def lambdaPlus (N k : ℕ) : ℝ := ((N : ℝ) / 2 + (k : ℝ) / 2 + 1) / (2 : ℝ) ^ N
/-- PDF pp.3–4, Eqs.(8),(17): the whole eigenspace obtained by coupling j to j+1/2. -/
def minusSector (N k : ℕ) : Matrix (AC N) (AC N) ℂ :=
(qubitSpinProjector (Fin N) k ⊗ₖ (1 : Matrix Bool Bool ℂ)) * totalProjector N (k + 1)
/-- PDF pp.3–4, Eqs.(8),(17): coupling j to j-1/2; absent when j=0. -/
def plusSector (N k : ℕ) : Matrix (AC N) (AC N) ℂ :=
if k = 0 then 0 else
(qubitSpinProjector (Fin N) k ⊗ₖ (1 : Matrix Bool Bool ℂ)) * totalProjector N (k - 1)
/-- PDF p.4: rho(s), on the full space with zero on other total-spin sectors. -/
def rhoBlock (N k : ℕ) : Matrix (AC N) (AC N) ℂ := totalProjector N k * portRho N
/-- PDF p.5, Eq.(24): projector onto singlet_{AiC} tensor the residual spin-s sector. -/
def xiProjector {N : ℕ} (i : Fin N) (k : ℕ) : Matrix (AC N) (AC N) ℂ :=
embedTheta i (qubitSpinProjector (Other N i) k)
/-- PDF p.5: sigma(i)(s), including the normalization 2^{-(N-1)}. -/
def signalBlock {N : ℕ} (i : Fin N) (k : ℕ) : Matrix (AC N) (AC N) ℂ :=
((2 : ℂ) ^ (N - 1))⁻¹ • xiProjector i k
/-- PDF p.5, Eq.(26): scalar compressed moment; k=2s and y is nonzero.
At s=0 the nonexistent j=-1/2 term is omitted. -/
def compressedScalar (N k : ℕ) (y : ℝ) : ℝ :=
(if k = 0 then 0 else (k : ℝ) / (2 * (k + 1)) *
Real.rpow (lambdaMinus N (k - 1)) (-1 / y)) +
((k : ℝ) + 2) / (2 * (k + 1)) * Real.rpow (lambdaPlus N (k + 1)) (-1 / y)
/-- PDF p.5, Eqs.(27),(28): SRM completed uniformly on its kernel. -/
def completedSRM {I : Type} [Fintype I] [DecidableEq I] {N : ℕ}
(S : Fin N → Matrix I I ℂ) (i : Fin N) : Matrix I I ℂ :=
let H := supportPower (∑ j, S j) (-1 / 2)
H * S i * H + (N : ℂ)⁻¹ • (1 - ∑ j, H * S j * H)
/-- PDF p.5, Eq.(29): exact fixed-resource entanglement fidelity. -/
def fixedFidelity (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.7, Eq.(41): the optimum singlet entanglement fidelity. -/
def deterministicOptimumFidelity (N : ℕ) : ℝ := Real.cos (Real.pi / (N + 2)) ^ 2
/-- PDF p.7, Eq.(42): the optimum Haar average recovered-qubit fidelity. -/
def deterministicOptimumAverage (N : ℕ) : ℝ := 2 / 3 + Real.cos (2 * Real.pi / (N + 2)) / 3
/-- PDF p.6, Eq.(35): gamma(j) on the legal doubled-spin range. -/
def deterministicGamma (N k : ℕ) : ℝ :=
(2 : ℝ) ^ (N + 2) / ((N + 2) * (k + 1) * spinMultiplicity N k) *
Real.sin (Real.pi * (k + 1) / (N + 2)) ^ 2
/-- PDF p.6, Eq.(34): the explicitly optimized deterministic resource X. -/
def deterministicX (N : ℕ) : Matrix (Qubits N) (Qubits N) ℂ :=
∑ k ∈ spins N, (deterministicGamma N k : ℂ) • qubitSpinProjector (Fin N) k
/-- PDF p.6, Eqs.(32)–(37): sqrt(z)rho(s)^(-1/y), after cancellation.
Its branch factors are sqrt(gamma(j)/lambda_j). This agrees with the generalized SRM
on nonzero sectors and defines its nonsingular s=0 endpoint without inventing y(0). -/
def generalizedFilter (N k : ℕ) : Matrix (AC N) (AC N) ℂ :=
(if k = 0 then 0 else
(Real.sqrt (deterministicGamma N (k - 1) / lambdaMinus N (k - 1)) : ℂ) • minusSector N (k - 1)) +
(Real.sqrt (deterministicGamma N (k + 1) / lambdaPlus N (k + 1)) : ℂ) • plusSector N (k + 1)
/-- PDF p.6, Eq.(32): transformed generalized SRM before the excess term. -/
def generalizedCore (N : ℕ) (i : Fin N) : Matrix (AC N) (AC N) ℂ :=
∑ k ∈ spins (N - 1), generalizedFilter N k * signalBlock i k * generalizedFilter N k
/-- PDF p.6, Eqs.(32),(39): transformed effects, including the uniform positive remainder. -/
def generalizedEffects (N : ℕ) (i : Fin N) : Matrix (AC N) (AC N) ℂ :=
generalizedCore N i + (N : ℂ)⁻¹ •
(deterministicX N ⊗ₖ (1 : Matrix Bool Bool ℂ) - ∑ j, generalizedCore N j)
/-- PDF pp.3,6–8: O=sqrt(X), the positive representative of the pure resource. -/
def resourceOperator {I : Type*} [Fintype I] [DecidableEq I]
(X : Matrix I I ℂ) : Matrix I I ℂ := cfc Real.sqrt X
/-- PDF pp.3,6–8: physical measurement on the range of O, completed on its complement.
For sub-POVMs use complete=false so the omitted complement is part of failure. -/
def physicalEffects {N : ℕ} (X : Matrix (Qubits N) (Qubits N) ℂ)
(E : Fin N → Matrix (AC N) (AC N) ℂ) (complete : Bool) (i : Fin N) :
Matrix (AC N) (AC N) ℂ :=
let H := supportPower X (-1 / 2) ⊗ₖ (1 : Matrix Bool Bool ℂ)
H * E i * H + if complete then
(N : ℂ)⁻¹ • (1 - (supportPower X 0 ⊗ₖ (1 : Matrix Bool Bool ℂ))) else 0
/-- PDF pp.6–7: the actual optimized deterministic POVM. -/
def deterministicMeasurement (N : ℕ) : Fin N → Matrix (AC N) (AC N) ℂ :=
physicalEffects (deterministicX N) (generalizedEffects N) true
/-- PDF p.8, Eq.(50): the exact fixed-resource success probability, k=2s. -/
def fixedSuccess (N : ℕ) : ℝ :=
(∑ k ∈ spins (N - 1), ((k + 1 : ℕ) : ℝ) ^ 2 * (N.factorial : ℝ) /
((((N - 1 - k) / 2).factorial : ℝ) * (((N + 3 + k) / 2).factorial : ℝ))) /
(2 : ℝ) ^ N
/-- PDF p.8, Eq.(56): fully optimized faithful qubit success probability. -/
def probabilisticOptimumSuccess (N : ℕ) : ℝ := (N : ℝ) / (N + 3)
/-- PDF pp.7–8, Eq.(48): fixed-resource attaining Theta_i. -/
def fixedTheta (N : ℕ) (i : Fin N) :
Matrix (Other N i → Bool) (Other N i → Bool) ℂ :=
∑ k ∈ spins (N - 1),
(((2 : ℝ) ^ (N - 1) * lambdaPlus N (k + 1))⁻¹ : ℂ) • qubitSpinProjector (Other N i) k
/-- PDF p.8, Eqs.(52),(53): optimized attaining Theta_i. -/
def optimalTheta (N : ℕ) (i : Fin N) :
Matrix (Other N i → Bool) (Other N i → Bool) ℂ :=
∑ k ∈ spins (N - 1),
((2 ^ (N + 1) * (6 / ((N + 1) * (N + 2) * (N + 3))) * (k + 1) /
((N : ℝ) * spinMultiplicity (N - 1) k) : ℝ) : ℂ) • qubitSpinProjector (Other N i) k
/-- PDF p.8, Eq.(54): optimized probabilistic resource X. -/
def probabilisticX (N : ℕ) : Matrix (Qubits N) (Qubits N) ℂ :=
∑ k ∈ spins N,
((2 ^ N * (6 / ((N + 1) * (N + 2) * (N + 3))) * (k + 1) /
(spinMultiplicity N k : ℝ) : ℝ) : ℂ) • qubitSpinProjector (Fin N) k
/-- PDF pp.8–9: optimized physical successful effects; failure is I minus their sum. -/
def probabilisticMeasurement (N : ℕ) : Fin N → Matrix (AC N) (AC N) ℂ :=
physicalEffects (probabilisticX N) (fun i => embedTheta i (optimalTheta N i)) false
/-- Sanity: the two nonzero singlet amplitudes have opposite signs (PDF p.2). -/
example : singletAmp true false = -singletAmp false true := by
simp [singletAmp]
/-- Sanity: the only legal spin of zero residual wires is zero (PDF pp.3–5). -/
example : spins 0 = {0} := by
ext k
simp [spins]
omega
/-- Sanity: support powers kill the zero operator, including the support projector r=0. -/
example (r : ℝ) : supportPower (0 : Matrix Bool Bool ℂ) r = 0 := by
simp [supportPower, cfc_zero]
/-- PDF pp.5–6: the normalized positive maximally entangled qudit resource. -/
def quditResource (N d : ℕ) (a b : Fin N → Fin d) : ℂ :=
if a = b then (Real.sqrt ((d : ℝ) ^ N) : ℂ)⁻¹ else 0
/-- PDF p.5: qudit sigma(i), with the positive maximally entangled reference. -/
def quditSignal (N d : ℕ) (i : Fin N) :
Matrix ((Fin N → Fin d) × Fin d) ((Fin N → Fin d) × Fin d) ℂ :=
fun p q => if p.1 i = p.2 ∧ q.1 i = q.2 ∧
(∀ k, k ≠ i → p.1 k = q.1 k) then ((d : ℂ) ^ N)⁻¹ else 0
/-- PDF pp.5–6: the completed qudit SRM channel, applied to arbitrary operators. -/
def quditChannel (N d : ℕ) : Superop (Fin d) (Fin d) :=
fun T => ∑ i, portRetainedOutput (quditResource N d) (completedSRM (quditSignal N d) i) i T
/-- PDF p.9: Bob's full reduced density of a pure resource. -/
def bobDensity {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ) :
Matrix (Qubits N) (Qubits N) ℂ :=
fun b b' => ∑ a, resource O a b * conj (resource O a b')
/-- PDF p.9: Bob's one-port marginal, tracing all A and all other ports. -/
def bobPortDensity {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(i : Fin N) : Matrix Bool Bool ℂ :=
fun u v => ∑ b : Qubits N, ∑ b' : Qubits N,
if b i = u ∧ b' i = v ∧ (∀ k, k ≠ i → b k = b' k) then bobDensity O b b' else 0
/-- PDF pp.9–10: insert the selected port into a configuration of the remaining ports. -/
def restorePort {N : ℕ} (i : Fin N) (r : Other N i → Bool) (t : Bool) : Qubits N :=
fun k => if h : k = i then t else r ⟨k, h⟩
/-- PDF p.2, Eq.(1), pp.9–10: the single-Kraus square-root postmeasurement vector.
All Alice registers, including C, are retained. -/
def postAmplitude {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Matrix (AC NA) (AC NA) ℂ) (v : EuclideanSpace ℂ Bool)
(a : Qubits NA) (c : Bool) (b : Qubits N) : ℂ :=
∑ a', ∑ c', resourceOperator M (a, c) (a', c') * resource O a' b * v c'
/-- PDF pp.9–10: branch probability, the squared norm of the unnormalized postmeasurement vector. -/
def postBranchProbability {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Matrix (AC NA) (AC NA) ℂ) (v : EuclideanSpace ℂ Bool) : ℝ :=
∑ a, ∑ c, ∑ b, Complex.normSq (postAmplitude O M v a c b)
/-- PDF pp.9–10: normalized density of the unused Bob ports on a successful branch.
Its entropy is that of the pure residual state in the (all Alice):(unused Bob) cut.
Theorems ensure a positive branch probability before using this quotient. -/
def residualDensity {N NA : ℕ} (O : Matrix (Qubits NA) (Qubits N) ℂ)
(M : Matrix (AC NA) (AC NA) ℂ) (v : EuclideanSpace ℂ Bool) (i : Fin N) :
Matrix (Other N i → Bool) (Other N i → Bool) ℂ :=
fun r r' => (∑ a, ∑ c, ∑ t : Bool,
postAmplitude O M v a c (restorePort i r t) *
conj (postAmplitude O M v a c (restorePort i r' t))) /
(postBranchProbability O M v : ℂ)
/-- PDF p.9: the two-qubit |psi^+> amplitude. -/
def plusAmp (a b : Bool) : ℂ := if a ≠ b then (Real.sqrt 2 : ℂ)⁻¹ else 0
/-- PDF p.9, Eq.(57): the explicit optimized two-port pure resource. -/
def twoPortResource (a b : Qubits 2) : ℂ :=
(Real.sqrt (1 / 10) : ℂ) * singletAmp (a 0) (a 1) * singletAmp (b 0) (b 1) +
(Real.sqrt (3 / 10) : ℂ) *
((if a 0 = false ∧ a 1 = false ∧ b 0 = true ∧ b 1 = true then 1 else 0) +
(if a 0 = true ∧ a 1 = true ∧ b 0 = false ∧ b 1 = false then 1 else 0) -
plusAmp (a 0) (a 1) * plusAmp (b 0) (b 1))
/-- PDF p.9: x^+ and x^-; these are Alice states, not the unknown input. -/
def xAmplitude (plus : Bool) (a : Qubits 2) : ℂ :=
((if plus then 1 else -1) * plusAmp (a 0) (a 1) +
(Real.sqrt 3 : ℂ) * singletAmp (a 0) (a 1)) / 2
/-- PDF p.9, Eq.(58): the two orthogonal unit vectors eta^- and eta^+. -/
def twoPortEta (plus : Bool) : EuclideanSpace ℂ (AC 2) :=
WithLp.toLp 2 fun p => if plus then
(Real.sqrt (2 / 3) : ℂ) * xAmplitude true p.1 * (if p.2 then 1 else 0) -
(Real.sqrt (1 / 3) : ℂ) *
(if p.1 0 = true ∧ p.1 1 = true ∧ p.2 = false then 1 else 0)
else
(Real.sqrt (2 / 3) : ℂ) * xAmplitude false p.1 * (if p.2 then 0 else 1) +
(Real.sqrt (1 / 3) : ℂ) *
(if p.1 0 = false ∧ p.1 1 = false ∧ p.2 = true then 1 else 0)
/-- PDF p.9: A1 <-> A2. -/
def swapTwo (a : Qubits 2) : Qubits 2 := a ∘ Equiv.swap 0 1
/-- PDF p.9, Eq.(58) and its exchanged branch: the two projective successful effects. -/
def twoPortMeasurement (i : Fin 2) : Matrix (AC 2) (AC 2) ℂ :=
let P := pureDensity (twoPortEta false) + pureDensity (twoPortEta true)
if i = 0 then P else fun p q => P (swapTwo p.1, p.2) (swapTwo q.1, q.2)
/-- PDF p.9, Eq.(59): the normalized residual vector for port 1; t labels the unused port. -/
def twoPortResidual (a : Qubits 2) (c t : Bool) : ℂ :=
((twoPortEta false (a, c)) * (if t then 1 else 0) -
(twoPortEta true (a, c)) * (if t then 0 else 1)) / (Real.sqrt 2 : ℂ)
/-- PDF p.9, Eq.(59), second line: the same residual expanded in Bell states. -/
def twoPortResidualExpanded (a : Qubits 2) (c t : Bool) : ℂ :=
(Real.sqrt 2 : ℂ)⁻¹ * singletAmp (a 0) (a 1) * singletAmp c t +
(Real.sqrt 6 : ℂ)⁻¹ *
((if a 0 = false ∧ a 1 = false ∧ c = true ∧ t = true then 1 else 0) +
(if a 0 = true ∧ a 1 = true ∧ c = false ∧ t = false then 1 else 0) -
plusAmp (a 0) (a 1) * plusAmp c t)
/-- PDF pp.9–10: the exact entropy of Eq.(57), replacing the rounded printed 1.90. -/
def twoPortInitialEntropy : ℝ :=
-(1 / 10 : ℝ) * Real.logb 2 (1 / 10) - (9 / 10 : ℝ) * Real.logb 2 (3 / 10)
/-- PDF p.8: the KLM success curve quoted from [17], only for the numerical comparison. -/
def klmCurve (m : ℕ) : ℝ := 1 - 1 / ((m : ℝ) + 1)
/-- Sanity: N=1 is postselected singlet teleportation with success 1/4 (PDF p.8). -/
example : probabilisticOptimumSuccess 1 = 1 / 4 := by norm_num [probabilisticOptimumSuccess]
/-- Sanity: restoring a port puts the specified bit in that port. -/
example {N : ℕ} (i : Fin N) (r : Other N i → Bool) (t : Bool) :
restorePort i r t i = t := by simp [restorePort]
end QAlgorithms.Papers.Independent.Intake100.P67
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intake100.P67.AC
For every natural number , is the set : its elements consist of a Boolean string indexed by , together with one additional Boolean. When , the string is the unique empty string, so this set has two elements.
QAlgorithms.Papers.Independent.Intake100.P67.IsDeterministicPortProtocol
For any natural numbers , any complex matrix with rows indexed by -bit Boolean strings and columns by -bit Boolean strings, and any family , , of complex square matrices indexed by an -bit Boolean string and a Boolean, this predicate is the conjunction
The identity acts on the space indexed by those string–Boolean pairs. The case is included. When , positivity of the empty family is vacuous, but its sum is zero, so the required equality to the identity is impossible.
QAlgorithms.Papers.Independent.Intake100.P67.IsFaithfulPortProtocol
For arbitrary natural numbers , let , let be a complex matrix with rows indexed by and columns by , and let be a complex matrix on for each . Define , , and on the other two pairs, and put . The predicate holds exactly when, for every complex vector on with , and every , there exists a real number such that, for all Boolean ,
The number may depend on and , and may be zero; no upper bound on , normalization of , or positivity condition on is included. When , there is no index , so the predicate holds vacuously.
QAlgorithms.Papers.Independent.Intake100.P67.IsProbabilisticPortProtocol
For arbitrary natural numbers , write , let be a complex -by- matrix, and let be complex matrices on , indexed by . The predicate holds exactly when
and the following condition also holds: define , , and otherwise, and set ; then for every unit complex vector on the two Boolean values and every , there is a real such that, for all Boolean ,
Here means positive semidefinite, may depend on , and is permitted. The effects need only sum to at most the identity in this order. For , the indexed conditions are vacuous and the predicate reduces to .
QAlgorithms.Papers.Independent.Intake100.P67.Other
For every natural number and every index , this abbreviates the type of indices satisfying . For , this type is empty. For , no index exists with which to form it.
QAlgorithms.Papers.Independent.Intake100.P67.PortSuccessFeasible
For any natural number , let be the set of Boolean -bit strings, let be a complex matrix on , and, for each , let be a complex matrix on Boolean assignments to . Define matrices on by
where , , and otherwise. The predicate holds exactly when
All traces here are complex traces, and the displayed trace equality is a complex equality. For , is one-by-one, the family is empty, and these conditions reduce to .
QAlgorithms.Papers.Independent.Intake100.P67.ResourceNormalized
For any natural numbers and any complex matrix with rows indexed by -bit Boolean strings and columns by -bit Boolean strings, this predicate means exactly
where is the conjugate transpose and the equality is in . Equivalently, the sum of the squared absolute values of all entries of is . Both and are included; for , the required value is .
QAlgorithms.Papers.Independent.Intake100.P67.SubPOVM
For any natural numbers , any complex matrix with rows indexed by -bit Boolean strings and columns by -bit Boolean strings, and any family , , of complex square matrices indexed by an -bit Boolean string and a Boolean, this predicate means
Here is the identity on the space indexed by those string–Boolean pairs. Both natural numbers may be zero. When , the family is empty, its positivity requirement is vacuous, and the last condition is positivity of the identity, leaving exactly the condition .
QAlgorithms.Papers.Independent.Intake100.P67.bobDensity
For arbitrary natural numbers and an arbitrary complex matrix with rows indexed by Boolean strings of length and columns indexed by Boolean strings of length , this defines a matrix on length- Boolean strings by
where , , and . No normalization hypothesis on is required. Zero-length registers are included: their string sets are singletons, and products over their coordinates equal .
QAlgorithms.Papers.Independent.Intake100.P67.bobPortDensity
For arbitrary natural numbers , an arbitrary complex matrix from length- Boolean strings to length- Boolean strings, and an index , this defines a complex matrix , indexed by Booleans , by
where , , and the other two values of are zero. There is no normalization assumption on . The index requires , while is allowed.
QAlgorithms.Papers.Independent.Intake100.P67.completedSRM
For any finite type equipped with decidable equality, any natural number , any family of complex matrices indexed by , and any , this defines
Here is applied using the total real continuous functional calculus, with the total real-power operation in its nonzero branch, and is the identity matrix on . No Hermiticity, positivity, or normalization of the matrices is assumed. The index requires , while the finite type itself may be empty.
QAlgorithms.Papers.Independent.Intake100.P67.compressedScalar
For all natural numbers and every real number , this defines
All displayed quotients are real quotients, and powers use the total real-power operation, including at zero or negative bases; no positivity assumption on the first base is imposed. In the positive- branch, is natural subtraction and equals ordinary subtraction. The value is included: division by zero gives exponent , both real powers then equal , and the whole expression equals .
QAlgorithms.Papers.Independent.Intake100.P67.deterministicGamma
For all natural numbers , including zero and with no restriction , this defines
where the natural number is zero unless and is even; when those conditions hold, it is
The floors describe the natural-number divisions used to define this multiplicity; the divisions in are real divisions. Real division by zero is defined to give zero, so whenever , including when or is odd.
QAlgorithms.Papers.Independent.Intake100.P67.deterministicMeasurement
For every natural number , this defines a family of complex matrices on , where , by
Here means real continuous functional calculus with the function equal to zero at and to the total real power otherwise. The matrices substituted into this expression are
where , and
with real subtraction in . The natural number is zero unless and is even, and otherwise equals . The filter and middle matrix are
where , , and the other two values of are zero. For any finite set , outside ; otherwise it is the real functional calculus with the indicator of applied to
with an ordered pair sum. The notation uses ; uses , identifying with the function equal to at and to at . All scalar coefficients are embedded into ; natural subtraction is truncated, zero inverses are zero, and real square roots of negative arguments are zero. When , this is the empty family.
QAlgorithms.Papers.Independent.Intake100.P67.deterministicOptimumAverage
For every natural number , including zero, this defines the real number
All divisions are real divisions, and is always positive. Its value at is ; the declaration itself asserts no averaging or optimization property.
QAlgorithms.Papers.Independent.Intake100.P67.deterministicOptimumFidelity
For every natural number , including zero, this defines the real number
The denominator is positive for every allowed , and the value at is . The declaration itself makes no assertion that this number is an optimum.
QAlgorithms.Papers.Independent.Intake100.P67.deterministicX
For every natural number , including , this defines a complex matrix indexed by the bit strings :
Here
For any finite set , the matrix , indexed by functions , is zero when ; otherwise it is the real continuous functional calculus of
with the function that is at and elsewhere. The pair sum is ordered. The divisions defining are natural-number divisions; the other displayed divisions are real divisions. In the zero-qubit case the index set has one element, and the definition gives .
QAlgorithms.Papers.Independent.Intake100.P67.embedTheta
For a natural number , an index , and an arbitrary complex matrix indexed by Boolean assignments to , this defines a matrix indexed by pairs , where is an -bit string and is Boolean, by
where , , and otherwise. No positivity or normalization of is required. When , the remaining index set is empty, so is a one-by-one matrix indexed by the unique empty assignment; when , no is available.
QAlgorithms.Papers.Independent.Intake100.P67.entFidelity
For any natural numbers , any complex matrix with rows indexed by -bit Boolean strings and columns by -bit Boolean strings, and any family , , of complex square matrices indexed by an -bit Boolean string and a Boolean, this declaration defines the real number
The matrix , indexed by , has entry when for every , and zero otherwise, where , , and the other values are zero. No normalization or positivity assumptions are imposed on or . The case is allowed, and when , the sum is empty and .
QAlgorithms.Papers.Independent.Intake100.P67.fixedFidelity
For every natural number , this defines the real number
The arithmetic inside the summand is real arithmetic, including both subtractions in the numerators and the subtraction under the second square root. Because , both square-root denominators are positive. The definition includes , for which its value is ; it asserts no optimization or probabilistic property.
QAlgorithms.Papers.Independent.Intake100.P67.fixedSuccess
For every natural number , this defines the real number
Here is natural-number subtraction, both divisions inside the factorial arguments are natural-number divisions, and all factorials and natural-number factors are converted to real numbers for the displayed arithmetic. The definition includes : its sum then contains , and its value is .
QAlgorithms.Papers.Independent.Intake100.P67.fixedTheta
For every natural number and every , let . This defines a complex matrix indexed by bit assignments :
Each real coefficient is embedded into . For any finite set , is zero if ; otherwise it is obtained by applying, through real continuous functional calculus, the function equal to at and elsewhere to
where the sum uses ordered pairs. The parameter requires , so is ordinary subtraction here; there is no such matrix to evaluate at . For , is empty and the matrix is indexed by its unique empty bit assignment.
QAlgorithms.Papers.Independent.Intake100.P67.generalizedCore
For every natural number and every , this defines a complex matrix on , with , by
The index requires . Writing , the middle matrix has entries
where , , and . The filter is
with
Here unless and is even, and otherwise , using natural-number division. For any finite set , define
where the sum is over ordered pairs; is zero outside , and otherwise is the real functional calculus of with the indicator of . The notation uses , while uses , identifying with the function taking value at and at . All scalar coefficients are regarded as complex scalars; inverses at zero are zero and real square roots of negative arguments are zero.
QAlgorithms.Papers.Independent.Intake100.P67.generalizedEffects
For every natural number and every , this defines a complex matrix on , where , by
where . In these formulas
where the subtraction in is real, and is zero unless and is even, and otherwise equals the natural-number quotient . The filter is
and, for ,
For each finite set , is zero outside ; inside that set it is the real functional calculus, with the indicator of , of
using ordered pairs. Here , and is written in coordinates , with at . The index forces ; at the resulting family has no entries. Scalar coefficients are embedded into , zero inverses are zero, and real square roots of negative arguments are zero.
QAlgorithms.Papers.Independent.Intake100.P67.generalizedFilter
For arbitrary natural numbers , this defines a complex matrix on , where , by
where
The natural number is zero unless and is even; in that case it is the natural-number quotient
To define the matrices used here, put . For a finite set , let
with an ordered pair sum, and let for , while otherwise is the real functional calculus of with the indicator of the single value . Then , and
and similarly for . There are no parity, range, or positivity assumptions on . All natural subtraction is truncated at zero, real division by zero is zero, and the real square root of a negative number is zero.
QAlgorithms.Papers.Independent.Intake100.P67.klmCurve
For every natural number , including , this defines the real number
with converted to a real number in the formula; in particular, its value at is .
QAlgorithms.Papers.Independent.Intake100.P67.lambdaMinus
For arbitrary natural numbers , this defines the real number
where both and are converted to real numbers before subtraction. There is no restriction : the value is positive for , zero for , and negative for . In particular, for it equals .
QAlgorithms.Papers.Independent.Intake100.P67.lambdaPlus
For every pair of natural numbers , including zero, this defines the real number
where the divisions in the numerator are real divisions. The denominator is always positive; in particular, .
QAlgorithms.Papers.Independent.Intake100.P67.minusSector
For all natural numbers , this defines a complex matrix on pairs , where and is Boolean, by
Here, for any finite index set of cardinality , define
with the sum over ordered pairs. The matrix is zero unless and ; otherwise it is the real functional calculus of for the function that equals at and elsewhere. The matrix is relabeled by assigning to the extra index and to index . The displayed multiplication has the stated order. There are no restrictions on ; in particular, an inadmissible makes the first factor zero.
QAlgorithms.Papers.Independent.Intake100.P67.optimalTheta
For every natural number and every , let . This defines a complex matrix on the bit assignments by
The coefficient arithmetic is real and the coefficients are then embedded into . Here unless and is even, and otherwise
using natural-number division. For a finite set , outside ; otherwise it is the real functional calculus with the indicator of applied to
where the sum is over ordered pairs. The index forces , so no value with and an index occurs; when , the matrix has the single empty bit assignment as its index.
QAlgorithms.Papers.Independent.Intake100.P67.physicalEffects
For every natural number , every complex matrix on , every family of complex matrices on , every Boolean flag , and every , this defines
Here is the real continuous functional calculus of with the function
where is the total real power function. In particular, for Hermitian , replaces zero eigenvalues by zero and nonzero eigenvalues by one. No positivity, Hermitian, normalization, or completeness assumptions are imposed on or the ; the real functional calculus is total and returns zero when its self-adjointness or spectral continuity conditions fail. The index entails ; for there are no members of this family.
QAlgorithms.Papers.Independent.Intake100.P67.plusAmp
For every pair of Booleans , this defines the complex number
QAlgorithms.Papers.Independent.Intake100.P67.plusSector
For all natural numbers , this defines a complex matrix indexed by pairs of an -bit string and a Boolean. Its value is zero when ; when , it is
For a finite set of cardinality , let
where the sum uses ordered pairs and swaps the two indices. Then unless and ; for an admissible , it is the real functional calculus of for the indicator of the value . The matrix is with its extra Boolean coordinate identified with . Thus is used only in the positive- branch, and inadmissible also gives zero. The definition includes .
QAlgorithms.Papers.Independent.Intake100.P67.portAverageFidelity
For any natural numbers , any complex matrix with rows indexed by -bit Boolean strings and columns by -bit Boolean strings, and any family , , of complex square matrices indexed by an -bit Boolean string and a Boolean, this declaration defines
Here is the Boolean-indexed identity, and has entry at if the -bit strings agree at every position other than , and zero otherwise; , , and its other values are zero. No normalization or positivity is assumed. Either natural number may be zero; when , the defined value is .
QAlgorithms.Papers.Independent.Intake100.P67.portRetainedOutput
For any finite types , with specified finite enumerations and with no nonemptiness assumptions, any natural number , any function , any complex square matrix indexed by , any index , and any complex square matrix indexed by , this declaration defines the matrix indexed by through
No normalization, positivity, or other conditions on are assumed. The index can exist only when ; for , the agreement condition outside is vacuous. If is empty, the result is zero, and if is empty, the result is the unique matrix on an empty index set.
QAlgorithms.Papers.Independent.Intake100.P67.portRho
For every natural number , this declaration defines the complex matrix
on pairs consisting of an -bit Boolean string and a Boolean, where, for and , the entry is if for every , and is zero otherwise; here , , and the remaining values of are zero. When , this is an empty sum and is the zero matrix on the two-element index set consisting of an empty string and a Boolean.
QAlgorithms.Papers.Independent.Intake100.P67.portSignal
For every natural number and index , this declaration defines a complex matrix indexed by pairs , , where are -bit Boolean strings and are Booleans, by
where , , and on the other Boolean pairs. The subtraction in is natural-number subtraction, but the existence of already requires ; there is no such index when . For , the agreement condition outside is vacuous and the denominator is .
QAlgorithms.Papers.Independent.Intake100.P67.portSuccessProbability
For arbitrary natural numbers , a complex matrix from -bit strings to -bit strings, and complex matrices on pairs consisting of an -bit string and a Boolean value, indexed by , this defines the real number
where is the conjugate transpose and is the identity on the two Boolean values. No normalization, positivity, or protocol condition is assumed, so the definition itself imposes no probability bounds on this number. The denominator is always positive; when , the sum is empty and the value is zero.
QAlgorithms.Papers.Independent.Intake100.P67.postAmplitude
For arbitrary natural numbers , an arbitrary complex matrix from length- to length- Boolean strings, an arbitrary complex matrix on , an arbitrary vector , and indices , , , this defines
where , , and its other values are zero. Here is the total real functional-calculus expression used in the definition; no Hermitian or positivity hypothesis on , or normalization hypothesis on or , is imposed. Either register length may be zero, with empty coordinate products equal to .
QAlgorithms.Papers.Independent.Intake100.P67.postBranchProbability
For arbitrary natural numbers , an arbitrary complex matrix from length- to length- Boolean strings, an arbitrary complex matrix on , and an arbitrary vector , this defines the real number
where , , and the other values are zero. The functional calculus is used without assumptions on ; neither nor is required to be normalized. Thus the definition is a sum of squared complex moduli without an imposed upper bound of . Zero register lengths are permitted, with empty coordinate products equal to .
QAlgorithms.Papers.Independent.Intake100.P67.probabilisticMeasurement
For every natural number , this defines a family of complex matrices , indexed by , on pairs , as follows. For a finite set , let be the matrix that swaps coordinates of a Boolean string on , and define
Let be zero unless and ; otherwise let it be the real functional calculus of for the function equal to at and elsewhere. Write , and let
Here the divisions in the natural-number arguments are integer divisions. Set
Define , , and , and define
If denotes the real functional calculus of for at and otherwise, the resulting matrix is
All real and complex divisions use the total convention , and is truncated natural subtraction. For , the family has no members.
QAlgorithms.Papers.Independent.Intake100.P67.probabilisticOptimumSuccess
For every natural number , including , this defines the real number
with converted to a real number before division. In particular, its value at is zero.
QAlgorithms.Papers.Independent.Intake100.P67.probabilisticX
For every natural number , including zero, this defines a complex matrix on :
All coefficient arithmetic is real before embedding the coefficient into . The natural number is zero unless and is even, and otherwise equals
For any finite set , is zero outside ; otherwise it is the real continuous functional calculus with the indicator of applied to
using ordered pairs in the sum. At , the bit-string index set has one element and this definition gives .
QAlgorithms.Papers.Independent.Intake100.P67.qubitSpinProjector
For any type equipped with a finite enumeration and any natural number , write and define
on Boolean assignments to , where exchanges . If and , the definition applies the real spectral functional calculus to with the function equal to at and at every other real number; otherwise it returns the zero matrix. The test at uses exact equality. When is empty, the result is the one-by-one identity for and zero for every .
QAlgorithms.Papers.Independent.Intake100.P67.quditChannel
For every pair of natural numbers , this defines a function from complex matrices to complex matrices. Put , let when and otherwise, and define matrices on by
Let be the real functional calculus of for the function at zero and otherwise, and put
For every input matrix and , the output is
Every inverse is total, with inverse zero equal to zero. For , the outer sum is empty and the function is the zero map; for , its input and output matrices have empty index sets. The definition itself imposes no channel axioms.
QAlgorithms.Papers.Independent.Intake100.P67.quditResource
For arbitrary natural numbers and strings , this defines the complex number
The square root is the real square root, embedded into , and its inverse is the complex inverse. No positivity assumptions on are imposed: when , both strings are the unique empty string and the value is , including when ; when , there are no such strings .
QAlgorithms.Papers.Independent.Intake100.P67.quditSignal
For arbitrary natural numbers and an index , this defines a complex matrix whose row and column indices are pairs , where is a length- string with entries in and , by
The nonzero value uses inversion in , where . Supplying requires ; is permitted, in which case the matrix has an empty index set.
QAlgorithms.Papers.Independent.Intake100.P67.residualDensity
For arbitrary natural numbers , an arbitrary complex matrix from length- to length- Boolean strings, an arbitrary complex matrix on , an arbitrary vector , and an index , this defines a complex matrix on Boolean assignments to the indices other than . Define
where , , , and , , with its other values zero. If is the string equal to at and to elsewhere, then
The denominator is embedded into . No positivity or normalization hypotheses are imposed on the inputs, and no hypothesis requires ; when , total complex division makes every entry zero. The index requires , and for the matrix has a singleton index set.
QAlgorithms.Papers.Independent.Intake100.P67.resource
For any natural numbers , any complex matrix whose rows are indexed by -bit Boolean strings and columns by -bit Boolean strings, and any such strings and , respectively, this declaration defines the complex number
where , , and is zero on the other two Boolean pairs. No normalization or other condition on is assumed. When , the product is , the sum has one term, and ; is also allowed.
QAlgorithms.Papers.Independent.Intake100.P67.resourceOperator
For any finite type , supplied with decidable equality, and any complex matrix indexed by , this defines the matrix obtained by applying the real function to through the real continuous functional calculus. If is Hermitian, this replaces every real eigenvalue by , with negative eigenvalues replaced by zero. No Hermitian or positive-semidefinite hypothesis is required; the functional calculus returns zero for a non-Hermitian matrix. The index type may be empty, in which case the result is the unique empty matrix.
QAlgorithms.Papers.Independent.Intake100.P67.restorePort
For every natural number , index , Boolean assignment on the indices other than , and Boolean , this defines a length- Boolean string by
The argument requires ; when , is the unique assignment on the empty set.
QAlgorithms.Papers.Independent.Intake100.P67.rhoBlock
For all natural numbers , this defines the complex matrix , in that order, on pairs of an -bit string and a Boolean. To define , take , of cardinality , and
The sum is over ordered pairs; is zero unless and , and otherwise is the functional calculus of for the indicator of , relabeled so that the extra coordinate is and the remaining coordinates are . The other factor is , where
and , , with on the other Boolean pairs. The exponent uses natural subtraction, which gives zero when ; in that case the sum defining is empty and the resulting matrix is zero.
QAlgorithms.Papers.Independent.Intake100.P67.signalBlock
For every natural number , every , and every natural number , this defines the complex matrix
on pairs of an -bit string and a Boolean. Here , , and its other values are zero. For , define
where the sum is over ordered pairs. The factor is zero unless and ; otherwise it is the functional calculus of for the indicator of . The index ensures , so the natural subtraction in the normalization is ordinary subtraction; is allowed to be empty.
QAlgorithms.Papers.Independent.Intake100.P67.singletAmp
For any Booleans , the complex number defined by this declaration is
QAlgorithms.Papers.Independent.Intake100.P67.spinSquare
For any type equipped with a finite enumeration, write and let be the identity matrix on the Boolean assignments . For distinct , define by if , and zero otherwise, where exchanges and fixes every other element. This defines the complex matrix
The sum is over ordered pairs, so both and occur. The subtraction is in the real numbers and may be negative. The type may be empty; in that case the matrix is the zero one-by-one matrix on the unique empty assignment.
QAlgorithms.Papers.Independent.Intake100.P67.spins
For every natural number , this defines the finite set
Thus it includes zero exactly when is even, always includes , and for equals .
QAlgorithms.Papers.Independent.Intake100.P67.successObjective
For any natural number and any family of complex matrices , indexed by , where has rows and columns indexed by Boolean assignments to , this defines
No positivity or feasibility conditions are assumed. The denominator is positive for every ; when , the family and sum are empty and the value is zero.
QAlgorithms.Papers.Independent.Intake100.P67.swapTwo
For every two-bit string , this defines the two-bit string obtained by exchanging its coordinates:
This includes strings with equal bits, which are unchanged.
QAlgorithms.Papers.Independent.Intake100.P67.totalProjector
For natural numbers , let consist of the indices together with one additional distinguished element, and identify a pair , consisting of an -bit string and a Boolean value, with the Boolean assignment on that takes value at index and value at the distinguished element. Put
where exactly when , and is zero otherwise, with exchanging . If and , let be the spectral functional calculus of for the function equal to at and zero elsewhere; otherwise let . The defined matrix has entries
This includes , when the resulting matrix on Boolean values is for and zero for every other .
QAlgorithms.Papers.Independent.Intake100.P67.transformed
For any natural numbers , any complex matrix from the space indexed by -bit Boolean strings to that indexed by -bit Boolean strings, and any complex square matrix indexed by pairs consisting of an -bit Boolean string and a Boolean, this declaration defines the matrix indexed by pairs consisting of an -bit Boolean string and a Boolean as
Here is the Kronecker product and is the identity matrix indexed by Booleans. No normalization, positivity, or unitarity is assumed, and either natural number may be zero.
QAlgorithms.Papers.Independent.Intake100.P67.twoPortEta
For each Boolean value , this defines a vector in the complex Euclidean space indexed by pairs , where is a two-bit string and is a Boolean value. Writing for the coordinate vector with value at and elsewhere, its two possible values are
Every coordinate not displayed is zero; all displayed real coefficients are regarded as complex numbers.
QAlgorithms.Papers.Independent.Intake100.P67.twoPortInitialEntropy
This defines the real constant
where .
QAlgorithms.Papers.Independent.Intake100.P67.twoPortMeasurement
For , this defines a complex matrix indexed by triples of bits . Let denote the coordinate vector at the bit triple , and define
With and , the matrix is
QAlgorithms.Papers.Independent.Intake100.P67.twoPortResidual
For a two-bit string and Boolean values , this defines a complex number . Using for false,true, its coordinates are
QAlgorithms.Papers.Independent.Intake100.P67.twoPortResidualExpanded
For a two-bit string and Boolean values , this defines
where is when its condition holds and otherwise, and the two functions on Boolean pairs are explicitly
The result and all coefficients are interpreted in .
QAlgorithms.Papers.Independent.Intake100.P67.twoPortResource
For arbitrary two-bit Boolean strings and , this defines the complex amplitude
where , , , and for unequal Booleans and for equal Booleans. Here and denote false and true, all square roots are real square roots embedded into , and each indicator equals exactly when its stated condition holds and otherwise.
QAlgorithms.Papers.Independent.Intake100.P67.xAmplitude
For a Boolean value and a two-bit string , this defines the complex number
Here and below, and in bit strings mean false and true, respectively.
QAlgorithms.Papers.Independent.Intake100.P67.xiProjector
For every natural number , every index , and every natural number , this defines a complex matrix on pairs of an -bit string and a Boolean by
where , , and otherwise. For , set
with ordered pairs in the sum. The matrix is zero unless and ; otherwise it is the functional calculus of for the function equal to at and elsewhere. The supplied index requires , but may be empty when .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.