Definitions for Deterministic transformations between unitary operations: Exponential advantage with adaptive quantum circuits and the power of indefinite causality
DefinitionQAlgorithms_Papers_Independent_Extend50_P06The objects the formalized statements of Deterministic transformations between unitary operations: Exponential advantage with adaptive quantum circuits and the power of indefinite causality (arXiv:2109.08202) are stated in. Each was checked against the paper by a blind read-back and a moderator.
Target: PDF pp.10–14: a unitary-valued target with the Borel measurability implicit in the Haar averages. Continuity is not assumed for a general target: bounded measurable kernels are integrable under probability Haar measure. For the homomorphic and anti-homomorphic results, measurability implies the usual continuity of finite-dimensional unitary representations.Homomorphic: PDF pp.14,16: multiplicativity or reversed multiplicativity on SU(d).AntihomomorphictransformationChoi: PDF p.4, Eq.(3): J(U) = |U⟩⟩⟨⟨U|, input index first.QueryRegisterTransformationWiresTransformationProcessMaskoverwrite: A mask selects named wires for tracing and replacing, PDF p.9, Eq.(14).replace: Trace selected wires and tensor with their normalized identities. Summing all z duplicates unselected coordinates; division by the full dimension cancels that multiplicity. This is exactly the trace-and-replace of Eq.(14).futureMaskoutputsMaskpastMaskallMasktailMask: Wires after slot t, including F, and optionally O_t; Eq.(12).slotProductChoi: Product of k independent channel Choi matrices; each slot is used once.insertSlots: PDF p.4, Eq.(5), contracting all IO wires (entry formula includes the shared-wire transpose). There is no oracle-dependent choice in S.unitarySlotsStrategyClassTransformationAdmissible: Definitions 2–4, PDF pp.6–9. Parallel and sequential domains use the exact linear trace constraints (10),(12); general uses Definition 4, including PSD, which supplies complete positivity also for ancillary extensions.targetChoiFidelity: PDF p.11, Eq.(15): channel fidelity, normalized by target dimension e².pointFidelitytransformationAverage: PDF p.11, Eq.(17): normalized Haar average.performance: PDF pp.13–14, Eq.(24), explicitly in P,I,O,F wire order.scores: The set of actually attained fidelities, not an unconstrained real supremum.transposeTarget: Canonical targets in the computational basis, PDF pp.15,17,21.inverseTargetconjugateTargetParallelTester: PDF p.10: normalized parallel testers (positive effects summing to σ⊗I). They characterize arbitrary finite-memory probes and normalized POVMs.ParallelMeasurePrepare: Definition 5, PDF p.10: prepare the channel R_a after the tester outcome a. Transposition is absorbed into the tester convention, as explained in the text.Estimator: PDF p.17, Eqs.(46),(47): a finite normalized parallel tester with fixed unitary guesses, equivalent to a unit probe and POVM by p.10.estimateScoreestimationScoresOrthogonalCommutantBasis: A basis may be orthogonal without unit Hilbert–Schmidt norm; PDF p.15.targetTensorRepresentation: Tensor representation on k query wires followed by one target wire.place: Named IP/OF or crossed OP/IF placement, PDF Eqs.(31),(41).commutantExpansion: Hilbert–Schmidt expansion; every denominator is nonzero for a basis member.queryTargetPairProjector: PDF p.32, Eq.(113): symmetric/antisymmetric projectors, index 0/1.queryTargetBellProjector: PDF p.33, Eq.(115): maximally entangled projector / its complement.TriplepermTriple: PDF p.32, Eq.(112): permutation matrix with its inverse action explicit. The tuple a records π^{-1}(0),π^{-1}(1),π^{-1}(2).rBasis: PDF p.32, Eq.(114), in order R+,R-,R0,R1,R2,R3.sBasis: PDF p.33, Eq.(116), in order S+,S-,S0,S1,S2,S3. X=I₁⊗J(I)₂₃, V=F₁₂⊗I₃; the third physical wire is never silently swapped.sixExpansion: Eqs.(119),(122),(125). Zero members are omitted before division (not asserted to form a six-element basis at d=2). The imaginary member 3 has minus sign; Hilbert–Schmidt norms equal the printed projector/Pauli denominators.PBTProtocol: PDF p.24: deterministic PBT with k ports, a pure unit resource and a normalized k-outcome POVM on target × Alice's k registers.PBTCovariant: Eq.(70), PDF p.24: U on the measured resource halves equals Uᵀ on the retained resource halves.pbtChoi: Select one retained port, discard the others, and condition on the POVM. The redundant z_a summation is canceled by division by d.pbtProcess: The corrected p.24 transposition circuit: query Alice's measured halves, measure P together with queried O, and retain the unqueried auxiliary port. Printed p.24 instead says to measure auxiliaries; that gives the direct-U orientation, contrary to Eq.(70). This wire-label correction needs moderation.queriedResourcepbtScore: Entanglement (channel) fidelity, not average pure-state fidelity.pbtScoresCertified: A four-decimal certification is a conservative absolute error bound.StrictAdvantage: A comparison of attained optima in Definition 4's mathematical domain.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Papers_Independent_Claimed50_P17
import Definitions.Def_QAlgorithms_Papers_Independent_Claimed50_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P05
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P47
/-!
Statements from Quintino and Ebler, arXiv:2109.08202v3.
Pinned matrix, SU(d), Haar, channel-Choi and projector definitions are reused.
The remaining paper-specific definitions are local. Physical wire order is P,I,O,F, with
I and O each comprising k qudits. Choi vectors are input first and unnormalized.
-/
namespace QAlgorithms.Papers.Independent.Extend50.P06
open scoped BigOperators ComplexConjugate Matrix ComplexOrder
open MeasureTheory
noncomputable section
attribute [local instance] Classical.propDecidable
-- Exact accepted interfaces; no duplicate SU subtype or ambient-coordinate Haar law.
open QAlgorithms.Papers.Independent.Information100.P47 (Mat)
open QAlgorithms.Papers.Independent.Claimed50.P21 (SU HaarLaw)
open QAlgorithms.Papers.Independent.Dependency50.P05 (ChannelChoi)
/-- Borel matrix coordinates for the target Haar pushforward, PDF pp.11–12. -/
local instance targetMatrixMeasurable (d : ℕ) : MeasurableSpace (Mat d) := borel _
/-- PDF pp.10–14: a unitary-valued target with the Borel measurability
implicit in the Haar averages. Continuity is not assumed for a general target:
bounded measurable kernels are integrable under probability Haar measure.
For the homomorphic and anti-homomorphic results, measurability implies the
usual continuity of finite-dimensional unitary representations. -/
structure Target (d e : ℕ) where
value : SU d → Mat e
measurable : Measurable value
specialUnitary : ∀ U, value U ∈ Matrix.specialUnitaryGroup (Fin e) ℂ
/-- PDF pp.14,16: multiplicativity or reversed multiplicativity on SU(d). -/
def Homomorphic {d e : ℕ} (f : Target d e) : Prop :=
∀ U V W : SU d, W.val = U.val * V.val → f.value W = f.value U * f.value V
def Antihomomorphic {d e : ℕ} (f : Target d e) : Prop :=
∀ U V W : SU d, W.val = U.val * V.val → f.value W = f.value V * f.value U
/-- PDF p.4, Eq.(3): J(U) = |U⟩⟩⟨⟨U|, input index first. -/
def transformationChoi {d : ℕ} (U : Mat d) : Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ :=
QAlgorithms.pureDensity (WithLp.toLp 2 (fun x : Fin d × Fin d => U x.2 x.1))
abbrev QueryRegister (k d : ℕ) := Fin k → Fin d
abbrev TransformationWires (k d e : ℕ) := Fin e × QueryRegister k d × QueryRegister k d × Fin e
abbrev TransformationProcess (k d e : ℕ) := Matrix (TransformationWires k d e) (TransformationWires k d e) ℂ
abbrev Mask (k : ℕ) := Bool × (Fin k → Bool) × (Fin k → Bool) × Bool
/-- A mask selects named wires for tracing and replacing, PDF p.9, Eq.(14). -/
def overwrite {k d e : ℕ} (m : Mask k) (x z : TransformationWires k d e) : TransformationWires k d e :=
(if m.1 then z.1 else x.1,
(fun j => if m.2.1 j then z.2.1 j else x.2.1 j),
(fun j => if m.2.2.1 j then z.2.2.1 j else x.2.2.1 j),
if m.2.2.2 then z.2.2.2 else x.2.2.2)
/-- Trace selected wires and tensor with their normalized identities. Summing
all z duplicates unselected coordinates; division by the full dimension cancels
that multiplicity. This is exactly the trace-and-replace of Eq.(14). -/
def replace {k d e : ℕ} (m : Mask k) (S : TransformationProcess k d e) : TransformationProcess k d e :=
fun x y => if (m.1 = true → x.1 = y.1) ∧
(∀ j, m.2.1 j = true → x.2.1 j = y.2.1 j) ∧
(∀ j, m.2.2.1 j = true → x.2.2.1 j = y.2.2.1 j) ∧
(m.2.2.2 = true → x.2.2.2 = y.2.2.2)
then (∑ z : TransformationWires k d e, S (overwrite m x z) (overwrite m y z)) /
(Fintype.card (TransformationWires k d e) : ℂ)
else 0
def futureMask (k : ℕ) : Mask k := (false, fun _ => false, fun _ => false, true)
def outputsMask (k : ℕ) : Mask k := (false, fun _ => false, fun _ => true, true)
def pastMask (k : ℕ) : Mask k := (false, fun _ => true, fun _ => true, true)
def allMask (k : ℕ) : Mask k := (true, fun _ => true, fun _ => true, true)
/-- Wires after slot t, including F, and optionally O_t; Eq.(12). -/
def tailMask {k : ℕ} (t : Fin k) (includeOutput : Bool) : Mask k :=
(false, fun j => decide (t < j),
fun j => decide (t < j) || (includeOutput && decide (j = t)), true)
/-- Product of k independent channel Choi matrices; each slot is used once. -/
def slotProductChoi {k d : ℕ}
(C : Fin k → Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ) :
Matrix (QueryRegister k d × QueryRegister k d) (QueryRegister k d × QueryRegister k d) ℂ :=
fun x y => ∏ t, C t (x.1 t,x.2 t) (y.1 t,y.2 t)
/-- PDF p.4, Eq.(5), contracting all IO wires (entry formula includes the
shared-wire transpose). There is no oracle-dependent choice in S. -/
def insertSlots {k d e : ℕ} (S : TransformationProcess k d e)
(C : Matrix (QueryRegister k d × QueryRegister k d) (QueryRegister k d × QueryRegister k d) ℂ) :
Matrix (Fin e × Fin e) (Fin e × Fin e) ℂ :=
fun x y => ∑ i, ∑ j, ∑ o, ∑ v, S (x.1,i,o,x.2) (y.1,j,v,y.2) * C (i,o) (j,v)
def unitarySlots {k d : ℕ} (U : Mat d) := slotProductChoi (k := k) (fun _ => transformationChoi U)
inductive StrategyClass where
| parallel | sequential | general
deriving DecidableEq
/-- Definitions 2–4, PDF pp.6–9. Parallel and sequential domains use the exact
linear trace constraints (10),(12); general uses Definition 4, including PSD,
which supplies complete positivity also for ancillary extensions. -/
def TransformationAdmissible {k d e : ℕ} (c : StrategyClass) (S : TransformationProcess k d e) : Prop :=
S.PosSemidef ∧ match c with
| .parallel => replace (futureMask k) S = replace (outputsMask k) S ∧
replace (pastMask k) S = replace (allMask k) S ∧ S.trace = (e * d ^ k : ℕ)
| .sequential => (∀ t, replace (tailMask t false) S = replace (tailMask t true) S) ∧
replace (pastMask k) S = replace (allMask k) S ∧ S.trace = (e * d ^ k : ℕ)
| .general => ∀ C : Fin k → Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ,
(∀ t, ChannelChoi (C t)) → ChannelChoi (insertSlots S (slotProductChoi C))
/-- PDF p.11, Eq.(15): channel fidelity, normalized by target dimension e². -/
def targetChoiFidelity {e : ℕ} (C : Matrix (Fin e × Fin e) (Fin e × Fin e) ℂ)
(V : Mat e) : ℝ := (Matrix.trace (C * transformationChoi V)).re / (e : ℝ)^2
def pointFidelity {k d e : ℕ} (S : TransformationProcess k d e) (f : SU d → Mat e) (U : SU d) : ℝ :=
targetChoiFidelity (insertSlots S (unitarySlots U.val)) (f U)
/-- PDF p.11, Eq.(17): normalized Haar average. -/
def transformationAverage {k d e : ℕ} (H : HaarLaw d) (f : SU d → Mat e) (S : TransformationProcess k d e) : ℝ :=
∫ U, pointFidelity S f U ∂H.law
/-- PDF pp.13–14, Eq.(24), explicitly in P,I,O,F wire order. -/
def performance {k d e : ℕ} (H : HaarLaw d) (f : SU d → Mat e) : TransformationProcess k d e :=
((e : ℂ)^2)⁻¹ • ∫ U : SU d, (fun (x y : TransformationWires k d e) => transformationChoi (f U) (x.1,x.2.2.2) (y.1,y.2.2.2) *
conj (unitarySlots (k := k) U.val (x.2.1,x.2.2.1) (y.2.1,y.2.2.1))) ∂H.law
/-- The set of actually attained fidelities, not an unconstrained real supremum. -/
def scores {k d e : ℕ} (H : HaarLaw d) (f : SU d → Mat e) (c : StrategyClass) : Set ℝ :=
{v | ∃ S : TransformationProcess k d e, TransformationAdmissible c S ∧ transformationAverage H f S = v}
/-- Canonical targets in the computational basis, PDF pp.15,17,21. -/
def transposeTarget {d : ℕ} (U : SU d) : Mat d := U.val.transpose
def inverseTarget {d : ℕ} (U : SU d) : Mat d := U.valᴴ
def conjugateTarget {d : ℕ} (U : SU d) : Mat d := U.val.map conj
/-- PDF p.10: normalized parallel testers (positive effects summing to σ⊗I).
They characterize arbitrary finite-memory probes and normalized POVMs. -/
def ParallelTester {k d n : ℕ}
(T : Fin n → Matrix (QueryRegister k d × QueryRegister k d) (QueryRegister k d × QueryRegister k d) ℂ) : Prop :=
(∀ a, (T a).PosSemidef) ∧ ∃ σ : Matrix (QueryRegister k d) (QueryRegister k d) ℂ,
σ.PosSemidef ∧ σ.trace = 1 ∧ ∀ x y,
(∑ a, T a x y) = σ x.1 y.1 * (1 : Matrix (QueryRegister k d) (QueryRegister k d) ℂ) x.2 y.2
/-- Definition 5, PDF p.10: prepare the channel R_a after the tester outcome a.
Transposition is absorbed into the tester convention, as explained in the text. -/
def ParallelMeasurePrepare {k d e : ℕ} (S : TransformationProcess k d e) : Prop :=
∃ n : ℕ, ∃ T : Fin n → Matrix (QueryRegister k d × QueryRegister k d) (QueryRegister k d × QueryRegister k d) ℂ,
∃ R : Fin n → Matrix (Fin e × Fin e) (Fin e × Fin e) ℂ,
ParallelTester T ∧ (∀ a, ChannelChoi (R a)) ∧
∀ x y, S x y = ∑ a, T a (x.2.1,x.2.2.1) (y.2.1,y.2.2.1) *
R a (x.1,x.2.2.2) (y.1,y.2.2.2)
/-- PDF p.17, Eqs.(46),(47): a finite normalized parallel tester with fixed
unitary guesses, equivalent to a unit probe and POVM by p.10. -/
structure Estimator (k d n : ℕ) where
tester : Fin n → Matrix (QueryRegister k d × QueryRegister k d) (QueryRegister k d × QueryRegister k d) ℂ
normalized : ParallelTester tester
guess : Fin n → SU d
def estimateScore {k d n : ℕ} (H : HaarLaw d) (E : Estimator k d n) : ℝ :=
∫ U, ∑ a, (Matrix.trace (E.tester a * unitarySlots U.val)).re *
targetChoiFidelity (transformationChoi (E.guess a).val) U.val ∂H.law
def estimationScores {k d : ℕ} (H : HaarLaw d) : Set ℝ :=
{v | ∃ n : ℕ, ∃ E : Estimator k d n, estimateScore H E = v}
/-- A basis may be orthogonal without unit Hilbert–Schmidt norm; PDF p.15. -/
def OrthogonalCommutantBasis {d n : ℕ} {ι : Type*} [Fintype ι]
(ρ : SU d → Matrix ι ι ℂ) (P : Fin n → Matrix ι ι ℂ) : Prop :=
(∀ i, P i ≠ 0) ∧ (∀ i j, i ≠ j → Matrix.trace ((P i)ᴴ * P j) = 0) ∧
∀ A : Matrix ι ι ℂ, (∀ U, A * ρ U = ρ U * A) ↔ A ∈ Submodule.span ℂ (Set.range P)
/-- Tensor representation on k query wires followed by one target wire. -/
def targetTensorRepresentation {k d e : ℕ} (f : SU d → Mat e) (anti : Bool) (U : SU d) :
Matrix (QueryRegister k d × Fin e) (QueryRegister k d × Fin e) ℂ :=
fun x y => (∏ t, conj (U.val (x.1 t) (y.1 t))) *
(if anti then (f U).transpose x.2 y.2 else f U x.2 y.2)
/-- Named IP/OF or crossed OP/IF placement, PDF Eqs.(31),(41). -/
def place {k d e : ℕ} (crossed : Bool)
(A B : Matrix (QueryRegister k d × Fin e) (QueryRegister k d × Fin e) ℂ) : TransformationProcess k d e :=
fun x y => if crossed then A (x.2.2.1,x.1) (y.2.2.1,y.1) * B (x.2.1,x.2.2.2) (y.2.1,y.2.2.2)
else A (x.2.1,x.1) (y.2.1,y.1) * B (x.2.2.1,x.2.2.2) (y.2.2.1,y.2.2.2)
/-- Hilbert–Schmidt expansion; every denominator is nonzero for a basis member. -/
def commutantExpansion {k d e n : ℕ} (crossed : Bool)
(P : Fin n → Matrix (QueryRegister k d × Fin e) (QueryRegister k d × Fin e) ℂ) : TransformationProcess k d e :=
((e : ℂ)^2)⁻¹ • ∑ i, (Matrix.trace ((P i)ᴴ * P i))⁻¹ • place crossed ((P i).map conj) (P i)
example : transformationChoi (1 : Mat 1) (0,0) (0,0) = 1 := by simp [transformationChoi, QAlgorithms.pureDensity]
example (k d : ℕ) (U : Mat d) : unitarySlots (k := 0) U = 1 := by
ext x y
have hxy : x = y := Subsingleton.elim _ _
subst y
simp [unitarySlots, slotProductChoi, Matrix.one_apply]
/-- PDF p.32, Eq.(113): symmetric/antisymmetric projectors, index 0/1. -/
def queryTargetPairProjector (d : ℕ) (antisymmetric : Bool) :
Matrix (QueryRegister 1 d × Fin d) (QueryRegister 1 d × Fin d) ℂ :=
fun x y => QAlgorithms.Papers.Independent.Claimed50.P17.pairProjector d
(if antisymmetric then 1 else 0) (x.1 0,x.2) (y.1 0,y.2)
/-- PDF p.33, Eq.(115): maximally entangled projector / its complement. -/
def queryTargetBellProjector (d : ℕ) (complement : Bool) :
Matrix (QueryRegister 1 d × Fin d) (QueryRegister 1 d × Fin d) ℂ :=
let P : Matrix (QueryRegister 1 d × Fin d) (QueryRegister 1 d × Fin d) ℂ :=
fun x y => QAlgorithms.Papers.Independent.Claimed50.P21.entangledProjector d
(x.1 0,x.2) (y.1 0,y.2)
if complement then 1 - P else P
abbrev Triple (d : ℕ) := QueryRegister 2 d × Fin d
/-- PDF p.32, Eq.(112): permutation matrix with its inverse action explicit.
The tuple a records π^{-1}(0),π^{-1}(1),π^{-1}(2). -/
def permTriple (d : ℕ) (a : Fin 3 → Fin 3) : Matrix (Triple d) (Triple d) ℂ :=
fun x y => let xv : Fin 3 → Fin d := ![x.1 0,x.1 1,x.2]
let yv : Fin 3 → Fin d := ![y.1 0,y.1 1,y.2]
if ∀ j, xv j = yv (a j) then 1 else 0
/-- PDF p.32, Eq.(114), in order R+,R-,R0,R1,R2,R3. -/
def rBasis (d : ℕ) : Fin 6 → Matrix (Triple d) (Triple d) ℂ :=
let a := permTriple d ![1,0,2]
let b := permTriple d ![0,2,1]
let c := permTriple d ![2,1,0]
let v := permTriple d ![2,0,1]
let w := permTriple d ![1,2,0]
![(6 : ℂ)⁻¹ • (1+a+b+c+v+w),
(6 : ℂ)⁻¹ • (1-a-b-c+v+w),
(3 : ℂ)⁻¹ • ((2 : ℂ) • 1-v-w),
(3 : ℂ)⁻¹ • ((2 : ℂ) • b-c-a),
((Real.sqrt 3 : ℂ))⁻¹ • (a-c),
(Complex.I / (Real.sqrt 3 : ℂ)) • (v-w)]
/-- PDF p.33, Eq.(116), in order S+,S-,S0,S1,S2,S3. X=I₁⊗J(I)₂₃,
V=F₁₂⊗I₃; the third physical wire is never silently swapped. -/
def sBasis (d : ℕ) : Fin 6 → Matrix (Triple d) (Triple d) ℂ :=
let X : Matrix (Triple d) (Triple d) ℂ := fun x y =>
if x.1 0 = y.1 0 ∧ x.1 1 = x.2 ∧ y.1 1 = y.2 then 1 else 0
let V := permTriple d ![1,0,2]
let A := (2 : ℂ)⁻¹ • (1+V)
let B := (2 : ℂ)⁻¹ • (1-V)
let q : ℂ := (d : ℂ)^2-1
![A * (1 - (2 / ((d : ℂ)+1)) • X) * A,
B * (1 - (2 / ((d : ℂ)-1)) • X) * B,
q⁻¹ • ((d : ℂ) • (X+V*X*V) - (X*V+V*X)),
q⁻¹ • ((d : ℂ) • (X*V+V*X) - (X+V*X*V)),
(Real.sqrt ((d : ℝ)^2-1) : ℂ)⁻¹ • (X-V*X*V),
(Complex.I / (Real.sqrt ((d : ℝ)^2-1) : ℂ)) • (X*V-V*X)]
/-- Eqs.(119),(122),(125). Zero members are omitted before division (not
asserted to form a six-element basis at d=2). The imaginary member 3 has minus
sign; Hilbert–Schmidt norms equal the printed projector/Pauli denominators. -/
def sixExpansion (d : ℕ) (crossed : Bool)
(B : Fin 6 → Matrix (Triple d) (Triple d) ℂ) : TransformationProcess 2 d d :=
((d : ℂ)^2)⁻¹ • ∑ i, if B i = 0 then 0 else
((if i = 5 then (-1 : ℂ) else 1) / Matrix.trace ((B i)ᴴ * B i)) •
place crossed (B i) (B i)
/-- PDF p.24: deterministic PBT with k ports, a pure unit resource and a
normalized k-outcome POVM on target × Alice's k registers. -/
structure PBTProtocol (k d : ℕ) where
resource : QueryRegister k d × QueryRegister k d → ℂ
unit : ∑ x, Complex.normSq (resource x) = 1
effect : Fin k → Matrix (Fin d × QueryRegister k d) (Fin d × QueryRegister k d) ℂ
positive : ∀ a, (effect a).PosSemidef
complete : ∑ a, effect a = 1
/-- Eq.(70), PDF p.24: U on the measured resource halves equals Uᵀ on the
retained resource halves. -/
def PBTCovariant {k d : ℕ} (P : PBTProtocol k d) : Prop :=
∀ U : SU d, ∀ a b : QueryRegister k d,
(∑ c, (∏ t, U.val (a t) (c t)) * P.resource (c,b)) =
∑ c, (∏ t, U.val (c t) (b t)) * P.resource (a,c)
/-- Select one retained port, discard the others, and condition on the POVM.
The redundant z_a summation is canceled by division by d. -/
def pbtChoi {k d : ℕ} (P : PBTProtocol k d)
(ψ : QueryRegister k d × QueryRegister k d → ℂ) : Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ :=
fun x y => (∑ a, ∑ i, ∑ j, ∑ z : QueryRegister k d,
P.effect a (y.1,j) (x.1,i) * ψ (i,Function.update z a x.2) *
conj (ψ (j,Function.update z a y.2))) / (d : ℂ)
/-- The corrected p.24 transposition circuit: query Alice's measured halves,
measure P together with queried O, and retain the unqueried auxiliary port.
Printed p.24 instead says to measure auxiliaries; that gives the direct-U
orientation, contrary to Eq.(70). This wire-label correction needs moderation. -/
def pbtProcess {k d : ℕ} (P : PBTProtocol k d) : TransformationProcess k d d :=
fun x y => (∑ a, ∑ z : QueryRegister k d,
P.effect a (y.1,y.2.2.1) (x.1,x.2.2.1) *
P.resource (x.2.1,Function.update z a x.2.2.2) *
conj (P.resource (y.2.1,Function.update z a y.2.2.2))) / (d : ℂ)
def queriedResource {k d : ℕ} (P : PBTProtocol k d) (U : Mat d) :
QueryRegister k d × QueryRegister k d → ℂ :=
fun x => ∑ i, (∏ t, U (x.1 t) (i t)) * P.resource (i,x.2)
/-- Entanglement (channel) fidelity, not average pure-state fidelity. -/
def pbtScore {k d : ℕ} (P : PBTProtocol k d) : ℝ :=
targetChoiFidelity (pbtChoi P P.resource) 1
def pbtScores (k d : ℕ) : Set ℝ := {v | ∃ P : PBTProtocol k d, pbtScore P = v}
/-- A four-decimal certification is a conservative absolute error bound. -/
def Certified {k d : ℕ} (H : HaarLaw d) (f : SU d → Mat d)
(c : StrategyClass) (r : ℝ) : Prop :=
∃ v, IsGreatest (scores (k := k) H f c) v ∧ |v-r| ≤ 1/10000
/-- A comparison of attained optima in Definition 4's mathematical domain. -/
def StrictAdvantage {k d : ℕ} (H : HaarLaw d) (f : SU d → Mat d) : Prop :=
∃ a b, IsGreatest (scores (k := k) H f .sequential) a ∧
IsGreatest (scores (k := k) H f .general) b ∧ a < b
example : queryTargetPairProjector 1 false (fun _ => 0,0) (fun _ => 0,0) = 1 := by
norm_num [queryTargetPairProjector,
QAlgorithms.Papers.Independent.Claimed50.P17.pairProjector]
example (d : ℕ) : queryTargetBellProjector d true = 1 - queryTargetBellProjector d false := rfl
end
end QAlgorithms.Papers.Independent.Extend50.P06
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Extend50.P06.Antihomomorphic
For any natural numbers and any target , meaning a continuous function from to complex matrices whose values are special unitary, is called antihomomorphic precisely when, for every , equality of their underlying matrices implies . The dimensions may be zero.
QAlgorithms.Papers.Independent.Extend50.P06.Certified
Let be arbitrary natural numbers, let be a probability measure on invariant under both left and right multiplication, let be any function, let be one of parallel, sequential, or general, and let . The predicate means that there exists an attained greatest average score among the processes described below, and . Put , and index a process matrix by . Write
Its average score is . For a set of coordinate wires, define
where only the selected coordinates are overwritten. Let and denote all - and -wires, and the first and last wires. Every admissible must be positive semidefinite. In the parallel class it additionally satisfies , , and . In the sequential class the first equality is replaced by for every , where , with the same second equality and trace condition. In the general class, for every family of positive semidefinite matrices satisfying , the matrix must be positive semidefinite and satisfy that same output-partial-trace identity. “Attained greatest” means some admissible process has score and every admissible process has score at most . There are no positivity restrictions on , no continuity or special-unitary requirement on , and no explicit integrability assumption; divisions and the integral use their total definitions, including division by zero being zero and a nonintegrable Bochner integral being zero.
QAlgorithms.Papers.Independent.Extend50.P06.Estimator
For arbitrary natural numbers , let . An estimator consists of a family of complex matrices indexed by , evidence that each is positive semidefinite and that there exists a positive semidefinite matrix indexed by with and , and a choice of special unitary matrix for each . No distinctness condition is imposed on the guesses . When , is a singleton; when , the required cannot exist, and no estimator exists. No estimator exists with .
QAlgorithms.Papers.Independent.Extend50.P06.Homomorphic
For any natural numbers and any target , meaning a continuous function from to complex matrices whose values are special unitary, is called homomorphic precisely when, for every , equality of their underlying matrices implies . The dimensions may be zero.
QAlgorithms.Papers.Independent.Extend50.P06.Mask
For every natural number , a mask is a tuple consisting of two Boolean values and two Boolean-valued functions on . When , both functions are uniquely determined, while the two endpoint Boolean values remain arbitrary.
QAlgorithms.Papers.Independent.Extend50.P06.OrthogonalCommutantBasis
For arbitrary natural numbers , any finite type equipped with a finite enumeration, any function , and any family , this predicate says that every is nonzero, that for every distinct pair , and that for every complex matrix indexed by ,
No representation, continuity, or unitarity property is required of . The finite type may be empty, and may be zero; when , the span is , so the last condition says that the common commutant is exactly .
QAlgorithms.Papers.Independent.Extend50.P06.PBTCovariant
For arbitrary natural numbers , let , , and let consist of a resource function with , and positive semidefinite effects on satisfying . This predicate requires that, for every complex unitary matrix with determinant , and every ,
There are no complex conjugates in these products, and this condition places no additional requirement on the effects. Empty products equal , empty sums equal , and the natural parameters are not assumed positive.
QAlgorithms.Papers.Independent.Extend50.P06.PBTProtocol
For natural numbers , let and . This structure consists of a function satisfying
together with complex matrices on , one for each , such that every is positive semidefinite and . No covariance condition is part of the structure. Zero parameters are included: if , then is a singleton and completeness requires the empty sum to equal the identity on ; hence no such structure exists when . If , then is empty and resource normalization is impossible. When , the resource has one entry of modulus one and the effect family is empty on an empty matrix index set.
QAlgorithms.Papers.Independent.Extend50.P06.ParallelMeasurePrepare
For arbitrary natural numbers , let , and let be a complex matrix indexed by tuples . This predicate means that there exist a natural number , positive semidefinite matrices indexed by , a positive semidefinite matrix indexed by with , and matrices indexed by , such that
and, for every pair of indexing tuples,
The definition imposes exactly this factorization and these normalization conditions. Zero parameter values are allowed syntactically, with empty sums and products interpreted conventionally; the tester normalization makes an empty outcome family, or an empty , impossible.
QAlgorithms.Papers.Independent.Extend50.P06.ParallelTester
For arbitrary natural numbers , put . A family of complex matrices indexed by satisfies this predicate precisely when every is positive semidefinite and there exists a positive semidefinite matrix indexed by , with complex trace exactly , such that
Thus its normalization is . All zero parameter values are included: when , contains the unique empty function; when , is empty and the trace-one requirement is impossible. The predicate also cannot hold when .
QAlgorithms.Papers.Independent.Extend50.P06.QueryRegister
For natural numbers , a query register is a function from to , equivalently an ordered -tuple of indices in the latter set. When , there is exactly one such function, including when ; when and , there are none.
QAlgorithms.Papers.Independent.Extend50.P06.StrategyClass
This declaration defines a type with exactly three distinct values, named , , and , and supplies a procedure for deciding equality between its values. It has no parameters, and these names alone impose no additional mathematical conditions.
QAlgorithms.Papers.Independent.Extend50.P06.StrictAdvantage
For arbitrary natural numbers , a probability measure on invariant under left and right multiplication, and any function , the predicate asserts the existence of attained greatest sequential and general average scores , respectively, with . Explicitly, put and ; a process is a matrix indexed by . Define
The score of is . For selected coordinate wires , let be zero unless agree on , and otherwise equal . A sequential process is positive semidefinite, has trace , satisfies , and, for every , satisfies , where are the first and last wires, are all query input and output wires, and . A general process is positive semidefinite and, whenever each slot matrix is positive semidefinite with , its insertion is positive semidefinite with output partial trace equal to the identity. The assertion requires a sequential process of score , all sequential scores at most , a general process of score , and all general scores at most . Zero parameters and empty index sets are included; no regularity assumption is made on , division by zero is zero, and a nonintegrable Bochner integral is assigned zero.
QAlgorithms.Papers.Independent.Extend50.P06.Target
For any natural numbers , including zero, a target consists of a measurable function , together with the requirement that for every . Here denotes the group of complex unitary matrices with determinant , and measurability uses the Borel measurable structures on the matrix spaces and the special unitary group.
QAlgorithms.Papers.Independent.Extend50.P06.TransformationAdmissible
For arbitrary natural numbers , a choice among , , and , and a complex matrix on , where and , this predicate first requires to be positive semidefinite. To state its remaining requirements, label the coordinates of by . For a selection of these coordinates, define unless and agree on every selected coordinate; otherwise define
where the overwrite replaces exactly the selected coordinates by those of . The denominator is the cardinality of the entire set . For , the requirements are
For , the second equality and trace requirement above remain, and the first is replaced by, for every ,
For , the requirement is instead that every family satisfying produces a matrix
that is positive semidefinite and satisfies . There is no separate trace requirement in this branch. All zero dimensions are included, empty products equal , and division by zero is interpreted as zero. In particular, when , the sequential conditions indexed by are vacuous, while the general branch requires , with its singleton register coordinates suppressed, to satisfy precisely the displayed positivity and partial-trace conditions for .
QAlgorithms.Papers.Independent.Extend50.P06.TransformationProcess
For natural numbers , a transformation process is an arbitrary complex square matrix indexed by tuples , where and . No positivity, trace, or normalization condition is imposed. If , or if and , the index set is empty and there is a unique such matrix.
QAlgorithms.Papers.Independent.Extend50.P06.TransformationWires
For natural numbers , the transformation-wire index set consists of tuples , where and are functions . Its cardinality is , with even for . Thus it is empty if or if and ; for , the two function coordinates are unique.
QAlgorithms.Papers.Independent.Extend50.P06.Triple
For every natural number , this abbreviates the type of pairs , where and . Equivalently, an element records an ordered triple of indices between and . For , this type is empty.
QAlgorithms.Papers.Independent.Extend50.P06.allMask
For every natural number , a mask is a quadruple consisting of a Boolean, two Boolean functions on , and another Boolean. This definition gives
Every component is therefore true wherever it has an argument. The definition also includes , when the two indexed functions have empty domains.
QAlgorithms.Papers.Independent.Extend50.P06.commutantExpansion
For arbitrary natural numbers , a Boolean , and any family of complex matrices indexed by , where and , this defines a complex matrix indexed by . For and , its entries are
Here is conjugate transpose, and all reciprocals are taken in , with ; consequently a zero contributes zero. No orthogonality, independence, commutation, or normalization condition is imposed on the family. All four natural parameters may be zero; an empty sum is zero, and contains the unique empty function when .
QAlgorithms.Papers.Independent.Extend50.P06.conjugateTarget
For every natural number and every special unitary matrix , this definition returns its entrywise complex conjugate, whose -entry is . The case is included and returns the empty matrix.
QAlgorithms.Papers.Independent.Extend50.P06.estimateScore
For arbitrary natural numbers , let be a probability measure on invariant under left and right multiplication, and let be an estimator consisting of guesses and positive semidefinite matrices indexed by , where , with for some positive semidefinite of trace . This definition assigns the real number
where and
The finite sum runs over all estimator outcomes. The case uses the singleton empty query register and an empty product equal to ; division by uses the convention , so the expression is also defined at whenever an estimator of the specified parameters exists.
QAlgorithms.Papers.Independent.Extend50.P06.estimationScores
For arbitrary natural numbers and a probability measure on invariant under left and right multiplication, this definition gives the set of all real numbers
obtained by choosing a natural number , guesses , and positive semidefinite matrices indexed by , where , such that for some positive semidefinite matrix indexed by with trace . Here , and . Membership requires an actual such finite estimator attaining the number; no supremum or closure is taken. Zero values of are included, empty products equal , and division by zero equals ; if , the required trace-one cannot exist and the set is empty.
QAlgorithms.Papers.Independent.Extend50.P06.futureMask
For every natural number , the future mask is the Boolean tuple . It marks only the final endpoint coordinate of a tuple , leaving the first endpoint and all positions of both -component function coordinates unmarked. This also applies when .
QAlgorithms.Papers.Independent.Extend50.P06.insertSlots
For arbitrary natural numbers , let be the set of functions from to . Given any complex matrix on
and any complex matrix on , this definition produces the matrix on pairs of indices given by
The contraction uses the displayed entries of without conjugating them. Neither matrix has any positivity or normalization hypothesis. When , all four summation indices have a single possible value. When and , these sums are empty and ; when , is an empty matrix.
QAlgorithms.Papers.Independent.Extend50.P06.inverseTarget
For every natural number and every special unitary matrix , this definition returns its conjugate transpose , whose -entry is . The case is included and returns the empty matrix.
QAlgorithms.Papers.Independent.Extend50.P06.outputsMask
For every natural number , the outputs mask is the Boolean tuple . It marks every position of the second -component function coordinate and the final endpoint of a tuple , leaving the first endpoint and the first function coordinate unmarked. When , only the final endpoint is marked.
QAlgorithms.Papers.Independent.Extend50.P06.overwrite
For any natural numbers , a mask , and tuples and with endpoint coordinates in and function coordinates from to , overwriting produces by taking each coordinate from exactly where the corresponding mask value is true and otherwise taking it from . Thus if is true and otherwise, if is true and otherwise, if is true and otherwise, and if is true and otherwise. For , only the endpoint choices remain; if the tuple index set is empty, there are no arguments .
QAlgorithms.Papers.Independent.Extend50.P06.pastMask
For every natural number , a mask is a quadruple consisting of a Boolean, two Boolean functions on , and another Boolean. This definition gives
Thus its first component is false, both indexed components are true at every index, and its last component is true. When , both indexed functions have empty domains.
QAlgorithms.Papers.Independent.Extend50.P06.pbtChoi
For arbitrary natural numbers , put and . Let consist of a normalized resource function , with , and positive semidefinite matrices on , indexed by , with . For any function , this defines a complex matrix on by
where denotes with coordinate replaced by . The supplied function need not be normalized or equal to ; the resource is not otherwise used in this formula. Division is complex division with , and the definition imposes no positivity restriction on or beyond the requirements implicit in the existence of .
QAlgorithms.Papers.Independent.Extend50.P06.pbtProcess
For arbitrary natural numbers , let , , and let consist of a resource function satisfying , and positive semidefinite matrices on , indexed by , satisfying . This defines a complex matrix on . For and , its entries are
where the replacement notation changes only coordinate . The factor is a complex reciprocal with ; empty sums are zero. The definition does not assert that this matrix satisfies any additional process admissibility condition, and range over all natural numbers for which the stipulated protocol exists.
QAlgorithms.Papers.Independent.Extend50.P06.pbtScore
For natural numbers , let , and let consist of a resource with and positive semidefinite matrices on , for , with . Define a matrix , indexed by pairs from , by
where replaces coordinate of by . The score is
Thus the vector used here is the unnormalized diagonal vector. Zero parameters are allowed, and division by zero is interpreted as zero; protocol existence excludes and .
QAlgorithms.Papers.Independent.Extend50.P06.pbtScores
For every pair of natural numbers , including zero, let . The set consists exactly of the real numbers
obtained by choosing a function with and matrices , for , that are positive semidefinite on and sum to the identity, and then setting
Here coordinate replacement has its literal meaning, empty sums are zero, empty products are one, and division by zero is zero. Membership asserts existence of such a protocol with exactly that score, without asserting attainment of a maximum. The set is empty when or , since the protocol conditions are then impossible.
QAlgorithms.Papers.Independent.Extend50.P06.performance
For arbitrary natural numbers , let consist of a Borel probability measure on invariant under both left and right multiplication by every member of , and let be any function. With and , this definition produces the complex matrix on whose entries are
The integral in the definition is a matrix-valued Bochner integral, and the scalar factor multiplies that integral. No continuity, measurability, or unitarity is assumed of ; if the matrix-valued integrand is not integrable, its integral is defined to be the zero matrix. When , the product is ; when , or when and , the resulting matrix has an empty indexing set.
QAlgorithms.Papers.Independent.Extend50.P06.permTriple
For every natural number and every function , this defines a complex matrix indexed by ordered triples of elements of . For triples and , its entry is
The function is arbitrary: it need not be injective or a permutation, so repeated coordinate selections are included. For , the matrix has an empty index set.
QAlgorithms.Papers.Independent.Extend50.P06.place
For arbitrary natural numbers , put . Given a Boolean flag and arbitrary complex matrices indexed by , this definition returns the complex matrix indexed by tuples , whose entries are
No positivity, normalization, or admissibility conditions are imposed on or on the resulting matrix. Zero values of are included, with a singleton when and the result an empty matrix whenever its indexing type is empty.
QAlgorithms.Papers.Independent.Extend50.P06.pointFidelity
For arbitrary natural numbers , let be the set of functions from the indices to the indices. Given any complex matrix on , any function from the special unitary group to complex matrices, and any , define
The definition returns
No admissibility condition is imposed on , and no continuity, measurability, or unitarity condition is imposed on . Empty products equal , including when ; the value is if , and also if and .
QAlgorithms.Papers.Independent.Extend50.P06.queriedResource
For natural numbers , write . A protocol supplies a complex function satisfying , and positive semidefinite matrices , indexed by , on , satisfying . For every complex matrix , the definition gives the function
No unitarity assumption is imposed on . Empty products equal , and empty sums equal . The natural-number parameters include zero, although no such protocol exists when , because its empty family of effects would have to sum to a nonzero identity, or when , because its resource could not have squared norm .
QAlgorithms.Papers.Independent.Extend50.P06.queryTargetBellProjector
For every natural number and Boolean , let be the set of functions , and define a complex matrix indexed by by
The defined matrix is if is true and otherwise, where is the identity matrix on that index set. The factor is the complex reciprocal, with . In particular, is included and gives a matrix on an empty index set.
QAlgorithms.Papers.Independent.Extend50.P06.queryTargetPairProjector
For every natural number and Boolean , this defines a complex matrix on pairs , where and . Writing , , and when is true and otherwise, its entry is
Thus the Boolean selects the minus or plus sign in this formula. The definition includes , when the matrix has an empty index set.
QAlgorithms.Papers.Independent.Extend50.P06.rBasis
For every natural number , this defines a family of six complex matrices indexed by triples in . For a coordinate list , let if for all three coordinates, and otherwise; set , , , , and . With the identity matrix, the six matrices, in index order , are
This specifies the family without asserting that it is a basis or that its members are nonzero or independent. The definition includes , when all these matrices have an empty index set.
QAlgorithms.Papers.Independent.Extend50.P06.replace
For any natural numbers , let be the set of tuples with and , let be any complex matrix indexed by , and let be a Boolean mask. Write for the tuple obtained by taking each coordinate from where its mask value is true and from otherwise. The replacement matrix is defined by
Agreement is required separately at each marked endpoint and each marked position of either function coordinate; no agreement is required at unmarked coordinates. The denominator is the cardinality of the entire tuple set, . When , the function coordinates are unique; when is empty, the resulting matrix has no entries.
QAlgorithms.Papers.Independent.Extend50.P06.sBasis
For every natural number , this defines six complex matrices on triples in . Define when , , and , and otherwise; define when , , and , and otherwise. Put , , and , interpreted as a complex scalar. The six matrices, in index order , are
All matrix products have the displayed order. The square root is the real square root, which is zero on negative inputs, subsequently regarded as complex; every zero denominator has reciprocal zero. Thus is included despite the vanishing denominators, and gives matrices on an empty index set. No basis or independence property is asserted.
QAlgorithms.Papers.Independent.Extend50.P06.scores
For arbitrary natural numbers , let and , with coordinates written . Given a probability measure on invariant under both left and right multiplication, an arbitrary function , and a choice of parallel, sequential, or general strategy, this definition gives the set of real numbers
Here , and
In all three cases is a positive semidefinite complex matrix indexed by . To specify the remaining conditions, for a set of coordinate positions define
where the selected coordinates of each argument are replaced by those of the same . The parallel conditions are , , and . The sequential conditions replace the first equality by, for every , , where , and retain the other equality and trace condition. The general condition is that for every family of positive semidefinite matrices indexed by satisfying , the matrix
is positive semidefinite and satisfies . Zero values of are included: empty products equal , empty sums equal , and division by zero equals . No continuity, homomorphism, or unitarity assumption is imposed on ; the integral uses the total Bochner integral, which equals when its integrand is not integrable.
QAlgorithms.Papers.Independent.Extend50.P06.sixExpansion
For every natural number , Boolean , and arbitrary family of complex matrices indexed by , where and , this defines a complex matrix on . For and , its entry is
A zero contributes zero by an explicit case distinction. All divisions are complex divisions with zero reciprocal equal to zero; is allowed and yields an empty index set. There are no assumptions that the six matrices form a basis or satisfy any symmetry or normalization.
QAlgorithms.Papers.Independent.Extend50.P06.slotProductChoi
For arbitrary natural numbers , write , the set of functions from the indices to the indices. Given any family of complex matrices indexed by pairs of indices, this definition produces a complex matrix on with entries
No positivity or normalization is required of the matrices . For , is a singleton and the empty product is , so the resulting matrix has its sole entry equal to , including when . For and , its indexing set is empty.
QAlgorithms.Papers.Independent.Extend50.P06.tailMask
For every natural number , every index , and every Boolean supplied as , this definition returns the mask
where brackets denote the Boolean truth value of a proposition. The second component is true precisely at indices strictly greater than ; the third is true at those indices and also at if is true. The first component is false and the last is true. Supplying requires , so there is no instance with .
QAlgorithms.Papers.Independent.Extend50.P06.targetChoiFidelity
For every natural number , every complex matrix indexed by pairs of indices, and every complex matrix , this definition returns the real number
Equivalently, its numerator is
No positivity, trace normalization, or unitarity is assumed of or . For , the sum is empty and real division by zero gives value .
QAlgorithms.Papers.Independent.Extend50.P06.targetTensorRepresentation
For arbitrary natural numbers , an arbitrary function , a Boolean flag , and , this definition returns a complex matrix indexed by , where , with entries
There are no continuity, multiplicativity, or unitarity assumptions on . All zero parameter values are included; for , the product is , and if the indexing type is empty, the result is the empty matrix.
QAlgorithms.Papers.Independent.Extend50.P06.transformationAverage
For arbitrary natural numbers , let consist of a Borel probability measure on whose pushforward under either or equals for every . Given any function and any complex matrix on , where and , this definition returns
There are no admissibility assumptions on or regularity assumptions on ; the integral uses the total Bochner-integral convention, which gives zero when the integrand is not integrable. Empty products equal . The result is zero when , with division by zero interpreted as zero, and when and .
QAlgorithms.Papers.Independent.Extend50.P06.transformationChoi
For every natural number and every complex matrix , define the vector indexed by by . The transformation Choi matrix is ; explicitly,
There is no assumption that is unitary and no normalization factor. When , this is the matrix on the empty index set.
QAlgorithms.Papers.Independent.Extend50.P06.transposeTarget
For every natural number and every special unitary matrix , this definition returns its transpose, the complex matrix whose -entry is . The case is included and returns the empty matrix.
QAlgorithms.Papers.Independent.Extend50.P06.unitarySlots
For arbitrary natural numbers and an arbitrary complex matrix , this definition produces a matrix on , where is the set of functions from the indices to the indices, with entries
Here each factor comes from the matrix with entries , namely the outer product of the vector with its conjugate. There is no assumption that is unitary. When , the resulting matrix has one entry, equal to the empty product ; when and , it is empty.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.