Definitions for Some remarks on port-based teleportation
DefinitionQAlgorithms_Papers_Independent_Intakenext100_P53The objects the formalized statements of Some remarks on port-based teleportation (arXiv:1506.01555) are stated in. Each was checked against the paper by a blind read-back and a moderator.
PortsACPortComplementspinSinglet: PDF p.2, Eq.(2): normalized physical spin-zero singlet. The printed second spin label m is corrected to -m, as forced by the stated spin-zero convention and the physical angular-momentum decomposition on the same page.singletDensity: PDF p.2, Eq.(2): singlet projector.insertPort: Ordered insertion of one port into its complement.singletInsert: PDF p.2, Eq.(4): isometric insertion of the A_i,C singlet.portProjector: PDF p.2, Eq.(4): P^-_(A_i,C) tensor I_rest.pbtSignal: PDF p.2, Eq.(4): normalized signal; used with N>=1,d>=2.pbtRho: PDF p.2, Eq.(5): physical signal sum.liftA: PDF p.2: O acts on Alice's ports and leaves C unchanged.resource: PDF p.2, Eq.(1): resource amplitude after applying O to A.NormalizedResource: PDF p.2, Eq.(1): exact resource normalization.DeterministicPOVM: PDF p.2: Alice's deterministic measurement on AC.ProbabilisticPOVM: PDF p.3: none is failure, some i is successful port i.pbtChannelBranch: PDF pp.2,4: induced unnormalized reference-B branch for input T on R,C. The effect determines the branch after Alice's registers are discarded.pbtBranch: PDF pp.3-4: normalized reference-singlet experiment.selectPort: Physical marginal retaining the reference and selected output port.pbtBranchProbability: PDF p.4: outcome probability in the reference-singlet experiment.pbtFidelity: PDF p.2, Eq.(3): operational entanglement fidelity of port selection.codingState: PDF p.4, Eq.(20): state measured when Bob sends B_k, renamed C.codingProbability: PDF p.4: actual coding outcome probability.ExactProbabilistic: PDF p.4: Choi equation for faithful successful branches, including zero probabilities without division. For these CP branches it characterizes p_i times the identity channel, also on inputs entangled with a reference.pbtSuccessProbability: PDF p.4: total exact-teleportation success probability.srm: PDF p.3, Eq.(12): SRM on the support.completedSRM: PDF p.3, Eqs.(12)-(13): deterministic completion.probabilisticSRM: PDF p.3: separate probabilistic failure effect.conditionalFidelity: PDF pp.4-5, Eq.(23): normalized conditional singlet overlap. Uses below have strictly positive branch probability.SymmetricPorts: PDF pp.4-5: symmetry conditions imposed on the actual protocol.maximumSpinVector: PDF p.6, A7: equal-port sum with every complementary spin at its highest weight; normalization uses its actual Euclidean norm.quditSpinZ: PDF p.2: physical spin-s z component, s=(d-1)/2.quditSpinRaise: PDF p.2: raising matrix in the m=s-r convention.spinX: Physical Cartesian x component.quditSpinY: Physical Cartesian y component.quditOnWire: A spin operator on a named wire of an ordered finite register.quditCollective: PDF p.2: physical collective angular momentum on any complement or port register.quditCasimir: PDF p.2: the actual squared total angular momentum.totalComponent: PDF p.2: addition of the C spin to all A spins.totalCasimir: PDF p.2: actual squared angular momentum on AC.casimirProjector: PDF p.2, Eqs.(7)-(8): spectral projector for twice-spin t. Impossible sectors have zero projector; no abstract decomposition is assumed.magneticProjector: Physical z-component slice; r=0,...,t corresponds to m=t/2-r.rhoSpinBlock: PDF p.2, Eq.(8): spin block constructed by singlet insertion of the actual complementary-register spin projectors.rhoSpinMagnetic: PDF p.6, Eq.(A2): physical total-spin and magnetic block.qubitSpins: PDF p.3: parity-correct twice-spin labels for N qubits.qubitSectorDimension: PDF p.3, Eq.(14): intrinsic physical sector dimension h_N(t/2).deterministicResource: PDF p.3, Eq.(14), normalized correction: numerator 2^(N+2), not the printed 2^(N+1). The intrinsic sector dimension fixes this uniquely already at N=1. The malformed printed combinatorial shorthand is not used.probabilisticResource: PDF p.3, Eq.(15): explicit probabilistic resource, including the parity-correct minimum spin. No optimality is built into this definition.transformedSRM: The SRM for the actual transformed signals O sigma_i O†.qutritResourceSquare: PDF p.7, Eq.(B3): actual qutrit two-port resource square.qutritResource: PDF p.7: the positive square root of X, not an arbitrary filter.qutritTransformedEffect: PDF p.7, Eq.(B5): transformed success effects with corrected factor 9/10.qutritPairKet: Computational ket of the two physical qutrit A ports, highest spin label first.qutritHighest: PDF p.6, B1: the three highest-weight total-spin-one vectors, with the phase convention in which the A_1,C singlet matrix carries (-1)^(J+J'). J=0,1,2 is the physical A-spin. Lower magnetic vectors are generated below.qutritCoupled: PDF p.6, B1: actual coupled basis; r=0,1,2 represents m=1,0,-1.qutritFrame: PDF p.6: the physical three-column block frame at one magnetic number.qutritFullFrame: All nine coupled vectors, not a postulated abstract matrix basis.qutritBlock: PDF p.6, Eq.(B2): the exact spin-one magnetic block.qutritKernelVector: PDF p.7, Eq.(B7), corrected: sqrt(5), not 5, in the normalized null vector.RealSpinBasis: PDF p.6, A1-A4: a real orthonormal basis of the actual complementary spin/magnetic slice. Completeness refers to spectral projectors of the physical angular momenta, not to a postulated abstract block.swapPorts: PDF p.6, A4: the physical port swap, leaving C untouched.gramFrame: PDF p.6, A1,A4: all xi vectors are constructed from one basis by swaps.pbtGram: PDF p.6, A3: actual Gram matrix.complementSwap: PDF p.6, A5: swap of two wires inside the base complement. Used only when neither swapped wire is i0, so the complement is invariant.gramSynthesis: PDF p.6, A6: synthesized physical vector. No coefficient is divided by its port norm, so zero-norm port components remain harmless.acDicke: PDF p.3, Eqs.(17)-(18): maximal-spin Dicke vectors on A,C.bdDicke: PDF p.3, Eq.(16): same symmetric spin vector on D,B.Refinement: PDF p.3, Eq.(18): e0 and the two signs for each positive integer m. This is a full refinement precisely in the odd-N regime used below.refinementVector: PDF p.3, Eq.(18): explicit e_m^+, e_m^-, e0, with false denoting +.refinementEffect: PDF pp.3-4: sequential failure then rank-one refinement effect on AC.recoveryMeasurement: PDF p.4: the same complete Alice measurement for both of Bob's choices.recoverBranch: PDF p.4: B-only unitary action, with an inert arbitrary reference.onePortBell: One-port coordinates for the N=1 Bell-measurement specialization.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P07
import Definitions.Def_QAlgorithms_Papers_Independent_Next46_P39
/-!
Ishizaka, arXiv:1506.01555v2. Locators are PDF pages.
Registers are ordered A,C and D,B. A spin label r means m=(d-1)/2-r.
Local definitions have complete bodies; compilation is pending batch handoff.
-/
noncomputable section
namespace QAlgorithms.Papers.Independent.Intakenext100.P53
open scoped Classical ComplexConjugate ComplexOrder Matrix Matrix.Norms.L2Operator
-- Accepted generic matrix and positive-operator interfaces. The support is the
-- orthogonal range projection; all uses below are on positive physical rho.
open QAlgorithms.Papers.Independent.Information100.P21 (Op)
open QAlgorithms.Papers.Independent.Information100.P07 (support)
open QAlgorithms.Papers.Independent.Next46.P39 (inverseSqrt)
abbrev Ports (d N : ℕ) := Fin N → Fin d
abbrev AC (d N : ℕ) := Ports d N × Fin d
abbrev PortComplement (d N : ℕ) (i : Fin N) := {j : Fin N // j ≠ i} → Fin d
/-- PDF p.2, Eq.(2): normalized physical spin-zero singlet. The printed
second spin label m is corrected to -m, as forced by the stated spin-zero
convention and the physical angular-momentum decomposition on the same page. -/
def spinSinglet (d : ℕ) : EuclideanSpace ℂ (Fin d × Fin d) :=
WithLp.toLp 2 fun x => if x.2 = Fin.rev x.1 then
(-1 : ℂ) ^ x.1.val / (Real.sqrt d : ℂ) else 0
/-- PDF p.2, Eq.(2): singlet projector. -/
def singletDensity (d : ℕ) : Op (Fin d × Fin d) := QAlgorithms.pureDensity (spinSinglet d)
/-- Ordered insertion of one port into its complement. -/
def insertPort {d N : ℕ} (i : Fin N) (a : Fin d) (r : PortComplement d N i) : Ports d N :=
fun j => if h : j = i then a else r ⟨j, h⟩
/-- PDF p.2, Eq.(4): isometric insertion of the A_i,C singlet. -/
def singletInsert {d N : ℕ} (i : Fin N) : Matrix (AC d N) (PortComplement d N i) ℂ :=
fun x r => spinSinglet d (x.1 i, x.2) *
if (fun j : {j : Fin N // j ≠ i} => x.1 j.val) = r then 1 else 0
/-- PDF p.2, Eq.(4): P^-_(A_i,C) tensor I_rest. -/
def portProjector {d N : ℕ} (i : Fin N) : Op (AC d N) :=
singletInsert i * (singletInsert i)ᴴ
/-- PDF p.2, Eq.(4): normalized signal; used with N>=1,d>=2. -/
def pbtSignal (d N : ℕ) (i : Fin N) : Op (AC d N) :=
((d : ℂ) ^ (N - 1))⁻¹ • portProjector i
/-- PDF p.2, Eq.(5): physical signal sum. -/
def pbtRho (d N : ℕ) : Op (AC d N) := ∑ i, pbtSignal d N i
/-- PDF p.2: O acts on Alice's ports and leaves C unchanged. -/
def liftA {d N : ℕ} (O : Op (Ports d N)) : Op (AC d N) :=
Matrix.kronecker O (1 : Op (Fin d))
/-- PDF p.2, Eq.(1): resource amplitude after applying O to A. -/
def resource {d N : ℕ} (O : Op (Ports d N)) :
EuclideanSpace ℂ (Ports d N × Ports d N) :=
WithLp.toLp 2 fun x => ∑ a : Ports d N, O x.1 a * ∏ i, spinSinglet d (a i, x.2 i)
/-- PDF p.2, Eq.(1): exact resource normalization. -/
def NormalizedResource {d N : ℕ} (O : Op (Ports d N)) : Prop :=
Matrix.trace (Oᴴ * O) = (d : ℂ) ^ N
/-- PDF p.2: Alice's deterministic measurement on AC. -/
def DeterministicPOVM {d N : ℕ} (E : Fin N → Op (AC d N)) : Prop :=
(∀ i, (E i).PosSemidef) ∧ ∑ i, E i = 1
/-- PDF p.3: none is failure, some i is successful port i. -/
def ProbabilisticPOVM {d N : ℕ} (E : Option (Fin N) → Op (AC d N)) : Prop :=
(∀ i, (E i).PosSemidef) ∧ ∑ i, E i = 1
/-- PDF pp.2,4: induced unnormalized reference-B branch for input T on R,C.
The effect determines the branch after Alice's registers are discarded. -/
def pbtChannelBranch {d N : ℕ} {R : Type*} [Fintype R]
(O : Op (Ports d N)) (E : Op (AC d N)) (T : Op (R × Fin d)) :
Op (R × Ports d N) :=
fun x y => ∑ a : Ports d N, ∑ b : Ports d N, ∑ c : Fin d, ∑ e : Fin d,
E (b, e) (a, c) * resource O (a, x.2) * conj (resource O (b, y.2)) *
T (x.1, c) (y.1, e)
/-- PDF pp.3-4: normalized reference-singlet experiment. -/
def pbtBranch {d N : ℕ} (O : Op (Ports d N)) (E : Op (AC d N)) :
Op (Fin d × Ports d N) := pbtChannelBranch O E (singletDensity d)
/-- Physical marginal retaining the reference and selected output port. -/
def selectPort {d N : ℕ} {R : Type*} [Fintype R]
(i : Fin N) (T : Op (R × Ports d N)) : Op (R × Fin d) :=
fun x y => ∑ r : PortComplement d N i, T (x.1, insertPort i x.2 r) (y.1, insertPort i y.2 r)
/-- PDF p.4: outcome probability in the reference-singlet experiment. -/
def pbtBranchProbability {d N : ℕ} (O : Op (Ports d N)) (E : Op (AC d N)) : ℝ :=
(Matrix.trace (pbtBranch O E)).re
/-- PDF p.2, Eq.(3): operational entanglement fidelity of port selection. -/
def pbtFidelity {d N : ℕ} (O : Op (Ports d N)) (E : Fin N → Op (AC d N)) : ℝ :=
∑ i, (Matrix.trace (singletDensity d * selectPort i (pbtBranch O (E i)))).re
/-- PDF p.4, Eq.(20): state measured when Bob sends B_k, renamed C. -/
def codingState {d N : ℕ} (O : Op (Ports d N)) (k : Fin N) : Op (AC d N) :=
fun x y => ∑ r : PortComplement d N k,
resource O (x.1, insertPort k x.2 r) * conj (resource O (y.1, insertPort k y.2 r))
/-- PDF p.4: actual coding outcome probability. -/
def codingProbability {d N : ℕ} (O : Op (Ports d N))
(E : Op (AC d N)) (k : Fin N) : ℝ := QAlgorithms.effectProb E (codingState O k)
/-- PDF p.4: Choi equation for faithful successful branches, including zero
probabilities without division. For these CP branches it characterizes p_i
times the identity channel, also on inputs entangled with a reference. -/
def ExactProbabilistic {d N : ℕ} (O : Op (Ports d N))
(E : Option (Fin N) → Op (AC d N)) : Prop :=
NormalizedResource O ∧ ProbabilisticPOVM E ∧
∀ i, selectPort i (pbtBranch O (E (some i))) =
(pbtBranchProbability O (E (some i)) : ℂ) • singletDensity d
/-- PDF p.4: total exact-teleportation success probability. -/
def pbtSuccessProbability {d N : ℕ} (O : Op (Ports d N))
(E : Option (Fin N) → Op (AC d N)) : ℝ :=
∑ i, pbtBranchProbability O (E (some i))
/-- PDF p.3, Eq.(12): SRM on the support. -/
def srm (d N : ℕ) (i : Fin N) : Op (AC d N) :=
inverseSqrt (pbtRho d N) * pbtSignal d N i * inverseSqrt (pbtRho d N)
/-- PDF p.3, Eqs.(12)-(13): deterministic completion. -/
def completedSRM (d N : ℕ) (i : Fin N) : Op (AC d N) :=
srm d N i + (N : ℂ)⁻¹ • (1 - support (pbtRho d N))
/-- PDF p.3: separate probabilistic failure effect. -/
def probabilisticSRM (d N : ℕ) : Option (Fin N) → Op (AC d N)
| none => 1 - support (pbtRho d N)
| some i => srm d N i
/-- PDF pp.4-5, Eq.(23): normalized conditional singlet overlap.
Uses below have strictly positive branch probability. -/
def conditionalFidelity {d N : ℕ} (O : Op (Ports d N))
(E : Op (AC d N)) (k : Fin N) : ℝ :=
(Matrix.trace (singletDensity d * selectPort k (pbtBranch O E))).re /
pbtBranchProbability O E
/-- PDF pp.4-5: symmetry conditions imposed on the actual protocol. -/
def SymmetricPorts {d N : ℕ} (O : Op (Ports d N))
(E : Fin N → Op (AC d N)) (Fother : ℝ) : Prop :=
(∀ i, pbtBranchProbability O (E i) = (N : ℝ)⁻¹) ∧
(∀ i, conditionalFidelity O (E i) i = pbtFidelity O E) ∧
∀ i k, i ≠ k → conditionalFidelity O (E i) k = Fother
example : spinSinglet 2 (0, 0) = 0 := by simp [spinSinglet, Fin.rev]
example : spinSinglet 2 (0, 1) = (Real.sqrt 2 : ℂ)⁻¹ := by simp [spinSinglet, Fin.rev]
example : spinSinglet 2 (1, 0) = -(Real.sqrt 2 : ℂ)⁻¹ := by simp [spinSinglet, Fin.rev, div_eq_mul_inv]
example {d N : ℕ} (i : Fin N) (a : Fin d) (r : PortComplement d N i) :
insertPort i a r i = a := by simp [insertPort]
example {I : Type*} [Fintype I] [DecidableEq I] : inverseSqrt (0 : Op I) = 0 := by
simp [inverseSqrt, cfc_zero]
example (d N : ℕ) : probabilisticSRM d N none = 1 - support (pbtRho d N) := rfl
/-- PDF p.6, A7: equal-port sum with every complementary spin at its
highest weight; normalization uses its actual Euclidean norm. -/
def maximumSpinVector (d N : ℕ) : EuclideanSpace ℂ (AC d N) :=
let v : EuclideanSpace ℂ (AC d N) := ∑ i : Fin N,
WithLp.toLp 2 fun x => ∑ r : PortComplement d N i,
singletInsert i x r * (if ∀ j, (r j).val = 0 then 1 else 0)
(‖v‖⁻¹ : ℂ) • v
/-- PDF p.2: physical spin-s z component, s=(d-1)/2. -/
def quditSpinZ (d : ℕ) : Op (Fin d) :=
Matrix.diagonal fun r => ((((d : ℝ) - 1) / 2 - r.val : ℝ) : ℂ)
/-- PDF p.2: raising matrix in the m=s-r convention. -/
def quditSpinRaise (d : ℕ) : Op (Fin d) :=
fun r t => if t.val = r.val + 1 then
(Real.sqrt (((r.val : ℝ) + 1) * ((d : ℝ) - 1 - r.val)) : ℂ) else 0
/-- Physical Cartesian x component. -/
def spinX (d : ℕ) : Op (Fin d) := (1 / 2 : ℂ) • (quditSpinRaise d + (quditSpinRaise d)ᴴ)
/-- Physical Cartesian y component. -/
def quditSpinY (d : ℕ) : Op (Fin d) :=
(1 / (2 * Complex.I) : ℂ) • (quditSpinRaise d - (quditSpinRaise d)ᴴ)
/-- A spin operator on a named wire of an ordered finite register. -/
def quditOnWire (d : ℕ) {W : Type*} [Fintype W] [DecidableEq W]
(q : W) (M : Op (Fin d)) : Op (W → Fin d) :=
fun x y => M (x q) (y q) * ∏ r ∈ Finset.univ.erase q, if x r = y r then 1 else 0
/-- PDF p.2: physical collective angular momentum on any complement or port register. -/
def quditCollective (d : ℕ) (W : Type*) [Fintype W] [DecidableEq W]
(M : Op (Fin d)) : Op (W → Fin d) := ∑ q, quditOnWire d q M
/-- PDF p.2: the actual squared total angular momentum. -/
def quditCasimir (d : ℕ) (W : Type*) [Fintype W] [DecidableEq W] : Op (W → Fin d) :=
quditCollective d W (spinX d) ^ 2 + quditCollective d W (quditSpinY d) ^ 2 +
quditCollective d W (quditSpinZ d) ^ 2
/-- PDF p.2: addition of the C spin to all A spins. -/
def totalComponent (d N : ℕ) (M : Op (Fin d)) : Op (AC d N) :=
Matrix.kronecker (quditCollective d (Fin N) M) (1 : Op (Fin d)) +
Matrix.kronecker (1 : Op (Ports d N)) M
/-- PDF p.2: actual squared angular momentum on AC. -/
def totalCasimir (d N : ℕ) : Op (AC d N) :=
totalComponent d N (spinX d) ^ 2 + totalComponent d N (quditSpinY d) ^ 2 +
totalComponent d N (quditSpinZ d) ^ 2
/-- PDF p.2, Eqs.(7)-(8): spectral projector for twice-spin t. Impossible
sectors have zero projector; no abstract decomposition is assumed. -/
def casimirProjector {I : Type*} [Fintype I] [DecidableEq I] (K : Op I) (t : ℕ) : Op I :=
cfc (fun x : ℝ => if x = (t : ℝ) / 2 * ((t : ℝ) / 2 + 1) then 1 else 0) K
/-- Physical z-component slice; r=0,...,t corresponds to m=t/2-r. -/
def magneticProjector {I : Type*} [Fintype I] [DecidableEq I]
(Z : Op I) (t r : ℕ) : Op I :=
cfc (fun x : ℝ => if x = (t : ℝ) / 2 - r then 1 else 0) Z
/-- PDF p.2, Eq.(8): spin block constructed by singlet insertion of the
actual complementary-register spin projectors. -/
def rhoSpinBlock (d N t : ℕ) : Op (AC d N) :=
((d : ℂ) ^ (N - 1))⁻¹ • ∑ i : Fin N,
singletInsert (d := d) i *
casimirProjector (quditCasimir d {j : Fin N // j ≠ i}) t *
(singletInsert (d := d) i)ᴴ
/-- PDF p.6, Eq.(A2): physical total-spin and magnetic block. -/
def rhoSpinMagnetic (d N t r : ℕ) : Op (AC d N) :=
rhoSpinBlock d N t * magneticProjector (totalComponent d N (quditSpinZ d)) t r
/-- PDF p.3: parity-correct twice-spin labels for N qubits. -/
def qubitSpins (N : ℕ) : Finset ℕ :=
(Finset.range (N + 1)).filter fun t => t % 2 = N % 2
/-- PDF p.3, Eq.(14): intrinsic physical sector dimension h_N(t/2). -/
def qubitSectorDimension (N t : ℕ) : ℝ :=
(Matrix.trace (casimirProjector (quditCasimir 2 (Fin N)) t)).re
/-- PDF p.3, Eq.(14), normalized correction: numerator 2^(N+2), not the
printed 2^(N+1). The intrinsic sector dimension fixes this uniquely already
at N=1. The malformed printed combinatorial shorthand is not used. -/
def deterministicResource (N : ℕ) : Op (Ports 2 N) :=
∑ t ∈ qubitSpins N,
((Real.sqrt ((2 : ℝ) ^ (N + 2) / (qubitSectorDimension N t * ((N : ℝ) + 2))) *
Real.sin (Real.pi * ((t : ℝ) + 1) / ((N : ℝ) + 2)) : ℝ) : ℂ) •
casimirProjector (quditCasimir 2 (Fin N)) t
/-- PDF p.3, Eq.(15): explicit probabilistic resource, including the
parity-correct minimum spin. No optimality is built into this definition. -/
def probabilisticResource (N : ℕ) : Op (Ports 2 N) :=
(Real.sqrt ((2 : ℝ) ^ N / (∑ t ∈ qubitSpins N, ((t : ℝ) + 1) ^ 2)) : ℂ) •
∑ t ∈ qubitSpins N,
(Real.sqrt (((t : ℝ) + 1) ^ 2 / qubitSectorDimension N t) : ℂ) •
casimirProjector (quditCasimir 2 (Fin N)) t
/-- The SRM for the actual transformed signals O sigma_i O†. -/
def transformedSRM {d N : ℕ} (O : Op (Ports d N)) (i : Fin N) : Op (AC d N) :=
let A := liftA O
let R := A * pbtRho d N * Aᴴ
inverseSqrt R * (A * pbtSignal d N i * Aᴴ) * inverseSqrt R
example (d : ℕ) : quditCollective d (Fin 0) (quditSpinZ d) = 0 := by simp [quditCollective]
example : qubitSpins 1 = {1} := by decide
/-- PDF p.7, Eq.(B3): actual qutrit two-port resource square. -/
def qutritResourceSquare : Op (Ports 3 2) :=
(6 / 5 : ℂ) • casimirProjector (quditCasimir 3 (Fin 2)) 0 +
(3 / 5 : ℂ) • casimirProjector (quditCasimir 3 (Fin 2)) 2 +
(6 / 5 : ℂ) • casimirProjector (quditCasimir 3 (Fin 2)) 4
/-- PDF p.7: the positive square root of X, not an arbitrary filter. -/
def qutritResource : Op (Ports 3 2) := cfc Real.sqrt qutritResourceSquare
/-- PDF p.7, Eq.(B5): transformed success effects with corrected factor 9/10. -/
def qutritTransformedEffect (i : Fin 2) : Op (AC 3 2) := (9 / 10 : ℂ) • portProjector i
/-- Computational ket of the two physical qutrit A ports, highest spin label first. -/
def qutritPairKet (a b : Fin 3) : EuclideanSpace ℂ (Ports 3 2) :=
QAlgorithms.ket (![a, b] : Ports 3 2)
/-- PDF p.6, B1: the three highest-weight total-spin-one vectors, with the
phase convention in which the A_1,C singlet matrix carries (-1)^(J+J').
J=0,1,2 is the physical A-spin. Lower magnetic vectors are generated below. -/
def qutritHighest (J : Fin 3) : EuclideanSpace ℂ (AC 3 2) :=
match J.val with
| 0 => (Real.sqrt 3 : ℂ)⁻¹ • QAlgorithms.tensorVec
(qutritPairKet 0 2 - qutritPairKet 1 1 + qutritPairKet 2 0) (QAlgorithms.ket 0)
| 1 => (- (1 / 2 : ℂ)) •
(QAlgorithms.tensorVec (qutritPairKet 0 1 - qutritPairKet 1 0) (QAlgorithms.ket 1) -
QAlgorithms.tensorVec (qutritPairKet 0 2 - qutritPairKet 2 0) (QAlgorithms.ket 0))
| _ => (Real.sqrt (3 / 5 : ℝ) : ℂ) •
QAlgorithms.tensorVec (qutritPairKet 0 0) (QAlgorithms.ket 2) -
(Real.sqrt (3 / 20 : ℝ) : ℂ) •
QAlgorithms.tensorVec (qutritPairKet 0 1 + qutritPairKet 1 0) (QAlgorithms.ket 1) +
(Real.sqrt (1 / 60 : ℝ) : ℂ) •
QAlgorithms.tensorVec (qutritPairKet 0 2 + qutritPairKet 2 0 +
(2 : ℂ) • qutritPairKet 1 1) (QAlgorithms.ket 0)
/-- PDF p.6, B1: actual coupled basis; r=0,1,2 represents m=1,0,-1. -/
def qutritCoupled (r J : Fin 3) : EuclideanSpace ℂ (AC 3 2) :=
((Real.sqrt 2 : ℂ) ^ r.val)⁻¹ •
QAlgorithms.act ((totalComponent 3 2 ((quditSpinRaise 3)ᴴ)) ^ r.val) (qutritHighest J)
/-- PDF p.6: the physical three-column block frame at one magnetic number. -/
def qutritFrame (r : Fin 3) : Matrix (AC 3 2) (Fin 3) ℂ :=
fun x J => qutritCoupled r J x
/-- All nine coupled vectors, not a postulated abstract matrix basis. -/
def qutritFullFrame : Matrix (AC 3 2) (Fin 3 × Fin 3) ℂ :=
fun x rJ => qutritCoupled rJ.1 rJ.2 x
/-- PDF p.6, Eq.(B2): the exact spin-one magnetic block. -/
def qutritBlock : Op (Fin 3) :=
(2 / 27 : ℂ) • !![1, 0, (Real.sqrt 5 : ℂ); 0, 3, 0; (Real.sqrt 5 : ℂ), 0, 5]
/-- PDF p.7, Eq.(B7), corrected: sqrt(5), not 5, in the normalized null vector. -/
def qutritKernelVector (r : Fin 3) : EuclideanSpace ℂ (AC 3 2) :=
(Real.sqrt 6 : ℂ)⁻¹ •
((Real.sqrt 5 : ℂ) • qutritCoupled r 0 - qutritCoupled r 2)
example : qutritHighest 0 = (Real.sqrt 3 : ℂ)⁻¹ • QAlgorithms.tensorVec
(qutritPairKet 0 2 - qutritPairKet 1 1 + qutritPairKet 2 0) (QAlgorithms.ket 0) := rfl
/-- PDF p.6, A1-A4: a real orthonormal basis of the actual complementary
spin/magnetic slice. Completeness refers to spectral projectors of the
physical angular momenta, not to a postulated abstract block. -/
structure RealSpinBasis (d N t r : ℕ) (i0 : Fin N) (A : Type*)
[Fintype A] [DecidableEq A] where
frame : Matrix (PortComplement d N i0) A ℂ
real_entries : ∀ x a, (frame x a).im = 0
orthonormal : frameᴴ * frame = 1
complete : frame * frameᴴ =
casimirProjector (quditCasimir d {j : Fin N // j ≠ i0}) t *
magneticProjector (quditCollective d {j : Fin N // j ≠ i0} (quditSpinZ d)) t r
/-- PDF p.6, A4: the physical port swap, leaving C untouched. -/
def swapPorts {d N : ℕ} (i k : Fin N) : Op (Ports d N) :=
fun x y => if x = (fun j => y (Equiv.swap i k j)) then 1 else 0
/-- PDF p.6, A1,A4: all xi vectors are constructed from one basis by swaps. -/
def gramFrame {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
(B : RealSpinBasis d N t r i0 A) : Matrix (AC d N) (Fin N × A) ℂ :=
fun x ia => (liftA (swapPorts (d := d) i0 ia.1) *
singletInsert (d := d) i0 * B.frame) x ia.2
/-- PDF p.6, A3: actual Gram matrix. -/
def pbtGram {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
(B : RealSpinBasis d N t r i0 A) : Op (Fin N × A) :=
(gramFrame B)ᴴ * gramFrame B
/-- PDF p.6, A5: swap of two wires inside the base complement. Used only
when neither swapped wire is i0, so the complement is invariant. -/
def complementSwap {d N : ℕ} (i0 i k : Fin N) : Op (PortComplement d N i0) :=
fun x y => ∏ j : {j : Fin N // j ≠ i0},
if h : Equiv.swap i k j.val ≠ i0 then
if x j = y ⟨Equiv.swap i k j.val, h⟩ then 1 else 0
else 0
/-- PDF p.6, A6: synthesized physical vector. No coefficient is divided by
its port norm, so zero-norm port components remain harmless. -/
def gramSynthesis {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
(B : RealSpinBasis d N t r i0 A) (c : EuclideanSpace ℂ (Fin N × A)) :
EuclideanSpace ℂ (AC d N) :=
WithLp.toLp 2 (Matrix.mulVec (gramFrame B) (WithLp.ofLp c))
example {d N t r : ℕ} {i0 : Fin N} {A : Type*} [Fintype A] [DecidableEq A]
(B : RealSpinBasis d N t r i0 A) : gramSynthesis B 0 = 0 := by
simp [gramSynthesis]
/-- PDF p.3, Eqs.(17)-(18): maximal-spin Dicke vectors on A,C. -/
def acDicke (N k : ℕ) : EuclideanSpace ℂ (AC 2 N) :=
WithLp.toLp 2 fun x =>
if (∑ i : Fin N, (x.1 i).val) + x.2.val = k then
(Real.sqrt (Nat.choose (N + 1) k) : ℂ)⁻¹ else 0
/-- PDF p.3, Eq.(16): same symmetric spin vector on D,B. -/
def bdDicke (N k : ℕ) : EuclideanSpace ℂ (Fin 2 × Ports 2 N) :=
WithLp.toLp 2 fun x => acDicke N k (x.2, x.1)
/-- PDF p.3, Eq.(18): e0 and the two signs for each positive integer m.
This is a full refinement precisely in the odd-N regime used below. -/
abbrev Refinement (N : ℕ) := Unit ⊕ (Fin ((N + 1) / 2) × Bool)
/-- PDF p.3, Eq.(18): explicit e_m^+, e_m^-, e0, with false denoting +. -/
def refinementVector (N : ℕ) : Refinement N → EuclideanSpace ℂ (AC 2 N)
| Sum.inl _ => acDicke N ((N + 1) / 2)
| Sum.inr (m, sign) => (Real.sqrt 2 : ℂ)⁻¹ •
(acDicke N ((N + 1) / 2 - (m.val + 1)) +
(if sign then (-1 : ℂ) else 1) • acDicke N ((N + 1) / 2 + (m.val + 1)))
/-- PDF pp.3-4: sequential failure then rank-one refinement effect on AC. -/
def refinementEffect (N : ℕ) (z : Refinement N) : Op (AC 2 N) :=
let P0 := probabilisticSRM 2 N none
P0 * QAlgorithms.pureDensity (refinementVector N z) * P0
/-- PDF p.4: the same complete Alice measurement for both of Bob's choices. -/
def recoveryMeasurement (N : ℕ) : Fin N ⊕ Refinement N → Op (AC 2 N)
| Sum.inl i => srm 2 N i
| Sum.inr z => refinementEffect N z
/-- PDF p.4: B-only unitary action, with an inert arbitrary reference. -/
def recoverBranch {N : ℕ} {R : Type*} [Fintype R] [DecidableEq R]
(U : Op (Ports 2 N)) (T : Op (R × Ports 2 N)) : Op (R × Ports 2 N) :=
let V := Matrix.kronecker (1 : Op R) U
V * T * Vᴴ
/-- One-port coordinates for the N=1 Bell-measurement specialization. -/
def onePortBell (sign : Bool) (parallel : Bool) : EuclideanSpace ℂ (AC 2 1) :=
WithLp.toLp 2 fun x =>
if (if parallel then x.2 = x.1 0 else x.2 = Fin.rev (x.1 0)) then
(if sign then (-1 : ℂ) ^ (x.1 0).val else 1) / (Real.sqrt 2 : ℂ) else 0
example (N : ℕ) : refinementVector N (Sum.inl ()) = acDicke N ((N + 1) / 2) := rfl
end QAlgorithms.Papers.Independent.Intakenext100.P53
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakenext100.P53.AC
For any natural numbers , is the set of pairs , where and . It is empty when ; when , the first component is the unique empty assignment and the second component is any of the labels.
QAlgorithms.Papers.Independent.Intakenext100.P53.DeterministicPOVM
For arbitrary natural numbers , put and . A family of complex matrices indexed by , with , satisfies this condition exactly when every is positive semidefinite and
For , the sum is zero, so the condition requires ; this is impossible when . When , is empty and the condition holds for the unique family of empty matrices.
QAlgorithms.Papers.Independent.Intakenext100.P53.ExactProbabilistic
For arbitrary natural numbers , let , , and . Given a complex matrix on and matrices on , with , define
and . The condition is the conjunction of
and, for every and ,
where inserts at and agrees with elsewhere. The condition imposes this last equality only on the outcomes indexed by , and allows their trace weights to be zero. For , those equalities are vacuous and the measurement condition reduces to . For , the measurement matrices and branch equalities are empty, while the displayed normalization condition on remains required.
QAlgorithms.Papers.Independent.Intakenext100.P53.NormalizedResource
For natural numbers , including zero, let be the set of port configurations, and let be any complex matrix indexed by . The condition is
as an equality of complex numbers. No positivity or unitarity of is required. When , is a singleton and the condition says that the sole entry of has squared modulus , including when , since . When , is empty and the condition holds for its unique empty matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.PortComplement
For any natural numbers and any index , is the set of functions from to . The index requires . When , this function set consists of the unique empty assignment, even if ; when and , it is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.Ports
For any natural numbers , is the set of functions , or equivalently assignments of one of labels to each of positions. When it contains exactly the empty assignment, including when ; when and it is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.ProbabilisticPOVM
For arbitrary natural numbers , put and . A family of complex matrices indexed by , with labels consisting of one additional label and the labels , satisfies this condition exactly when every matrix is positive semidefinite and
There is no further condition on the additional outcome. When , this requires . When , is empty and all these conditions hold for the empty matrices.
QAlgorithms.Papers.Independent.Intakenext100.P53.RealSpinBasis
For arbitrary natural numbers , a selected index , and any finite type equipped with decidable equality, this structure consists of a complex matrix whose rows are functions and whose columns are indexed by , together with the following requirements. Every entry of has imaginary part zero, , and
Here ; on , define with other entries zero, and define when , and otherwise. Set and . For each , its action on wire has entries
and , , , and . The two indicator functions in the requirement are applied by spectral calculus, selecting precisely the displayed real eigenvalues. All natural-number parameters may be zero except that supplying requires ; may be empty, is unrestricted relative to , and when the row-index set consists of the unique function on the empty set.
QAlgorithms.Papers.Independent.Intakenext100.P53.Refinement
For each natural number , this abbreviates the disjoint union of a singleton and the set of pairs with and . Its cardinality is . Integer division is used in ; no parity restriction is imposed on , and for only the singleton remains.
QAlgorithms.Papers.Independent.Intakenext100.P53.SymmetricPorts
For natural numbers , an arbitrary complex matrix on , matrices on for , and a real number , define
and, for every matrix on ,
Here and . Define by tracing out all ports other than :
Put , , and , with division by zero defined as zero. The declared predicate means exactly
No normalization or positivity assumptions are part of this predicate. When , all three conditions are vacuous; when , the last condition places no restriction on .
QAlgorithms.Papers.Independent.Intakenext100.P53.acDicke
For every pair of natural numbers , this defines a complex Euclidean vector on pairs , where and , by
The values and in the sum are their integer representatives. Both and arbitrary are included; if , no coordinate satisfies the condition and the vector is zero. Inverses are total, with .
QAlgorithms.Papers.Independent.Intakenext100.P53.bdDicke
For every pair of natural numbers , this defines a complex Euclidean vector on pairs , where and , by
Thus the scalar coordinate is placed before the -port assignment in the indexing. The definition permits and every natural ; for the vector is zero, and the inverse of zero is interpreted as zero.
QAlgorithms.Papers.Independent.Intakenext100.P53.casimirProjector
For every finite type equipped with decidable equality, every complex matrix indexed by , and every natural number , this defines
using the total real continuous functional calculus. For Hermitian , this selects its eigenspace with eigenvalue , giving zero if that eigenvalue is absent. No Hermitian hypothesis is required by the definition; the functional calculus returns zero for non-Hermitian . The definition includes , which selects eigenvalue zero, and empty , which gives the empty matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.codingProbability
For natural numbers , a chosen index , and arbitrary complex matrices on and on , where , define
and
where inserts at position . The declared real number is . Neither normalization of nor any positivity or upper bound on is assumed. A chosen cannot exist for ; when , the trace is empty and the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P53.codingState
For natural numbers , a chosen index , and any complex matrix on , where , define
The declaration defines the complex matrix on by
where has value at and agrees with elsewhere. No normalization or other condition on is assumed. The index excludes ; for , the sum contains the single empty complement configuration. For , the matrix has an empty index set.
QAlgorithms.Papers.Independent.Intakenext100.P53.complementSwap
For arbitrary natural numbers and indices , this defines a complex matrix indexed by assignments . Let exchange and , acting as the identity elsewhere. Then precisely when, for every , both and hold; otherwise . This is the literal product of these – factors over , with an empty product equal to . No assumption requires to differ from or from each other: if , the matrix is the identity; if exactly one of equals , every entry is zero because one factor sends a complementary site to . The indices exclude , but is allowed; when , the complementary assignment space is a singleton and the product is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.completedSRM
For natural numbers and , write , , and . Define
Here uses natural-number subtraction. Let mean functional calculus with the scalar function , taking the inverse of zero to be zero, and let be the orthogonal projection onto the range of . The declaration defines
with the scalar interpreted in . No index exists for ; is allowed and gives an empty matrix index set. This definition itself imposes no additional hypotheses.
QAlgorithms.Papers.Independent.Intakenext100.P53.conditionalFidelity
For natural numbers , an arbitrary complex matrix on , an arbitrary complex matrix on , and a port , define
Let , indexed by , be
For an assignment to all ports except , let insert at port , and define
The declaration defines the real number
It assumes neither normalization of nor positivity of . Division is total: a zero denominator gives value zero. The port argument excludes , while remains permitted.
QAlgorithms.Papers.Independent.Intakenext100.P53.deterministicResource
For every natural number , the declaration defines a complex matrix on by
Here , defined by continuous functional calculus, , and , where , , , and the superscript means action on that site with identities elsewhere. The real coefficients are embedded into . The definition has no positivity assumption on ; it includes , for which the matrix is times the identity on the one-dimensional configuration space. All divisions use the total field operation, so division by zero returns zero, and the real square root returns zero on nonpositive inputs.
QAlgorithms.Papers.Independent.Intakenext100.P53.gramFrame
For natural numbers , a distinguished index , and a finite type with decidable equality, let be the specified real spin basis, with matrix indexed by assignments and by . Its assumptions are that every entry of is real, , and equals the product of the complementary system’s spin- Casimir projector and its magnetic projector for value . Explicitly, the single-site matrices used here are , with all other entries zero, , and ; on the complementary sites, the Casimir is , and the magnetic operator is . The two projectors are obtained by applying the indicator functions of and , respectively, through functional calculus. The declaration defines a complex matrix whose rows are pairs , where and , and whose columns are . If exchanges and , then
The assignment indexing in this formula has domain . Equivalently, the construction inserts the vector with coordinates on pairs at port , then exchanges ports and . There are no positivity or admissibility restrictions on beyond the supplied basis assumptions; excludes , while may be empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.gramSynthesis
For natural numbers , a distinguished port , a finite type with decidable equality, a real spin basis , and any complex Euclidean vector indexed by , this defines the vector indexed by with and :
Writing and for the exchange of and , the coefficient equals when , and equals zero otherwise, with the assignment indexing restricted to . The supplied basis has real entries, satisfies , and satisfies on the complementary sites, where projects onto Casimir value and onto magnetic value . These are functional-calculus projectors for the Casimir and magnetic operator , formed from , with all other entries zero, , and . No normalization is required of , and no further restrictions are placed on ; may be empty, in which case the synthesized vector is zero.
QAlgorithms.Papers.Independent.Intakenext100.P53.insertPort
For any natural numbers , index , label , and assignment , is the assignment on all positions that equals at and equals at every . These arguments require and ; for , is the empty assignment.
QAlgorithms.Papers.Independent.Intakenext100.P53.liftA
For any natural numbers and any complex matrix indexed by assignments , is the matrix on pairs of such an assignment and an additional label whose entry at row and column is if and zero otherwise. Thus it is the Kronecker product of with the identity. No condition is imposed on ; is allowed, and gives an empty output matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.magneticProjector
For every finite type equipped with decidable equality, every complex matrix indexed by , and all natural numbers , this defines
using the total real continuous functional calculus. For Hermitian , this selects its eigenspace with eigenvalue , giving zero if that eigenvalue is absent. No Hermitian hypothesis is imposed, and the functional calculus returns zero for non-Hermitian . There is no restriction relating to : the subtraction is real subtraction and the selected value may be negative. Empty gives the empty matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.maximumSpinVector
For arbitrary natural numbers , let and . Define
The declaration first forms the vector whose coordinates are
equivalently summing, for each , the singlet-insertion matrix against the indicator of the all-zero assignment on the remaining ports. It then defines
There are no positivity assumptions on or . The inverse of zero is zero, so the result is zero whenever , including and .
QAlgorithms.Papers.Independent.Intakenext100.P53.onePortBell
For each pair of Boolean values and , this defines a vector in the complex Euclidean space indexed by , where is a single port and . Its coefficient at is zero unless when , or when ; on those supported indices its coefficient is when , and when . Equivalently, writing the port value first and second, its four possible values are
Here denotes the vector with coefficient at the indicated basis index and elsewhere.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtBranch
For arbitrary natural numbers , let , , and . Given arbitrary complex matrices on and on , set
The declaration defines the complex matrix on by
Thus the matrix supplied as the input to the branch construction has entries . No normalization or positivity assumptions are imposed on or . The parameters may be zero; for , the resulting matrix has an empty index set.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtBranchProbability
For arbitrary natural numbers , let , , and . Given arbitrary complex matrices on and on , define
The declared real number is
the real part of the trace of the corresponding branch matrix. No assumptions require this number to lie between zero and one. The definition includes ; when , the sum is empty and the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtChannelBranch
For arbitrary natural numbers , any finite type , possibly empty, let , , and . Given arbitrary complex matrices on , on , and on , define
The declaration defines the complex matrix on by
There are no normalization, positivity, or measurement assumptions on the arguments. Empty sums are zero and empty products are one; in particular, if , the sums over are empty and is zero.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtFidelity
For arbitrary natural numbers , let , , and . Given any complex matrix on and any family of complex matrices on , indexed by , set
For each , define matrices on and on by
where has value at and agrees with elsewhere. With , the declared real number is
No normalization, positivity, or completeness assumptions are imposed on or the . The value is zero when or .
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtGram
For arbitrary natural numbers , a distinguished port , a finite type with decidable equality, and a supplied real spin basis , this defines the matrix on , so that
Here, writing and letting exchange and , the entry is if , and zero otherwise; the assignment indexing is restricted to . The basis assumptions are that has real entries, , and is the product of the spectral projectors for complementary-site Casimir value and magnetic value . These operators are built from , with other entries zero, , , the Casimir , and magnetic operator , using the sites . The parameters have no further restrictions; follows from , and an empty gives an empty Gram matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtRho
For every pair of natural numbers , is the complex matrix indexed by pairs of an assignment and a label . Its entry at row and column is the sum over all of when , , and for every , with zero contributed otherwise. Natural-number subtraction is truncated at zero and complex inversion sends zero to zero. When , the sum is empty and the result is the zero matrix; when , its index set is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtSignal
For any natural numbers and index , is the complex matrix indexed by pairs of an -position assignment of labels in and one additional label . Its entry at row and column is if , , and for every , and is zero otherwise. Here is natural-number subtraction, truncated at zero, and the reciprocal is taken in , where . The argument requires ; when , the matrix has no entries.
QAlgorithms.Papers.Independent.Intakenext100.P53.pbtSuccessProbability
For arbitrary natural numbers , let , , and . Given any complex matrix on and any family of complex matrices on , with , set
The declared real number is
Thus it sums the real traces of the branch matrices for the outcomes ; does not enter the expression. No normalization, positivity, completeness, or exactness condition is assumed. The value is zero when or .
QAlgorithms.Papers.Independent.Intakenext100.P53.portProjector
For any natural numbers and index , is the complex matrix on pairs , where assigns a label in to each of the positions and is another such label. Its entry at row and column is if , , and for every , and is zero otherwise. This is the product of the matrix with entries when and the remaining assignment matches its column, and its conjugate transpose. The index requires ; for , the resulting matrix is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.probabilisticResource
For every natural number , the declaration defines a complex matrix on by
Here is obtained by continuous functional calculus, , and , with single-site matrices , , and ; the site operators act as identities elsewhere. All displayed coefficients are real and then embedded into . The summation set always contains , including when ; at , the resulting matrix is the identity on the one-dimensional configuration space. Division by zero is defined to be zero, and the real square root is zero on nonpositive inputs.
QAlgorithms.Papers.Independent.Intakenext100.P53.probabilisticSRM
For arbitrary natural numbers , let , , and . Put
The subtraction is truncated at zero. Let be the orthogonal projection onto the range of , and let be the functional-calculus value of at , with . The declaration defines a matrix-valued function with one outcome labelled “none” and one outcome labelled “some ” for each port:
For , there are no “some” outcomes, , and the “none” matrix is . The definition also permits .
QAlgorithms.Papers.Independent.Intakenext100.P53.qubitSectorDimension
For arbitrary natural numbers , let , , and , and, on , define
Each acts on site and as the identity on the other sites. The declaration defines the real number , where , with the indicator function applied by continuous functional calculus. There is no requirement that or that have the parity of ; an absent spectral value gives . For , the configuration space has one element and , so the value is for and for .
QAlgorithms.Papers.Independent.Intakenext100.P53.qubitSpins
For every natural number , the declaration defines the finite set
Thus the set contains exactly the natural numbers at most having the same parity as , including when is even; for , it is .
QAlgorithms.Papers.Independent.Intakenext100.P53.quditCasimir
For every natural number and every finite type equipped with decidable equality, define matrices by if , and zero otherwise; if , and zero otherwise; ; and , with real arithmetic in the entries of and . For any such matrix , define its configuration matrix by
The declaration defines
where the squares are matrix products and denotes conjugate transpose. Empty products equal and empty sums equal zero; in particular, empty gives a one-dimensional zero matrix. No lower bound on is assumed.
QAlgorithms.Papers.Independent.Intakenext100.P53.quditCollective
For every natural number , every finite type equipped with decidable equality, and every complex matrix , this defines a matrix on the configuration set by
Empty products equal , and an empty sum equals zero. In particular, if is empty, the configuration set has one element and this is the one-dimensional zero matrix, including when ; if is nonempty and , the configuration set is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.quditOnWire
For every natural number , every finite type equipped with decidable equality, every , and every complex matrix , this defines a complex matrix on the configuration set by
Thus an entry is if the configurations agree at every position other than , and is zero otherwise. An empty product is . The supplied requires to be nonempty; if , the configuration set is consequently empty and the resulting matrix is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.quditSpinRaise
For every natural number , this defines a complex matrix , with rows and columns indexed by , by
The square root is the real square root and its value is embedded into ; the subtraction inside it is real subtraction. Thus the potentially nonzero entries lie in row , column . The definition includes , giving the empty matrix, and , giving the zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.quditSpinY
For every natural number , let be the complex matrix indexed by whose entry in row , column is when , and is zero otherwise, using real arithmetic under the square root. This defines
where and denotes conjugate transpose. The definition includes , giving the empty matrix, and , giving the zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.quditSpinZ
For every natural number , this defines a complex matrix , with rows and columns indexed by , whose entries are
The displayed arithmetic is real arithmetic, embedded into ; in particular, here is real subtraction. No positivity assumption on is imposed: gives the empty matrix, and gives the one-dimensional zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritBlock
This defines the complex matrix, indexed in the order , given by
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritCoupled
For every , this defines a vector in the complex Euclidean space with basis , . Let
and define
Then , where matrix action is ordinary matrix-vector multiplication. In particular, uses and gives .
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritFrame
For each , this defines a complex matrix , with rows indexed by and columns indexed by . In the corresponding computational basis, put
let and . The definition is
Thus its columns are the three indicated vectors, including themselves when .
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritFullFrame
This defines a complex matrix , with rows indexed by and columns indexed by ordered pairs . In this computational basis, let
and set and . Its entries are
with .
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritHighest
For each , this defines a vector in the -dimensional complex Euclidean space with basis , where denote the two port entries and the final register. The three cases are exactly
Here each displayed ket has coefficient at its indicated basis label and at all other labels; the final case applies precisely when .
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritKernelVector
For every , this defines a vector in the complex Euclidean space with basis , . Let , , and
Then
including , when .
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritPairKet
For every , this defines the vector in the -dimensional complex Euclidean space indexed by functions : its coefficient at a function is if and , and otherwise.
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritResource
On the space indexed by , let , , , , and
The declaration defines the constant matrix obtained by applying the real square-root function through continuous functional calculus to
The spectral indicator functions in this expression are themselves applied by continuous functional calculus.
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritResourceSquare
On the space indexed by two-port configurations , define
and . The declaration defines the constant matrix
where each indicator function is applied by continuous functional calculus. The three target eigenvalues arise respectively from for , and the rational coefficients are complex scalars.
QAlgorithms.Papers.Independent.Intakenext100.P53.qutritTransformedEffect
For each , this defines an operator on the -dimensional space with basis , where . Define when , and otherwise. Its matrix entries are
Thus , where places the rank-one operator associated with on port and the final register, and acts as the identity on the other port.
QAlgorithms.Papers.Independent.Intakenext100.P53.recoverBranch
For every natural number , every finite type with decidable equality, every complex matrix on the assignment space , and every complex matrix on times that assignment space, this defines
Equivalently, its entry at is , where range over all -port assignments. There is no assumption that is unitary or that is positive or normalized. Both , when the assignment space is a singleton, and an empty are allowed.
QAlgorithms.Papers.Independent.Intakenext100.P53.recoveryMeasurement
For every natural number , this defines a family of complex matrices on pairs , with and , indexed by the disjoint union of the ports and the refinement labels. Define when and , and zero otherwise, and set
where is applied through continuous functional calculus, with , and is the orthogonal range projector. The matrix for a port label is ; the matrix for a refinement label is . To specify the latter, put and if , and zero otherwise. Refinement labels comprise a singleton, with , and pairs with and Boolean , with , where false gives sign and true gives sign . Natural-number subtraction is used in and in the vector indices. No restriction excludes : then there are no port labels and only the singleton refinement label remains. This declaration defines the family without asserting that its sum is the identity.
QAlgorithms.Papers.Independent.Intakenext100.P53.refinementEffect
For every natural number and every refinement label , this defines the matrix on pairs with and . Here
where is the orthogonal projector onto the matrix range, and if and , and is zero otherwise. The exponent uses natural-number subtraction. To define , put and let equal when and zero otherwise. The label set is the disjoint union of a singleton and the pairs with and Boolean ; the singleton gives , while a pair gives , with and . The matrix has entries . The case is included: , , and only the singleton label occurs.
QAlgorithms.Papers.Independent.Intakenext100.P53.refinementVector
For every natural number , put and define to be when , and zero otherwise, for assignments and . This declaration assigns a vector to each element of the disjoint union consisting of a singleton and the pairs with and Boolean : the singleton receives , and receives
Subtraction in the lower index is natural-number subtraction, which truncates at zero; the bound ensures that it does not truncate in this branch. No parity or positivity condition on is assumed. For , there are no pairs , and the singleton receives .
QAlgorithms.Papers.Independent.Intakenext100.P53.resource
For any natural numbers and any complex matrix indexed by assignments , is the complex Euclidean vector indexed by two such assignments , with coordinate , where the sum ranges over all assignments and if , and zero otherwise. No normalization or other condition is imposed on . When , the sum has one term and the product is empty, so the sole coordinate is , including when ; when and , the vector has an empty index set.
QAlgorithms.Papers.Independent.Intakenext100.P53.rhoSpinBlock
For arbitrary natural numbers , let , let , and, for , let . Define the singlet-insertion matrix by
To specify the operator on the complementary ports, define single-site matrices , when , and otherwise, and put , . For a finite set of sites, let be the sum of acting on each site and the identity on all other sites, and let . Writing for the matrix obtained by continuous functional calculus with the indicated indicator function, the declaration defines
where , and the scalar inverse is taken in , with . There are no lower bounds on ; in particular, gives an empty sum and hence the zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.rhoSpinMagnetic
For arbitrary natural numbers , the declaration defines a matrix on configurations by
Here ; has entry from a complementary configuration to exactly when and restricts to away from , and has entry otherwise. The single-site matrices are , if and otherwise, , and . For any finite site set , , where acts on site and as the identity elsewhere; ; and . Both indicator functions are applied by continuous functional calculus. The definition uses the displayed order of matrix multiplication and imposes no restriction such as ; a target value absent from the relevant spectrum gives the zero spectral projector. All natural-number values, including and , are admitted, with inverse zero interpreted as zero; makes the result zero.
QAlgorithms.Papers.Independent.Intakenext100.P53.selectPort
For natural numbers , any finite type , possibly empty, and a chosen index , let and . Given any complex matrix on , the declaration defines a complex matrix on by
No positivity or normalization of is assumed. A chosen cannot exist when . When , the complement is empty and the sum has one term, corresponding to its unique empty configuration. When , the output index set is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.singletDensity
For every natural number , is the complex matrix indexed by with entries , where when and otherwise. Equivalently, its entry at row and column is when both and , and is zero otherwise. For , this is the empty matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.singletInsert
For any natural numbers and index , is the complex matrix whose rows are pairs with and , and whose columns are assignments . Its entry is if and for every , and is zero otherwise. The index requires ; when , there are no rows, and when , there is exactly one column.
QAlgorithms.Papers.Independent.Intakenext100.P53.spinSinglet
For every natural number , is the complex Euclidean vector indexed by pairs whose coordinate is if , and otherwise. When , the index set is empty and this is the unique vector in the zero-dimensional space; there are no coordinates at which division by is evaluated.
QAlgorithms.Papers.Independent.Intakenext100.P53.spinX
For every natural number , let be the complex matrix indexed by whose entry in row , column is when , and is zero otherwise, with real arithmetic under the square root. This defines
where denotes conjugate transpose. No restriction on is imposed; gives the empty matrix and gives the zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.srm
For natural numbers and an index , let , , and . Define the vector and matrix by
Set , where is natural-number subtraction, and . Let be the matrix obtained by applying to through functional calculus, with . The declaration defines the complex matrix on by
There is no index when ; is permitted, in which case is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.swapPorts
For arbitrary natural numbers and any indices , this defines a complex square matrix indexed by functions , with entries
where exchanges and and fixes all other indices. The indices need not be distinct: when , this is the identity matrix. Supplying either index requires ; is allowed and then the matrix has an empty index set.
QAlgorithms.Papers.Independent.Intakenext100.P53.totalCasimir
For all natural numbers , define complex matrices by if , and zero otherwise; if , and zero otherwise; ; and , with real arithmetic in the entries of . Put , and for a matrix set
The declaration defines the matrix on
using matrix squares and conjugate transpose . Empty products are and empty sums are zero. No positivity assumptions on are imposed; leaves the single additional -dimensional factor, and gives an empty matrix.
QAlgorithms.Papers.Independent.Intakenext100.P53.totalComponent
For all natural numbers and every complex matrix , let and define a matrix on by
This defines the matrix on
Here is the Kronecker product, empty products equal , and empty sums equal zero. The definition allows , in which case is a singleton and the resulting matrix is under that indexing; it also allows , in which case the total indexing set is empty.
QAlgorithms.Papers.Independent.Intakenext100.P53.transformedSRM
For arbitrary natural numbers , every complex matrix indexed by port configurations , and every , let . For each port , define by the entry from to when and , and by otherwise. Put , , and . The declaration defines
Thus the inverse-square-root function is applied by continuous functional calculus, with value zero at , rather than requiring an invertible matrix. No normalization, positivity, or unitarity condition is imposed on , and no lower bound is imposed on . The argument cannot be supplied when .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.