Definitions for Entanglement Measures and Purification Procedures
DefinitionQAlgorithms_Papers_Independent_Intakenext100_P42The objects the formalized statements of Entanglement Measures and Purification Procedures (arXiv:quant-ph/9707035) are stated in. Each was checked against the paper by a blind read-back and a moderator.
relativeEntanglementNats: PDF p.8, Eq.(7): the infimum is over the actual normalized separable states. In finite dimensions it is attained and finite; the certificates below retain attainment.IsMinimizer: PDF pp.12–15: a closest separable state, including feasibility.DistanceFamily: PDF pp.8–10: coherent distance family on finite registers of every dimension.IsSubstate: PDF p.8: the subnormalized PSD domain required by F4 and F5a, including zero.UnitaryInvariantDistance: PDF p.8, F2: unitary invariance on normalized density matrices.F3: PDF p.8, F3: normalized partial-trace monotonicity. The blocks flag selects the subnormalized PSD extension used in Theorem 2, PDF p.10, Eq.(18).F5b: PDF p.9, proof-used F5b: the ancillary projector is onto a UNIT vector.CompleteProjectors: PDF p.8: a complete orthogonal family of Hermitian projectors.F5a: PDF p.8, F5a: block additivity on the subnormalized domain.ProductComplete: PDF p.4, Eq.(1): the source's complete product-Kraus idealization. This predicate does not identify separable operations with physical LOCC.rectangularKrausBranch: PDF pp.4,6: unnormalized outcome state.rectangularKrausProbability: PDF p.6: branch probability.normalizedBranch: PDF p.6: positive-probability outcome normalization; never used at zero probability.MeasureConditions: PDF pp.6–7, E1–E3, for the source's explicit product-Kraus operations. Zero-probability outcomes are omitted before evaluating a normalized state.FiniteSchmidtExpansion: PDF pp.12–14: finite Schmidt data, permitting zero weights and unequal local dimensions.finiteSchmidtVector: PDF p.14, Eq.(33): the vector constructed from its Schmidt expansion.schmidtDiagonal: PDF p.13: the explicitly proposed Schmidt-diagonal comparison state.finiteSchmidtEntropyNats: PDF pp.12–14: Schmidt entropy in nats, with 0 log 0 = 0.kernelG: PDF p.13, Eqs.(27)–(30): continuous diagonal value and zero-weight boundary. The source's sentence g(p,p)=1 is read only for p>0.formationNats: PDF p.7, Eq.(6): the finite pure-ensemble convex roof (creation/formation), in nats.buresGenerator: PDF p.17: the actual Bures-generated quantity is 2 minus twice ROOT fidelity.buresEntanglement: PDF pp.8,17: Bures distance to the separable set, for the generator actually printed.entanglementIndicator: PDF p.19: the indicator of entanglement.groupedStateProduct: PDF p.11: product of possibly different-dimensional inputs, across the grouped cut.qubitAngle: PDF p.22, Eq.(49): a qubit ray parameterized by its polar angle and phase.mixingAmplitude: PDF p.21, Eq.(48): 16 amplitudes using 15 angles; the last product is empty.angleState: PDF pp.21–22, Eqs.(47)–(49): the complete 79-angle two-qubit parameterization. The first 15 entries are mixing angles; each term then uses 4 local ray angles.HasPureProductDecomposition: PDF p.20: bounded finite pure-product decomposition.qubitMatrixUnit: PDF pp.23–24: matrix units in the ordered two-qubit computational basis.bellBasisVector: PDF p.23, Eqs.(57)–(58): Phi+, Phi-, Psi+, Psi-, in that order.exampleOneInput: PDF p.23, Eq.(54).exampleOneMinimum: PDF p.23, Eq.(55): the actual constructed comparison matrix.correlated: PDF p.24, Eq.(63): complex maximally correlated two-qubit family.correlatedMinimum: PDF pp.23–24, Eqs.(60),(64): the diagonal comparison state.exampleTwoInput: PDF p.23, Eq.(59).correlatedEigenvalue: Corrected eigenvalues for PDF p.24, Eq.(66), determined by Eq.(63). Printed 1-4A(1-A)-|B|^2 is changed to (2A-1)^2+4|B|^2.bellDiagonal: PDF pp.16,33: Bell-diagonal density matrix with the specified four weights.singletWernerState: PDF p.25: Werner state with singlet weight F.localBell: PDF p.25: all maximally entangled two-qubit vectors via local unitaries.twoQubitMaxEntangledFraction: PDF p.25: optimized maximally-entangled overlap. On density inputs this real supremum ranges over a nonempty compact set and is attained.wernerValue: Corrected PDF p.25, Eq.(73): zero on the separable Werner regime.bipartitionProductMatrix: PDF p.34, Eq.(91): product across a specified nontrivial bipartition. The blocks may each have internal entanglement and arbitrary unequal dimensions.IsMultipartiteBiseparable: PDF pp.34–35, Eqs.(91)–(92): mixtures over ALL nontrivial bipartitions; this is biseparability, rather than full product separability (94).partyKraus: PDF p.35, Eq.(93): one product Kraus operator across all parties.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_BipartiteSeparability
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Defs_ExtendedQuantumEntropy
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P56
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P04
import Definitions.Def_QAlgorithms_Papers_Independent_Bridge50_P49
/-!
Vedral–Plenio, quant-ph/9707035v2. Finite, nonempty local registers; natural logs.
Signed support-aware relative entropy, natural entropy, grouped binary products and
copies reuse the pinned accepted library. Remaining paper-local concepts have distinct
names where frozen short-name matches have different domains, units or meanings.
Source corrections and excluded claims are recorded in this unit's audit artifacts.
-/
noncomputable section
open scoped Matrix ComplexConjugate ComplexOrder ENNReal Topology
namespace QAlgorithms.Papers.Independent.Intakenext100.P42
open QAlgorithms QAlgorithms.Entanglement
open QAlgorithms.Papers.Independent.Dependency50.P21 (relativeEntropy)
open QAlgorithms.Papers.Independent.Information100.P56 (entropy)
open QAlgorithms.Papers.Independent.Information100.P04 (copies)
open QAlgorithms.Papers.Independent.Bridge50.P49 (groupedProduct)
attribute [local instance] Classical.propDecidable Classical.decEq
/-- PDF p.8, Eq.(7): the infimum is over the actual normalized separable states.
In finite dimensions it is attained and finite; the certificates below retain attainment. -/
def relativeEntanglementNats {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] [Nonempty I] [Nonempty J]
(sigma : Matrix (I × J) (I × J) ℂ) : EReal :=
sInf {v | ∃ rho : Matrix (I × J) (I × J) ℂ,
IsSeparableDensity rho ∧ v = relativeEntropy sigma rho}
/-- PDF pp.12–15: a closest separable state, including feasibility. -/
def IsMinimizer {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] [Nonempty I] [Nonempty J]
(sigma rho : Matrix (I × J) (I × J) ℂ) : Prop :=
IsSeparableDensity rho ∧ ∀ tau, IsSeparableDensity tau →
relativeEntropy sigma rho ≤ relativeEntropy sigma tau
/-- PDF pp.8–10: coherent distance family on finite registers of every dimension. -/
abbrev DistanceFamily := {I : Type} → [Fintype I] → [DecidableEq I] →
Matrix I I ℂ → Matrix I I ℂ → EReal
/-- PDF p.8: the subnormalized PSD domain required by F4 and F5a, including zero. -/
def IsSubstate {I : Type} [Fintype I] (rho : Matrix I I ℂ) : Prop :=
rho.PosSemidef ∧ rho.trace.re ≤ 1
/-- PDF p.8, F2: unitary invariance on normalized density matrices. -/
def UnitaryInvariantDistance (D : DistanceFamily) : Prop :=
∀ {I : Type} [Fintype I] [DecidableEq I] [Nonempty I]
(sigma rho : Matrix I I ℂ), IsDensityMatrix sigma → IsDensityMatrix rho →
∀ U : Matrix.unitaryGroup I ℂ,
D ((U : Matrix I I ℂ) * sigma * (U : Matrix I I ℂ)ᴴ)
((U : Matrix I I ℂ) * rho * (U : Matrix I I ℂ)ᴴ) = D sigma rho
/-- PDF p.8, F3: normalized partial-trace monotonicity. The blocks flag selects
the subnormalized PSD extension used in Theorem 2, PDF p.10, Eq.(18). -/
def F3 (D : DistanceFamily) (blocks : Bool := false) : Prop :=
∀ {I J : Type} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J]
[Nonempty I] [Nonempty J] (sigma rho : Matrix (I × J) (I × J) ℂ),
(if blocks then IsSubstate sigma else IsDensityMatrix sigma) →
(if blocks then IsSubstate rho else IsDensityMatrix rho) →
D (traceLeft sigma) (traceLeft rho) ≤ D sigma rho
/-- PDF p.9, proof-used F5b: the ancillary projector is onto a UNIT vector. -/
def F5b (D : DistanceFamily) : Prop :=
∀ {I : Type} [Fintype I] [DecidableEq I] [Nonempty I]
(sigma rho : Matrix I I ℂ), IsDensityMatrix sigma → IsDensityMatrix rho →
∀ {K : Type} [Fintype K] [DecidableEq K] [Nonempty K]
(alpha : EuclideanSpace ℂ K), ‖alpha‖ = 1 →
D (Matrix.kronecker sigma (pureDensity alpha))
(Matrix.kronecker rho (pureDensity alpha)) = D sigma rho
/-- PDF p.8: a complete orthogonal family of Hermitian projectors. -/
def CompleteProjectors {I K : Type} [Fintype I] [Fintype K]
[DecidableEq I] (P : K → Matrix I I ℂ) : Prop :=
(∀ k, (P k).IsHermitian ∧ P k * P k = P k) ∧
(∀ k l, k ≠ l → P k * P l = 0) ∧ ∑ k, P k = 1
/-- PDF p.8, F5a: block additivity on the subnormalized domain. -/
def F5a (D : DistanceFamily) : Prop :=
∀ {I K : Type} [Fintype I] [Fintype K] [DecidableEq I] [Nonempty I]
(P : K → Matrix I I ℂ), CompleteProjectors P →
∀ sigma rho, IsDensityMatrix sigma → IsDensityMatrix rho →
D (∑ k, P k * sigma * P k) (∑ k, P k * rho * P k) =
∑ k, D (P k * sigma * P k) (P k * rho * P k)
/-- PDF p.4, Eq.(1): the source's complete product-Kraus idealization.
This predicate does not identify separable operations with physical LOCC. -/
def ProductComplete {I J A B K : Type} [Fintype I] [Fintype J]
[Fintype A] [Fintype B] [Fintype K] [DecidableEq I] [DecidableEq J]
(L : K → Matrix A I ℂ) (R : K → Matrix B J ℂ) : Prop :=
IsKrausFamily (fun k => Matrix.kronecker (L k) (R k))
/-- PDF pp.4,6: unnormalized outcome state. -/
def rectangularKrausBranch {I J K : Type} [Fintype I] [Fintype J]
(V : K → Matrix J I ℂ) (sigma : Matrix I I ℂ) (k : K) : Matrix J J ℂ :=
V k * sigma * (V k)ᴴ
/-- PDF p.6: branch probability. -/
def rectangularKrausProbability {I J K : Type} [Fintype I] [Fintype J]
(V : K → Matrix J I ℂ) (sigma : Matrix I I ℂ) (k : K) : ℝ :=
(rectangularKrausBranch V sigma k).trace.re
/-- PDF p.6: positive-probability outcome normalization; never used at zero probability. -/
def normalizedBranch {I J K : Type} [Fintype I] [Fintype J]
(V : K → Matrix J I ℂ) (sigma : Matrix I I ℂ) (k : K) : Matrix J J ℂ :=
((rectangularKrausProbability V sigma k)⁻¹ : ℂ) • rectangularKrausBranch V sigma k
/-- PDF pp.6–7, E1–E3, for the source's explicit product-Kraus operations.
Zero-probability outcomes are omitted before evaluating a normalized state. -/
def MeasureConditions {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] [Nonempty I] [Nonempty J]
(E : Matrix (I × J) (I × J) ℂ → EReal) : Prop :=
(∀ sigma, IsDensityMatrix sigma → (E sigma = 0 ↔ IsSeparableDensity sigma)) ∧
(∀ sigma, IsDensityMatrix sigma →
∀ U : Matrix.unitaryGroup I ℂ, ∀ V : Matrix.unitaryGroup J ℂ,
E (conjSuperop (Matrix.kronecker (U : Matrix I I ℂ) (V : Matrix J J ℂ)) sigma) =
E sigma) ∧
(∀ {K : Type} [Fintype K] (L : K → Matrix I I ℂ) (R : K → Matrix J J ℂ),
ProductComplete L R → ∀ sigma, IsDensityMatrix sigma →
let V := fun k => Matrix.kronecker (L k) (R k)
(∑ k, if 0 < rectangularKrausProbability V sigma k then
(rectangularKrausProbability V sigma k : EReal) * E (normalizedBranch V sigma k) else 0) ≤
E sigma)
/-- PDF pp.12–14: finite Schmidt data, permitting zero weights and unequal local dimensions. -/
structure FiniteSchmidtExpansion (I J K : Type) [Fintype I] [Fintype J] [Fintype K] where
weight : K → ℝ
nonnegative : ∀ k, 0 ≤ weight k
total : ∑ k, weight k = 1
left : K → EuclideanSpace ℂ I
right : K → EuclideanSpace ℂ J
left_orthonormal : Orthonormal ℂ left
right_orthonormal : Orthonormal ℂ right
/-- PDF p.14, Eq.(33): the vector constructed from its Schmidt expansion. -/
def finiteSchmidtVector {I J K : Type} [Fintype I] [Fintype J] [Fintype K]
(s : FiniteSchmidtExpansion I J K) : EuclideanSpace ℂ (I × J) :=
WithLp.toLp 2 fun p => ∑ k, (Real.sqrt (s.weight k) : ℂ) * s.left k p.1 * s.right k p.2
/-- PDF p.13: the explicitly proposed Schmidt-diagonal comparison state. -/
def schmidtDiagonal {I J K : Type} [Fintype I] [Fintype J] [Fintype K]
(s : FiniteSchmidtExpansion I J K) : Matrix (I × J) (I × J) ℂ :=
∑ k, (s.weight k : ℂ) • Matrix.kronecker (pureDensity (s.left k)) (pureDensity (s.right k))
/-- PDF pp.12–14: Schmidt entropy in nats, with 0 log 0 = 0. -/
def finiteSchmidtEntropyNats {I J K : Type} [Fintype I] [Fintype J] [Fintype K]
(s : FiniteSchmidtExpansion I J K) : ℝ := -∑ k, s.weight k * Real.log (s.weight k)
/-- PDF p.13, Eqs.(27)–(30): continuous diagonal value and zero-weight boundary.
The source's sentence g(p,p)=1 is read only for p>0. -/
def kernelG (p q : ℝ) : ℝ :=
if p = 0 ∨ q = 0 then 0 else
if p = q then 1 else Real.sqrt (p * q) * Real.log (q / p) / (q - p)
/-- PDF p.7, Eq.(6): the finite pure-ensemble convex roof (creation/formation), in nats. -/
def formationNats {I J : Type} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J]
(sigma : Matrix (I × J) (I × J) ℂ) : EReal :=
sInf {v | ∃ m : ℕ, ∃ w : Fin m → ℝ, ∃ psi : Fin m → EuclideanSpace ℂ (I × J),
(∀ k, 0 ≤ w k) ∧ (∑ k, w k) = 1 ∧ (∀ k, ‖psi k‖ = 1) ∧
sigma = ∑ k, (w k : ℂ) • pureDensity (psi k) ∧
v = ((∑ k, w k * entropy (traceLeft (pureDensity (psi k))) : ℝ) : EReal)}
/-- PDF p.17: the actual Bures-generated quantity is 2 minus twice ROOT fidelity. -/
def buresGenerator {I : Type} [Fintype I] [DecidableEq I]
(sigma rho : Matrix I I ℂ) : ℝ := 2 - 2 * rootFidelity sigma rho
/-- PDF pp.8,17: Bures distance to the separable set, for the generator actually printed. -/
def buresEntanglement {I J : Type} [Fintype I] [Fintype J]
[DecidableEq I] [DecidableEq J] [Nonempty I] [Nonempty J]
(sigma : Matrix (I × J) (I × J) ℂ) : EReal :=
sInf {v | ∃ rho : Matrix (I × J) (I × J) ℂ, IsSeparableDensity rho ∧
v = (buresGenerator sigma rho : EReal)}
/-- PDF p.19: the indicator of entanglement. -/
def entanglementIndicator {I J : Type} [Fintype I] [Fintype J] [Nonempty I] [Nonempty J]
(sigma : Matrix (I × J) (I × J) ℂ) : EReal :=
if IsSeparableDensity sigma then 0 else 1
/-- PDF p.11: product of possibly different-dimensional inputs, across the grouped cut. -/
def groupedStateProduct {T : Type} [Fintype T] {I J : T → Type}
(sigma : ∀ t, Matrix (I t × J t) (I t × J t) ℂ) :
Matrix ((∀ t, I t) × (∀ t, J t)) ((∀ t, I t) × (∀ t, J t)) ℂ :=
fun p q => ∏ t, sigma t (p.1 t,p.2 t) (q.1 t,q.2 t)
/-- Sanity: zero weights do not receive the positive diagonal continuation. -/
example (q : ℝ) : kernelG 0 q = 0 := by simp [kernelG]
/-- Sanity: equal positive weights give the divided difference's continuation. -/
example : kernelG (1 / 2) (1 / 2) = 1 := by norm_num [kernelG]
/-- Sanity: the empty tensor product is the scalar unit, not a zero operator. -/
example {I J : Type} (sigma : Matrix (I × J) (I × J) ℂ)
(p q : (Fin 0 → I) × (Fin 0 → J)) : copies sigma 0 p q = 1 := by
simp [copies]
/-- Sanity: the zero positive operator has zero entropy and zero relative entropy to itself. -/
example {I : Type} [Fintype I] [DecidableEq I] :
entropy (0 : Matrix I I ℂ) = 0 ∧ relativeEntropy (0 : Matrix I I ℂ) 0 = 0 := by
simp [entropy, relativeEntropy,
QAlgorithms.Papers.Independent.Dependency50.P21.IsSupported, cfc_zero]
/-- PDF p.22, Eq.(49): a qubit ray parameterized by its polar angle and phase. -/
def qubitAngle (theta phase : ℝ) : EuclideanSpace ℂ Bool :=
WithLp.toLp 2 fun b => if b then (Real.sin theta : ℂ) * Complex.exp ((phase : ℂ) * Complex.I)
else (Real.cos theta : ℂ)
/-- PDF p.21, Eq.(48): 16 amplitudes using 15 angles; the last product is empty. -/
def mixingAmplitude (angle : Fin 15 → ℝ) (i : Fin 16) : ℝ :=
Real.sin (if h : i.val = 0 then Real.pi / 2 else angle ⟨i.val - 1, by omega⟩) *
∏ j : Fin 15, if i.val ≤ j.val then Real.cos (angle j) else 1
/-- PDF pp.21–22, Eqs.(47)–(49): the complete 79-angle two-qubit parameterization.
The first 15 entries are mixing angles; each term then uses 4 local ray angles. -/
def angleState (a : Fin 79 → ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
∑ i : Fin 16, ((mixingAmplitude (fun j => a ⟨j.val, by omega⟩) i)^2 : ℂ) •
Matrix.kronecker
(pureDensity (qubitAngle (a ⟨15 + 4*i.val, by omega⟩) (a ⟨16 + 4*i.val, by omega⟩)))
(pureDensity (qubitAngle (a ⟨17 + 4*i.val, by omega⟩) (a ⟨18 + 4*i.val, by omega⟩)))
/-- PDF p.20: bounded finite pure-product decomposition. -/
def HasPureProductDecomposition {I J : Type} [Fintype I] [Fintype J]
(rho : Matrix (I × J) (I × J) ℂ) (bound : ℕ) : Prop :=
∃ m : ℕ, m ≤ bound ∧ ∃ w : Fin m → ℝ,
∃ a : Fin m → EuclideanSpace ℂ I, ∃ b : Fin m → EuclideanSpace ℂ J,
(∀ i, 0 ≤ w i) ∧ (∑ i, w i) = 1 ∧ (∀ i, ‖a i‖ = 1 ∧ ‖b i‖ = 1) ∧
rho = ∑ i, (w i : ℂ) • Matrix.kronecker (pureDensity (a i)) (pureDensity (b i))
/-- PDF pp.23–24: matrix units in the ordered two-qubit computational basis. -/
def qubitMatrixUnit (a b c d : Bool) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
Matrix.single (a,b) (c,d) 1
/-- PDF p.23, Eqs.(57)–(58): Phi+, Phi-, Psi+, Psi-, in that order. -/
def bellBasisVector (i : Fin 4) : EuclideanSpace ℂ (Bool × Bool) :=
let c : ℂ := (Real.sqrt 2)⁻¹
![c • (ket (false,false) + ket (true,true)),
c • (ket (false,false) - ket (true,true)),
c • (ket (false,true) + ket (true,false)),
c • (ket (false,true) - ket (true,false))] i
/-- PDF p.23, Eq.(54). -/
def exampleOneInput (t : ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
(t : ℂ) • pureDensity (bellBasisVector 0) + ((1-t : ℝ) : ℂ) • qubitMatrixUnit false true false true
/-- PDF p.23, Eq.(55): the actual constructed comparison matrix. -/
def exampleOneMinimum (t : ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
((t/2*(1-t/2) : ℝ) : ℂ) •
(qubitMatrixUnit false false false false + qubitMatrixUnit false false true true +
qubitMatrixUnit true true false false + qubitMatrixUnit true true true true) +
(((1-t/2)^2 : ℝ) : ℂ) • qubitMatrixUnit false true false true +
((t^2/4 : ℝ) : ℂ) • qubitMatrixUnit true false true false
/-- PDF p.24, Eq.(63): complex maximally correlated two-qubit family. -/
def correlated (a : ℝ) (b : ℂ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
(a : ℂ) • qubitMatrixUnit false false false false +
b • qubitMatrixUnit false false true true + conj b • qubitMatrixUnit true true false false +
((1-a : ℝ) : ℂ) • qubitMatrixUnit true true true true
/-- PDF pp.23–24, Eqs.(60),(64): the diagonal comparison state. -/
def correlatedMinimum (a : ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
(a : ℂ) • qubitMatrixUnit false false false false +
((1-a : ℝ) : ℂ) • qubitMatrixUnit true true true true
/-- PDF p.23, Eq.(59). -/
def exampleTwoInput (t : ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
(t : ℂ) • pureDensity (bellBasisVector 0) + ((1-t : ℝ) : ℂ) • qubitMatrixUnit false false false false
/-- Corrected eigenvalues for PDF p.24, Eq.(66), determined by Eq.(63).
Printed 1-4A(1-A)-|B|^2 is changed to (2A-1)^2+4|B|^2. -/
def correlatedEigenvalue (a : ℝ) (b : ℂ) (plus : Bool) : ℝ :=
(1 + (if plus then 1 else -1) * Real.sqrt ((2*a-1)^2 + 4*Complex.normSq b)) / 2
/-- PDF pp.16,33: Bell-diagonal density matrix with the specified four weights. -/
def bellDiagonal (p : Fin 4 → ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
∑ i, (p i : ℂ) • pureDensity (bellBasisVector i)
/-- PDF p.25: Werner state with singlet weight F. -/
def singletWernerState (f : ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
(f : ℂ) • pureDensity (bellBasisVector 3) + (( (1-f)/3 : ℝ) : ℂ) • (1-pureDensity (bellBasisVector 3))
/-- PDF p.25: all maximally entangled two-qubit vectors via local unitaries. -/
def localBell (U V : Matrix.unitaryGroup Bool ℂ) : EuclideanSpace ℂ (Bool × Bool) :=
WithLp.toLp 2 ((Matrix.kronecker (U : Matrix Bool Bool ℂ) (V : Matrix Bool Bool ℂ)).mulVec
(WithLp.ofLp (bellBasisVector 0)))
/-- PDF p.25: optimized maximally-entangled overlap. On density inputs this real
supremum ranges over a nonempty compact set and is attained. -/
def twoQubitMaxEntangledFraction (sigma : Matrix (Bool × Bool) (Bool × Bool) ℂ) : ℝ :=
sSup {v | ∃ U V : Matrix.unitaryGroup Bool ℂ,
v = effectProb (pureDensity (localBell U V)) sigma}
/-- Corrected PDF p.25, Eq.(73): zero on the separable Werner regime. -/
def wernerValue (f : ℝ) : ℝ :=
if f ≤ 1/2 then 0 else f * Real.log f + (1-f)*Real.log (1-f) + Real.log 2
/-- PDF p.34, Eq.(91): product across a specified nontrivial bipartition.
The blocks may each have internal entanglement and arbitrary unequal dimensions. -/
def bipartitionProductMatrix {N : ℕ} (d : Fin N → ℕ) (S : Finset (Fin N))
(X : Matrix (∀ i : {i // i ∈ S}, Fin (d i.val))
(∀ i : {i // i ∈ S}, Fin (d i.val)) ℂ)
(Y : Matrix (∀ i : {i // i ∉ S}, Fin (d i.val))
(∀ i : {i // i ∉ S}, Fin (d i.val)) ℂ) :
Matrix (∀ i, Fin (d i)) (∀ i, Fin (d i)) ℂ :=
fun p q => X (fun i => p i.val) (fun i => q i.val) *
Y (fun i => p i.val) (fun i => q i.val)
/-- PDF pp.34–35, Eqs.(91)–(92): mixtures over ALL nontrivial bipartitions;
this is biseparability, rather than full product separability (94). -/
def IsMultipartiteBiseparable {N : ℕ} (d : Fin N → ℕ)
(rho : Matrix (∀ i, Fin (d i)) (∀ i, Fin (d i)) ℂ) : Prop :=
∃ m : ℕ, ∃ w : Fin m → ℝ, ∃ S : Fin m → Finset (Fin N),
∃ X : ∀ k, Matrix (∀ i : {i // i ∈ S k}, Fin (d i.val))
(∀ i : {i // i ∈ S k}, Fin (d i.val)) ℂ,
∃ Y : ∀ k, Matrix (∀ i : {i // i ∉ S k}, Fin (d i.val))
(∀ i : {i // i ∉ S k}, Fin (d i.val)) ℂ,
(∀ k, 0 ≤ w k) ∧ (∑ k, w k) = 1 ∧
(∀ k, (S k).Nonempty ∧ S k ≠ Finset.univ) ∧
(∀ k, IsDensityMatrix (X k) ∧ IsDensityMatrix (Y k)) ∧
rho = ∑ k, (w k : ℂ) • bipartitionProductMatrix d (S k) (X k) (Y k)
/-- PDF p.35, Eq.(93): one product Kraus operator across all parties. -/
def partyKraus {N : ℕ} {d : Fin N → ℕ}
(A : ∀ i, Matrix (Fin (d i)) (Fin (d i)) ℂ) :
Matrix (∀ i, Fin (d i)) (∀ i, Fin (d i)) ℂ :=
fun p q => ∏ i, A i (p i) (q i)
/-- Sanity: the zero-angle qubit is |0>. -/
example : qubitAngle 0 0 false = 1 ∧ qubitAngle 0 0 true = 0 := by
simp [qubitAngle]
/-- Sanity: zero off-diagonal coherence leaves exactly the diagonal comparison matrix. -/
example (a : ℝ) : correlated a 0 = correlatedMinimum a := by
simp [correlated, correlatedMinimum]
/-- Sanity: the corrected Werner value at its separable boundary is zero. -/
example : wernerValue (1/2) = 0 := by simp [wernerValue]
/-- Sanity: scalar relative entropy can be negative on unequal subnormalizations. -/
example : ((Real.log (1/2) : ℝ) : EReal) < 0 := by
exact_mod_cast Real.log_neg (by norm_num : (0 : ℝ) < 1/2) (by norm_num : (1/2 : ℝ) < 1)
end QAlgorithms.Papers.Independent.Intakenext100.P42
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakenext100.P42.CompleteProjectors
For finite types , with decidable equality on , and a family of complex matrices indexed by , this predicate says that every is Hermitian and satisfies , that whenever , and that . Zero projectors are permitted. Neither type is required to be nonempty: if is empty these conditions hold for its unique matrix family, while if is empty the completeness condition requires , which excludes nonempty .
QAlgorithms.Papers.Independent.Intakenext100.P42.DistanceFamily
This abbreviates a family of functions that, for every type equipped with a finite enumeration and decidable equality, takes two complex matrices indexed by and returns an extended real number in . The indexing type may be empty, and the matrix arguments are arbitrary. No nonnegativity, symmetry, normalization, or other distance property is required.
QAlgorithms.Papers.Independent.Intakenext100.P42.F3
For a family of extended real valued functions on pairs of complex square matrices, indexed by finite types with decidable equality, and a Boolean parameter , whose default value is false, this predicate requires the following for every pair of finite, nonempty types with decidable equality and all complex matrices indexed by :
When is false, both inputs must be positive semidefinite with complex trace ; when it is true, both must be positive semidefinite with real part of the trace at most , allowing zero inputs. These are hypotheses of the required inequality, and no other conditions on are imposed.
QAlgorithms.Papers.Independent.Intakenext100.P42.F5a
For a family of extended real valued functions on matrix pairs indexed by finite types with decidable equality, this predicate requires that, for every finite, nonempty type with decidable equality, every finite type , every family of Hermitian idempotent matrices indexed by satisfying for and , and all positive semidefinite matrices of complex trace ,
The summands use the unnormalized compressed matrices directly, including zero matrices, and the right side is a finite sum in the extended reals. Although may be empty in the quantification, the projector hypotheses cannot hold for empty because is nonempty.
QAlgorithms.Papers.Independent.Intakenext100.P42.F5b
For a family assigning extended real values to matrix pairs on finite types with decidable equality, this predicate requires that, for every finite, nonempty type with decidable equality, every pair of positive semidefinite matrices indexed by with complex trace , every finite, nonempty type with decidable equality, and every vector of Euclidean norm ,
The tensor product has entries . No further properties of are assumed.
QAlgorithms.Papers.Independent.Intakenext100.P42.FiniteSchmidtExpansion
For finite types , this structure consists of real weights and vectors , , with the standard Euclidean inner products, satisfying for every , , and for all . Zero weights are permitted, and their associated vectors must still belong to the orthonormal families. Although the types are not explicitly assumed nonempty, no such structure exists when any of is empty.
QAlgorithms.Papers.Independent.Intakenext100.P42.HasPureProductDecomposition
For any finite types , any complex matrix indexed by , and any natural number , this predicate means that there exist a natural number , real weights , and vectors , , such that every , , every , and
for all and . Zero weights are allowed. Although is quantified over, it cannot satisfy the weight sum, so the predicate is false when ; it is also false if either or is empty, since no unit vector then exists.
QAlgorithms.Papers.Independent.Intakenext100.P42.IsMinimizer
For finite, nonempty types , each with decidable equality, and arbitrary complex matrices indexed by , this predicate says that is a separable density matrix and that for every separable density matrix . A separable density matrix has a finite representation , with nonnegative real weights summing to and positive semidefinite factors of complex trace on , respectively; such a representation necessarily has . For any candidate , is , with and matrix functions interpreted through continuous functional calculus, if , and is otherwise. No density condition is imposed on , uniqueness is not required, and the comparison allows infinite values.
QAlgorithms.Papers.Independent.Intakenext100.P42.IsMultipartiteBiseparable
For every natural number , natural dimensions for , and complex matrix indexed by configurations , this predicate means that there exist a natural number , real weights , subsets of the party indices, and complex matrices on the configurations of and its complement, respectively, such that
each and is positive semidefinite with complex trace equal to , and
The partition may vary with , and zero weights are allowed, but all stated requirements still apply to their terms. Although is quantified over, it cannot satisfy the weight sum; the predicate is also impossible when , or when any local dimension is zero.
QAlgorithms.Papers.Independent.Intakenext100.P42.IsSubstate
For any finite type and complex matrix indexed by , this predicate means that is positive semidefinite and . There is no nonemptiness or decidable equality assumption on , and no strictly positive trace requirement. In particular, the zero matrix satisfies the predicate, including when is empty.
QAlgorithms.Papers.Independent.Intakenext100.P42.MeasureConditions
For nonempty finite types , each with decidable equality, and a function , this predicate requires three properties. First, for every positive semidefinite matrix of trace , if and only if has a finite representation , where , , , and every and is positive semidefinite of trace . Second, for every such and every pair of unitaries on and on , . Third, for every finite type and families , satisfying , every positive semidefinite trace-one satisfies
Here is embedded in the extended reals for multiplication by , and is embedded in for scaling ; a zero inverse is interpreted as zero. The predicate imposes no separate nonnegativity or finiteness condition on . An empty cannot satisfy the stated completeness identity because are nonempty.
QAlgorithms.Papers.Independent.Intakenext100.P42.ProductComplete
For finite types , with decidable equality on , and families of complex rectangular matrices and , this predicate means exactly
No nonemptiness assumptions are imposed. In particular, when is empty the condition is , which holds exactly when the input indexing type is empty.
QAlgorithms.Papers.Independent.Intakenext100.P42.UnitaryInvariantDistance
For a family assigning an extended real value to each pair of complex square matrices on every finite type with decidable equality, this predicate says that, for every such nonempty type , every pair of positive semidefinite matrices with complex trace , and every unitary matrix indexed by ,
The equality is required only for these density matrix inputs; no further properties of are assumed.
QAlgorithms.Papers.Independent.Intakenext100.P42.angleState
For any real parameters , this defines a complex matrix indexed by pairs of Boolean values as
where, in coordinate order ,
Here has entries , the tensor product has entries , and an empty product equals . No restrictions are imposed on the parameters.
QAlgorithms.Papers.Independent.Intakenext100.P42.bellBasisVector
For each , this defines a complex vector indexed by Boolean pairs. Writing , , and for the vector with coordinate at and elsewhere, its values are
QAlgorithms.Papers.Independent.Intakenext100.P42.bellDiagonal
For any function , this defines the complex matrix on by
where, writing for the coordinate vector at ,
and denote false and true. Each outer product has entries . There is no assumption that the are nonnegative or sum to one.
QAlgorithms.Papers.Independent.Intakenext100.P42.bipartitionProductMatrix
For every natural number , every collection of natural dimensions for , every subset of these indices, and arbitrary complex matrices and indexed respectively by configurations and , this defines a matrix on all configurations by
Neither matrix is required to be positive or normalized. Empty sides are allowed and have a single empty configuration; zero local dimensions are also allowed. In particular, when , all three configuration spaces are singletons and the definition multiplies the sole entries of and .
QAlgorithms.Papers.Independent.Intakenext100.P42.buresEntanglement
For nonempty finite types with decidable equality and an arbitrary complex matrix indexed by , this definition is the extended-real infimum of
over all matrices admitting a finite decomposition , where , , , and each on and on is positive semidefinite with trace . Here is the continuous functional calculus of the real square-root function, and each displayed real value is embedded in the extended reals before taking the infimum. There is no density-matrix assumption on . The decomposition length cannot be zero because the weights sum to ; the candidate set is nonempty because are nonempty.
QAlgorithms.Papers.Independent.Intakenext100.P42.buresGenerator
For a finite type with decidable equality and arbitrary complex matrices indexed by , this definition gives the real number
where denotes the continuous functional calculus of the real square-root function applied to . Neither matrix is required to be positive semidefinite or trace one; the formula uses the total functional-calculus operation even outside those assumptions. Empty is included, in which case the trace is zero and the value is .
QAlgorithms.Papers.Independent.Intakenext100.P42.correlated
For every real number and complex number , this defines the following complex matrix, with rows and columns ordered as :
No bounds on or are assumed.
QAlgorithms.Papers.Independent.Intakenext100.P42.correlatedEigenvalue
For any real number , complex number , and Boolean value , this defines the real number
where . Neither nor is restricted.
QAlgorithms.Papers.Independent.Intakenext100.P42.correlatedMinimum
For every real number , this defines the complex diagonal matrix
in the ordered basis . The parameter is unrestricted.
QAlgorithms.Papers.Independent.Intakenext100.P42.entanglementIndicator
For nonempty finite types and an arbitrary complex matrix indexed by , this definition returns the extended-real value precisely when there exist , nonnegative real weights summing to , and positive semidefinite trace-one matrices on and on such that ; otherwise it returns . No density-matrix hypothesis is imposed on the input, so matrices without such a decomposition also receive . The weight-sum condition excludes .
QAlgorithms.Papers.Independent.Intakenext100.P42.exampleOneInput
For every real number , this defines the following complex matrix, with rows and columns ordered as :
There is no assumption that lies in .
QAlgorithms.Papers.Independent.Intakenext100.P42.exampleOneMinimum
For every real number , this defines the following complex matrix, with rows and columns ordered as :
The parameter is unrestricted.
QAlgorithms.Papers.Independent.Intakenext100.P42.exampleTwoInput
For every real number , this defines the following complex matrix, with rows and columns ordered as :
There is no assumption that lies in .
QAlgorithms.Papers.Independent.Intakenext100.P42.finiteSchmidtEntropyNats
For finite types and data comprising nonnegative weights with and orthonormal families , , the declared real number is . The logarithm is the real natural logarithm, whose total definition has , so a zero weight contributes zero. The vector families do not occur in this formula but remain part of the required data; such data cannot exist if any of is empty.
QAlgorithms.Papers.Independent.Intakenext100.P42.finiteSchmidtVector
For finite types and data consisting of weights with and orthonormal families , , the declared vector in the Euclidean space has coordinates
The square roots are real and are then regarded as complex scalars; neither vector coordinate is conjugated. Zero weights are allowed, while the normalization and orthonormality requirements prevent such data from existing if , or is empty.
QAlgorithms.Papers.Independent.Intakenext100.P42.formationNats
For finite types with decidable equality and an arbitrary complex matrix indexed by , this definition takes an infimum in the extended reals over all finite decompositions
where . The value associated with a decomposition is the real number , embedded in the extended reals, where
and is formed using the continuous functional calculus. No density-matrix hypothesis is imposed on ; if no decomposition satisfies these conditions, the infimum is . The case cannot satisfy the weight-sum condition, and if or is empty no admissible decomposition exists. Zero weights are allowed, but even their vectors must have norm .
QAlgorithms.Papers.Independent.Intakenext100.P42.groupedStateProduct
For a finite type , arbitrary families of types indexed by , and arbitrary complex matrices indexed by , this definition gives a matrix indexed by , with entries
The types need not be finite or nonempty, and the matrices have no positivity or normalization requirements. If is empty, both function spaces have one element and the empty product is , so the resulting matrix has its single entry equal to .
QAlgorithms.Papers.Independent.Intakenext100.P42.kernelG
For arbitrary real numbers , this definition gives
There is no positivity assumption on either argument: equal negative arguments give , and arguments of opposite signs give , since the real square root of a negative number is defined as zero. The real logarithm is total, with for negative .
QAlgorithms.Papers.Independent.Intakenext100.P42.localBell
For any two complex unitary matrices indexed by the Booleans, this defines the vector
in the complex Euclidean space indexed by pairs of Booleans. Here is the coordinate vector at , with denoting false and true; explicitly, its coordinate at is
QAlgorithms.Papers.Independent.Intakenext100.P42.mixingAmplitude
For any real angles and any index , this defines the real number
The product is empty and equals when , so ; all angles are unrestricted.
QAlgorithms.Papers.Independent.Intakenext100.P42.normalizedBranch
For finite types , an arbitrary type , a family of complex matrices , an arbitrary matrix , and , define and . The declared matrix is , with the real scalar regarded as complex. There is no positivity, normalization, or completeness assumption on or , and need not be finite. The inverse is total: if , the result is the zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P42.partyKraus
For every natural number , every collection of natural dimensions , and every family of complex square matrices indexed by , this defines the matrix on configurations by
No positivity, unitarity, or Kraus completeness condition is imposed on the family. Zero dimensions are allowed; when , the configuration space is a singleton and the sole matrix entry is the empty product .
QAlgorithms.Papers.Independent.Intakenext100.P42.qubitAngle
For arbitrary real numbers and , this defines a complex vector indexed by Boolean values, with coordinates
Neither real parameter is restricted.
QAlgorithms.Papers.Independent.Intakenext100.P42.qubitMatrixUnit
For any Boolean values , this defines the complex matrix indexed by Boolean pairs whose entry in row and column is , with every other entry .
QAlgorithms.Papers.Independent.Intakenext100.P42.rectangularKrausBranch
For finite types , an arbitrary type , a family , any complex matrix indexed by , and any , this defines the complex matrix indexed by to be . No positivity, trace, normalization, or completeness condition is imposed on or the family , and need not be finite. Empty or empty is allowed; in either case the resulting matrix is zero.
QAlgorithms.Papers.Independent.Intakenext100.P42.rectangularKrausProbability
For finite types , an arbitrary type , a family , any complex matrix indexed by , and any , this defines the real number
No positivity, trace, normalization, or completeness hypotheses are imposed, so the definition does not require this number to lie in . The type need not be finite, and empty or empty is allowed, giving value .
QAlgorithms.Papers.Independent.Intakenext100.P42.relativeEntanglementNats
For finite, nonempty types , each with decidable equality, and any complex matrix indexed by , this defines the extended real number
Here a separable density matrix is a matrix admitting a finite decomposition , where , the real weights satisfy and , and every and is positive semidefinite with complex trace , indexed by and , respectively. The weight condition excludes . The quantity equals
when , and equals otherwise; both matrix functions use the continuous functional calculus supplied by the code. No positivity, Hermiticity, or trace condition is imposed on , and the definition makes no attainment assertion.
QAlgorithms.Papers.Independent.Intakenext100.P42.schmidtDiagonal
For finite types and data consisting of weights summing to and orthonormal families , , this definition gives the matrix
The weights are regarded as complex scalars when multiplying matrices. Zero weights are permitted; no such data exist if any of is empty.
QAlgorithms.Papers.Independent.Intakenext100.P42.singletWernerState
For every real , this defines the complex matrix
where is the coordinate vector at , denote false and true, is the identity matrix, and . The parameter is unrestricted; membership in is not required.
QAlgorithms.Papers.Independent.Intakenext100.P42.twoQubitMaxEntangledFraction
For an arbitrary complex matrix indexed by pairs of Booleans, this defines the real supremum
where is the coordinate vector at , denote false and true, and . No positivity, Hermiticity, or trace normalization is assumed for .
QAlgorithms.Papers.Independent.Intakenext100.P42.wernerValue
For every real , this defines
The logarithms are natural logarithms using the total real logarithm, for which and when . Thus the definition includes , and at its value is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.