Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Quantum cloning

Definition
QAlgorithms_Papers_Independent_Extend50_P40

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

prove2quantum

The objects the formalized statements of Quantum cloning (arXiv:quant-ph/0511088) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Triple
  • finBlochDensity: Appendix A pp.30–31: rho(m) for real Bloch coordinates.
  • densityBloch: Appendix A p.30: the Bloch coordinates computed from a qubit density.
  • vectorBloch: Appendix A p.30: corrected y sign, compatible with the frozen Pauli Y.
  • orthogonalQubit: II.A.3 p.8: psi perpendicular, with the source's phase convention.
  • depol: II.B p.9: radial mixture, extended linearly to arbitrary operators.
  • bellBasisState: Appendix A p.30: Bell order Phi+,Phi-,Psi+,Psi-.
  • equator: II.D p.11 Eq.(35): normalized equatorial input, phase in radians.
  • cloneMarginalA: II.A p.8: partial traces of an actual three-register pure output.
  • cloneMarginalB: II.A p.8: B is the first register of the B–machine pair.
  • marginalMachine: II.A p.8: machine register M is traced last.
  • cloneChannel: I.D p.5: a fixed isometry's AB output channel, machine discarded.
  • bhMatrix: II.A p.8 Eq.(12), corrected: sqrt(1/3) on normalized Psi+ in BOTH columns. The minus on the input |1> is retained. The printed sqrt(1/6) in column 2 has squared norm 5/6 and contradicts Eq.(13).
  • bhOutput: II.A p.8: the linear Buzek–Hillery output on an arbitrary qubit vector.
  • NoSignalingFamily: I.E p.6: the larger no-signaling model; no channel hypothesis is imposed. Covariance (9) is an explicit assumption, independently of equal fidelities.
  • singleFidelity: II.B p.9: each site's fidelity is the trace of the actual site observable.
  • UniformCloner: I.D p.5: universality and symmetry mean ONE common fidelity for all inputs/sites. This does not impose Bose support or covariance on competitors.
  • optimalSingle: II.B p.9 Eq.(21): numerical common pure-state fidelity.
  • shuffleCloner: II.B p.9 Eq.(22): incoherent shuffling after appending maximally mixed blanks. The Bose compression fixes the accepted corner domain, not the output domain.
  • sphereAverage: II.A p.7 Eq.(10): normalized spherical average, uniform azimuth and z. This is probability measure sin(theta)dtheta dphi/(4pi), with z=cos(theta).
  • randomBasisCloner: II.A p.7: actual random-basis measurement and two copies of its outcome. Complex traces preserve linearity on non-Hermitian inputs.
  • distributor: II.C pp.10–11 Fig.2: B+=A; M+=A; A-=B; A+=M (all modulo d). The resulting basis permutation is (s-w+x,s+w,s+x), NOT the mod-two formula.
  • program: II.C pp.10–11 Eq.(27): fixed program, independently of the unknown psi.
  • distributorOutput: II.C pp.10–11: processor applied to input tensor program.
  • asymmetricOutput: II.C Eq.(27): coherent identity/swap output, in the source tensor order.
  • QubitTradeoff: II.C p.10 Eq.(23): the sharp qubit asymmetric fidelity inequality.
  • onFirstTwo: II.C p.11 Eqs.(31),(32), II.D p.12 Eq.(42): extend an AB operator by identity on M and reindex ((A,B),M) to the fixed (A,(B,M)) order.
  • cerfQubit: II.C p.11 Eq.(31): Cerf's ambient operator, not generally unitary.
  • cerfWeyl: II.C p.11 Eq.(33): positive Fourier sign, shift k+m modulo d.
  • cerfQudit: II.C p.11 Eq.(32), corrected: the second Weyl operator is its ADJOINT. Printed U tensor U fails the swap identity and even the d=2 symmetric test.
  • twoStateFidelity: II.D p.11 Eq.(34), orthogonal case defined separately to avoid 1/0.
  • economicMatrix: II.D p.12 Eq.(39): the economical isometry on input times blank |0>.
  • economicOutput: II.D p.12: the actual economical output.
  • phaseClonerMatrix: II.D p.12 Eq.(41): restriction to input psi_A tensor Phi+_BM.
  • phaseOutput: II.D p.12: phase cloner with machine retained.
  • phaseCerf: II.D p.12 Eq.(42): parentheses keep I_M outside the WHOLE Pauli sum.
  • asymmetryFilter: VI.A p.26 Eq.(103): a Kraus contraction, generally not a projector.
  • filteredOutput: VI.A p.26: successful unnormalized state; filter acts on B and machine.
  • symmetricPair: VI.A p.25 Eq.(101): symmetric two-photon projection.
  • bunching: VI.A p.25: bunching success operation, before conditioning.
  • Estimator: II.E pp.13–14: a finite estimator POVM on the actual N-copy Bose corner.
  • estimationOutput: II.E p.13: restored N-fold input in the outcome probability.
  • estimationShrink: II.E p.14: coefficient of the optimal qubit estimator.
  • binaryInformation: IV.B pp.20–22: mutual information of uniform binary variables with agreement p.
  • rawRate: IV.B p.20 Eq.(81): displayed raw information rate, without preprocessing.
  • economicLaw: IV.B p.21: actual sifted x-basis law of the economical attack; bits are uniform.
  • classicalMutualInformation: IV.B p.20: mutual information in bits, with the standard 0 log 0 convention. Only genuine normalized finite probability laws occur in statements.
  • infoAB: IV.B p.21: marginal AB of a three-bit law.
  • infoAE: IV.B p.21: marginal AE of a three-bit law.
  • infoBE: IV.B p.21: marginal BE of a three-bit law.
  • eveGivenAlice: IV.B pp.21–22: Eve's actual two-qubit state given Alice's raw bit.
  • eveGivenBob: IV.C p.22: Eve's conditional state given Bob's equiprobable sifted bit. The factor two is Bayes normalization, not an assumed independent output.
  • binaryHolevo: IV.C p.22 Eq.(86): equiprobable binary Holevo quantity, in bits.
  • collectiveRate: IV.C p.22 Eq.(85): the stated attack's raw collective rate.
  • bellDecoder: IV.B p.21: the specified Bell-to-computational decoder, retaining phases.
  • discriminationState: IV.B p.22: the binary pure states to be discriminated after reading Eve's flag.
  • decodedAttack: IV.B pp.21–22 Eq.(84): normalized state after the fixed Bell decoder.
  • flagFactorization: IV.B pp.21–22 Eq.(84): factorization displaying the deterministic error flag.
  • ancillaLaw: IV.B p.22: Eve reads E2 in Z and E1 in X after the Bell decoder.
  • measureNot: II.A.3 p.8 footnote 10: random-basis estimate followed by the opposite state.
  • spherical: Appendix A p.30 Eq.(A4): spherical representative of a pure-state ray.
  • pdcFirstOrder: VI.A.1 p.25 Eq.(97): normalized first-order singlet-pair creation amplitude. The two signal photons are represented in their normalized symmetric tensor sector.
  • bunchingVector: VI.A.1 pp.25–26: the selected three-photon bunching amplitude, before normalization.
  • modeEmission: VI.A.3 p.28 Eq.(105): coherent equal-coupling one-emission map for d modes. The two signal factors are symmetrized and the emitting ground mode is retained. This constructs the action on superpositions, rather than specifying basis fidelities.
  • modeOutput: VI.A.3 p.28: actual output vector in the selected one-emission sector.
  • oneModeOccupation: III.A p.15: identify a one-mode occupation tuple with its sole photon number.
  • oneModeCoordinates: III.A p.15: the complete one-mode Fock space in the source's tuple coordinates. This is only a basis relabeling; no cutoff, state choice or extra hypothesis.
  • oneModeProjector: III.A p.15: reuse the frozen coherent projector, transported to one-mode occupation tuples by unitary conjugation. No coherent state is redefined here.
  • noiseWeight: III.A p.15 Eq.(53): normalized complex-plane noise density; t means sigma^2.
  • gaussianMixture: III.A p.15 Eq.(53): actual operator-valued mixture, with the t=0 boundary set to the pure density rather than Lean's zero value of a singular integral.
  • OscillatorCloner: III.A p.15: a Stinespring isometry represents a fixed normal CPTP channel. One full oscillator environment is separable and accommodates arbitrary countable Kraus rank; no photon cutoff is introduced in any register.
  • coherentReplicas: III.A p.15: identical coherent input replicas, no extra input degrees of freedom.
  • permuteCloneOccupation: III.A p.15: permutation of the M clone modes leaving the environment fixed.
  • SymmetricGaussian: III.A p.15: exactly the source SGC restrictions on coherent inputs. Bose support is retained, but no all-input Gaussian channel action is assumed.
  • priorWeight: III.C p.19 Eq.(79): normalized prior density, Sigma>0 required in uses.
  • priorGain: III.C p.19: physically allowed gain. The printed gain formula is restricted to the broad-prior branch; below the threshold G=1, forced by Eq.(80).
  • priorFidelity: III.C p.19 Eq.(80): reciprocal in the narrow-prior branch, as printed.
  • priorClone: III.C p.19: one actual reduced clone of the amplifier/splitter construction.
  • priorIntegrand: III.C p.19: average figure of merit; no pointwise universality is required.
  • DisplacementNoise: III.A.2 p.16: centered displacement noise with finite added quadrature variances. A genuine probability measure supplies symmetric classical covariance; no defective frozen moment predicate is used. Singular noise laws are allowed.
  • addedX: III.A.2 p.16: added x VARIANCE, not standard deviation or total output variance.
  • addedP: III.A.2 p.16: added p variance in the hbar=1 convention.
  • noiseMixture: III.A.2 p.16: displacement alpha=(x+i p)/sqrt(2), with a fixed law independent of the unknown coherent input.
  • EmissionSector: V.B p.24 Eq.(93): permutation-symmetric atomic sector, with i photons emitted into the wrong polarization, j into the initial polarization, and A-i-j atoms still excited. This is an exact finite excitation sector, not a cutoff.
  • emissionRaising: V.B p.24 Eq.(93): stimulated creation part in the normalized symmetric atomic occupation basis. The square roots include BOTH photon and atom occupation factors. N input photons and A excited atoms are different parameters.
  • emissionHamiltonian: V.B p.24 Eq.(93): full Hermitian equal-coupling Hamiltonian on the conserved sector. Reabsorption is retained by adding the adjoint.
  • emissionInitial: V.B p.24: all A atoms excited, no new photons yet.
  • emissionState: V.B p.24: FULL e^(-iHt) evolution, not just the H^k short-time term.
  • emissionProbability: V.B p.24 Eq.(92): unnormalized joint probability of k added photons, l of them in the initial polarization. Impossible events have probability zero.
  • emissionSuccess: V.B p.24 Eq.(91): physical probability of the selected photon count.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Ensemble
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P12
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P48
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P39
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P34
import Definitions.Def_QAlgorithms_Papers_Independent_Renew46_P24
import Definitions.Def_QAlgorithms_Papers_Independent_Support21_P16
import Definitions.Def_QAlgorithms_Papers_Independent_Renew46_P41

/-!
arXiv:quant-ph/0511088v1, Quantum cloning. PDF pages are cited throughout.
Reviewed paper imports are used under the independent-paper workflow override.
All new objects are local; no frozen module is modified. The six exact reuse
nodes have no duplicate theorem here. Source corrections are recorded in the
audit artifacts. Compilation and independent moderation are pending.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P40

open QAlgorithms
open scoped Matrix ComplexOrder ComplexConjugate BigOperators Topology
open MeasureTheory Filter
open scoped Matrix.Norms.Frobenius
open QAlgorithms.Papers.Independent.Dependency50.P12 (sigma)
open QAlgorithms.Papers.Independent.Dependency50.P48 (pureFidelity)

attribute [local instance] Classical.propDecidable Classical.decEq

abbrev Triple (d : ℕ) := Fin d × (Fin d × Fin d)

open QAlgorithms.Papers.Independent.Support21.P16
  (CloneMap IsBoseInputChannel coherentTensor tensorWithIdentity canonicalCloner
   HasBoseOutput HasBlackCowCoefficient canonicalCoefficient oneMixed)
open QAlgorithms.Papers.Independent.Renew46.P45
  (TensorMat boseProjector siteObservable)
open QAlgorithms.Papers.Independent.Information100.P58 (Word)

/-- Appendix A pp.30–31: rho(m) for real Bloch coordinates. -/
def finBlochDensity (m : Fin 3 → ℝ) : Matrix (Fin 2) (Fin 2) ℂ :=
  (QAlgorithms.Papers.Independent.Renew46.P24.blochDensity m).submatrix
    (fun i => decide (i = 1)) (fun j => decide (j = 1))

/-- Appendix A p.30: the Bloch coordinates computed from a qubit density. -/
def densityBloch (rho : Matrix (Fin 2) (Fin 2) ℂ) : Fin 3 → ℝ := fun k => (rho * sigma k).trace.re

/-- Appendix A p.30: corrected y sign, compatible with the frozen Pauli Y. -/
def vectorBloch (psi : EuclideanSpace ℂ (Fin 2)) : Fin 3 → ℝ :=
  ![2 * (conj (psi 0) * psi 1).re, 2 * (conj (psi 0) * psi 1).im,
    Complex.normSq (psi 0) - Complex.normSq (psi 1)]

/-- II.A.3 p.8: psi perpendicular, with the source's phase convention. -/
def orthogonalQubit (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Fin 2) :=
  WithLp.toLp 2 ![-conj (psi 1), conj (psi 0)]

/-- II.B p.9: radial mixture, extended linearly to arbitrary operators. -/
def depol {d : ℕ} (eta : ℝ) (A : Matrix (Fin d) (Fin d) ℂ) : Matrix (Fin d) (Fin d) ℂ :=
  (eta : ℂ) • A + (((1 - eta : ℝ) : ℂ) * A.trace) • oneMixed d

/-- Appendix A p.30: Bell order Phi+,Phi-,Psi+,Psi-. -/
def bellBasisState (k : Fin 4) : EuclideanSpace ℂ (Fin 2 × Fin 2) :=
  (Real.sqrt 2 : ℂ)⁻¹ •
    (if k = 0 then ket (0, 0) + ket (1, 1)
     else if k = 1 then ket (0, 0) - ket (1, 1)
     else if k = 2 then ket (0, 1) + ket (1, 0)
     else ket (0, 1) - ket (1, 0))

/-- II.D p.11 Eq.(35): normalized equatorial input, phase in radians. -/
def equator (theta : ℝ) : EuclideanSpace ℂ (Fin 2) :=
  WithLp.toLp 2 ![(Real.sqrt 2 : ℂ)⁻¹,
    Complex.exp (Complex.I * (theta : ℂ)) / (Real.sqrt 2 : ℂ)]

/-- II.A p.8: partial traces of an actual three-register pure output. -/
def cloneMarginalA {d : ℕ} (psi : EuclideanSpace ℂ (Triple d)) : Matrix (Fin d) (Fin d) ℂ :=
  traceRight (pureDensity psi)

/-- II.A p.8: B is the first register of the B–machine pair. -/
def cloneMarginalB {d : ℕ} (psi : EuclideanSpace ℂ (Triple d)) : Matrix (Fin d) (Fin d) ℂ :=
  traceRight (traceLeft (pureDensity psi))

/-- II.A p.8: machine register M is traced last. -/
def marginalMachine {d : ℕ} (psi : EuclideanSpace ℂ (Triple d)) : Matrix (Fin d) (Fin d) ℂ :=
  traceLeft (traceLeft (pureDensity psi))

/-- I.D p.5: a fixed isometry's AB output channel, machine discarded. -/
def cloneChannel {d : ℕ} (V : Matrix (Triple d) (Fin d) ℂ) : Superop (Fin d) (Fin d × Fin d) :=
  fun A p q => ∑ m, (V * A * Vᴴ) (p.1, (p.2, m)) (q.1, (q.2, m))

/-- II.A p.8 Eq.(12), corrected: sqrt(1/3) on normalized Psi+ in BOTH columns.
The minus on the input |1> is retained. The printed sqrt(1/6) in column 2
has squared norm 5/6 and contradicts Eq.(13). -/
def bhMatrix : Matrix (Triple 2) (Fin 2) ℂ :=
  fun p i => if i = 0 then
    if p = (0, (0, 1)) then (Real.sqrt (2 / 3) : ℂ)
    else if p = (0, (1, 0)) ∨ p = (1, (0, 0)) then -(Real.sqrt (1 / 6) : ℂ)
    else 0
  else
    if p = (1, (1, 0)) then -(Real.sqrt (2 / 3) : ℂ)
    else if p = (0, (1, 1)) ∨ p = (1, (0, 1)) then (Real.sqrt (1 / 6) : ℂ)
    else 0

/-- II.A p.8: the linear Buzek–Hillery output on an arbitrary qubit vector. -/
def bhOutput (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Triple 2) :=
  WithLp.toLp 2 (bhMatrix.mulVec psi)

/-- I.E p.6: the larger no-signaling model; no channel hypothesis is imposed.
Covariance (9) is an explicit assumption, independently of equal fidelities. -/
def NoSignalingFamily (F : Superop (Fin 2) (Fin 2 × Fin 2)) (eta : ℝ) : Prop :=
  (∀ psi : EuclideanSpace ℂ (Fin 2), ‖psi‖ = 1 →
    IsDensityMatrix (F (pureDensity psi)) ∧
    traceRight (F (pureDensity psi)) = depol eta (pureDensity psi) ∧
    traceLeft (F (pureDensity psi)) = depol eta (pureDensity psi)) ∧
  (∀ (U : Matrix.unitaryGroup (Fin 2) ℂ) (psi : EuclideanSpace ℂ (Fin 2)), ‖psi‖ = 1 →
    F ((U : Matrix (Fin 2) (Fin 2) ℂ) * pureDensity psi * (U : Matrix (Fin 2) (Fin 2) ℂ)ᴴ) =
      Matrix.kronecker (U : Matrix (Fin 2) (Fin 2) ℂ) (U : Matrix (Fin 2) (Fin 2) ℂ) * F (pureDensity psi) *
        (Matrix.kronecker (U : Matrix (Fin 2) (Fin 2) ℂ) (U : Matrix (Fin 2) (Fin 2) ℂ))ᴴ) ∧
  F (pureDensity (equator 0)) + F (pureDensity (equator Real.pi)) =
    F (pureDensity (ket (0 : Fin 2))) + F (pureDensity (ket (1 : Fin 2)))

/-- II.B p.9: each site's fidelity is the trace of the actual site observable. -/
def singleFidelity {d N M : ℕ} (T : CloneMap d N M) (psi : EuclideanSpace ℂ (Fin d)) (j : Fin M) : ℝ :=
  (siteObservable (pureDensity psi) j * T (pureDensity (coherentTensor N psi))).trace.re

/-- I.D p.5: universality and symmetry mean ONE common fidelity for all inputs/sites.
This does not impose Bose support or covariance on competitors. -/
def UniformCloner {d N M : ℕ} (T : CloneMap d N M) (f : ℝ) : Prop :=
  ∀ psi : EuclideanSpace ℂ (Fin d), ‖psi‖ = 1 → ∀ j : Fin M, singleFidelity T psi j = f

/-- II.B p.9 Eq.(21): numerical common pure-state fidelity. -/
def optimalSingle (d N M : ℕ) : ℝ :=
  (N : ℝ) / M + ((M : ℝ) - N) * (N + 1) / (M * ((N : ℝ) + d))

/-- II.B p.9 Eq.(22): incoherent shuffling after appending maximally mixed blanks.
The Bose compression fixes the accepted corner domain, not the output domain. -/
def shuffleCloner {d N M : ℕ} (hNM : N ≤ M) : CloneMap d N M :=
  fun A => ((d : ℂ)⁻¹ ^ (M - N) *
    (Fintype.card (Equiv.Perm (Fin M)) : ℂ)⁻¹) •
    ∑ p : Equiv.Perm (Fin M),
      let P := QAlgorithms.Schur.tensorPermutation d M p
      P * tensorWithIdentity hNM (boseProjector d N * A * boseProjector d N) * Pᴴ

/-- II.A p.7 Eq.(10): normalized spherical average, uniform azimuth and z.
This is probability measure sin(theta)dtheta dphi/(4pi), with z=cos(theta). -/
def sphereAverage {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : (Fin 3 → ℝ) → E) : E :=
  (1 / (4 * Real.pi) : ℝ) •
    ∫ a in (0 : ℝ)..(2 * Real.pi), ∫ z in (-1 : ℝ)..1,
      f ![Real.sqrt (1 - z ^ 2) * Real.cos a,
          Real.sqrt (1 - z ^ 2) * Real.sin a, z]

/-- II.A p.7: actual random-basis measurement and two copies of its outcome.
Complex traces preserve linearity on non-Hermitian inputs. -/
def randomBasisCloner (A : Matrix (Fin 2) (Fin 2) ℂ) : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ :=
  sphereAverage fun b =>
    let P := finBlochDensity b
    let Q := 1 - P
    (P * A).trace • Matrix.kronecker P P + (Q * A).trace • Matrix.kronecker Q Q

/-- II.C pp.10–11 Fig.2: B+=A; M+=A; A-=B; A+=M (all modulo d).
The resulting basis permutation is (s-w+x,s+w,s+x), NOT the mod-two formula. -/
def distributor (d : ℕ) : Matrix (Triple d) (Triple d) ℂ :=
  fun y x => if y = (x.1 - x.2.1 + x.2.2, (x.1 + x.2.1, x.1 + x.2.2)) then 1 else 0

/-- II.C pp.10–11 Eq.(27): fixed program, independently of the unknown psi. -/
def program (d : ℕ) (a b : ℝ) : EuclideanSpace ℂ (Fin d × Fin d) :=
  (a : ℂ) • QAlgorithms.Papers.Independent.Information100.P22.bell (Fin d) + (b : ℂ) •
    WithLp.toLp 2 (fun p => if p.1.val = 0 then (Real.sqrt d : ℂ)⁻¹ else 0)

/-- II.C pp.10–11: processor applied to input tensor program. -/
def distributorOutput {d : ℕ} (a b : ℝ) (psi : EuclideanSpace ℂ (Fin d)) : EuclideanSpace ℂ (Triple d) :=
  WithLp.toLp 2 ((distributor d).mulVec (tensorVec psi (program d a b)))

/-- II.C Eq.(27): coherent identity/swap output, in the source tensor order. -/
def asymmetricOutput {d : ℕ} (a b : ℝ) (psi : EuclideanSpace ℂ (Fin d)) : EuclideanSpace ℂ (Triple d) :=
  WithLp.toLp 2 fun p => (a : ℂ) * psi p.1 * QAlgorithms.Papers.Independent.Information100.P22.bell (Fin d) p.2 +
    (b : ℂ) * psi p.2.1 * QAlgorithms.Papers.Independent.Information100.P22.bell (Fin d) (p.1, p.2.2)

/-- II.C p.10 Eq.(23): the sharp qubit asymmetric fidelity inequality. -/
def QubitTradeoff (fA fB : ℝ) : Prop :=
  1 / 2 - (1 - fA) - (1 - fB) ≤ Real.sqrt ((1 - fA) * (1 - fB))

/-- II.C p.11 Eqs.(31),(32), II.D p.12 Eq.(42): extend an AB operator
by identity on M and reindex ((A,B),M) to the fixed (A,(B,M)) order. -/
def onFirstTwo {d : ℕ} (A : Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ) :
    Matrix (Triple d) (Triple d) ℂ :=
  (Matrix.kronecker A (1 : Matrix (Fin d) (Fin d) ℂ)).submatrix
    (fun p => ((p.1, p.2.1), p.2.2)) (fun q => ((q.1, q.2.1), q.2.2))

example {d : ℕ} (A : Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ)
    (p q : Triple d) :
    onFirstTwo A p q = A (p.1, p.2.1) (q.1, q.2.1) *
      (1 : Matrix (Fin d) (Fin d) ℂ) p.2.2 q.2.2 := rfl

/-- II.C p.11 Eq.(31): Cerf's ambient operator, not generally unitary. -/
def cerfQubit (v x : ℝ) : Matrix (Triple 2) (Triple 2) ℂ :=
  onFirstTwo ((v : ℂ) • (1 : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ) +
    (x : ℂ) • ∑ k : Fin 3, Matrix.kronecker (sigma k) (sigma k))

/-- II.C p.11 Eq.(33): positive Fourier sign, shift k+m modulo d. -/
def cerfWeyl (d : ℕ) (m n : Fin d) : Matrix (Fin d) (Fin d) ℂ :=
  letI : NeZero d := ⟨Nat.ne_of_gt (lt_of_le_of_lt (Nat.zero_le m.val) m.isLt)⟩
  let e := ZMod.finEquiv d
  (QAlgorithms.Papers.Independent.Information100.P34.weyl (e m) (e n)).submatrix e e

/-- II.C p.11 Eq.(32), corrected: the second Weyl operator is its ADJOINT.
Printed U tensor U fails the swap identity and even the d=2 symmetric test. -/
def cerfQudit (d : ℕ) (v x : ℝ) : Matrix (Triple d) (Triple d) ℂ :=
  onFirstTwo ((v : ℂ) • (1 : Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ) +
    (x : ℂ) • ∑ m : Fin d, ∑ n : Fin d,
      if m.val = 0 ∧ n.val = 0 then 0
      else Matrix.kronecker (cerfWeyl d m n) (cerfWeyl d m n)ᴴ)

/-- II.D p.11 Eq.(34), orthogonal case defined separately to avoid 1/0. -/
def twoStateFidelity (s : ℝ) : ℝ := if s = 0 then 1 else
  1 / 2 + Real.sqrt 2 / (32 * s) * (1 + s) *
    (3 - 3 * s + Real.sqrt (1 - 2 * s + 9 * s ^ 2)) *
    Real.sqrt (-1 + 2 * s + 3 * s ^ 2 + (1 - s) * Real.sqrt (1 - 2 * s + 9 * s ^ 2))

/-- II.D p.12 Eq.(39): the economical isometry on input times blank |0>. -/
def economicMatrix (theta : ℝ) : Matrix (Fin 2 × Fin 2) (Fin 2) ℂ :=
  fun p i => if i = 0 then if p = (0, 0) then 1 else 0
    else if p = (1, 0) then (Real.cos theta : ℂ)
    else if p = (0, 1) then (Real.sin theta : ℂ) else 0

/-- II.D p.12: the actual economical output. -/
def economicOutput (theta : ℝ) (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Fin 2 × Fin 2) :=
  WithLp.toLp 2 ((economicMatrix theta).mulVec psi)

/-- II.D p.12 Eq.(41): restriction to input psi_A tensor Phi+_BM. -/
def phaseClonerMatrix (theta : ℝ) : Matrix (Triple 2) (Fin 2) ℂ :=
  fun p i => (Real.sqrt 2 : ℂ)⁻¹ *
    (if i = 0 then
      if p = (0, (0, 0)) then 1
      else if p = (0, (1, 1)) then (Real.cos theta : ℂ)
      else if p = (1, (0, 1)) then (Real.sin theta : ℂ) else 0
    else
      if p = (1, (0, 0)) then (Real.cos theta : ℂ)
      else if p = (0, (1, 0)) then (Real.sin theta : ℂ)
      else if p = (1, (1, 1)) then 1 else 0)

/-- II.D p.12: phase cloner with machine retained. -/
def phaseOutput (theta : ℝ) (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Triple 2) :=
  WithLp.toLp 2 ((phaseClonerMatrix theta).mulVec psi)

/-- II.D p.12 Eq.(42): parentheses keep I_M outside the WHOLE Pauli sum. -/
def phaseCerf (theta : ℝ) : Matrix (Triple 2) (Triple 2) ℂ :=
  let F := (1 + Real.cos theta) / 2
  onFirstTwo
    ((F : ℂ) • (1 : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ) + ((1 - F : ℝ) : ℂ) • Matrix.kronecker (sigma 2) (sigma 2) +
      (Real.sqrt (F * (1 - F)) : ℂ) •
        (Matrix.kronecker (sigma 0) (sigma 0) + Matrix.kronecker (sigma 1) (sigma 1)))

/-- VI.A p.26 Eq.(103): a Kraus contraction, generally not a projector. -/
def asymmetryFilter (T : ℝ) : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ :=
  ((2 * T - 1 : ℝ) : ℂ) • 1 + ((2 * (1 - T) : ℝ) : ℂ) • pureDensity (bellBasisState 3)

/-- VI.A p.26: successful unnormalized state; filter acts on B and machine. -/
def filteredOutput (T : ℝ) (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Triple 2) :=
  WithLp.toLp 2 ((Matrix.kronecker (1 : Matrix (Fin 2) (Fin 2) ℂ) (asymmetryFilter T)).mulVec (bhOutput psi))

/-- VI.A p.25 Eq.(101): symmetric two-photon projection. -/
def symmetricPair : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ := 1 - pureDensity (bellBasisState 3)

/-- VI.A p.25: bunching success operation, before conditioning. -/
def bunching (A : Matrix (Fin 2) (Fin 2) ℂ) : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ :=
  symmetricPair * Matrix.kronecker A (oneMixed 2) * symmetricPair

/-- II.E pp.13–14: a finite estimator POVM on the actual N-copy Bose corner. -/
structure Estimator (N : ℕ) where
  outcomes : ℕ
  effects : Fin outcomes → TensorMat 2 N
  positive : ∀ i, (effects i).PosSemidef
  complete : ∑ i, effects i = boseProjector 2 N
  guess : Fin outcomes → EuclideanSpace ℂ (Fin 2)
  normalized : ∀ i, ‖guess i‖ = 1

/-- II.E p.13: restored N-fold input in the outcome probability. -/
def estimationOutput {N : ℕ} (E : Estimator N) (psi : EuclideanSpace ℂ (Fin 2)) : Matrix (Fin 2) (Fin 2) ℂ :=
  ∑ i, (E.effects i * pureDensity (coherentTensor N psi)).trace • pureDensity (E.guess i)

/-- II.E p.14: coefficient of the optimal qubit estimator. -/
def estimationShrink (N : ℕ) : ℝ := (N : ℝ) / (N + 2)

/-- IV.B pp.20–22: mutual information of uniform binary variables with agreement p. -/
def binaryInformation (p : ℝ) : ℝ := 1 - binEntropy2 p

/-- IV.B p.20 Eq.(81): displayed raw information rate, without preprocessing. -/
def rawRate (iab iae ibe : ℝ) : ℝ := iab - min iae ibe

/-- IV.B p.21: actual sifted x-basis law of the economical attack; bits are uniform. -/
def economicLaw (theta : ℝ) (a b e : Bool) : ℝ :=
  (1 / 2) * pureFidelity
    (tensorVec (equator (if b then Real.pi else 0)) (equator (if e then Real.pi else 0)))
    (pureDensity (economicOutput theta (equator (if a then Real.pi else 0))))

/-- IV.B p.20: mutual information in bits, with the standard 0 log 0 convention.
Only genuine normalized finite probability laws occur in statements. -/
def classicalMutualInformation {I J : Type*} [Fintype I] [Fintype J] (p : I → J → ℝ) : ℝ :=
  ∑ i, ∑ j, p i j * Real.log (p i j / ((∑ y, p i y) * ∑ x, p x j)) / Real.log 2

/-- IV.B p.21: marginal AB of a three-bit law. -/
def infoAB (p : Bool → Bool → Bool → ℝ) : ℝ :=
  classicalMutualInformation fun a b => ∑ e, p a b e

/-- IV.B p.21: marginal AE of a three-bit law. -/
def infoAE (p : Bool → Bool → Bool → ℝ) : ℝ :=
  classicalMutualInformation fun a e => ∑ b, p a b e

/-- IV.B p.21: marginal BE of a three-bit law. -/
def infoBE (p : Bool → Bool → Bool → ℝ) : ℝ :=
  classicalMutualInformation fun b e => ∑ a, p a b e

/-- IV.B pp.21–22: Eve's actual two-qubit state given Alice's raw bit. -/
def eveGivenAlice (theta : ℝ) (a : Bool) : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ :=
  traceLeft (pureDensity (phaseOutput theta (equator (if a then Real.pi else 0))))

/-- IV.C p.22: Eve's conditional state given Bob's equiprobable sifted bit.
The factor two is Bayes normalization, not an assumed independent output. -/
def eveGivenBob (theta : ℝ) (b : Bool) : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ :=
  let average := (1 / 2 : ℂ) •
    (pureDensity (phaseOutput theta (equator 0)) + pureDensity (phaseOutput theta (equator Real.pi)))
  (2 : ℂ) • traceLeft
    (Matrix.kronecker (pureDensity (equator (if b then Real.pi else 0)))
      (1 : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ) * average)

/-- IV.C p.22 Eq.(86): equiprobable binary Holevo quantity, in bits. -/
def binaryHolevo {I : Type*} [Fintype I] [DecidableEq I]
    (rho0 rho1 : Matrix I I ℂ) : ℝ :=
  vnEntropy ((1 / 2 : ℂ) • (rho0 + rho1)) - (vnEntropy rho0 + vnEntropy rho1) / 2

/-- IV.C p.22 Eq.(85): the stated attack's raw collective rate. -/
def collectiveRate (theta : ℝ) : ℝ :=
  binaryInformation ((1 + Real.cos theta) / 2) -
    min (binaryHolevo (eveGivenAlice theta false) (eveGivenAlice theta true))
      (binaryHolevo (eveGivenBob theta false) (eveGivenBob theta true))

/-- IV.B p.21: the specified Bell-to-computational decoder, retaining phases. -/
def bellDecoder : Matrix (Fin 2 × Fin 2) (Fin 2 × Fin 2) ℂ :=
  fun p q => ∑ k : Fin 4,
    if p = (![ (0, 0), (1, 1), (1, 0), (0, 1)] : Fin 4 → (Fin 2 × Fin 2)) k
    then conj (bellBasisState k q) else 0

/-- IV.B p.22: the binary pure states to be discriminated after reading Eve's flag. -/
def discriminationState (theta : ℝ) (bit : Bool) : EuclideanSpace ℂ (Fin 2) :=
  WithLp.toLp 2 ![(Real.sqrt ((1 + Real.cos theta) / 2) : ℂ),
    (if bit then -1 else 1) * (Real.sqrt ((1 - Real.cos theta) / 2) : ℂ)]

/-- IV.B pp.21–22 Eq.(84): normalized state after the fixed Bell decoder. -/
def decodedAttack (theta : ℝ) (bit : Bool) : EuclideanSpace ℂ (Triple 2) :=
  WithLp.toLp 2 ((Matrix.kronecker (1 : Matrix (Fin 2) (Fin 2) ℂ) bellDecoder).mulVec
    (phaseOutput theta (equator (if bit then Real.pi else 0))))

/-- IV.B pp.21–22 Eq.(84): factorization displaying the deterministic error flag. -/
def flagFactorization (theta : ℝ) (bit : Bool) : EuclideanSpace ℂ (Triple 2) :=
  (Real.sqrt ((1 + Real.cos theta) / 2) : ℂ) •
      tensorVec (equator (if bit then Real.pi else 0)) (tensorVec (discriminationState theta bit) (ket (0 : Fin 2))) +
    ((if bit then 1 else -1) * (Real.sqrt ((1 - Real.cos theta) / 2) : ℂ)) •
      tensorVec (equator (if bit then 0 else Real.pi)) (tensorVec (discriminationState theta (!bit)) (ket (1 : Fin 2)))

/-- IV.B p.22: Eve reads E2 in Z and E1 in X after the Bell decoder. -/
def ancillaLaw (theta : ℝ) (a b : Bool) (e : Bool × Bool) : ℝ :=
  (1 / 2) * pureFidelity
    (tensorVec (equator (if b then Real.pi else 0))
      (tensorVec (equator (if e.1 then Real.pi else 0)) (ket (if e.2 then (1 : Fin 2) else 0))))
    (pureDensity (decodedAttack theta a))

/-- Appendix A: small tests pin the tensor order, Y sign and endpoint conventions. -/
example : sigma 1 0 1 = -Complex.I := by simp [sigma, QAlgorithms.QubitChannels.sigma, pauliY]

example : bhMatrix (0, (0, 1)) 0 = (Real.sqrt (2 / 3) : ℂ) := by simp [bhMatrix]

example : distributor 2 (1, (1, 1)) (1, (0, 0)) = 1 := by norm_num [distributor]

example : program 2 1 0 = QAlgorithms.Papers.Independent.Information100.P22.bell (Fin 2) := by simp [program]

example (psi : EuclideanSpace ℂ (Fin 2)) : asymmetricOutput 1 0 psi = tensorVec psi (QAlgorithms.Papers.Independent.Information100.P22.bell (Fin 2)) := by
  ext p
  simp [asymmetricOutput, tensorVec]

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

example : economicMatrix 0 (1, 0) 1 = 1 := by simp [economicMatrix]

example : asymmetryFilter 1 = 1 := by norm_num [asymmetryFilter]

example : estimationShrink 0 = 0 := by norm_num [estimationShrink]

example (f : (Fin 3 → ℝ) → ℝ) (h : ∀ b, f b = 0) : sphereAverage f = 0 := by
  simp [sphereAverage, h]

/-- II.A.3 p.8 footnote 10: random-basis estimate followed by the opposite state. -/
def measureNot (A : Matrix (Fin 2) (Fin 2) ℂ) : Matrix (Fin 2) (Fin 2) ℂ :=
  sphereAverage fun b =>
    let P := finBlochDensity b
    let Q := 1 - P
    (P * A).trace • Q + (Q * A).trace • P

/-- Appendix A p.30 Eq.(A4): spherical representative of a pure-state ray. -/
def spherical (theta azimuth : ℝ) : EuclideanSpace ℂ (Fin 2) :=
  WithLp.toLp 2 ![(Real.cos (theta / 2) : ℂ),
    Complex.exp (Complex.I * (azimuth : ℂ)) * (Real.sin (theta / 2) : ℂ)]

/-- VI.A.1 p.25 Eq.(97): normalized first-order singlet-pair creation amplitude.
The two signal photons are represented in their normalized symmetric tensor sector. -/
def pdcFirstOrder (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Triple 2) :=
  WithLp.toLp 2 fun p => (Real.sqrt 6 : ℂ)⁻¹ * ∑ j : Fin 2,
    (psi p.1 * (if p.2.1 = j then 1 else 0) +
     (if p.1 = j then 1 else 0) * psi p.2.1) * orthogonalQubit (ket j) p.2.2

/-- VI.A.1 pp.25–26: the selected three-photon bunching amplitude, before normalization. -/
def bunchingVector (psi : EuclideanSpace ℂ (Fin 2)) : EuclideanSpace ℂ (Triple 2) :=
  WithLp.toLp 2 fun p => ∑ a : Fin 2, ∑ b : Fin 2,
    symmetricPair (p.1, p.2.1) (a, b) * psi a * bellBasisState 3 (b, p.2.2)

/-- VI.A.3 p.28 Eq.(105): coherent equal-coupling one-emission map for d modes.
The two signal factors are symmetrized and the emitting ground mode is retained.
This constructs the action on superpositions, rather than specifying basis fidelities. -/
def modeEmission (d : ℕ) : Matrix (Triple d) (Fin d) ℂ :=
  fun p i => (Real.sqrt (2 * ((d : ℝ) + 1)) : ℂ)⁻¹ *
    ((if p.1 = i ∧ p.2.1 = p.2.2 then 1 else 0) +
     (if p.2.1 = i ∧ p.1 = p.2.2 then 1 else 0))

/-- VI.A.3 p.28: actual output vector in the selected one-emission sector. -/
def modeOutput {d : ℕ} (psi : EuclideanSpace ℂ (Fin d)) : EuclideanSpace ℂ (Triple d) :=
  WithLp.toLp 2 ((modeEmission d).mulVec psi)

example : spherical 0 0 = ket (0 : Fin 2) := by
  ext i
  fin_cases i <;> simp [spherical, ket]

example : measureNot 0 = 0 := by simp [measureNot, sphereAverage]

example (d : ℕ) : modeOutput (0 : EuclideanSpace ℂ (Fin d)) = 0 := by simp [modeOutput]

open QAlgorithms.Papers.Independent.Claimed50.P30
  (ModeHilbert ModeOperator IsModeDensity FockWeylSystem)
open QAlgorithms.Papers.Independent.Renew46.P41
  (coherentProduct NormalizedCoherent IsReducedDensity FockCanonicalAction
   ModeUnitary twoModeAmplifierQuadratures modeMixingQuadratures embeddedOpticalBeam
   displacedThermal cloneNoise cloneFidelity)

open QAlgorithms.Papers.Independent.Dependency50.P39 (coherentProjector)

/-- III.A p.15: identify a one-mode occupation tuple with its sole photon number. -/
def oneModeOccupation : (Fin 1 → ℕ) ≃ ℕ where
  toFun j := j 0
  invFun n := fun _ => n
  left_inv j := by
    funext k
    exact congrArg j (Subsingleton.elim (0 : Fin 1) k)
  right_inv _ := rfl

/-- III.A p.15: the complete one-mode Fock space in the source's tuple coordinates.
This is only a basis relabeling; no cutoff, state choice or extra hypothesis. -/
def oneModeCoordinates :
    QAlgorithms.Papers.Independent.Dependency50.P39.Fock ≃ₗᵢ[ℂ] ModeHilbert 1 where
  toLinearEquiv :=
    { toFun := fun u => ⟨fun j => u (oneModeOccupation j),
        memℓp_gen (oneModeOccupation.summable_iff.mpr
          ((lp.memℓp u).summable (by norm_num)))⟩
      invFun := fun u => ⟨fun n => u (oneModeOccupation.symm n),
        memℓp_gen (oneModeOccupation.symm.summable_iff.mpr
          ((lp.memℓp u).summable (by norm_num)))⟩
      left_inv := by intro u; ext n; simp
      right_inv := by intro u; ext j; simp
      map_add' := by intro u v; rfl
      map_smul' := by intro c u; rfl }
  norm_map' := by
    intro u
    rw [lp.norm_eq_tsum_rpow (by norm_num), lp.norm_eq_tsum_rpow (by norm_num)]
    congr 1
    exact oneModeOccupation.tsum_eq (fun n => ‖u n‖ ^ (2 : ENNReal).toReal)

/-- III.A p.15: reuse the frozen coherent projector, transported to one-mode
occupation tuples by unitary conjugation. No coherent state is redefined here. -/
def oneModeProjector (alpha : ℂ) : ModeOperator 1 :=
  (oneModeCoordinates.toContinuousLinearEquiv.toContinuousLinearMap.comp
    (coherentProjector alpha)).comp
    oneModeCoordinates.symm.toContinuousLinearEquiv.toContinuousLinearMap

example (n : ℕ) : oneModeOccupation (fun _ => n) = n := rfl

example (u : QAlgorithms.Papers.Independent.Dependency50.P39.Fock)
    (j : Fin 1 → ℕ) : oneModeCoordinates u j = u (j 0) := rfl

example (alpha : ℂ) : oneModeProjector alpha =
    (oneModeCoordinates.toContinuousLinearEquiv.toContinuousLinearMap.comp
      (coherentProjector alpha)).comp
      oneModeCoordinates.symm.toContinuousLinearEquiv.toContinuousLinearMap := rfl

/-- III.A p.15 Eq.(53): normalized complex-plane noise density; t means sigma^2. -/
def noiseWeight (t : ℝ) (beta : ℂ) : ℝ :=
  Real.exp (-Complex.normSq beta / t) / (Real.pi * t)

/-- III.A p.15 Eq.(53): actual operator-valued mixture, with the t=0 boundary
set to the pure density rather than Lean's zero value of a singular integral. -/
def gaussianMixture (t : ℝ) (alpha : ℂ) : ModeOperator 1 :=
  if t = 0 then oneModeProjector alpha
  else ∫ beta : ℂ, (noiseWeight t beta : ℂ) • oneModeProjector (alpha + beta)

/-- III.A p.15: a Stinespring isometry represents a fixed normal CPTP channel.
One full oscillator environment is separable and accommodates arbitrary countable
Kraus rank; no photon cutoff is introduced in any register. -/
abbrev OscillatorCloner (N M : ℕ) := ModeHilbert N →ₗᵢ[ℂ] ModeHilbert (M + 1)

/-- III.A p.15: identical coherent input replicas, no extra input degrees of freedom. -/
def coherentReplicas (N : ℕ) (alpha : ℂ) : ModeHilbert N :=
  coherentProduct (fun _ : Fin N => alpha)

/-- III.A p.15: permutation of the M clone modes leaving the environment fixed. -/
def permuteCloneOccupation {M : ℕ} (p : Equiv.Perm (Fin M))
    (j : Fin (M + 1) → ℕ) : Fin (M + 1) → ℕ :=
  fun k => if h : k.val < M then j ⟨(p ⟨k.val, h⟩).val, by omega⟩ else j k

/-- III.A p.15: exactly the source SGC restrictions on coherent inputs.
Bose support is retained, but no all-input Gaussian channel action is assumed. -/
def SymmetricGaussian {N M : ℕ} (V : OscillatorCloner N M) (t : ℝ) : Prop :=
  0 ≤ t ∧ ∀ alpha : ℂ,
    NormalizedCoherent (fun _ : Fin N => alpha) ∧
    (∀ p : Equiv.Perm (Fin M), ∀ j : Fin (M + 1) → ℕ,
      V (coherentReplicas N alpha) (permuteCloneOccupation p j) = V (coherentReplicas N alpha) j) ∧
    ∀ k : Fin M,
      IsReducedDensity
        (InnerProductSpace.rankOne ℂ (V (coherentReplicas N alpha)) (V (coherentReplicas N alpha)))
        ⟨k.val, by omega⟩ (gaussianMixture t alpha)

/-- III.C p.19 Eq.(79): normalized prior density, Sigma>0 required in uses. -/
def priorWeight (Sigma : ℝ) (alpha : ℂ) : ℝ :=
  Real.exp (-Complex.normSq alpha / (2 * Sigma ^ 2)) / (2 * Real.pi * Sigma ^ 2)

/-- III.C p.19: physically allowed gain. The printed gain formula is restricted
to the broad-prior branch; below the threshold G=1, forced by Eq.(80). -/
def priorGain (Sigma : ℝ) : ℝ :=
  if 1 / 2 + 1 / Real.sqrt 2 ≤ Sigma ^ 2 then 8 * Sigma ^ 4 / (2 * Sigma ^ 2 + 1) ^ 2 else 1

/-- III.C p.19 Eq.(80): reciprocal in the narrow-prior branch, as printed. -/
def priorFidelity (Sigma : ℝ) : ℝ :=
  if 1 / 2 + 1 / Real.sqrt 2 ≤ Sigma ^ 2 then (4 * Sigma ^ 2 + 2) / (6 * Sigma ^ 2 + 1)
  else 1 / ((3 - 2 * Real.sqrt 2) * Sigma ^ 2 + 1)

/-- III.C p.19: one actual reduced clone of the amplifier/splitter construction. -/
def priorClone (W : FockWeylSystem 1) (Sigma : ℝ) (alpha : ℂ) : ModeOperator 1 :=
  displacedThermal W ((Real.sqrt (priorGain Sigma / 2) : ℂ) * alpha) ((priorGain Sigma - 1) / 2)

/-- III.C p.19: average figure of merit; no pointwise universality is required. -/
def priorIntegrand (W : FockWeylSystem 1) (Sigma : ℝ) (alpha : ℂ) : ℝ :=
  priorWeight Sigma alpha *
    (inner ℂ (coherentProduct (fun _ : Fin 1 => alpha))
      (priorClone W Sigma alpha (coherentProduct (fun _ : Fin 1 => alpha)))).re

example (alpha : ℂ) : gaussianMixture 0 alpha = oneModeProjector alpha := by
  simp [gaussianMixture]

example : priorGain 0 = 1 := by norm_num [priorGain]; positivity

example {M : ℕ} (j : Fin (M + 1) → ℕ) :
    permuteCloneOccupation (Equiv.refl (Fin M)) j = j := by
  funext k
  simp [permuteCloneOccupation]

/-- III.A.2 p.16: centered displacement noise with finite added quadrature
variances. A genuine probability measure supplies symmetric classical covariance;
no defective frozen moment predicate is used. Singular noise laws are allowed. -/
structure DisplacementNoise where
  law : Measure (ℝ × ℝ)
  probability : IsProbabilityMeasure law
  finiteX : Integrable (fun z : ℝ × ℝ => z.1 ^ 2) law
  finiteP : Integrable (fun z : ℝ × ℝ => z.2 ^ 2) law
  centeredX : (∫ z : ℝ × ℝ, z.1 ∂law) = 0
  centeredP : (∫ z : ℝ × ℝ, z.2 ∂law) = 0

/-- III.A.2 p.16: added x VARIANCE, not standard deviation or total output variance. -/
def addedX (mu : DisplacementNoise) : ℝ := ∫ z : ℝ × ℝ, z.1 ^ 2 ∂mu.law

/-- III.A.2 p.16: added p variance in the hbar=1 convention. -/
def addedP (mu : DisplacementNoise) : ℝ := ∫ z : ℝ × ℝ, z.2 ^ 2 ∂mu.law

/-- III.A.2 p.16: displacement alpha=(x+i p)/sqrt(2), with a fixed law
independent of the unknown coherent input. -/
def noiseMixture (mu : DisplacementNoise) (alpha : ℂ) : ModeOperator 1 :=
  ∫ z : ℝ × ℝ,
    oneModeProjector (alpha + ((z.1 : ℂ) + Complex.I * (z.2 : ℂ)) / (Real.sqrt 2 : ℂ)) ∂mu.law

/-- V.B p.24 Eq.(93): permutation-symmetric atomic sector, with i photons
emitted into the wrong polarization, j into the initial polarization, and
A-i-j atoms still excited. This is an exact finite excitation sector, not a cutoff. -/
abbrev EmissionSector (A : ℕ) :=
  {q : Fin (A + 1) × Fin (A + 1) // q.1.val + q.2.val ≤ A}

/-- V.B p.24 Eq.(93): stimulated creation part in the normalized symmetric
atomic occupation basis. The square roots include BOTH photon and atom occupation
factors. N input photons and A excited atoms are different parameters. -/
def emissionRaising (N A : ℕ) : Matrix (EmissionSector A) (EmissionSector A) ℂ :=
  fun q r =>
    (if q.val.1 = r.val.1 ∧ q.val.2.val = r.val.2.val + 1 then
      (Real.sqrt (((N : ℝ) + r.val.2.val + 1) * (r.val.2.val + 1) *
        ((A : ℝ) - r.val.1.val - r.val.2.val)) : ℂ) else 0) +
    (if q.val.2 = r.val.2 ∧ q.val.1.val = r.val.1.val + 1 then
      (Real.sqrt ((r.val.1.val + 1 : ℝ) ^ 2 *
        ((A : ℝ) - r.val.1.val - r.val.2.val)) : ℂ) else 0)

/-- V.B p.24 Eq.(93): full Hermitian equal-coupling Hamiltonian on the conserved
sector. Reabsorption is retained by adding the adjoint. -/
def emissionHamiltonian (N A : ℕ) (g : ℝ) : Matrix (EmissionSector A) (EmissionSector A) ℂ :=
  (g : ℂ) • (emissionRaising N A + (emissionRaising N A)ᴴ)

/-- V.B p.24: all A atoms excited, no new photons yet. -/
def emissionInitial (A : ℕ) : EmissionSector A := ⟨(0, 0), by simp⟩

/-- V.B p.24: FULL e^(-iHt) evolution, not just the H^k short-time term. -/
def emissionState (N A : ℕ) (g t : ℝ) : EuclideanSpace ℂ (EmissionSector A) :=
  WithLp.toLp 2
    ((NormedSpace.exp ((-Complex.I * (t : ℂ)) • emissionHamiltonian N A g)).mulVec
      (ket (emissionInitial A)))

/-- V.B p.24 Eq.(92): unnormalized joint probability of k added photons,
l of them in the initial polarization. Impossible events have probability zero. -/
def emissionProbability (N A k l : ℕ) (g t : ℝ) : ℝ :=
  ∑ q : EmissionSector A,
    if q.val.1.val + q.val.2.val = k ∧ q.val.2.val = l
    then Complex.normSq (emissionState N A g t q) else 0

/-- V.B p.24 Eq.(91): physical probability of the selected photon count. -/
def emissionSuccess (N A k : ℕ) (g t : ℝ) : ℝ :=
  ∑ l ∈ Finset.range (k + 1), emissionProbability N A k l g t

example (N A : ℕ) : emissionHamiltonian N A 0 = 0 := by
  simp [emissionHamiltonian]

example (A : ℕ) : (emissionInitial A).val = (0, 0) := rfl

end QAlgorithms.Papers.Independent.Extend50.P40
Source
Quantum cloning, arXiv:quant-ph/0511088v1, https://arxiv.org/abs/quant-ph/0511088v1
Read-back

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

QAlgorithms.Papers.Independent.Extend50.P40.DisplacementNoise

A displacement-noise object consists of a measure μ\muμ on R2\mathbb R^2R2, together with the requirements that μ\muμ is a probability measure, both coordinate-square functions are integrable, and both coordinate integrals vanish:

μ(R2)=1,∫R2x2 dμ<∞,∫R2p2 dμ<∞,∫R2x dμ=∫R2p dμ=0.\mu(\mathbb R^2)=1,\qquad \int_{\mathbb R^2}x^2\,d\mu<\infty,\qquad \int_{\mathbb R^2}p^2\,d\mu<\infty,\qquad \int_{\mathbb R^2}x\,d\mu=\int_{\mathbb R^2}p\,d\mu=0.μ(R2)=1,∫R2​x2dμ<∞,∫R2​p2dμ<∞,∫R2​xdμ=∫R2​pdμ=0.

There is no requirement of independence, equal second moments, or a density with respect to Lebesgue measure; measures concentrated at a point are included when these conditions hold.

QAlgorithms.Papers.Independent.Extend50.P40.EmissionSector

For every natural number AAA, the emission-sector type is the finite set

EA={(u,v)∈{0,…,A}2:u+v≤A}.\mathcal E_A=\{(u,v)\in\{0,\ldots,A\}^2:u+v\le A\}.EA​={(u,v)∈{0,…,A}2:u+v≤A}.

Both coordinates are natural numbers, and A=0A=0A=0 is included, in which case the only element is (0,0)(0,0)(0,0).

QAlgorithms.Papers.Independent.Extend50.P40.Estimator

For every natural number NNN, including N=0N=0N=0, an estimator consists of a natural number rrr of outcomes, complex matrices EiE_iEi​ indexed by pairs of binary words of length NNN, and vectors gi∈C2g_i\in\mathbb C^2gi​∈C2, for 0≤i<r0\le i<r0≤i<r, subject to

Ei⪰0,∑i=0r−1Ei=BN,∥gi∥=1,E_i\succeq0,\qquad \sum_{i=0}^{r-1}E_i=B_N,\qquad \|g_i\|=1,Ei​⪰0,i=0∑r−1​Ei​=BN​,∥gi​∥=1,

where

BN=1N!∑π∈SNPπ,(Pπ)y,x={1y=x∘π−1,0otherwise.B_N=\frac1{N!}\sum_{\pi\in S_N}P_\pi, \qquad (P_\pi)_{y,x}= \begin{cases} 1&y=x\circ\pi^{-1},\\ 0&\text{otherwise}. \end{cases}BN​=N!1​π∈SN​∑​Pπ​,(Pπ​)y,x​={10​y=x∘π−1,otherwise.​

There is no separate requirement that r>0r>0r>0; if r=0r=0r=0, completeness requires the empty sum 000 to equal BNB_NBN​. For N=0N=0N=0, the word space has one element and B0B_0B0​ is its identity matrix.

QAlgorithms.Papers.Independent.Extend50.P40.NoSignalingFamily

For an arbitrary function FFF from complex 2×22\times22×2 matrices to complex matrices indexed by {0,1}2\{0,1\}^2{0,1}2, and any real number η\etaη, this predicate is the conjunction of the following requirements. For every unit vector ψ∈C2\psi\in\mathbb C^2ψ∈C2, writing ρψ=ψψ†\rho_\psi=\psi\psi^\daggerρψ​=ψψ†, the matrix F(ρψ)F(\rho_\psi)F(ρψ​) is positive semidefinite with trace 111, and both its partial traces equal ηρψ+1−η2Tr⁡(ρψ)I2\eta\rho_\psi+\frac{1-\eta}{2}\operatorname{Tr}(\rho_\psi)I_2ηρψ​+21−η​Tr(ρψ​)I2​; explicitly, these partial traces have entries ∑bF(ρψ)(i,b),(j,b)\sum_b F(\rho_\psi)_{(i,b),(j,b)}∑b​F(ρψ​)(i,b),(j,b)​ and ∑aF(ρψ)(a,i),(a,j)\sum_a F(\rho_\psi)_{(a,i),(a,j)}∑a​F(ρψ​)(a,i),(a,j)​. For every unitary 2×22\times22×2 matrix UUU and every such ψ\psiψ,

F(UρψU†)=(U⊗U)F(ρψ)(U⊗U)†.F(U\rho_\psi U^\dagger)=(U\otimes U)F(\rho_\psi)(U\otimes U)^\dagger.F(Uρψ​U†)=(U⊗U)F(ρψ​)(U⊗U)†.

Finally,

F(∣+⟩⟨+∣)+F(∣−⟩⟨−∣)=F(∣0⟩⟨0∣)+F(∣1⟩⟨1∣),∣±⟩=∣0⟩±∣1⟩2.F(|+\rangle\langle+|)+F(|-\rangle\langle-|) =F(|0\rangle\langle0|)+F(|1\rangle\langle1|), \qquad |\pm\rangle=\frac{|0\rangle\pm|1\rangle}{\sqrt2}.F(∣+⟩⟨+∣)+F(∣−⟩⟨−∣)=F(∣0⟩⟨0∣)+F(∣1⟩⟨1∣),∣±⟩=2​∣0⟩±∣1⟩​.

The definition imposes no restriction on η\etaη, and does not assume that FFF is linear or a channel.

QAlgorithms.Papers.Independent.Extend50.P40.OscillatorCloner

For arbitrary natural numbers N,MN,MN,M, this abbreviates the type of complex linear isometric maps

ℓ2(({0,…,N−1}→N);C)⟶ℓ2(({0,…,M}→N);C).\ell^2((\{0,\ldots,N-1\}\to\mathbb N);\mathbb C) \longrightarrow \ell^2((\{0,\ldots,M\}\to\mathbb N);\mathbb C).ℓ2(({0,…,N−1}→N);C)⟶ℓ2(({0,…,M}→N);C).

Such maps preserve norms and need not be surjective. Neither N>0N>0N>0 nor N≤MN\le MN≤M is required; when N=0N=0N=0, the source coordinate set consists of the unique empty function.

QAlgorithms.Papers.Independent.Extend50.P40.QubitTradeoff

For arbitrary real numbers fA,fBf_A,f_BfA​,fB​, this defines the proposition

12−(1−fA)−(1−fB)≤(1−fA)(1−fB).\frac12-(1-f_A)-(1-f_B) \le \sqrt{(1-f_A)(1-f_B)}.21​−(1−fA​)−(1−fB​)≤(1−fA​)(1−fB​)​.

There is no assumption that either parameter lies in [0,1][0,1][0,1]. The square root is the real square root, defined to be 000 for a negative argument.

QAlgorithms.Papers.Independent.Extend50.P40.SymmetricGaussian

For arbitrary natural numbers N,MN,MN,M, a complex linear isometry V:HN→HM+1V:H_N\to H_{M+1}V:HN​→HM+1​, where Hr=ℓ2(({0,…,r−1}→N);C)H_r=\ell^2((\{0,\ldots,r-1\}\to\mathbb N);\mathbb C)Hr​=ℓ2(({0,…,r−1}→N);C), and t∈Rt\in\mathbb Rt∈R, this predicate requires t≥0t\ge0t≥0 and the following conditions for every α∈C\alpha\in\mathbb Cα∈C. Define

aN,α(j)=∏r=0N−1e−∣α∣2/2αj(r)j(r)!,CN(α)=∑jaN,α(j)ej.a_{N,\alpha}(j)=\prod_{r=0}^{N-1} e^{-|\alpha|^2/2}\frac{\alpha^{j(r)}}{\sqrt{j(r)!}}, \qquad C_N(\alpha)=\sum_j a_{N,\alpha}(j)e_j.aN,α​(j)=r=0∏N−1​e−∣α∣2/2j(r)!​αj(r)​,CN​(α)=j∑​aN,α​(j)ej​.

The family in this sum must be summable, CN(α)(j)=aN,α(j)C_N(\alpha)(j)=a_{N,\alpha}(j)CN​(α)(j)=aN,α​(j) for every jjj, and ∥CN(α)∥=1\|C_N(\alpha)\|=1∥CN​(α)∥=1. Writing Ψα=VCN(α)\Psi_\alpha=VC_N(\alpha)Ψα​=VCN​(α), it also requires Ψα(jp)=Ψα(j)\Psi_\alpha(j_p)=\Psi_\alpha(j)Ψα​(jp​)=Ψα​(j) for every permutation ppp of the first MMM positions and every occupation function jjj, where jp(k)=j(p(k))j_p(k)=j(p(k))jp​(k)=j(p(k)) for k<Mk<Mk<M and jp(M)=j(M)j_p(M)=j(M)jp​(M)=j(M). Finally, for every k<Mk<Mk<M, the operator Gt(α)G_t(\alpha)Gt​(α) on H1H_1H1​ must be a density operator and must satisfy, for every a,b:{0}→Na,b:\{0\}\to\mathbb Na,b:{0}→N,

∑e:{r∈{0,…,M}:r≠k}→NΨα(ins⁡k(a(0),e)) Ψα(ins⁡k(b(0),e))‾=(Gt(α)eb)(a),\sum_{e:\{r\in\{0,\ldots,M\}:r\ne k\}\to\mathbb N} \Psi_\alpha(\operatorname{ins}_k(a(0),e))\, \overline{\Psi_\alpha(\operatorname{ins}_k(b(0),e))} = \bigl(G_t(\alpha)e_b\bigr)(a),e:{r∈{0,…,M}:r=k}→N∑​Ψα​(insk​(a(0),e))Ψα​(insk​(b(0),e))​=(Gt​(α)eb​)(a),

with the displayed family summing to the right-hand side; ins⁡k(s,e)\operatorname{ins}_k(s,e)insk​(s,e) puts sss at position kkk and eee elsewhere. Here G0(α)=∣Jcα⟩⟨Jcα∣G_0(\alpha)=|Jc_\alpha\rangle\langle Jc_\alpha|G0​(α)=∣Jcα​⟩⟨Jcα​∣, and for t>0t>0t>0,

Gt(α)=∫Ce−∣β∣2/tπt∣Jcα+β⟩⟨Jcα+β∣ dβ.G_t(\alpha)=\int_{\mathbb C}\frac{e^{-|\beta|^2/t}}{\pi t} |Jc_{\alpha+\beta}\rangle\langle Jc_{\alpha+\beta}|\,d\beta.Gt​(α)=∫C​πte−∣β∣2/t​∣Jcα+β​⟩⟨Jcα+β​∣dβ.

The map JJJ is Ju(j)=u(j(0))Ju(j)=u(j(0))Ju(j)=u(j(0)), and czc_zcz​ is chosen with coordinates e−∣z∣2/2zr/r!e^{-|z|^2/2}z^r/\sqrt{r!}e−∣z∣2/2zr/r!​ if such a square-summable vector exists, and is zero otherwise; the integral is the total Bochner integral. “Density operator” here means self-adjoint, nonnegative quadratic form, summable diagonal with sum 111, and admitting a representation Th=∑r⟨vr,h⟩urTh=\sum_r\langle v_r,h\rangle u_rTh=∑r​⟨vr​,h⟩ur​ with ∑r∥ur∥∥vr∥<∞\sum_r\|u_r\|\|v_r\|<\infty∑r​∥ur​∥∥vr​∥<∞. There is no requirement that N>0N>0N>0, M>0M>0M>0, or N≤MN\le MN≤M; when M=0M=0M=0, the reduced-density conditions are vacuous.

QAlgorithms.Papers.Independent.Extend50.P40.Triple

For every natural number ddd, Triple(d)\mathrm{Triple}(d)Triple(d) is the set of triples (a,(b,c))(a,(b,c))(a,(b,c)) with a,b,c∈{0,…,d−1}a,b,c\in\{0,\ldots,d-1\}a,b,c∈{0,…,d−1}, with the indicated nesting of pairs. For d=0d=0d=0 this set is empty.

QAlgorithms.Papers.Independent.Extend50.P40.UniformCloner

For arbitrary natural numbers d,N,Md,N,Md,N,M, a function TTT from complex matrices on length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} to complex matrices on length-MMM words, and a real number fff, this predicate requires that for every unit vector ψ∈Cd\psi\in\mathbb C^dψ∈Cd and every j∈{0,…,M−1}j\in\{0,\ldots,M-1\}j∈{0,…,M−1},

Re⁡Tr⁡ ⁣(Aj T(vNvN†))=f,vN(x)=∏k=0N−1ψxk,(Aj)x,y=ψxjψyj‾∏ℓ≠j1{xℓ=yℓ}.\operatorname{Re}\operatorname{Tr}\!\left(A_j\,T(v_Nv_N^\dagger)\right)=f, \quad v_N(x)=\prod_{k=0}^{N-1}\psi_{x_k}, \quad (A_j)_{x,y}=\psi_{x_j}\overline{\psi_{y_j}}\prod_{\ell\ne j}\mathbf1_{\{x_\ell=y_\ell\}}.ReTr(Aj​T(vN​vN†​))=f,vN​(x)=k=0∏N−1​ψxk​​,(Aj​)x,y​=ψxj​​ψyj​​​ℓ=j∏​1{xℓ​=yℓ​}​.

It includes no channel, linearity, or symmetry assumption on TTT. The condition is vacuous if M=0M=0M=0, and also if d=0d=0d=0, because C0\mathbb C^0C0 has no unit vector; N=0N=0N=0 is allowed, with v0=1v_0=1v0​=1 on the unique empty word.

QAlgorithms.Papers.Independent.Extend50.P40.addedP

For every displacement-noise object μ\muμ, whose underlying measure on R2\mathbb R^2R2 is a probability measure with integrable coordinate squares and zero coordinate means, the definition assigns the real number

addedP⁡(μ)=∫R2p2 dμ(x,p).\operatorname{addedP}(\mu)=\int_{\mathbb R^2}p^2\,d\mu(x,p).addedP(μ)=∫R2​p2dμ(x,p).

QAlgorithms.Papers.Independent.Extend50.P40.addedX

For every displacement-noise object μ\muμ, whose underlying measure on R2\mathbb R^2R2 is a probability measure with integrable coordinate squares and zero coordinate means, the definition assigns the real number

addedX⁡(μ)=∫R2x2 dμ(x,p).\operatorname{addedX}(\mu)=\int_{\mathbb R^2}x^2\,d\mu(x,p).addedX(μ)=∫R2​x2dμ(x,p).

QAlgorithms.Papers.Independent.Extend50.P40.ancillaLaw

For every real θ\thetaθ, Booleans a,ba,ba,b, and Boolean pair e=(e1,e2)e=(e_1,e_2)e=(e1​,e2​), set εx=1\varepsilon_x=1εx​=1 for false and −1-1−1 for true and χx=(∣0⟩+εx∣1⟩)/2\chi_x=(|0\rangle+\varepsilon_x|1\rangle)/\sqrt2χx​=(∣0⟩+εx​∣1⟩)/2​. Let wθ,aw_{\theta,a}wθ,a​ have coordinates, ordered as 000,001,010,011,100,101,110,111000,001,010,011,100,101,110,111000,001,010,011,100,101,110,111,

wθ,a=122(1+cos⁡θ−εasin⁡θεasin⁡θ1−cos⁡θεa(1+cos⁡θ)sin⁡θsin⁡θεa(cos⁡θ−1)).w_{\theta,a}=\frac1{2\sqrt2} \begin{pmatrix} 1+\cos\theta\\ -\varepsilon_a\sin\theta\\ \varepsilon_a\sin\theta\\ 1-\cos\theta\\ \varepsilon_a(1+\cos\theta)\\ \sin\theta\\ \sin\theta\\ \varepsilon_a(\cos\theta-1) \end{pmatrix}.wθ,a​=22​1​​1+cosθ−εa​sinθεa​sinθ1−cosθεa​(1+cosθ)sinθsinθεa​(cosθ−1)​​.

Writing ∣e2⟩=∣0⟩|e_2\rangle=|0\rangle∣e2​⟩=∣0⟩ for false and ∣1⟩|1\rangle∣1⟩ for true, the definition is

ancillaLaw⁡(θ,a,b,e)=12∣⟨χb⊗(χe1⊗∣e2⟩), wθ,a⟩∣2.\operatorname{ancillaLaw}(\theta,a,b,e) =\frac12\left| \left\langle \chi_b\otimes(\chi_{e_1}\otimes|e_2\rangle),\,w_{\theta,a} \right\rangle \right|^2.ancillaLaw(θ,a,b,e)=21​∣⟨χb​⊗(χe1​​⊗∣e2​⟩),wθ,a​⟩∣2.

The inner product conjugates its first argument. This expands the real trace of the product of the two corresponding rank-one matrices, with the additional factor 1/21/21/2; θ\thetaθ is unrestricted.

QAlgorithms.Papers.Independent.Extend50.P40.asymmetricOutput

For every natural number ddd, real numbers a,ba,ba,b, and vector ψ∈Cd\psi\in\mathbb C^dψ∈Cd, this defines a vector indexed by triples (i,(j,k))∈{0,…,d−1}3(i,(j,k))\in\{0,\ldots,d-1\}^3(i,(j,k))∈{0,…,d−1}3, with amplitudes

(asymmetricOutput⁡(a,b,ψ))i,(j,k)=aψi 1j=k+bψj 1i=kd.\bigl(\operatorname{asymmetricOutput}(a,b,\psi)\bigr)_{i,(j,k)} =\frac{a\psi_i\,\mathbf 1_{j=k}+b\psi_j\,\mathbf 1_{i=k}}{\sqrt d}.(asymmetricOutput(a,b,ψ))i,(j,k)​=d​aψi​1j=k​+bψj​1i=k​​.

Here 1P\mathbf 1_P1P​ is 111 when PPP holds and 000 otherwise; the factors 1j=k/d\mathbf 1_{j=k}/\sqrt d1j=k​/d​ and 1i=k/d\mathbf 1_{i=k}/\sqrt d1i=k​/d​ expand the specified Bell vector. No normalization of ψ\psiψ or constraint on a,ba,ba,b is assumed. When d=0d=0d=0, the indexing set is empty and the result is the unique vector in the zero dimensional space.

QAlgorithms.Papers.Independent.Extend50.P40.asymmetryFilter

For every real number TTT, define the complex matrix on C2⊗C2\mathbb C^2\otimes\mathbb C^2C2⊗C2 by

FT=(2T−1)I4+2(1−T)∣s⟩⟨s∣,∣s⟩=∣01⟩−∣10⟩2.F_T=(2T-1)I_4+2(1-T)|s\rangle\langle s|, \qquad |s\rangle=\frac{|01\rangle-|10\rangle}{\sqrt2}.FT​=(2T−1)I4​+2(1−T)∣s⟩⟨s∣,∣s⟩=2​∣01⟩−∣10⟩​.

Here ∣ab⟩|ab\rangle∣ab⟩ is the coordinate vector indexed by (a,b)∈{0,1}2(a,b)\in\{0,1\}^2(a,b)∈{0,1}2, and ∣s⟩⟨s∣|s\rangle\langle s|∣s⟩⟨s∣ has entries sabscd‾s_{ab}\overline{s_{cd}}sab​scd​​. There is no restriction on TTT and no normalization operation in this definition.

QAlgorithms.Papers.Independent.Extend50.P40.bellBasisState

For each k∈{0,1,2,3}k\in\{0,1,2,3\}k∈{0,1,2,3}, this defines a vector in C{0,1}×{0,1}\mathbb C^{\{0,1\}\times\{0,1\}}C{0,1}×{0,1} by

k⟼{(e00+e11)/2,k=0,(e00−e11)/2,k=1,(e01+e10)/2,k=2,(e01−e10)/2,k=3,k\longmapsto \begin{cases} (e_{00}+e_{11})/\sqrt2,&k=0,\\ (e_{00}-e_{11})/\sqrt2,&k=1,\\ (e_{01}+e_{10})/\sqrt2,&k=2,\\ (e_{01}-e_{10})/\sqrt2,&k=3, \end{cases}k⟼⎩⎨⎧​(e00​+e11​)/2​,(e00​−e11​)/2​,(e01​+e10​)/2​,(e01​−e10​)/2​,​k=0,k=1,k=2,k=3,​

where eabe_{ab}eab​ is the coordinate vector with entry one at (a,b)(a,b)(a,b) and zero elsewhere.

QAlgorithms.Papers.Independent.Extend50.P40.bellDecoder

The definition is the complex matrix indexed by pairs from {0,1}\{0,1\}{0,1} which, with both rows and columns ordered as (0,0),(0,1),(1,0),(1,1)(0,0),(0,1),(1,0),(1,1)(0,0),(0,1),(1,0),(1,1), is

bellDecoder⁡=12(100101−100110100−1).\operatorname{bellDecoder} =\frac1{\sqrt2} \begin{pmatrix} 1&0&0&1\\ 0&1&-1&0\\ 0&1&1&0\\ 1&0&0&-1 \end{pmatrix}.bellDecoder=2​1​​1001​0110​0−110​100−1​​.

Equivalently, its rows at (0,0),(1,1),(1,0),(0,1)(0,0),(1,1),(1,0),(0,1)(0,0),(1,1),(1,0),(0,1) are respectively the conjugate coordinate vectors of (∣00⟩+∣11⟩)/2(|00\rangle+|11\rangle)/\sqrt2(∣00⟩+∣11⟩)/2​, (∣00⟩−∣11⟩)/2(|00\rangle-|11\rangle)/\sqrt2(∣00⟩−∣11⟩)/2​, (∣01⟩+∣10⟩)/2(|01\rangle+|10\rangle)/\sqrt2(∣01⟩+∣10⟩)/2​, and (∣01⟩−∣10⟩)/2(|01\rangle-|10\rangle)/\sqrt2(∣01⟩−∣10⟩)/2​.

QAlgorithms.Papers.Independent.Extend50.P40.bhMatrix

This defines a complex matrix BBB with rows indexed by triples (r,(s,t))∈{0,1}×({0,1}×{0,1})(r,(s,t))\in\{0,1\}\times(\{0,1\}\times\{0,1\})(r,(s,t))∈{0,1}×({0,1}×{0,1}) and columns indexed by i∈{0,1}i\in\{0,1\}i∈{0,1}. Its nonzero entries are exactly

B(0,(0,1)),0=23,B(0,(1,0)),0=B(1,(0,0)),0=−16,B_{(0,(0,1)),0}=\sqrt{\frac23},\qquad B_{(0,(1,0)),0}=B_{(1,(0,0)),0}=-\sqrt{\frac16},B(0,(0,1)),0​=32​​,B(0,(1,0)),0​=B(1,(0,0)),0​=−61​​, B(1,(1,0)),1=−23,B(0,(1,1)),1=B(1,(0,1)),1=16.B_{(1,(1,0)),1}=-\sqrt{\frac23},\qquad B_{(0,(1,1)),1}=B_{(1,(0,1)),1}=\sqrt{\frac16}.B(1,(1,0)),1​=−32​​,B(0,(1,1)),1​=B(1,(0,1)),1​=61​​.

Every other entry is zero.

QAlgorithms.Papers.Independent.Extend50.P40.bhOutput

For every vector ψ∈C2\psi\in\mathbb C^2ψ∈C2, with no normalization assumption, this defines the vector in C{0,1}×({0,1}×{0,1})\mathbb C^{\{0,1\}\times(\{0,1\}\times\{0,1\})}C{0,1}×({0,1}×{0,1}) given by

23 ψ0 ∣0,(0,1)⟩−16 ψ0(∣0,(1,0)⟩+∣1,(0,0)⟩)−23 ψ1 ∣1,(1,0)⟩+16 ψ1(∣0,(1,1)⟩+∣1,(0,1)⟩),\sqrt{\frac23}\,\psi_0\,|0,(0,1)\rangle -\sqrt{\frac16}\,\psi_0\bigl(|0,(1,0)\rangle+|1,(0,0)\rangle\bigr) -\sqrt{\frac23}\,\psi_1\,|1,(1,0)\rangle +\sqrt{\frac16}\,\psi_1\bigl(|0,(1,1)\rangle+|1,(0,1)\rangle),32​​ψ0​∣0,(0,1)⟩−61​​ψ0​(∣0,(1,0)⟩+∣1,(0,0)⟩)−32​​ψ1​∣1,(1,0)⟩+61​​ψ1​(∣0,(1,1)⟩+∣1,(0,1)⟩),

where each ket is the coordinate vector with value 111 at its indicated triple and 000 elsewhere.

QAlgorithms.Papers.Independent.Extend50.P40.binaryHolevo

For any finite index type III with decidable equality, including the empty type, and any two complex matrices ρ0,ρ1\rho_0,\rho_1ρ0​,ρ1​ indexed by III, define

S(X)=−Re⁡tr⁡ ⁣[f(X)],f(x)=xlog⁡2x,S(X)=-\operatorname{Re}\operatorname{tr}\!\left[f(X)\right], \qquad f(x)=x\log_2x,S(X)=−Retr[f(X)],f(x)=xlog2​x,

where f(X)f(X)f(X) is the real continuous functional calculus used in the declaration. Then

binaryHolevo⁡(ρ0,ρ1)=S ⁣(ρ0+ρ12)−S(ρ0)+S(ρ1)2.\operatorname{binaryHolevo}(\rho_0,\rho_1) =S\!\left(\frac{\rho_0+\rho_1}{2}\right) -\frac{S(\rho_0)+S(\rho_1)}2.binaryHolevo(ρ0​,ρ1​)=S(2ρ0​+ρ1​​)−2S(ρ0​)+S(ρ1​)​.

Neither matrix is assumed Hermitian, positive, or trace one. The logarithm uses the total real convention, with log⁡20=0\log_2 0=0log2​0=0. If III is empty, all traces and the resulting value are zero.

QAlgorithms.Papers.Independent.Extend50.P40.binaryInformation

For every real number ppp, define

1−−plog⁡p−(1−p)log⁡(1−p)log⁡2.1-\frac{-p\log p-(1-p)\log(1-p)}{\log2}.1−log2−plogp−(1−p)log(1−p)​.

The logarithms are natural logarithms with the total real convention log⁡0=0\log0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for negative xxx. No restriction 0≤p≤10\le p\le10≤p≤1 is imposed; at either p=0p=0p=0 or p=1p=1p=1, the defined value is 111.

QAlgorithms.Papers.Independent.Extend50.P40.bunching

For every complex 2×22\times22×2 matrix AAA, define the complex 4×44\times44×4 matrix

P(A⊗I22)P,P=I4−∣s⟩⟨s∣,∣s⟩=∣01⟩−∣10⟩2.P\left(A\otimes\frac{I_2}{2}\right)P, \qquad P=I_4-|s\rangle\langle s|, \qquad |s\rangle=\frac{|01\rangle-|10\rangle}{\sqrt2}.P(A⊗2I2​​)P,P=I4​−∣s⟩⟨s∣,∣s⟩=2​∣01⟩−∣10⟩​.

No positivity, Hermiticity, or trace condition is imposed on AAA, and the result is not normalized by its trace.

QAlgorithms.Papers.Independent.Extend50.P40.bunchingVector

For any vector ψ∈C2\psi\in\mathbb C^2ψ∈C2, without a normalization assumption, let s=(e0⊗e1−e1⊗e0)/2s=(e_0\otimes e_1-e_1\otimes e_0)/\sqrt2s=(e0​⊗e1​−e1​⊗e0​)/2​, so that sab=(δa0δb1−δa1δb0)/2s_{ab}=(\delta_{a0}\delta_{b1}-\delta_{a1}\delta_{b0})/\sqrt2sab​=(δa0​δb1​−δa1​δb0​)/2​, and let S=I4−ss†S=I_4-ss^\daggerS=I4​−ss†. This defines a vector v∈C{0,1}3v\in\mathbb C^{\{0,1\}^3}v∈C{0,1}3 by

vabc=∑u=01∑w=01(δauδbw−sabsuw‾)ψuswc.v_{abc}=\sum_{u=0}^1\sum_{w=0}^1 \bigl(\delta_{au}\delta_{bw}-s_{ab}\overline{s_{uw}}\bigr)\psi_u s_{wc}.vabc​=u=0∑1​w=0∑1​(δau​δbw​−sab​suw​​)ψu​swc​.

Thus both the matrix called symmetricPair and the vector called bellBasisState 3 are expanded explicitly in this formula.

QAlgorithms.Papers.Independent.Extend50.P40.cerfQubit

For arbitrary real numbers v,xv,xv,x, this defines the complex matrix on three two dimensional registers

cerfQubit⁡(v,x)=[vI4+x(X⊗X+Y⊗Y+Z⊗Z)]⊗I2,X=(0110),Y=(0−ii0),Z=(100−1).\operatorname{cerfQubit}(v,x) =\bigl[vI_4+x(X\otimes X+Y\otimes Y+Z\otimes Z)\bigr]\otimes I_2, \qquad X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad Y=\begin{pmatrix}0&-\mathrm i\\ \mathrm i&0\end{pmatrix},\quad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.cerfQubit(v,x)=[vI4​+x(X⊗X+Y⊗Y+Z⊗Z)]⊗I2​,X=(01​10​),Y=(0i​−i0​),Z=(10​0−1​).

Its rows and columns are indexed as (i,(j,k))(i,(j,k))(i,(j,k)), with i,j,k∈{0,1}i,j,k\in\{0,1\}i,j,k∈{0,1}. No restriction on v,xv,xv,x, or assertion of unitarity, is included.

QAlgorithms.Papers.Independent.Extend50.P40.cerfQudit

For every natural number ddd and arbitrary real numbers v,xv,xv,x, this defines the matrix indexed by triples from {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}

cerfQudit⁡(d,v,x)=[vId2+x ⁣ ⁣∑0≤m,n<d$m,n)≠(0,0)Wmn⊗Wmn†]⊗Id,\operatorname{cerfQudit}(d,v,x) =\left[ vI_{d^2} +x\!\!\sum_{\substack{0\le m,n<d\$m,n)\ne(0,0)}} W_{mn}\otimes W_{mn}^{\dagger} \right]\otimes I_d,cerfQudit(d,v,x)=​vId2​+x0≤m,n<d$m,n)=(0,0)​∑​Wmn​⊗Wmn†​​⊗Id​,

with indices regrouped as ((i,(j,k)),where, where ,whereW_{mn}=S^mC^n,, ,S_{ij}=\mathbf 1_{,i\equiv j+1\pmod d},, ,C_{ij}=\mathbf 1_{i=j}\exp(2\pi\mathrm i,j/d),and, and ,and\daggerdenotesconjugatetranspose.Norestrictionondenotes conjugate transpose. No restriction ondenotesconjugatetranspose.Norestrictiononv,xisimposed.Foris imposed. Forisimposed.Ford=1,thesumisemptyandtheresultis, the sum is empty and the result is ,thesumisemptyandtheresultisvI_1;for; for ;ford=0$, the result is the unique matrix with empty indexing sets.

QAlgorithms.Papers.Independent.Extend50.P40.cerfWeyl

For a natural number ddd and indices m,n∈{0,…,d−1}m,n\in\{0,\ldots,d-1\}m,n∈{0,…,d−1}, this defines the complex d×dd\times dd×d matrix

cerfWeyl⁡(d,m,n)=SmCn,Sij=1 i≡j+1(modd),Cij=1i=jexp⁡ ⁣(2πi jd).\operatorname{cerfWeyl}(d,m,n)=S^mC^n, \qquad S_{ij}=\mathbf 1_{\,i\equiv j+1\pmod d}, \qquad C_{ij}=\mathbf 1_{i=j}\exp\!\left(\frac{2\pi\mathrm i\,j}{d}\right).cerfWeyl(d,m,n)=SmCn,Sij​=1i≡j+1(modd)​,Cij​=1i=j​exp(d2πij​).

The construction identifies the indices with their residue classes modulo ddd, applies these shift and diagonal matrices there, and reindexes back. The supplied index mmm forces d>0d>0d>0; when d=0d=0d=0, there are no possible arguments m,nm,nm,n.

QAlgorithms.Papers.Independent.Extend50.P40.classicalMutualInformation

For arbitrary finite types I,JI,JI,J, equipped with their finite enumerations, and every function p:I×J→Rp:I\times J\to\mathbb Rp:I×J→R, define

∑i∈I∑j∈Jpijlog⁡2log⁡ ⁣(pij(∑y∈Jpiy)(∑x∈Ipxj)).\sum_{i\in I}\sum_{j\in J} \frac{p_{ij}}{\log2} \log\!\left( \frac{p_{ij}} {\left(\sum_{y\in J}p_{iy}\right) \left(\sum_{x\in I}p_{xj}\right)} \right).i∈I∑​j∈J∑​log2pij​​log​(∑y∈J​piy​)(∑x∈I​pxj​)pij​​​.

No nonnegativity or total-mass condition is imposed on ppp. Division by zero is defined to give zero, and the real logarithm satisfies log⁡0=0\log0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for negative xxx. Either indexing type may be empty, in which case the entire sum is zero.

QAlgorithms.Papers.Independent.Extend50.P40.cloneChannel

For every natural number ddd and arbitrary complex matrix VVV whose rows are indexed by triples (a,(b,m))(a,(b,m))(a,(b,m)) and columns by j∈{0,…,d−1}j\in\{0,\ldots,d-1\}j∈{0,…,d−1}, this defines a function sending each complex d×dd\times dd×d matrix AAA to a matrix indexed by pairs p,q∈{0,…,d−1}2p,q\in\{0,\ldots,d-1\}^2p,q∈{0,…,d−1}2, with entries

(cloneChannel(V)(A))p,q=∑m=0d−1∑j=0d−1∑ℓ=0d−1V(p1,(p2,m)),j Aj,ℓ V(q1,(q2,m)),ℓ‾.(\mathrm{cloneChannel}(V)(A))_{p,q} =\sum_{m=0}^{d-1}\sum_{j=0}^{d-1}\sum_{\ell=0}^{d-1} V_{(p_1,(p_2,m)),j}\,A_{j,\ell}\, \overline{V_{(q_1,(q_2,m)),\ell}}.(cloneChannel(V)(A))p,q​=m=0∑d−1​j=0∑d−1​ℓ=0∑d−1​V(p1​,(p2​,m)),j​Aj,ℓ​V(q1​,(q2​,m)),ℓ​​.

No isometry assumption on VVV or density assumption on AAA is imposed. The definition also includes d=0d=0d=0, when both input and output matrices are empty.

QAlgorithms.Papers.Independent.Extend50.P40.cloneMarginalA

For every natural number ddd and arbitrary vector ψ∈C{0,…,d−1}×({0,…,d−1}×{0,…,d−1})\psi\in\mathbb C^{\{0,\ldots,d-1\}\times(\{0,\ldots,d-1\}\times\{0,\ldots,d-1\})}ψ∈C{0,…,d−1}×({0,…,d−1}×{0,…,d−1}), this defines the complex d×dd\times dd×d matrix with entries

(cloneMarginalA(ψ))a,a′=∑b=0d−1∑c=0d−1ψa,(b,c) ψa′,(b,c)‾.(\mathrm{cloneMarginalA}(\psi))_{a,a'} =\sum_{b=0}^{d-1}\sum_{c=0}^{d-1} \psi_{a,(b,c)}\,\overline{\psi_{a',(b,c)}}.(cloneMarginalA(ψ))a,a′​=b=0∑d−1​c=0∑d−1​ψa,(b,c)​ψa′,(b,c)​​.

No normalization is required. For d=0d=0d=0 the resulting matrix is empty.

QAlgorithms.Papers.Independent.Extend50.P40.cloneMarginalB

For every natural number ddd and arbitrary vector ψ∈C{0,…,d−1}×({0,…,d−1}×{0,…,d−1})\psi\in\mathbb C^{\{0,\ldots,d-1\}\times(\{0,\ldots,d-1\}\times\{0,\ldots,d-1\})}ψ∈C{0,…,d−1}×({0,…,d−1}×{0,…,d−1}), this defines the complex d×dd\times dd×d matrix with entries

(cloneMarginalB(ψ))b,b′=∑c=0d−1∑a=0d−1ψa,(b,c) ψa,(b′,c)‾.(\mathrm{cloneMarginalB}(\psi))_{b,b'} =\sum_{c=0}^{d-1}\sum_{a=0}^{d-1} \psi_{a,(b,c)}\,\overline{\psi_{a,(b',c)}}.(cloneMarginalB(ψ))b,b′​=c=0∑d−1​a=0∑d−1​ψa,(b,c)​ψa,(b′,c)​​.

No normalization is required. For d=0d=0d=0 the resulting matrix is empty.

QAlgorithms.Papers.Independent.Extend50.P40.coherentReplicas

For every natural number NNN and α∈C\alpha\in\mathbb Cα∈C, this defines a vector in HN=ℓ2(({0,…,N−1}→N);C)H_N=\ell^2((\{0,\ldots,N-1\}\to\mathbb N);\mathbb C)HN​=ℓ2(({0,…,N−1}→N);C) by the total infinite sum

CN(α)=∑j:{0,…,N−1}→N(∏k=0N−1e−∣α∣2/2αj(k)j(k)!)ej,C_N(\alpha)= \sum_{j:\{0,\ldots,N-1\}\to\mathbb N} \left(\prod_{k=0}^{N-1} e^{-|\alpha|^2/2}\frac{\alpha^{j(k)}}{\sqrt{j(k)!}}\right)e_j,CN​(α)=j:{0,…,N−1}→N∑​(k=0∏N−1​e−∣α∣2/2j(k)!​αj(k)​)ej​,

where eje_jej​ is the coordinate unit vector at jjj. Summability and normalization are not conditions in this definition; a nonsummable family has total sum zero. For N=0N=0N=0, there is one empty occupation function, its coefficient is the empty product 111, and the vector is its coordinate unit vector.

QAlgorithms.Papers.Independent.Extend50.P40.collectiveRate

For every real θ\thetaθ, let εa=1\varepsilon_a=1εa​=1 for false and −1-1−1 for true, χa=(∣0⟩+εa∣1⟩)/2\chi_a=(|0\rangle+\varepsilon_a|1\rangle)/\sqrt2χa​=(∣0⟩+εa​∣1⟩)/2​, and

va=12(∣000⟩+cos⁡θ ∣011⟩+sin⁡θ ∣101⟩+εa(cos⁡θ ∣100⟩+sin⁡θ ∣010⟩+∣111⟩)).v_a=\frac12\left( |000\rangle+\cos\theta\,|011\rangle+\sin\theta\,|101\rangle +\varepsilon_a\bigl(\cos\theta\,|100\rangle+\sin\theta\,|010\rangle+|111\rangle\bigr) \right).va​=21​(∣000⟩+cosθ∣011⟩+sinθ∣101⟩+εa​(cosθ∣100⟩+sinθ∣010⟩+∣111⟩)).

Define Γ=12(vfalsevfalse†+vtruevtrue†)\Gamma=\tfrac12(v_{\mathrm{false}}v_{\mathrm{false}}^\dagger+v_{\mathrm{true}}v_{\mathrm{true}}^\dagger)Γ=21​(vfalse​vfalse†​+vtrue​vtrue†​), Aa=Tr⁡1(vava†)A_a=\operatorname{Tr}_1(v_av_a^\dagger)Aa​=Tr1​(va​va†​), and Ba=2Tr⁡1[(χaχa†⊗I4)Γ]B_a=2\operatorname{Tr}_1[(\chi_a\chi_a^\dagger\otimes I_4)\Gamma]Ba​=2Tr1​[(χa​χa†​⊗I4​)Γ], where Tr⁡1\operatorname{Tr}_1Tr1​ sums matching first-coordinate indices. Write S(X)=−Re⁡tr⁡[f(X)]S(X)=-\operatorname{Re}\operatorname{tr}[f(X)]S(X)=−Retr[f(X)] for the continuous functional calculus of f(x)=xlog⁡2xf(x)=x\log_2xf(x)=xlog2​x, and H(X,Y)=S((X+Y)/2)−(S(X)+S(Y))/2\mathcal H(X,Y)=S((X+Y)/2)-(S(X)+S(Y))/2H(X,Y)=S((X+Y)/2)−(S(X)+S(Y))/2. With h2(u)=−[uln⁡u+(1−u)ln⁡(1−u)]/ln⁡2h_2(u)=-[u\ln u+(1-u)\ln(1-u)]/\ln2h2​(u)=−[ulnu+(1−u)ln(1−u)]/ln2, the definition is

collectiveRate⁡(θ)=1−h2 ⁣(1+cos⁡θ2)−min⁡ ⁣{H(Afalse,Atrue),H(Bfalse,Btrue)}.\operatorname{collectiveRate}(\theta) =1-h_2\!\left(\frac{1+\cos\theta}{2}\right) -\min\!\left\{ \mathcal H(A_{\mathrm{false}},A_{\mathrm{true}}), \mathcal H(B_{\mathrm{false}},B_{\mathrm{true}}) \right\}.collectiveRate(θ)=1−h2​(21+cosθ​)−min{H(Afalse​,Atrue​),H(Bfalse​,Btrue​)}.

Logarithms use their total real convention, including ln⁡0=0\ln0=0ln0=0; no restriction is placed on θ\thetaθ.

QAlgorithms.Papers.Independent.Extend50.P40.decodedAttack

For every real θ\thetaθ and Boolean bit\mathrm{bit}bit, put c=cos⁡θc=\cos\thetac=cosθ, s=sin⁡θs=\sin\thetas=sinθ, and ε=1\varepsilon=1ε=1 for false and −1-1−1 for true. The definition gives the vector indexed by (i,(j,k))∈{0,1}3(i,(j,k))\in\{0,1\}^3(i,(j,k))∈{0,1}3 whose coordinates, ordered as 000,001,010,011,100,101,110,111000,001,010,011,100,101,110,111000,001,010,011,100,101,110,111, are

decodedAttack⁡(θ,bit)=122(1+c−εsεs1−cε(1+c)ssε(c−1)).\operatorname{decodedAttack}(\theta,\mathrm{bit}) =\frac1{2\sqrt2} \begin{pmatrix} 1+c\\ -\varepsilon s\\ \varepsilon s\\ 1-c\\ \varepsilon(1+c)\\ s\\ s\\ \varepsilon(c-1) \end{pmatrix}.decodedAttack(θ,bit)=22​1​​1+c−εsεs1−cε(1+c)ssε(c−1)​​.

These coordinates result from applying the identity to the first coordinate and the matrix \frac1{\sqrt2}\begin{psmallmatrix}1&0&0&1\\0&1&-1&0\\0&1&1&0\\1&0&0&-1\end{psmallmatrix} to the last two coordinates of 12(∣000⟩+c∣011⟩+s∣101⟩+ε(c∣100⟩+s∣010⟩+∣111⟩))\frac12(|000\rangle+c|011\rangle+s|101\rangle+\varepsilon(c|100\rangle+s|010\rangle+|111\rangle))21​(∣000⟩+c∣011⟩+s∣101⟩+ε(c∣100⟩+s∣010⟩+∣111⟩)); there is no restriction on θ\thetaθ.

QAlgorithms.Papers.Independent.Extend50.P40.densityBloch

For every complex 2×22\times22×2 matrix ρ\rhoρ, this defines the real vector whose kkkth component is Re⁡tr⁡(ρσk)\operatorname{Re}\operatorname{tr}(\rho\sigma_k)Retr(ρσk​) for k=0,1,2k=0,1,2k=0,1,2, where

σ0=(0110),σ1=(0−ii0),σ2=(100−1).\sigma_0=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad \sigma_1=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\qquad \sigma_2=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.σ0​=(01​10​),σ1​=(0i​−i0​),σ2​=(10​0−1​).

There is no assumption that ρ\rhoρ is Hermitian, positive, or of trace one.

QAlgorithms.Papers.Independent.Extend50.P40.depol

For every natural number ddd, real number η\etaη, and complex d×dd\times dd×d matrix AAA, this defines

ηA+(1−η)tr⁡(A) d−1Id.\eta A+(1-\eta)\operatorname{tr}(A)\,d^{-1}I_d.ηA+(1−η)tr(A)d−1Id​.

Here d−1d^{-1}d−1 is the reciprocal of ddd interpreted in C\mathbb CC, with 0−1=00^{-1}=00−1=0. Thus d=0d=0d=0 is included and yields the empty matrix. No restriction on η\etaη and no positivity or trace assumption on AAA is imposed.

QAlgorithms.Papers.Independent.Extend50.P40.discriminationState

For every real θ\thetaθ and Boolean bit\mathrm{bit}bit, let εbit=1\varepsilon_{\mathrm{bit}}=1εbit​=1 for false and −1-1−1 for true. The definition gives the vector in C2\mathbb C^2C2

discriminationState⁡(θ,bit)=((1+cos⁡θ)/2εbit(1−cos⁡θ)/2),\operatorname{discriminationState}(\theta,\mathrm{bit}) = \begin{pmatrix} \sqrt{(1+\cos\theta)/2}\\ \varepsilon_{\mathrm{bit}}\sqrt{(1-\cos\theta)/2} \end{pmatrix},discriminationState(θ,bit)=((1+cosθ)/2​εbit​(1−cosθ)/2​​),

with its real entries regarded as complex numbers and its norm taken to be the Euclidean norm. The parameter θ\thetaθ ranges over all real numbers, including values for which either entry vanishes.

QAlgorithms.Papers.Independent.Extend50.P40.distributor

For every natural number ddd, this defines a complex matrix with rows and columns indexed by {0,…,d−1}×({0,…,d−1}×{0,…,d−1})\{0,\ldots,d-1\}\times(\{0,\ldots,d-1\}\times\{0,\ldots,d-1\}){0,…,d−1}×({0,…,d−1}×{0,…,d−1}). Its entry in row yyy, column x=(r,(s,t))x=(r,(s,t))x=(r,(s,t)), is 111 exactly when

y=(r−s+t, (r+s,r+t)),y=(r-s+t,\,(r+s,r+t)),y=(r−s+t,(r+s,r+t)),

and is zero otherwise. All additions and subtraction are the modular operations on these finite indices, hence are taken modulo ddd when d>0d>0d>0. For d=0d=0d=0, the row and column index sets are empty.

QAlgorithms.Papers.Independent.Extend50.P40.distributorOutput

For any natural number ddd, real numbers a,ba,ba,b, and vector ψ∈Cd\psi\in\mathbb C^dψ∈Cd, without normalization assumptions, this defines a vector indexed by triples y∈{0,…,d−1}×({0,…,d−1}×{0,…,d−1})y\in\{0,\ldots,d-1\}\times(\{0,\ldots,d-1\}\times\{0,\ldots,d-1\})y∈{0,…,d−1}×({0,…,d−1}×{0,…,d−1}), whose coordinates are

wy=∑r,s,t=0d−11{y=(r−s+t, (r+s,r+t))} ψr a 1{s=t}+b 1{s=0}d.w_y= \sum_{r,s,t=0}^{d-1} \mathbf1_{\{y=(r-s+t,\,(r+s,r+t))\}}\, \psi_r\, \frac{a\,\mathbf1_{\{s=t\}}+b\,\mathbf1_{\{s=0\}}}{\sqrt d}.wy​=r,s,t=0∑d−1​1{y=(r−s+t,(r+s,r+t))}​ψr​d​a1{s=t}​+b1{s=0}​​.

The operations inside the triple are modular operations on the finite indices. This is multiplication by the matrix whose column (r,(s,t))(r,(s,t))(r,(s,t)) has its sole 111 at that displayed triple, applied to the vector with coordinates ψr(a1{s=t}+b1{s=0})/d\psi_r(a\mathbf1_{\{s=t\}}+b\mathbf1_{\{s=0\}})/\sqrt dψr​(a1{s=t}​+b1{s=0}​)/d​. For d=0d=0d=0, the output index set is empty and the result is the unique zero vector.

QAlgorithms.Papers.Independent.Extend50.P40.economicLaw

For every real angle θ\thetaθ and every three Boolean values a,b,ea,b,ea,b,e, identified with 000 and 111, define

12∣⟨qb⊗qe, ∣00⟩+(−1)acos⁡θ ∣10⟩+(−1)asin⁡θ ∣01⟩2⟩∣2=(1+(−1)a+bcos⁡θ+(−1)a+esin⁡θ)216,qc=∣0⟩+(−1)c∣1⟩2.\frac12\left| \left\langle q_b\otimes q_e,\, \frac{|00\rangle+(-1)^a\cos\theta\,|10\rangle +(-1)^a\sin\theta\,|01\rangle}{\sqrt2} \right\rangle \right|^2 = \frac{\left(1+(-1)^{a+b}\cos\theta+(-1)^{a+e}\sin\theta\right)^2}{16}, \qquad q_c=\frac{|0\rangle+(-1)^c|1\rangle}{\sqrt2}.21​​⟨qb​⊗qe​,2​∣00⟩+(−1)acosθ∣10⟩+(−1)asinθ∣01⟩​⟩​2=16(1+(−1)a+bcosθ+(−1)a+esinθ)2​,qc​=2​∣0⟩+(−1)c∣1⟩​.

Thus the definition is half the squared overlap of the displayed vectors; it applies to every real θ\thetaθ.

QAlgorithms.Papers.Independent.Extend50.P40.economicMatrix

For every real number θ\thetaθ, this defines a complex matrix with rows indexed by (0,0),(0,1),(1,0),(1,1)(0,0),(0,1),(1,0),(1,1)(0,0),(0,1),(1,0),(1,1) and columns indexed by 0,10,10,1:

economicMatrix⁡(θ)=(100sin⁡θ0cos⁡θ00).\operatorname{economicMatrix}(\theta)= \begin{pmatrix} 1&0\\ 0&\sin\theta\\ 0&\cos\theta\\ 0&0 \end{pmatrix}.economicMatrix(θ)=​1000​0sinθcosθ0​​.

The sine and cosine values are regarded as complex numbers.

QAlgorithms.Papers.Independent.Extend50.P40.economicOutput

For every real number θ\thetaθ and arbitrary vector ψ=(ψ0,ψ1)∈C2\psi=(\psi_0,\psi_1)\in\mathbb C^2ψ=(ψ0​,ψ1​)∈C2, this defines the vector in C{0,1}×{0,1}\mathbb C^{\{0,1\}\times\{0,1\}}C{0,1}×{0,1}

economicOutput⁡(θ,ψ)=ψ0e(0,0)+ψ1sin⁡θ e(0,1)+ψ1cos⁡θ e(1,0),\operatorname{economicOutput}(\theta,\psi) =\psi_0 e_{(0,0)} +\psi_1\sin\theta\,e_{(0,1)} +\psi_1\cos\theta\,e_{(1,0)},economicOutput(θ,ψ)=ψ0​e(0,0)​+ψ1​sinθe(0,1)​+ψ1​cosθe(1,0)​,

where epe_pep​ is the coordinate vector equal to 111 at ppp and 000 elsewhere. No normalization of ψ\psiψ is assumed.

QAlgorithms.Papers.Independent.Extend50.P40.emissionHamiltonian

For all natural numbers N,AN,AN,A and every real number ggg, this definition gives the complex matrix

HN,A,g=g(RN,A+(RN,A)†)H^{N,A,g}=g\bigl(R^{N,A}+(R^{N,A})^\dagger\bigr)HN,A,g=g(RN,A+(RN,A)†)

on EA={(u,v)∈N2:u+v≤A}\mathcal E_A=\{(u,v)\in\mathbb N^2:u+v\le A\}EA​={(u,v)∈N2:u+v≤A}, where, for q=(u,v)q=(u,v)q=(u,v) and r=(x,y)r=(x,y)r=(x,y),

Rq,rN,A=1{u=x, v=y+1}(N+y+1)(y+1)(A−x−y)+1{v=y, u=x+1}(x+1)2(A−x−y).R^{N,A}_{q,r} =\mathbf1_{\{u=x,\ v=y+1\}}\sqrt{(N+y+1)(y+1)(A-x-y)} +\mathbf1_{\{v=y,\ u=x+1\}}\sqrt{(x+1)^2(A-x-y)}.Rq,rN,A​=1{u=x, v=y+1}​(N+y+1)(y+1)(A−x−y)​+1{v=y, u=x+1}​(x+1)2(A−x−y)​.

The roots are real square roots, viewed as complex numbers, and †\dagger† denotes conjugate transpose. No positivity or nonzero assumption is imposed on ggg; N=0N=0N=0 and A=0A=0A=0 are allowed, and the matrix is zero when g=0g=0g=0 or A=0A=0A=0.

QAlgorithms.Papers.Independent.Extend50.P40.emissionInitial

For every natural number AAA, this definition selects the element (0,0)(0,0)(0,0) of the finite set EA={(u,v)∈N2:u+v≤A}\mathcal E_A=\{(u,v)\in\mathbb N^2:u+v\le A\}EA​={(u,v)∈N2:u+v≤A}, including when A=0A=0A=0.

QAlgorithms.Papers.Independent.Extend50.P40.emissionProbability

For arbitrary natural numbers N,A,k,lN,A,k,lN,A,k,l and real numbers g,tg,tg,t, let EA={(x,y)∈N2:x+y≤A}E_A=\{(x,y)\in\mathbb N^2:x+y\le A\}EA​={(x,y)∈N2:x+y≤A}, and define the matrix RRR on this index set by

R(x,y),(u,v)=1x=u, y=v+1(N+v+1)(v+1)(A−u−v)+1y=v, x=u+1(u+1)2(A−u−v),R_{(x,y),(u,v)} =\mathbf1_{x=u,\ y=v+1}\sqrt{(N+v+1)(v+1)(A-u-v)} +\mathbf1_{y=v,\ x=u+1}\sqrt{(u+1)^2(A-u-v)},R(x,y),(u,v)​=1x=u, y=v+1​(N+v+1)(v+1)(A−u−v)​+1y=v, x=u+1​(u+1)2(A−u−v)​,

with real arithmetic inside the square roots and indicators equal to 111 or 000 according to their conditions. With H=g(R+R†)H=g(R+R^\dagger)H=g(R+R†) and ψ=e−itHe(0,0)\psi=e^{-itH}e_{(0,0)}ψ=e−itHe(0,0)​, where e(0,0)e_{(0,0)}e(0,0)​ is the coordinate unit vector, the definition is

emissionProbability⁡(N,A,k,l,g,t)=∑(x,y)∈EAx+y=k, y=l∣ψ(x,y)∣2.\operatorname{emissionProbability}(N,A,k,l,g,t) =\sum_{\substack{(x,y)\in E_A\\x+y=k,\ y=l}}|\psi_{(x,y)}|^2.emissionProbability(N,A,k,l,g,t)=(x,y)∈EA​x+y=k, y=l​∑​∣ψ(x,y)​∣2.

Thus it is the squared modulus of the coordinate (k−l,l)(k-l,l)(k−l,l) when l≤k≤Al\le k\le Al≤k≤A, and is 000 otherwise. Zero values of any natural-number parameter and arbitrary signs of g,tg,tg,t are included.

QAlgorithms.Papers.Independent.Extend50.P40.emissionRaising

For every pair of natural numbers N,AN,AN,A, this definition gives a complex matrix RN,AR^{N,A}RN,A whose rows and columns are indexed by EA={(u,v)∈N2:u+v≤A}\mathcal E_A=\{(u,v)\in\mathbb N^2:u+v\le A\}EA​={(u,v)∈N2:u+v≤A}. For row q=(u,v)q=(u,v)q=(u,v) and column r=(x,y)r=(x,y)r=(x,y), its entry is

R(u,v),(x,y)N,A=1{u=x, v=y+1}(N+y+1)(y+1)(A−x−y)+1{v=y, u=x+1}(x+1)2(A−x−y),R^{N,A}_{(u,v),(x,y)} =\mathbf1_{\{u=x,\ v=y+1\}}\sqrt{(N+y+1)(y+1)(A-x-y)} +\mathbf1_{\{v=y,\ u=x+1\}}\sqrt{(x+1)^2(A-x-y)},R(u,v),(x,y)N,A​=1{u=x, v=y+1}​(N+y+1)(y+1)(A−x−y)​+1{v=y, u=x+1}​(x+1)2(A−x−y)​,

with all quantities inside the square roots evaluated in R\mathbb RR and the resulting real values included in C\mathbb CC. Here 1\mathbf11 is the indicator of the indicated condition. The definition includes N=0N=0N=0 and A=0A=0A=0; for A=0A=0A=0 the matrix is zero.

QAlgorithms.Papers.Independent.Extend50.P40.emissionState

For natural numbers N,AN,AN,A and arbitrary real numbers g,tg,tg,t, let EA={(x,y)∈N2:x+y≤A}E_A=\{(x,y)\in\mathbb N^2:x+y\le A\}EA​={(x,y)∈N2:x+y≤A}. Define a real-entry matrix RRR indexed by EAE_AEA​ by

R(x,y),(u,v)=1x=u, y=v+1(N+v+1)(v+1)(A−u−v)+1y=v, x=u+1(u+1)2(A−u−v),R_{(x,y),(u,v)} =\mathbf1_{x=u,\ y=v+1}\sqrt{(N+v+1)(v+1)(A-u-v)} +\mathbf1_{y=v,\ x=u+1}\sqrt{(u+1)^2(A-u-v)},R(x,y),(u,v)​=1x=u, y=v+1​(N+v+1)(v+1)(A−u−v)​+1y=v, x=u+1​(u+1)2(A−u−v)​,

where 1\mathbf11 is 111 when its subscripted conditions hold and 000 otherwise, and all arithmetic inside square roots is real arithmetic. Set H=g(R+R†)H=g(R+R^\dagger)H=g(R+R†), with R†R^\daggerR† the conjugate transpose. The definition assigns the vector

emissionState⁡(N,A,g,t)=e−itHe(0,0)in CEA,\operatorname{emissionState}(N,A,g,t)=e^{-itH}e_{(0,0)} \quad\text{in }\mathbb C^{E_A},emissionState(N,A,g,t)=e−itHe(0,0)​in CEA​,

where e(0,0)e_{(0,0)}e(0,0)​ has coordinate 111 at (0,0)(0,0)(0,0) and 000 elsewhere, and the exponential is the matrix exponential. There are no positivity restrictions on g,tg,tg,t or on N,AN,AN,A beyond their being natural numbers; in particular, A=0A=0A=0 gives a single coordinate, H=0H=0H=0, and the vector e(0,0)e_{(0,0)}e(0,0)​.

QAlgorithms.Papers.Independent.Extend50.P40.emissionSuccess

For arbitrary natural numbers N,A,kN,A,kN,A,k and real numbers g,tg,tg,t, let EA={(x,y)∈N2:x+y≤A}E_A=\{(x,y)\in\mathbb N^2:x+y\le A\}EA​={(x,y)∈N2:x+y≤A} and define

R(x,y),(u,v)=1x=u, y=v+1(N+v+1)(v+1)(A−u−v)+1y=v, x=u+1(u+1)2(A−u−v),ψ=e−it g(R+R†)e(0,0).R_{(x,y),(u,v)} =\mathbf1_{x=u,\ y=v+1}\sqrt{(N+v+1)(v+1)(A-u-v)} +\mathbf1_{y=v,\ x=u+1}\sqrt{(u+1)^2(A-u-v)}, \qquad \psi=e^{-it\,g(R+R^\dagger)}e_{(0,0)}.R(x,y),(u,v)​=1x=u, y=v+1​(N+v+1)(v+1)(A−u−v)​+1y=v, x=u+1​(u+1)2(A−u−v)​,ψ=e−itg(R+R†)e(0,0)​.

Here indicators take values 0,10,10,1, the square-root expressions use real arithmetic, R†R^\daggerR† is the conjugate transpose, and e(0,0)e_{(0,0)}e(0,0)​ is the coordinate unit vector. The definition sums the squared coordinate moduli first over pairs with total kkk and second coordinate lll, then over l=0,…,kl=0,\ldots,kl=0,…,k:

emissionSuccess⁡(N,A,k,g,t)=∑l=0k ∑(x,y)∈EAx+y=k, y=l∣ψ(x,y)∣2.\operatorname{emissionSuccess}(N,A,k,g,t) =\sum_{l=0}^{k}\ \sum_{\substack{(x,y)\in E_A\\x+y=k,\ y=l}} |\psi_{(x,y)}|^2.emissionSuccess(N,A,k,g,t)=l=0∑k​ (x,y)∈EA​x+y=k, y=l​∑​∣ψ(x,y)​∣2.

Consequently this is ∑x+y=k∣ψ(x,y)∣2\sum_{x+y=k}|\psi_{(x,y)}|^2∑x+y=k​∣ψ(x,y)​∣2 within EAE_AEA​, and is 000 if k>Ak>Ak>A. The definition also includes k=0k=0k=0, A=0A=0A=0, N=0N=0N=0, and arbitrary real g,tg,tg,t.

QAlgorithms.Papers.Independent.Extend50.P40.equator

For every real number θ\thetaθ, this defines the vector

12(1,eiθ)∈C2.\frac1{\sqrt2}\left(1,e^{i\theta}\right)\in\mathbb C^2.2​1​(1,eiθ)∈C2.

There is no restriction on the range of θ\thetaθ.

QAlgorithms.Papers.Independent.Extend50.P40.estimationOutput

For every natural number NNN, every estimator with rrr outcomes, positive semidefinite effects EiE_iEi​ satisfying ∑iEi=BN\sum_iE_i=B_N∑i​Ei​=BN​, and unit vectors gi∈C2g_i\in\mathbb C^2gi​∈C2, and every vector ψ∈C2\psi\in\mathbb C^2ψ∈C2, define

∑i=0r−1tr⁡ ⁣(Ei∣v⟩⟨v∣)∣gi⟩⟨gi∣,vx=∏k=0N−1ψxk(x∈{0,1}N).\sum_{i=0}^{r-1} \operatorname{tr}\!\left(E_i|v\rangle\langle v|\right) |g_i\rangle\langle g_i|, \qquad v_x=\prod_{k=0}^{N-1}\psi_{x_k} \quad(x\in\{0,1\}^N).i=0∑r−1​tr(Ei​∣v⟩⟨v∣)∣gi​⟩⟨gi​∣,vx​=k=0∏N−1​ψxk​​(x∈{0,1}N).

Here BNB_NBN​ is the average of the coordinate permutation matrices (Pπ)y,x=1{y=x∘π−1}(P_\pi)_{y,x}=\mathbf1_{\{y=x\circ\pi^{-1}\}}(Pπ​)y,x​=1{y=x∘π−1}​ over all π∈SN\pi\in S_Nπ∈SN​, and ∣u⟩⟨u∣|u\rangle\langle u|∣u⟩⟨u∣ has entries uxuy‾u_x\overline{u_y}ux​uy​​. The trace coefficients are used as complex scalars, without taking real parts. No normalization hypothesis is imposed on ψ\psiψ; when N=0N=0N=0, vvv has the single coordinate 111, by the empty-product convention.

QAlgorithms.Papers.Independent.Extend50.P40.estimationShrink

For every natural number NNN, including zero, define the real number

NN+2.\frac{N}{N+2}.N+2N​.

The denominator is positive for every allowed NNN, and the value at N=0N=0N=0 is 000.

QAlgorithms.Papers.Independent.Extend50.P40.eveGivenAlice

For every real θ\thetaθ and Boolean aaa, put εa=1\varepsilon_a=1εa​=1 when a=falsea=\mathrm{false}a=false and εa=−1\varepsilon_a=-1εa​=−1 when a=truea=\mathrm{true}a=true, and define the vector on {0,1}3\{0,1\}^3{0,1}3 by

vθ,a=12(∣000⟩+cos⁡θ ∣011⟩+sin⁡θ ∣101⟩+εa(cos⁡θ ∣100⟩+sin⁡θ ∣010⟩+∣111⟩)),v_{\theta,a}=\frac12\left( |000\rangle+\cos\theta\,|011\rangle+\sin\theta\,|101\rangle +\varepsilon_a\bigl(\cos\theta\,|100\rangle+\sin\theta\,|010\rangle+|111\rangle\bigr) \right),vθ,a​=21​(∣000⟩+cosθ∣011⟩+sinθ∣101⟩+εa​(cosθ∣100⟩+sinθ∣010⟩+∣111⟩)),

where ∣ijk⟩|ijk\rangle∣ijk⟩ is the coordinate vector indexed by (i,(j,k))(i,(j,k))(i,(j,k)). The definition gives the complex matrix on {0,1}2\{0,1\}^2{0,1}2 with entries

eveGivenAlice⁡(θ,a)(j,k),(ℓ,m)=∑i=01vθ,a(i,j,k) vθ,a(i,ℓ,m)‾.\operatorname{eveGivenAlice}(\theta,a)_{(j,k),(\ell,m)} =\sum_{i=0}^1 v_{\theta,a}(i,j,k)\,\overline{v_{\theta,a}(i,\ell,m)}.eveGivenAlice(θ,a)(j,k),(ℓ,m)​=i=0∑1​vθ,a​(i,j,k)vθ,a​(i,ℓ,m)​.

Thus it forms the matrix vv†vv^\daggervv† and sums out its first coordinate; there is no restriction on θ\thetaθ.

QAlgorithms.Papers.Independent.Extend50.P40.eveGivenBob

For every real θ\thetaθ and Boolean bbb, let εx=1\varepsilon_x=1εx​=1 for false and −1-1−1 for true, let χb=(∣0⟩+εb∣1⟩)/2\chi_b=(|0\rangle+\varepsilon_b|1\rangle)/\sqrt2χb​=(∣0⟩+εb​∣1⟩)/2​, and, for each Boolean aaa, set

vθ,a=12(∣000⟩+cos⁡θ ∣011⟩+sin⁡θ ∣101⟩+εa(cos⁡θ ∣100⟩+sin⁡θ ∣010⟩+∣111⟩)).v_{\theta,a}=\frac12\left( |000\rangle+\cos\theta\,|011\rangle+\sin\theta\,|101\rangle +\varepsilon_a\bigl(\cos\theta\,|100\rangle+\sin\theta\,|010\rangle+|111\rangle\bigr) \right).vθ,a​=21​(∣000⟩+cosθ∣011⟩+sinθ∣101⟩+εa​(cosθ∣100⟩+sinθ∣010⟩+∣111⟩)).

Here the coordinate labels are (i,(j,k))(i,(j,k))(i,(j,k)). With Γθ=12(vθ,falsevθ,false†+vθ,truevθ,true†)\Gamma_\theta=\tfrac12(v_{\theta,\mathrm{false}}v_{\theta,\mathrm{false}}^\dagger+v_{\theta,\mathrm{true}}v_{\theta,\mathrm{true}}^\dagger)Γθ​=21​(vθ,false​vθ,false†​+vθ,true​vθ,true†​), the definition is

eveGivenBob⁡(θ,b)=2 Tr⁡1 ⁣[(χbχb†⊗I4)Γθ],(Tr⁡1X)(j,k),(ℓ,m)=∑i=01X(i,(j,k)),(i,(ℓ,m)).\operatorname{eveGivenBob}(\theta,b) =2\,\operatorname{Tr}_{1}\!\left[ (\chi_b\chi_b^\dagger\otimes I_4)\Gamma_\theta \right], \qquad (\operatorname{Tr}_{1}X)_{(j,k),(\ell,m)} =\sum_{i=0}^1X_{(i,(j,k)),(i,(\ell,m))}.eveGivenBob(θ,b)=2Tr1​[(χb​χb†​⊗I4​)Γθ​],(Tr1​X)(j,k),(ℓ,m)​=i=0∑1​X(i,(j,k)),(i,(ℓ,m))​.

The product inside this partial trace is exactly the displayed left multiplication, and θ\thetaθ is unrestricted.

QAlgorithms.Papers.Independent.Extend50.P40.filteredOutput

For every real TTT and every vector ψ=(ψ0,ψ1)∈C2\psi=(\psi_0,\psi_1)\in\mathbb C^2ψ=(ψ0​,ψ1​)∈C2, define the vector indexed by triples (a,(b,c))∈{0,1}3(a,(b,c))\in\{0,1\}^3(a,(b,c))∈{0,1}3 to be

(I2⊗FT)[ψ0(23∣001⟩−16∣010⟩−16∣100⟩)+ψ1(−23∣110⟩+16∣011⟩+16∣101⟩)],(I_2\otimes F_T)\left[ \psi_0\left(\sqrt{\frac23}|001\rangle-\sqrt{\frac16}|010\rangle-\sqrt{\frac16}|100\rangle\right) +\psi_1\left(-\sqrt{\frac23}|110\rangle+\sqrt{\frac16}|011\rangle+\sqrt{\frac16}|101\rangle\right) \right],(I2​⊗FT​)[ψ0​(32​​∣001⟩−61​​∣010⟩−61​​∣100⟩)+ψ1​(−32​​∣110⟩+61​​∣011⟩+61​​∣101⟩)],

where FT=(2T−1)I4+2(1−T)∣s⟩⟨s∣F_T=(2T-1)I_4+2(1-T)|s\rangle\langle s|FT​=(2T−1)I4​+2(1−T)∣s⟩⟨s∣ and ∣s⟩=(∣01⟩−∣10⟩)/2|s\rangle=(|01\rangle-|10\rangle)/\sqrt2∣s⟩=(∣01⟩−∣10⟩)/2​. The identity acts on the first coordinate and FTF_TFT​ on the last two. Neither ψ\psiψ nor the resulting vector is required or made to have norm one.

QAlgorithms.Papers.Independent.Extend50.P40.finBlochDensity

For every real vector m=(m0,m1,m2)m=(m_0,m_1,m_2)m=(m0​,m1​,m2​), this defines the complex matrix, with rows and columns ordered 0,10,10,1, by

12(1+m2m0−im1m0+im11−m2).\frac12 \begin{pmatrix} 1+m_2 & m_0-i m_1\\ m_0+i m_1 & 1-m_2 \end{pmatrix}.21​(1+m2​m0​+im1​​m0​−im1​1−m2​​).

The indexing identifies 000 with false and 111 with true. No bound on mmm or positivity assumption is imposed.

QAlgorithms.Papers.Independent.Extend50.P40.flagFactorization

For every real θ\thetaθ and Boolean bit\mathrm{bit}bit, define A=(1+cos⁡θ)/2A=\sqrt{(1+\cos\theta)/2}A=(1+cosθ)/2​ and B=(1−cos⁡θ)/2B=\sqrt{(1-\cos\theta)/2}B=(1−cosθ)/2​. For each Boolean xxx, let εx=1\varepsilon_x=1εx​=1 for false and −1-1−1 for true, χx=(∣0⟩+εx∣1⟩)/2\chi_x=(|0\rangle+\varepsilon_x|1\rangle)/\sqrt2χx​=(∣0⟩+εx​∣1⟩)/2​, and dx=A∣0⟩+εxB∣1⟩d_x=A|0\rangle+\varepsilon_xB|1\rangledx​=A∣0⟩+εx​B∣1⟩. If ¬bit\neg\mathrm{bit}¬bit denotes Boolean negation, the definition is the vector on {0,1}×({0,1}×{0,1})\{0,1\}\times(\{0,1\}\times\{0,1\}){0,1}×({0,1}×{0,1})

flagFactorization⁡(θ,bit)=A χbit⊗(dbit⊗∣0⟩)−εbitB χ¬bit⊗(d¬bit⊗∣1⟩).\operatorname{flagFactorization}(\theta,\mathrm{bit}) =A\,\chi_{\mathrm{bit}}\otimes(d_{\mathrm{bit}}\otimes|0\rangle) -\varepsilon_{\mathrm{bit}}B\, \chi_{\neg\mathrm{bit}}\otimes(d_{\neg\mathrm{bit}}\otimes|1\rangle).flagFactorization(θ,bit)=Aχbit​⊗(dbit​⊗∣0⟩)−εbit​Bχ¬bit​⊗(d¬bit​⊗∣1⟩).

Tensor products here multiply coordinate amplitudes, and ∣0⟩,∣1⟩|0\rangle,|1\rangle∣0⟩,∣1⟩ are coordinate unit vectors. This defines a vector for every real θ\thetaθ; it does not itself assert equality with any other vector.

QAlgorithms.Papers.Independent.Extend50.P40.gaussianMixture

For every t∈Rt\in\mathbb Rt∈R and α∈C\alpha\in\mathbb Cα∈C, this defines a bounded operator on H1=ℓ2(({0}→N);C)H_1=\ell^2((\{0\}\to\mathbb N);\mathbb C)H1​=ℓ2(({0}→N);C) by

Gt(α)={∣Jcα⟩⟨Jcα∣,t=0,∫Ce−∣β∣2/tπt ∣Jcα+β⟩⟨Jcα+β∣ dβ,t≠0,G_t(\alpha)= \begin{cases} |Jc_\alpha\rangle\langle Jc_\alpha|,&t=0,\\[2mm] \displaystyle\int_{\mathbb C} \frac{e^{-|\beta|^2/t}}{\pi t}\, |Jc_{\alpha+\beta}\rangle\langle Jc_{\alpha+\beta}|\,d\beta,&t\ne0, \end{cases}Gt​(α)=⎩⎨⎧​∣Jcα​⟩⟨Jcα​∣,∫C​πte−∣β∣2/t​∣Jcα+β​⟩⟨Jcα+β​∣dβ,​t=0,t=0,​

where dβd\betadβ is Lebesgue measure on C\mathbb CC, Ju(j)=u(j(0))Ju(j)=u(j(0))Ju(j)=u(j(0)), and ∣v⟩⟨v∣|v\rangle\langle v|∣v⟩⟨v∣ means h↦⟨v,h⟩vh\mapsto\langle v,h\rangle vh↦⟨v,h⟩v. For each z∈Cz\in\mathbb Cz∈C, czc_zcz​ is the square-summable sequence with coordinates e−∣z∣2/2zr/r!e^{-|z|^2/2}z^r/\sqrt{r!}e−∣z∣2/2zr/r!​, chosen if such a sequence exists and otherwise defined as zero. The integral is a Bochner integral in the space of bounded operators; its total definition returns zero when the integrand is not integrable. Negative ttt is included, and no density or integrability condition is part of this definition.

QAlgorithms.Papers.Independent.Extend50.P40.infoAB

For every real-valued function ppp of three Boolean arguments, identify the Boolean values with 0,10,10,1, set qab=pab0+pab1q_{ab}=p_{ab0}+p_{ab1}qab​=pab0​+pab1​, and define

∑a=01∑b=01qablog⁡2log⁡ ⁣(qab(∑b′=01qab′)(∑a′=01qa′b)).\sum_{a=0}^{1}\sum_{b=0}^{1} \frac{q_{ab}}{\log2} \log\!\left( \frac{q_{ab}} {\left(\sum_{b'=0}^{1}q_{ab'}\right) \left(\sum_{a'=0}^{1}q_{a'b}\right)} \right).a=0∑1​b=0∑1​log2qab​​log​(∑b′=01​qab′​)(∑a′=01​qa′b​)qab​​​.

No probability-distribution hypothesis is imposed on ppp. Division by zero gives zero, and the real logarithm uses log⁡0=0\log0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for negative arguments.

QAlgorithms.Papers.Independent.Extend50.P40.infoAE

For any function p:{false,true}3→Rp:\{\mathrm{false},\mathrm{true}\}^3\to\mathbb Rp:{false,true}3→R, define qae=∑bp(a,b,e)q_{ae}=\sum_b p(a,b,e)qae​=∑b​p(a,b,e), qA(a)=∑eqaeq_A(a)=\sum_e q_{ae}qA​(a)=∑e​qae​, and qE(e)=∑aqaeq_E(e)=\sum_a q_{ae}qE​(e)=∑a​qae​, with all sums over Boolean values. The definition is

infoAE⁡(p)=1ln⁡2∑a,eqaeln⁡ ⁣(qaeqA(a)qE(e)).\operatorname{infoAE}(p)= \frac{1}{\ln 2}\sum_{a,e}q_{ae}\ln\!\left(\frac{q_{ae}}{q_A(a)q_E(e)}\right).infoAE(p)=ln21​a,e∑​qae​ln(qA​(a)qE​(e)qae​​).

No nonnegativity or normalization assumption is imposed on ppp. Division and logarithms use their total real conventions: division by zero is zero, ln⁡0=0\ln 0=0ln0=0, and the real logarithm of a negative number is the logarithm of its absolute value.

QAlgorithms.Papers.Independent.Extend50.P40.infoBE

For any function p:{false,true}3→Rp:\{\mathrm{false},\mathrm{true}\}^3\to\mathbb Rp:{false,true}3→R, define qbe=∑ap(a,b,e)q_{be}=\sum_a p(a,b,e)qbe​=∑a​p(a,b,e), qB(b)=∑eqbeq_B(b)=\sum_e q_{be}qB​(b)=∑e​qbe​, and qE(e)=∑bqbeq_E(e)=\sum_b q_{be}qE​(e)=∑b​qbe​, with all sums over Boolean values. The definition is

infoBE⁡(p)=1ln⁡2∑b,eqbeln⁡ ⁣(qbeqB(b)qE(e)).\operatorname{infoBE}(p)= \frac{1}{\ln 2}\sum_{b,e}q_{be}\ln\!\left(\frac{q_{be}}{q_B(b)q_E(e)}\right).infoBE(p)=ln21​b,e∑​qbe​ln(qB​(b)qE​(e)qbe​​).

The function ppp need not be nonnegative or normalized. Division by zero is zero, ln⁡0=0\ln 0=0ln0=0, and the real logarithm of a negative number means the logarithm of its absolute value.

QAlgorithms.Papers.Independent.Extend50.P40.marginalMachine

For every natural number ddd and arbitrary vector ψ∈C{0,…,d−1}×({0,…,d−1}×{0,…,d−1})\psi\in\mathbb C^{\{0,\ldots,d-1\}\times(\{0,\ldots,d-1\}\times\{0,\ldots,d-1\})}ψ∈C{0,…,d−1}×({0,…,d−1}×{0,…,d−1}), this defines the complex d×dd\times dd×d matrix with entries

(marginalMachine(ψ))c,c′=∑b=0d−1∑a=0d−1ψa,(b,c) ψa,(b,c′)‾.(\mathrm{marginalMachine}(\psi))_{c,c'} =\sum_{b=0}^{d-1}\sum_{a=0}^{d-1} \psi_{a,(b,c)}\,\overline{\psi_{a,(b,c')}}.(marginalMachine(ψ))c,c′​=b=0∑d−1​a=0∑d−1​ψa,(b,c)​ψa,(b,c′)​​.

No normalization is required. For d=0d=0d=0 the resulting matrix is empty.

QAlgorithms.Papers.Independent.Extend50.P40.measureNot

For any complex 2×22\times22×2 matrix AAA, with no positivity or normalization assumption, define

b(φ,z)=(1−z2cos⁡φ,1−z2sin⁡φ,z),P(φ,z)=12(1+z1−z2e−iφ1−z2eiφ1−z),Q(φ,z)=I2−P(φ,z).b(\varphi,z)= \bigl(\sqrt{1-z^2}\cos\varphi,\sqrt{1-z^2}\sin\varphi,z\bigr), \qquad P(\varphi,z)=\frac12 \begin{pmatrix} 1+z&\sqrt{1-z^2}e^{-i\varphi}\\ \sqrt{1-z^2}e^{i\varphi}&1-z \end{pmatrix}, \quad Q(\varphi,z)=I_2-P(\varphi,z).b(φ,z)=(1−z2​cosφ,1−z2​sinφ,z),P(φ,z)=21​(1+z1−z2​eiφ​1−z2​e−iφ1−z​),Q(φ,z)=I2​−P(φ,z).

The definition is the matrix-valued iterated integral

measureNot⁡(A)=14π∫02π∫−11[tr⁡(P(φ,z)A) Q(φ,z)+tr⁡(Q(φ,z)A) P(φ,z)] dz dφ.\operatorname{measureNot}(A) =\frac1{4\pi}\int_0^{2\pi}\int_{-1}^{1} \left[ \operatorname{tr}(P(\varphi,z)A)\,Q(\varphi,z) +\operatorname{tr}(Q(\varphi,z)A)\,P(\varphi,z) \right]\,dz\,d\varphi.measureNot(A)=4π1​∫02π​∫−11​[tr(P(φ,z)A)Q(φ,z)+tr(Q(φ,z)A)P(φ,z)]dzdφ.

The trace coefficients are complex scalars, and the integrals use the usual real volume measure.

QAlgorithms.Papers.Independent.Extend50.P40.modeEmission

For every natural number ddd, including d=0d=0d=0, this defines a complex matrix VdV_dVd​ with rows indexed by (a,b,c)∈{0,…,d−1}3(a,b,c)\in\{0,\ldots,d-1\}^3(a,b,c)∈{0,…,d−1}3 and columns indexed by i∈{0,…,d−1}i\in\{0,\ldots,d-1\}i∈{0,…,d−1}, with entries

(Vd)(a,b,c),i=δaiδbc+δbiδac2(d+1).(V_d)_{(a,b,c),i} =\frac{\delta_{ai}\delta_{bc}+\delta_{bi}\delta_{ac}} {\sqrt{2(d+1)}}.(Vd​)(a,b,c),i​=2(d+1)​δai​δbc​+δbi​δac​​.

The denominator is positive for every allowed ddd. When d=0d=0d=0, both index sets are empty, so the definition gives the unique matrix of that shape.

QAlgorithms.Papers.Independent.Extend50.P40.modeOutput

For every natural number ddd and every vector ψ∈Cd\psi\in\mathbb C^dψ∈Cd, without a normalization assumption, this defines a vector v∈Cd3v\in\mathbb C^{d^3}v∈Cd3 by multiplying ψ\psiψ by the matrix whose ((a,b,c),i)((a,b,c),i)((a,b,c),i)-entry is (δaiδbc+δbiδac)/2(d+1)(\delta_{ai}\delta_{bc}+\delta_{bi}\delta_{ac})/\sqrt{2(d+1)}(δai​δbc​+δbi​δac​)/2(d+1)​; equivalently,

vabc=ψaδbc+ψbδac2(d+1)(0≤a,b,c<d).v_{abc}=\frac{\psi_a\delta_{bc}+\psi_b\delta_{ac}}{\sqrt{2(d+1)}} \qquad(0\le a,b,c<d).vabc​=2(d+1)​ψa​δbc​+ψb​δac​​(0≤a,b,c<d).

For d=0d=0d=0, the input and output spaces each contain only their zero vector, and this defines that output.

QAlgorithms.Papers.Independent.Extend50.P40.noiseMixture

For every displacement-noise object μ\muμ—a probability measure on R2\mathbb R^2R2 with integrable coordinate squares and zero coordinate means—and every α∈C\alpha\in\mathbb Cα∈C, this definition gives a bounded complex-linear operator on H1=ℓ2(N{0};C)\mathcal H_1=\ell^2(\mathbb N^{\{0\}};\mathbb C)H1​=ℓ2(N{0};C) by the operator-valued integral

Nμ(α)=∫R2∣cα+(x+ip)/2⟩⟨cα+(x+ip)/2∣ dμ(x,p).\mathcal N_\mu(\alpha)=\int_{\mathbb R^2}|c_{\alpha+(x+ip)/\sqrt2}\rangle\langle c_{\alpha+(x+ip)/\sqrt2}|\,d\mu(x,p).Nμ​(α)=∫R2​∣cα+(x+ip)/2​​⟩⟨cα+(x+ip)/2​​∣dμ(x,p).

Here the one-mode coordinate identification sends a sequence u∈ℓ2(N;C)u\in\ell^2(\mathbb N;\mathbb C)u∈ℓ2(N;C) to the function j↦u(j(0))j\mapsto u(j(0))j↦u(j(0)), and cβc_\betacβ​ is the image under this identification of the chosen square-summable vector with coefficients e−∣β∣2/2βr/r!e^{-|\beta|^2/2}\beta^r/\sqrt{r!}e−∣β∣2/2βr/r!​ for every r∈Nr\in\mathbb Nr∈N, if such a vector exists; the underlying definition chooses the zero vector otherwise. The rank-one operator ∣c⟩⟨c∣|c\rangle\langle c|∣c⟩⟨c∣ sends vvv to ⟨c,v⟩c\langle c,v\rangle c⟨c,v⟩c. This declaration itself supplies no integrability assertion for the operator-valued integrand; the integral uses the total Bochner-integral convention, which returns zero for a nonintegrable integrand.

QAlgorithms.Papers.Independent.Extend50.P40.noiseWeight

For every real ttt and complex β\betaβ, this defines the real number

wt(β)=exp⁡(−∣β∣2/t)πt.w_t(\beta)=\frac{\exp(-|\beta|^2/t)}{\pi t}.wt​(β)=πtexp(−∣β∣2/t)​.

There is no positivity assumption on ttt. Division uses the total convention a/0=0a/0=0a/0=0, so w0(β)=0w_0(\beta)=0w0​(β)=0 for every β\betaβ.

QAlgorithms.Papers.Independent.Extend50.P40.onFirstTwo

For every natural number ddd and complex matrix AAA whose rows and columns are indexed by pairs from {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, this defines a matrix indexed by triples through

(onFirstTwo⁡(A))i,(j,k) ; i′,(j′,k′)=A(i,j),(i′,j′) 1k=k′.\bigl(\operatorname{onFirstTwo}(A)\bigr)_{i,(j,k)\,;\,i',(j',k')} =A_{(i,j),(i',j')}\,\mathbf 1_{k=k'}.(onFirstTwo(A))i,(j,k);i′,(j′,k′)​=A(i,j),(i′,j′)​1k=k′​.

Thus it is A⊗IdA\otimes I_dA⊗Id​, with the indices regrouped as (i,(j,k))(i,(j,k))(i,(j,k)). No property of AAA is assumed. The definition includes d=0d=0d=0, when the resulting matrix has empty indexing sets.

QAlgorithms.Papers.Independent.Extend50.P40.oneModeCoordinates

This defines a complex linear isometric equivalence from ℓ2(N;C)\ell^2(\mathbb N;\mathbb C)ℓ2(N;C) to ℓ2(({0}→N);C)\ell^2((\{0\}\to\mathbb N);\mathbb C)ℓ2(({0}→N);C). It sends a square-summable sequence uuu to the function j↦u(j(0))j\mapsto u(j(0))j↦u(j(0)); its inverse sends vvv to the sequence n↦v(jn)n\mapsto v(j_n)n↦v(jn​), where jn(0)=nj_n(0)=njn​(0)=n. These maps are mutually inverse, preserve addition and complex scalar multiplication, and preserve the ℓ2\ell^2ℓ2 norm.

QAlgorithms.Papers.Independent.Extend50.P40.oneModeOccupation

This defines a bijection between functions j:{0}→Nj:\{0\}\to\mathbb Nj:{0}→N and natural numbers: it sends jjj to j(0)j(0)j(0), and its inverse sends n∈Nn\in\mathbb Nn∈N to the constant function with value nnn.

QAlgorithms.Papers.Independent.Extend50.P40.oneModeProjector

For every α∈C\alpha\in\mathbb Cα∈C, this defines a bounded complex linear operator on ℓ2(({0}→N);C)\ell^2((\{0\}\to\mathbb N);\mathbb C)ℓ2(({0}→N);C) by transporting the operator u↦⟨cα,u⟩cαu\mapsto\langle c_\alpha,u\rangle c_\alphau↦⟨cα​,u⟩cα​ through the coordinate identification Ju(j)=u(j(0))Ju(j)=u(j(0))Ju(j)=u(j(0)): the resulting operator is J∣cα⟩⟨cα∣J−1J|c_\alpha\rangle\langle c_\alpha|J^{-1}J∣cα​⟩⟨cα​∣J−1. Here cα∈ℓ2(N;C)c_\alpha\in\ell^2(\mathbb N;\mathbb C)cα​∈ℓ2(N;C) is chosen to have coordinates

cα(n)=e−∣α∣2/2αnn!c_\alpha(n)=e^{-|\alpha|^2/2}\frac{\alpha^n}{\sqrt{n!}}cα​(n)=e−∣α∣2/2n!​αn​

if a square-summable vector with these coordinates exists, and is defined to be zero otherwise.

QAlgorithms.Papers.Independent.Extend50.P40.optimalSingle

For every triple of natural numbers d,N,Md,N,Md,N,M, this defines the real number

NM+(M−N)(N+1)M(N+d),\frac{N}{M}+\frac{(M-N)(N+1)}{M(N+d)},MN​+M(N+d)(M−N)(N+1)​,

where all quantities in this formula are interpreted as real numbers, so M−NM-NM−N is ordinary real subtraction even when N>MN>MN>M. There are no positivity or ordering assumptions. Division by zero is defined to be zero; in particular, the value is zero when M=0M=0M=0.

QAlgorithms.Papers.Independent.Extend50.P40.orthogonalQubit

For every vector ψ=(ψ0,ψ1)∈C2\psi=(\psi_0,\psi_1)\in\mathbb C^2ψ=(ψ0​,ψ1​)∈C2, this defines the vector (−ψ1‾,ψ0‾)∈C2(-\overline{\psi_1},\overline{\psi_0})\in\mathbb C^2(−ψ1​​,ψ0​​)∈C2. No normalization or nonzero assumption is imposed; the zero vector is sent to the zero vector.

QAlgorithms.Papers.Independent.Extend50.P40.pdcFirstOrder

For any vector ψ=(ψ0,ψ1)∈C2\psi=(\psi_0,\psi_1)\in\mathbb C^2ψ=(ψ0​,ψ1​)∈C2, without a normalization assumption, this defines a vector vvv indexed by triples (a,b,c)∈{0,1}3(a,b,c)\in\{0,1\}^3(a,b,c)∈{0,1}3, where the source’s nested triple (a,(b,c))(a,(b,c))(a,(b,c)) has been written as (a,b,c)(a,b,c)(a,b,c), by

vabc=16∑j=01(ψaδbj+δajψb)(−1)jδc,1−j.v_{abc}=\frac1{\sqrt6}\sum_{j=0}^1 \bigl(\psi_a\delta_{bj}+\delta_{aj}\psi_b\bigr)(-1)^j\delta_{c,1-j}.vabc​=6​1​j=0∑1​(ψa​δbj​+δaj​ψb​)(−1)jδc,1−j​.

Here δ\deltaδ is the Kronecker delta. The last factor explicitly expands the operation sending a vector (z0,z1)(z_0,z_1)(z0​,z1​) to (−z1‾,z0‾)(-\overline{z_1},\overline{z_0})(−z1​​,z0​​), applied to the coordinate vector eje_jej​: it sends e0e_0e0​ to e1e_1e1​ and e1e_1e1​ to −e0-e_0−e0​.

QAlgorithms.Papers.Independent.Extend50.P40.permuteCloneOccupation

For every natural number MMM, permutation ppp of {0,…,M−1}\{0,\ldots,M-1\}{0,…,M−1}, and occupation function j:{0,…,M}→Nj:\{0,\ldots,M\}\to\mathbb Nj:{0,…,M}→N, this defines the occupation function

jp(k)={j(p(k)),k<M,j(M),k=M.j_p(k)= \begin{cases} j(p(k)),&k<M,\\ j(M),&k=M. \end{cases}jp​(k)={j(p(k)),j(M),​k<M,k=M.​

Thus the first MMM entries are precomposed with ppp, while the last entry is fixed. When M=0M=0M=0, this is the identity on occupation functions on the singleton {0}\{0\}{0}.

QAlgorithms.Papers.Independent.Extend50.P40.phaseCerf

For every real number θ\thetaθ, put F=(1+cos⁡θ)/2F=(1+\cos\theta)/2F=(1+cosθ)/2. This defines the complex matrix indexed by triples (i,(j,k))∈{0,1}3(i,(j,k))\in\{0,1\}^3(i,(j,k))∈{0,1}3

phaseCerf⁡(θ)=[FI4+(1−F)Z⊗Z+F(1−F)(X⊗X+Y⊗Y)]⊗I2,X=(0110),Y=(0−ii0),Z=(100−1).\operatorname{phaseCerf}(\theta) =\left[ FI_4+(1-F)Z\otimes Z +\sqrt{F(1-F)}(X\otimes X+Y\otimes Y) \right]\otimes I_2, \qquad X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad Y=\begin{pmatrix}0&-\mathrm i\\ \mathrm i&0\end{pmatrix},\quad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.phaseCerf(θ)=[FI4​+(1−F)Z⊗Z+F(1−F)​(X⊗X+Y⊗Y)]⊗I2​,X=(01​10​),Y=(0i​−i0​),Z=(10​0−1​).

The tensor indices are regrouped as indicated, and the square root is the nonnegative real square root.

QAlgorithms.Papers.Independent.Extend50.P40.phaseClonerMatrix

For every real number θ\thetaθ, this defines the complex matrix VθV_\thetaVθ​ with columns indexed by 0,10,10,1 and rows indexed by (i,(j,k))∈{0,1}3(i,(j,k))\in\{0,1\}^3(i,(j,k))∈{0,1}3, specified by

Vθe0=e(0,(0,0))+cos⁡θ e(0,(1,1))+sin⁡θ e(1,(0,1))2,Vθe1=cos⁡θ e(1,(0,0))+sin⁡θ e(0,(1,0))+e(1,(1,1))2.V_\theta e_0 =\frac{e_{(0,(0,0))}+\cos\theta\,e_{(0,(1,1))} +\sin\theta\,e_{(1,(0,1))}}{\sqrt2}, \qquad V_\theta e_1 =\frac{\cos\theta\,e_{(1,(0,0))} +\sin\theta\,e_{(0,(1,0))}+e_{(1,(1,1))}}{\sqrt2}.Vθ​e0​=2​e(0,(0,0))​+cosθe(0,(1,1))​+sinθe(1,(0,1))​​,Vθ​e1​=2​cosθe(1,(0,0))​+sinθe(0,(1,0))​+e(1,(1,1))​​.

Here each epe_pep​ is the corresponding coordinate basis vector, so all entries absent from these formulas are zero.

QAlgorithms.Papers.Independent.Extend50.P40.phaseOutput

For every real number θ\thetaθ and arbitrary vector ψ=(ψ0,ψ1)∈C2\psi=(\psi_0,\psi_1)\in\mathbb C^2ψ=(ψ0​,ψ1​)∈C2, this defines the vector indexed by (i,(j,k))∈{0,1}3(i,(j,k))\in\{0,1\}^3(i,(j,k))∈{0,1}3

phaseOutput⁡(θ,ψ)=12[ψ0 ⁣(e(0,(0,0))+cos⁡θ e(0,(1,1))+sin⁡θ e(1,(0,1)))+ψ1 ⁣(cos⁡θ e(1,(0,0))+sin⁡θ e(0,(1,0))+e(1,(1,1)))],\operatorname{phaseOutput}(\theta,\psi) =\frac1{\sqrt2}\left[ \psi_0\!\left(e_{(0,(0,0))}+\cos\theta\,e_{(0,(1,1))} +\sin\theta\,e_{(1,(0,1))}\right) +\psi_1\!\left(\cos\theta\,e_{(1,(0,0))} +\sin\theta\,e_{(0,(1,0))}+e_{(1,(1,1))}\right) \right],phaseOutput(θ,ψ)=2​1​[ψ0​(e(0,(0,0))​+cosθe(0,(1,1))​+sinθe(1,(0,1))​)+ψ1​(cosθe(1,(0,0))​+sinθe(0,(1,0))​+e(1,(1,1))​)],

where epe_pep​ is 111 at coordinate ppp and 000 elsewhere. No normalization of ψ\psiψ is assumed.

QAlgorithms.Papers.Independent.Extend50.P40.priorClone

For any one-mode Fock Weyl system WWW, any real Σ\SigmaΣ, and any complex α\alphaα, this defines a bounded complex-linear operator on H1=ℓ2(N;C)\mathcal H_1=\ell^2(\mathbb N;\mathbb C)H1​=ℓ2(N;C). Put

g(Σ)={8Σ4(2Σ2+1)2,12+12≤Σ2,1,otherwise,z=g(Σ)2 α.g(\Sigma)= \begin{cases} \dfrac{8\Sigma^4}{(2\Sigma^2+1)^2}, &\dfrac12+\dfrac1{\sqrt2}\le\Sigma^2,\\[4pt] 1,&\text{otherwise}, \end{cases} \qquad z=\sqrt{\frac{g(\Sigma)}2}\,\alpha.g(Σ)=⎩⎨⎧​(2Σ2+1)28Σ4​,1,​21​+2​1​≤Σ2,otherwise,​z=2g(Σ)​​α.

Writing ∣j⟩|j\rangle∣j⟩ for the standard occupation basis, the operator defined is

DW(z)(∑j=0∞2g(Σ)+1(g(Σ)−1g(Σ)+1)j∣j⟩⟨j∣)DW(z)∗,\mathcal D_W(z) \left(\sum_{j=0}^{\infty} \frac{2}{g(\Sigma)+1} \left(\frac{g(\Sigma)-1}{g(\Sigma)+1}\right)^j |j\rangle\langle j|\right) \mathcal D_W(z)^*,DW​(z)(j=0∑∞​g(Σ)+12​(g(Σ)+1g(Σ)−1​)j∣j⟩⟨j∣)DW​(z)∗,

where the sum is the operator-valued sum used in the definition, and DW(z)=W(Im⁡z,−Re⁡z)\mathcal D_W(z)=W(\operatorname{Im}z,-\operatorname{Re}z)DW​(z)=W(Imz,−Rez). A one-mode Fock Weyl system here supplies unitary bounded operators W(ξx,ξp)W(\xi_x,\xi_p)W(ξx​,ξp​) with occupation-basis matrix entries drs(−ξp+iξx)d_{rs}(-\xi_p+i\xi_x)drs​(−ξp​+iξx​), where

drs(w)=e−∣w∣2/2r! s!∑j=0min⁡(r,s)wr−j(−w‾)s−jj!(r−j)!(s−j)!.d_{rs}(w)=e^{-|w|^2/2}\sqrt{r!\,s!} \sum_{j=0}^{\min(r,s)} \frac{w^{r-j}(-\overline w)^{s-j}} {j!(r-j)!(s-j)!}.drs​(w)=e−∣w∣2/2r!s!​j=0∑min(r,s)​j!(r−j)!(s−j)!wr−j(−w)s−j​.

There is no positivity assumption on Σ\SigmaΣ; zero and negative values are included, and equality at the displayed threshold selects the first branch.

QAlgorithms.Papers.Independent.Extend50.P40.priorFidelity

For every Σ∈R\Sigma\in\mathbb RΣ∈R, this defines

f(Σ)={4Σ2+26Σ2+1,12+12≤Σ2,1(3−22)Σ2+1,Σ2<12+12.f(\Sigma)= \begin{cases} \displaystyle\frac{4\Sigma^2+2}{6\Sigma^2+1}, &\displaystyle \frac12+\frac1{\sqrt2}\le\Sigma^2,\\[2mm] \displaystyle\frac1{(3-2\sqrt2)\Sigma^2+1}, &\displaystyle \Sigma^2<\frac12+\frac1{\sqrt2}. \end{cases}f(Σ)=⎩⎨⎧​6Σ2+14Σ2+2​,(3−22​)Σ2+11​,​21​+2​1​≤Σ2,Σ2<21​+2​1​.​

Equality at the threshold uses the first branch. Negative Σ\SigmaΣ and Σ=0\Sigma=0Σ=0 are included, with f(0)=1f(0)=1f(0)=1.

QAlgorithms.Papers.Independent.Extend50.P40.priorGain

For every Σ∈R\Sigma\in\mathbb RΣ∈R, this defines

g(Σ)={8Σ4(2Σ2+1)2,12+12≤Σ2,1,Σ2<12+12.g(\Sigma)= \begin{cases} \displaystyle\frac{8\Sigma^4}{(2\Sigma^2+1)^2}, &\displaystyle \frac12+\frac1{\sqrt2}\le\Sigma^2,\\[2mm] 1,&\displaystyle \Sigma^2<\frac12+\frac1{\sqrt2}. \end{cases}g(Σ)=⎩⎨⎧​(2Σ2+1)28Σ4​,1,​21​+2​1​≤Σ2,Σ2<21​+2​1​.​

Equality at the threshold uses the first branch. Negative Σ\SigmaΣ and Σ=0\Sigma=0Σ=0 are included, with g(0)=1g(0)=1g(0)=1.

QAlgorithms.Papers.Independent.Extend50.P40.priorIntegrand

For any one-mode Fock Weyl system WWW, real Σ\SigmaΣ, and complex α\alphaα, this defines the real number

e−∣α∣2/(2Σ2)2πΣ2Re⁡⟨cα,τW,Σ,αcα⟩,cα=∑j=0∞e−∣α∣2/2αjj! ∣j⟩in ℓ2(N;C).\frac{e^{-|\alpha|^2/(2\Sigma^2)}}{2\pi\Sigma^2} \operatorname{Re}\langle c_\alpha,\tau_{W,\Sigma,\alpha}c_\alpha\rangle, \qquad c_\alpha=\sum_{j=0}^{\infty} e^{-|\alpha|^2/2}\frac{\alpha^j}{\sqrt{j!}}\,|j\rangle \quad\text{in }\ell^2(\mathbb N;\mathbb C).2πΣ2e−∣α∣2/(2Σ2)​Re⟨cα​,τW,Σ,α​cα​⟩,cα​=j=0∑∞​e−∣α∣2/2j!​αj​∣j⟩in ℓ2(N;C).

Here

g={8Σ4(2Σ2+1)2,12+12≤Σ2,1,otherwise,τW,Σ,α=DW ⁣(g/2 α)(∑j=0∞2g+1(g−1g+1)j∣j⟩⟨j∣)DW ⁣(g/2 α)∗.g= \begin{cases} \dfrac{8\Sigma^4}{(2\Sigma^2+1)^2}, &\dfrac12+\dfrac1{\sqrt2}\le\Sigma^2,\\ 1,&\text{otherwise}, \end{cases} \qquad \tau_{W,\Sigma,\alpha} =\mathcal D_W\!\left(\sqrt{g/2}\,\alpha\right) \left(\sum_{j=0}^{\infty}\frac{2}{g+1} \left(\frac{g-1}{g+1}\right)^j|j\rangle\langle j|\right) \mathcal D_W\!\left(\sqrt{g/2}\,\alpha\right)^*.g=⎩⎨⎧​(2Σ2+1)28Σ4​,1,​21​+2​1​≤Σ2,otherwise,​τW,Σ,α​=DW​(g/2​α)(j=0∑∞​g+12​(g+1g−1​)j∣j⟩⟨j∣)DW​(g/2​α)∗.

The coherent vector and thermal operator are defined by their respective infinite sums. The supplied Weyl system consists of unitary bounded operators W(ξx,ξp)W(\xi_x,\xi_p)W(ξx​,ξp​), and DW(z)=W(Im⁡z,−Re⁡z)\mathcal D_W(z)=W(\operatorname{Im}z,-\operatorname{Re}z)DW​(z)=W(Imz,−Rez); its matrix entries are

⟨r∣DW(z)∣s⟩=e−∣z∣2/2r! s!∑j=0min⁡(r,s)zr−j(−z‾)s−jj!(r−j)!(s−j)!.\langle r|\mathcal D_W(z)|s\rangle =e^{-|z|^2/2}\sqrt{r!\,s!} \sum_{j=0}^{\min(r,s)} \frac{z^{r-j}(-\overline z)^{s-j}} {j!(r-j)!(s-j)!}.⟨r∣DW​(z)∣s⟩=e−∣z∣2/2r!s!​j=0∑min(r,s)​j!(r−j)!(s−j)!zr−j(−z)s−j​.

No restriction on Σ\SigmaΣ is imposed. In particular, at Σ=0\Sigma=0Σ=0, real division by zero is defined as zero, so the prefactor, and hence this integrand, is zero.

QAlgorithms.Papers.Independent.Extend50.P40.priorWeight

For every real Σ\SigmaΣ and complex α\alphaα, this defines

wΣ(α)=exp⁡ ⁣(−∣α∣2/(2Σ2))2πΣ2.w_\Sigma(\alpha)= \frac{\exp\!\left(-|\alpha|^2/(2\Sigma^2)\right)} {2\pi\Sigma^2}.wΣ​(α)=2πΣ2exp(−∣α∣2/(2Σ2))​.

No sign or nonzero assumption is imposed on Σ\SigmaΣ. The expression depends only on Σ2\Sigma^2Σ2, and under total division by zero it equals zero for every α\alphaα when Σ=0\Sigma=0Σ=0.

QAlgorithms.Papers.Independent.Extend50.P40.program

For every natural number ddd and real numbers a,ba,ba,b, this defines a vector vvv indexed by pairs (r,s)∈{0,…,d−1}2(r,s)\in\{0,\ldots,d-1\}^2(r,s)∈{0,…,d−1}2, with coordinates

vr,s=a 1{r=s}+b 1{r=0}d.v_{r,s} =\frac{a\,\mathbf1_{\{r=s\}}+b\,\mathbf1_{\{r=0\}}}{\sqrt d}.vr,s​=d​a1{r=s}​+b1{r=0}​​.

Thus the first summand has equal amplitude a/da/\sqrt da/d​ on all diagonal pairs, while the second has equal amplitude b/db/\sqrt db/d​ on all pairs whose first coordinate is zero. No normalization condition on a,ba,ba,b is required. For d=0d=0d=0, the index set is empty and this is the unique zero vector; inverse square roots use the total convention 0−1=00^{-1}=00−1=0.

QAlgorithms.Papers.Independent.Extend50.P40.randomBasisCloner

For every complex 2×22\times22×2 matrix AAA, with no positivity or normalization assumption, this defines the complex matrix on {0,1}2\{0,1\}^2{0,1}2

14π∫02π∫−11[Tr⁡(PbA)(Pb⊗Pb)+Tr⁡(QbA)(Qb⊗Qb)] dz da,\frac1{4\pi}\int_0^{2\pi}\int_{-1}^{1} \left[ \operatorname{Tr}(P_bA)(P_b\otimes P_b) +\operatorname{Tr}(Q_bA)(Q_b\otimes Q_b) \right]\,dz\,da,4π1​∫02π​∫−11​[Tr(Pb​A)(Pb​⊗Pb​)+Tr(Qb​A)(Qb​⊗Qb​)]dzda,

where b=(1−z2cos⁡a,1−z2sin⁡a,z)b=(\sqrt{1-z^2}\cos a,\sqrt{1-z^2}\sin a,z)b=(1−z2​cosa,1−z2​sina,z),

Pb=12(1+b2b0−ib1b0+ib11−b2),Qb=I2−Pb.P_b=\frac12 \begin{pmatrix} 1+b_2&b_0-\mathrm i b_1\\ b_0+\mathrm i b_1&1-b_2 \end{pmatrix}, \qquad Q_b=I_2-P_b.Pb​=21​(1+b2​b0​+ib1​​b0​−ib1​1−b2​​),Qb​=I2​−Pb​.

The inner integral is taken over zzz, and the outer integral over aaa.

QAlgorithms.Papers.Independent.Extend50.P40.rawRate

For every three real numbers iab,iae,ibei_{ab},i_{ae},i_{be}iab​,iae​,ibe​, define

iab−min⁡{iae,ibe}.i_{ab}-\min\{i_{ae},i_{be}\}.iab​−min{iae​,ibe​}.

No sign, range, or information-theoretic hypotheses are imposed on these arguments, and the result is not truncated at zero.

QAlgorithms.Papers.Independent.Extend50.P40.shuffleCloner

For natural numbers d,N,Md,N,Md,N,M satisfying N≤MN\le MN≤M, this defines a function taking a complex matrix AAA on length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} to

(d−1)M−NM!∑p∈SMPp EN,M(SNASN) Pp†.\frac{(d^{-1})^{M-N}}{M!} \sum_{p\in\mathfrak S_M} P_p\,E_{N,M}(S_NAS_N)\,P_p^\dagger.M!(d−1)M−N​p∈SM​∑​Pp​EN,M​(SN​ASN​)Pp†​.

Here PpP_pPp​ has entry 111 in row yyy, column xxx, exactly when y=x∘p−1y=x\circ p^{-1}y=x∘p−1, and zero otherwise; SN=1N!∑q∈SNPqS_N=\frac1{N!}\sum_{q\in\mathfrak S_N}P_qSN​=N!1​∑q∈SN​​Pq​; and

EN,M(B)x,y=B(x0,…,xN−1),(y0,…,yN−1)∏k=NM−11{xk=yk}.E_{N,M}(B)_{x,y} =B_{(x_0,\ldots,x_{N-1}),(y_0,\ldots,y_{N-1})} \prod_{k=N}^{M-1}\mathbf1_{\{x_k=y_k\}}.EN,M​(B)x,y​=B(x0​,…,xN−1​),(y0​,…,yN−1​)​k=N∏M−1​1{xk​=yk​}​.

No condition on AAA is required. Zero lengths and d=0d=0d=0 are included: length-zero words form a singleton, positive-length words over the empty alphabet do not exist, empty products equal 111, 0!=10!=10!=1, and the scalar uses 0−1=00^{-1}=00−1=0 and 00=10^0=100=1.

QAlgorithms.Papers.Independent.Extend50.P40.singleFidelity

For any natural numbers d,N,Md,N,Md,N,M, any function TTT from complex matrices indexed by length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} to complex matrices indexed by length-MMM words over that alphabet, any vector ψ∈Cd\psi\in\mathbb C^dψ∈Cd, and any j∈{0,…,M−1}j\in\{0,\ldots,M-1\}j∈{0,…,M−1}, this defines

Re⁡Tr⁡ ⁣(Aj T(vNvN†)),vN(x)=∏k=0N−1ψxk,(Aj)x,y=ψxjψyj‾∏ℓ≠j1{xℓ=yℓ}.\operatorname{Re}\operatorname{Tr}\!\left(A_j\,T(v_Nv_N^\dagger)\right), \qquad v_N(x)=\prod_{k=0}^{N-1}\psi_{x_k}, \qquad (A_j)_{x,y}=\psi_{x_j}\overline{\psi_{y_j}}\prod_{\ell\ne j}\mathbf1_{\{x_\ell=y_\ell\}}.ReTr(Aj​T(vN​vN†​)),vN​(x)=k=0∏N−1​ψxk​​,(Aj​)x,y​=ψxj​​ψyj​​​ℓ=j∏​1{xℓ​=yℓ​}​.

No normalization of ψ\psiψ or channel property of TTT is assumed. The empty product for N=0N=0N=0 is 111. The argument jjj cannot exist when M=0M=0M=0, or when d=0<Md=0<Md=0<M does not by itself obstruct jjj; in that latter case the output word index set is empty and the trace is zero.

QAlgorithms.Papers.Independent.Extend50.P40.sphereAverage

For every normed real vector space EEE, whose addition forms a commutative group, and every function f:R3→Ef:\mathbb R^3\to Ef:R3→E, this defines

14π∫02π(∫−11f ⁣(1−z2cos⁡a,1−z2sin⁡a,z) dz) da.\frac1{4\pi}\int_0^{2\pi}\left( \int_{-1}^{1} f\!\left(\sqrt{1-z^2}\cos a,\sqrt{1-z^2}\sin a,z\right)\,dz \right)\,da.4π1​∫02π​(∫−11​f(1−z2​cosa,1−z2​sina,z)dz)da.

Both integrals are Bochner interval integrals, with the zzz-integral performed first. No completeness, measurability, continuity, or integrability assumption is imposed; these are total integral operations, assigning zero when the corresponding integrand is not integrable.

QAlgorithms.Papers.Independent.Extend50.P40.spherical

For any real numbers θ\thetaθ and φ\varphiφ, with no restriction on their ranges, this defines the vector in C2\mathbb C^2C2, equipped with its Euclidean norm, whose coordinates are

(cos⁡θ2, eiφsin⁡θ2).\left(\cos\frac{\theta}{2},\ e^{i\varphi}\sin\frac{\theta}{2}\right).(cos2θ​, eiφsin2θ​).

QAlgorithms.Papers.Independent.Extend50.P40.symmetricPair

Define the complex matrix on C2⊗C2\mathbb C^2\otimes\mathbb C^2C2⊗C2 by

P=I4−∣s⟩⟨s∣,∣s⟩=∣01⟩−∣10⟩2,P=I_4-|s\rangle\langle s|, \qquad |s\rangle=\frac{|01\rangle-|10\rangle}{\sqrt2},P=I4​−∣s⟩⟨s∣,∣s⟩=2​∣01⟩−∣10⟩​,

where ∣s⟩⟨s∣|s\rangle\langle s|∣s⟩⟨s∣ has entries sabscd‾s_{ab}\overline{s_{cd}}sab​scd​​ in the coordinate basis indexed by pairs from {0,1}\{0,1\}{0,1}.

QAlgorithms.Papers.Independent.Extend50.P40.twoStateFidelity

For every real number sss, this defines the real value

twoStateFidelity⁡(s)={1,s=0,12+232s(1+s)(3−3s+1−2s+9s2)−1+2s+3s2+(1−s)1−2s+9s2,s≠0.\operatorname{twoStateFidelity}(s)= \begin{cases} 1,&s=0,\\[2mm] \displaystyle \frac12+\frac{\sqrt2}{32s}(1+s) \left(3-3s+\sqrt{1-2s+9s^2}\right) \sqrt{-1+2s+3s^2+(1-s)\sqrt{1-2s+9s^2}}, &s\ne0. \end{cases}twoStateFidelity(s)=⎩⎨⎧​1,21​+32s2​​(1+s)(3−3s+1−2s+9s2​)−1+2s+3s2+(1−s)1−2s+9s2​​,​s=0,s=0.​

There is no restriction on sss; each real square root is defined to be 000 when its argument is negative.

QAlgorithms.Papers.Independent.Extend50.P40.vectorBloch

For every vector ψ=(ψ0,ψ1)∈C2\psi=(\psi_0,\psi_1)\in\mathbb C^2ψ=(ψ0​,ψ1​)∈C2, this defines the real vector

(2Re⁡(ψ0‾ψ1), 2Im⁡(ψ0‾ψ1), ∣ψ0∣2−∣ψ1∣2).\left( 2\operatorname{Re}(\overline{\psi_0}\psi_1),\ 2\operatorname{Im}(\overline{\psi_0}\psi_1),\ |\psi_0|^2-|\psi_1|^2 \right).(2Re(ψ0​​ψ1​), 2Im(ψ0​​ψ1​), ∣ψ0​∣2−∣ψ1​∣2).

No normalization or nonzero assumption on ψ\psiψ is required.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me