Definitions for Decoding quantum information via the Petz recovery map
DefinitionQAlgorithms_Papers_Independent_Bridge50_P38The objects the formalized statements of Decoding quantum information via the Petz recovery map (arXiv:1504.04449) are stated in. Each was checked against the paper by a blind read-back and a moderator.
SubspaceCode: PDF pp.7–8, (3.1),(3.4): a positive integer dimensional subspace, represented by an orthonormal frame, and a CPTP decoder into the ambient input. Changing the frame does not change either Haar-average or entanglement fidelity.codeMap: PDF pp.7–8: the actual decoded map compressed to code coordinates. This compression need not preserve trace: ambient decoder leakage is retained.codeAverageFidelity: PDF p.7, (3.1): normalized Haar average of squared pure-state overlap.codeEntanglementFidelity: PDF p.8, (3.4): squared fidelity to the normalized maximally entangled code input, evaluated after the actual ambient decoder.subspaceCapacity: PDF p.8, (3.2)–(3.6): exact feasible positive integer message sizes. For a lawful channel and 0<=epsilon<1 the set is nonempty and bounded by card(A)^n. Extended suprema also give explicit empty/unbounded conventions off that domain.averageCapacity: PDF p.8, (3.3): average pure-state transmission capacity in qubits per block.inputVariance: PDF pp.6–7: relative information variance for the actual purified output. For density inputs and CPTP N the support inclusion needed by D and V is automatic.quantumDispersion: PDF p.7, (2.5): source dispersion in the two OPEN error regimes. Only used at epsilon != 1/2; this definition supplies no source value at 1/2.secondOrderCorrection: PDF pp.18–20: the second-order correction, with its zero middle-error case stated directly, without assigning a value to V_(1/2).basisClock: PDF p.10: Z_U = U diag(exp(2 pi i (k+1)/d)) U^dagger. The diagonal clock is the accepted one-based clock, not a zero-based variant.firstAction: PDF p.10: a map acting on the first register, keeping all second-register blocks.collisionExponential: PDF pp.6,11: the actual collision exponential tr(rho sigma^-1/2 rho sigma^-1/2). The inverse square root is the support inverse, zero on the kernel. This quadratic form is defined even for zero or unnormalized CP outputs, with no log(0) artifact.symmetricErasure: PDF pp.2,20: symmetric erasure channel into the input plus one orthogonal flag. Both transmitted off-diagonal entries and the erasure probability are explicit.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Defs_FiniteRegisters
import Definitions.Def_QAlgorithms_Defs_QuditChannelFidelities
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P36
import Definitions.Def_QAlgorithms_Papers_Independent_Gap48_P03
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P35
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P22
import Definitions.Def_QAlgorithms_Papers_Independent_Gap48_P23
/-!
Beigi–Datta–Leditzky, arXiv:1504.04449v4. Page numbers are PDF pages.
The source's codes have isometric subspace inclusion and an ambient-space decoder.
Capacities below are total log2(message dimension), not per-use rates.
Theorem 3.1 and the quantitative Petz-decoder witness are deferred in HARD.md.
Compilation and independent moderation are pending the batch handoff.
-/
noncomputable section
open scoped Matrix ComplexConjugate ComplexOrder
open QAlgorithms
namespace QAlgorithms.Papers.Independent.Bridge50.P38
open QAlgorithms.Papers.Independent.Information100.P80 (log2)
open QAlgorithms.Papers.Independent.Information100.P63 (normalQuantile)
open QAlgorithms.Papers.Independent.Dependency50.P36
(relativeEntropyFinite pairInformationVariance)
open QAlgorithms.Papers.Independent.Dependency50.P35
(columnProjector pinch marginalAB marginalAC)
open QAlgorithms.Papers.Independent.Information100.P22
(densityPurification singleUseInformation coherentInformation)
open QAlgorithms.Papers.Independent.Gap48.P23 (CompletelyPositive)
attribute [local instance] Classical.propDecidable Classical.decEq
variable {A B C : Type} [Fintype A] [DecidableEq A]
variable [Fintype B] [DecidableEq B] [Fintype C] [DecidableEq C]
/-- PDF pp.7–8, (3.1),(3.4): a positive integer dimensional subspace,
represented by an orthonormal frame, and a CPTP decoder into the ambient input.
Changing the frame does not change either Haar-average or entanglement fidelity. -/
structure SubspaceCode (A B : Type) [Fintype A] [DecidableEq A]
[Fintype B] [DecidableEq B] where
m : ℕ
positive : 0 < m
inclusion : Matrix A (Fin m) ℂ
isometry : inclusionᴴ * inclusion = 1
decoder : Superop B A
decoder_channel : IsChannel decoder
/-- PDF pp.7–8: the actual decoded map compressed to code coordinates.
This compression need not preserve trace: ambient decoder leakage is retained. -/
def codeMap (N : Superop A B) (K : SubspaceCode A B) :
Superop (Fin K.m) (Fin K.m) :=
fun X => K.inclusionᴴ * K.decoder (N (conjSuperop K.inclusion X)) * K.inclusion
/-- PDF p.7, (3.1): normalized Haar average of squared pure-state overlap. -/
def codeAverageFidelity (N : Superop A B) (K : SubspaceCode A B) : ℝ :=
QuditFidelity.averageFidelity K.m K.positive (codeMap N K)
/-- PDF p.8, (3.4): squared fidelity to the normalized maximally entangled
code input, evaluated after the actual ambient decoder. -/
def codeEntanglementFidelity (N : Superop A B) (K : SubspaceCode A B) : ℝ :=
QuditFidelity.entanglementFidelity K.m K.positive (codeMap N K)
/-- PDF p.8, (3.2)–(3.6): exact feasible positive integer message sizes.
For a lawful channel and 0<=epsilon<1 the set is nonempty and bounded by card(A)^n.
Extended suprema also give explicit empty/unbounded conventions off that domain. -/
def subspaceCapacity (entanglement : Bool) (N : Superop A B)
(n : ℕ) (epsilon : ℝ) : EReal :=
sSup {r | ∃ K : SubspaceCode (Fin n → A) (Fin n → B),
1 - epsilon ≤ (if entanglement then
codeEntanglementFidelity (piSuperop (fun _ : Fin n => N)) K else
codeAverageFidelity (piSuperop (fun _ : Fin n => N)) K) ∧
r = (log2 K.m : EReal)}
/-- PDF p.8, (3.3): average pure-state transmission capacity in qubits per block. -/
def averageCapacity (N : Superop A B) (n : ℕ) (epsilon : ℝ) : EReal :=
subspaceCapacity false N n epsilon
/-- PDF pp.6–7: relative information variance for the actual purified output.
For density inputs and CPTP N the support inclusion needed by D and V is automatic. -/
def inputVariance (N : Superop A B) (rho : Matrix A A ℂ) : ℝ :=
let omega := idTensorSuperop N (pureDensity (densityPurification rho))
pairInformationVariance omega (Matrix.kronecker (1 : Matrix A A ℂ) (traceLeft omega))
/-- PDF p.7, (2.5): source dispersion in the two OPEN error regimes.
Only used at epsilon != 1/2; this definition supplies no source value at 1/2. -/
def quantumDispersion (N : Superop A B) (epsilon : ℝ)
(_hne : epsilon ≠ 1/2) : ℝ :=
let vs := {v | ∃ rho : Matrix A A ℂ,
(IsDensityMatrix rho ∧ coherentInformation N rho = singleUseInformation N) ∧
v = inputVariance N rho}
if epsilon < 1/2 then sInf vs else sSup vs
/-- PDF pp.18–20: the second-order correction, with its zero middle-error
case stated directly, without assigning a value to V_(1/2). -/
def secondOrderCorrection (N : Superop A B) (epsilon : ℝ) (n : ℕ) : ℝ :=
if h : epsilon = 1/2 then 0 else
Real.sqrt ((n : ℝ) * quantumDispersion N epsilon h) * normalQuantile epsilon
/-- PDF p.10: Z_U = U diag(exp(2 pi i (k+1)/d)) U^dagger.
The diagonal clock is the accepted one-based clock, not a zero-based variant. -/
def basisClock {d : ℕ} (U : Matrix.unitaryGroup (Fin d) ℂ) : Matrix (Fin d) (Fin d) ℂ :=
(U : Matrix (Fin d) (Fin d) ℂ) *
QAlgorithms.Papers.Independent.Gap48.P03.clockUnitary d *
(U : Matrix (Fin d) (Fin d) ℂ)ᴴ
/-- PDF p.10: a map acting on the first register, keeping all second-register blocks. -/
def firstAction {R S T : Type} (L : Superop R S) : Superop (R × T) (S × T) :=
fun X p q => L (fun i j => X (i,p.2) (j,q.2)) p.1 q.1
/-- PDF pp.6,11: the actual collision exponential tr(rho sigma^-1/2 rho sigma^-1/2).
The inverse square root is the support inverse, zero on the kernel. This quadratic
form is defined even for zero or unnormalized CP outputs, with no log(0) artifact. -/
def collisionExponential {I : Type} [Fintype I] [DecidableEq I]
(rho sigma : Matrix I I ℂ) : ℝ :=
let S := cfc (fun x : ℝ => (Real.sqrt x)⁻¹) sigma
(rho * S * rho * S).trace.re
/-- PDF pp.2,20: symmetric erasure channel into the input plus one orthogonal flag.
Both transmitted off-diagonal entries and the erasure probability are explicit. -/
def symmetricErasure (A : Type) [Fintype A] : Superop A (Option A) :=
fun X p q => match p, q with
| some a, some b => (1/2 : ℂ) * X a b
| none, none => (1/2 : ℂ) * X.trace
| _, _ => 0
/-- Sanity: the middle-error second-order term is exactly zero. -/
example (N : Superop A B) (n : ℕ) : secondOrderCorrection N (1/2) n = 0 := by
simp [secondOrderCorrection]
/-- Sanity: no inaccessible output-flag coherence is introduced by erasure. -/
example (X : Matrix A A ℂ) (a : A) : symmetricErasure A X (some a) none = 0 := by
rfl
/-- Sanity: the erasure flag carries half the actual input trace. -/
example (X : Matrix A A ℂ) : symmetricErasure A X none none = (1/2 : ℂ) * X.trace := by
rfl
/-- Sanity: zero CP output has zero collision quadratic form, even at singular sigma. -/
example {I : Type} [Fintype I] [DecidableEq I] (sigma : Matrix I I ℂ) :
collisionExponential 0 sigma = 0 := by
simp [collisionExponential]
/-- Sanity: register order in the input purification is second-factor input. -/
example (rho : Matrix A A ℂ) (r a s b : A) :
pureDensity (densityPurification rho) (r,a) (s,b) =
cfc Real.sqrt rho a r * conj (cfc Real.sqrt rho b s) := by
rfl
/-- Sanity: a singleton marginal is the projector of the same supplied vector. -/
example (psi : EuclideanSpace ℂ (Unit × Unit × Unit)) :
marginalAB (pureDensity psi) ((),()) ((),()) = psi ((),(),()) * conj (psi ((),(),())) := by
simp [marginalAB, pureDensity]
end QAlgorithms.Papers.Independent.Bridge50.P38
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Bridge50.P38.SubspaceCode
For finite types and , each with decidable equality, a subspace code consists of a natural number , a complex matrix with rows indexed by and columns indexed by , satisfying , and a map from complex matrices to complex matrices that has a finite Kraus representation: there exist a natural number and matrices such that and for every . Thus the columns of are orthonormal; in particular, , so no such code exists when is empty. No recovery or fidelity requirement is included in this structure.
QAlgorithms.Papers.Independent.Bridge50.P38.averageCapacity
For finite types with decidable equality, any matrix map , any natural number , and any real , the average capacity is the extended-real supremum of over positive integers , matrices satisfying , and decoders admitting finite Kraus representations with , subject to
Here is normalized Haar measure, and
The definition permits , arbitrary real , and maps without channel assumptions; if there is no qualifying code, its value is .
QAlgorithms.Papers.Independent.Bridge50.P38.basisClock
For every natural number , including , and every unitary complex matrix , the basis clock is
The index in the exponential is . When , there are no diagonal entries and the result is the empty matrix.
QAlgorithms.Papers.Independent.Bridge50.P38.codeAverageFidelity
For finite types with decidable equality, an arbitrary matrix map , and a code with positive dimension , isometric inclusion satisfying , and decoder for a finite family satisfying , define . The code average fidelity is the real number
where is normalized Haar measure and is the first coordinate unit vector in . No channel assumption on , or resulting bound between zero and one, is part of this definition.
QAlgorithms.Papers.Independent.Bridge50.P38.codeEntanglementFidelity
For finite types with decidable equality, an arbitrary matrix map , and a code with , inclusion , and a decoder with finitely many satisfying , put . Its code entanglement fidelity is
Here the extended map applies separately to each matrix block indexed by the first register. This is a real-valued definition for arbitrary , without an assumption that is a channel.
QAlgorithms.Papers.Independent.Bridge50.P38.codeMap
For finite types with decidable equality, any map , and a code consisting of , an inclusion matrix with , and a decoder admitting finitely many Kraus matrices with , the associated map on matrices is
This formula applies to every complex matrix ; no channel, linearity, or positivity assumption is imposed on .
QAlgorithms.Papers.Independent.Bridge50.P38.collisionExponential
For any finite type with decidable equality and arbitrary complex matrices , let be the matrix obtained from by the supplied functional calculus with scalar function . The collision exponential is
There is no density, Hermiticity, positivity, invertibility, or support hypothesis. The scalar function takes value zero at zero, and also at negative real arguments because the real square root and inverse are total with for and . If is empty, the trace and hence this quantity are zero.
QAlgorithms.Papers.Independent.Bridge50.P38.firstAction
For arbitrary types , without finiteness assumptions, and any map , its first action maps matrices indexed by to matrices indexed by according to
Thus is applied separately to each block determined by . No linearity, positivity, or channel assumption is imposed on , and the types may be empty.
QAlgorithms.Papers.Independent.Bridge50.P38.inputVariance
For finite types with decidable equality, any matrix map , and any complex matrix , form the vector , where the square root is defined by the supplied functional calculus, and put ; explicitly, its entry is . Let , , and , using functional calculus with the scalar function . The defined input variance is
Neither being a density matrix nor being a channel is required, and no support condition or nonnegativity conclusion is included; scalar logarithms use the total convention .
QAlgorithms.Papers.Independent.Bridge50.P38.quantumDispersion
For finite types with decidable equality, any matrix map , and any real , define , using functional calculus with , and define , where . Let
For each density matrix satisfying , put , , and
The quantum dispersion is if , and the supremum of that same set if . All extrema here are real-valued extrema with the supplied total conventions, so an empty optimizing set has infimum and supremum zero. No channel assumption on , attainment assumption, or restriction is imposed.
QAlgorithms.Papers.Independent.Bridge50.P38.secondOrderCorrection
For finite types with decidable equality, an arbitrary matrix map , any real , and any natural number , the correction is zero when ; otherwise it is
Here is the infimum, for , or supremum, for , of over density matrices maximizing among all density matrices, where , , and . With and , the variance used is
with all matrix functions interpreted through the supplied functional calculus. No channel assumption or restriction on is imposed; real infima and suprema retain their total conventions, and the real square root is zero for nonpositive arguments. In particular, gives correction zero.
QAlgorithms.Papers.Independent.Bridge50.P38.subspaceCapacity
For finite types with decidable equality, a Boolean flag , any matrix map , a natural number , and any real , this quantity is the supremum in the extended real numbers of over the following codes: , satisfies , and has a finite Kraus representation whose Kraus matrices satisfy . Write , where the defined parallel extension is
When is true, the required inequality is , where and ; when is false, it is , with and normalized Haar measure . No channel assumption on or restriction on is imposed. The case is included, with singleton word registers and empty products equal to one; an empty set of qualifying codes gives supremum .
QAlgorithms.Papers.Independent.Bridge50.P38.symmetricErasure
For every finite type , including the empty type, this defines a map from complex matrices indexed by to complex matrices indexed by , where is an additional index. For every input matrix , its output entries are
The definition applies to arbitrary matrices , without a positivity or normalization hypothesis.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.