Definitions for Charge-conserving unitaries typically generate optimal covariant quantum error-correcting codes
DefinitionQAlgorithms_Papers_Independent_Extend50_P03The objects the formalized statements of Charge-conserving unitaries typically generate optimal covariant quantum error-correcting codes (arXiv:2102.11835) are stated in. Each was checked against the paper by a blind read-back and a moderator.
hammingCharge: PDF p.7: Hamming-weight charge.chargeRotation: PDF p.7: exp(+i theta Q).Conserves: PDF p.7: full centralizer, including all sector phases.ChargeHaar: PDF pp.6–7: Haar characterized by probability, support and full left invariance.SpecialHaar: PDF p.12: full SU(2^n) Haar, inside the ambient unitary group.splitBits: Definition 1, PDF p.7: split the first k wires.Ancilla: Definition 1, PDF p.7: fixed normalized charge eigenvector, independent of U.pureEncoder: PDF p.7: append a fixed pure vector and apply U, on all matrix units.chargeEncoder: Definition 1's encoding channel.U1ChargeCovariant: PDF p.5: channel covariance, with the ancilla scalar phase cancelled.BitsOnjoinBits: Join assignments on disjoint complementary physical wire sets.retain: PDF p.8: partial trace retaining exactly S.PatternLaw: PDF p.12: classical distribution of t-wire erasure locations.flaggedPatternErasure: PDF p.12: direct-sum flagged erasure, padded with zeros on erased output wires.purified: PDF p.3: purified distance from root fidelity.optimizedChoiFidelity: PDF pp.3–4: optimal Choi fidelity. On channels, the feasible set is nonempty and bounded in [0,1]; the reference is normalized k EPR pairs, not a Haar average.worstFidelity: PDF p.4: one decoder precedes all positive finite reference dimensions and all normalized joint states. On channels both optimization sets are bounded/nonempty.optimizedCodeError: PDF pp.3–4: optimized error, with worst=true or Choi=false.siteError: Decoder receives the complement of the erased set S.mixtureError: Optimized error with the erasure location flag.ChargeCodeParametersAdmissibleCodeSizes: PDF pp.7–8: nontrivial asymptotic parameters. Finite formulas also allow k,t=0.LinearSequence: PDF pp.8,11: exact integer alpha=a*n; no rounding or floor.relativeRemainder: Distinct relative remainders in Theorems 1 and 2.leadingError: PDF pp.8,11: preserve every radical and factor.ZeroErrorGuarantee: Trivial regimes excluded from relative asymptotics: a zero logical register needs no recovery, and a zero erased register permits exact recovery. PDF pp.3–8.AsymptoticGuarantee: Theorem 1 or 2 with uniform C,c before sequences, ancillas, laws, and patterns. Integrability is a conclusion; exponential probability is an upper bound only.endpointEntropy: Entropy at the two charge interval endpoints.ChargeInterior: Compact interior charge endpoints for the linear-charge entropy estimate. Unlike Appendix C, this imposes no small-erasure condition.Interior: PDF p.24: compact interior and valid-sector conditions used in Appendix C.chooseZ: Negative/too-large signed binomial lower indices give zero, never Nat truncation.weightSectorProjector: PDF p.7: Hamming-weight sector projector. Invalid sectors vanish.averageChoi: PDF p.20: constructed joint averaged Choi state, reference first.reducedAverage: PDF p.21: constructed first-t-wire marginal of averageChoi.averageSectorWeight: Eq.(27), PDF p.21.averageZeta: PDF pp.21,25: computed environment marginal, not an arbitrary state.comparisonChoi: PDF p.21: I_R/2^k tensor zeta.averageBasis: PDF p.25: computed averaged environment output of a basis input.averageEncodedUnit: PDF p.25: the actual full physical average, before taking any marginal.averageMatrixUnit: PDF p.25: averaged environment matrix unit.averageWorst: PDF p.25: finite maximum auxiliary averaged-basis error.ConcentrationGuarantee: Lemma 2, PDF pp.10–11: uniform polynomial prefactors, with n/4 and n/2. No entropy conclusion is inserted as an assumption.PatternGuarantee: PDF p.12: one exceptional set for all sites and all flagged classical mixtures.unitaryEntryMoment: PDF p.14: matrix-entry (r,r) moments, including cross-sector correlations.ExactDesign: PDF pp.14–15: exact full symmetric second twirl and its first twirl.minSdp: PDF p.18, Eq.(24): feasible for all PSD rho on finite nonempty registers, with traces bounded below. Block inputs may be subnormalized or zero.decouplingFactor: PDF p.17: diagonal F on equal-charge A,Abar pairs. Its unused orthogonal complement adds only zero rows on the unconditioned side.erasureChoi: PDF p.18: normalized Choi matrix of tracing out the last n-t wires.lambdaState: Lemma 3, PDF p.17: F(Psi tensor tau)F†; P=(A,Abar), Q=(R,E).ancillaChoiInput: PDF p.17: pre-U Choi input with the fixed ancilla.choiEntropy: Appendix A's entropy of the constructed Lambda state.basisInput: Appendix C: normalized logical v appended with the ancilla, trivial reference.decouplingInputEntropy: PDF pp.23–24: entropy for a basis or two-basis input.choiSectorKappa: PDF p.20, Eq.(26): all actual residual sectors, signed binomial indices, positive denominator sectors under alpha≤n-k.basisKappa: PDF p.24: sum of squares over valid residual sectors.twoBasis: PDF p.23: four superpositions; x≠y ensures norm one.orthogonalBlockOperator: Lemma 4, PDF p.19: construct the orthogonal-block operator in order (P1,P2),Q.singleErasureLaw: PDF p.13: uniformly random single erasure with known location.choiLowerCoefficient: Eq.(21), PDF p.13: ceil(k/2)=(k+1)/2; lower coefficient cited from [11].chargeCoefficient: PDF p.12: common charge-dependent leading factor.joinFirst: Join the first t wires and last n-t wires with the exact size equality.firstTrace: The actual first-t-wire marginal, used to identify the constructed averages.ChoiEntropyGrowth: Appendix A, PDF p.20: alpha=a*n with fixed 0<a<1. The source permits all legal k,t, including alpha+k=n; no compact upper-endpoint margin is assumed.ChoiEntropyLinear: Appendix A, PDF p.20: the explicit Omega(n) corollary with k^2t^2=O(n). The exponent constant depends only on a; the threshold may depend on the sequence and its eventual O(n) constant. Ancilla choices remain uniform.AverageWorstExpansion: Appendix D, PDF p.25: equality to leading order, not a finite exact correction.OptimalSingleLimit: PDF p.13: ratios for mean flagged single-erasure errors. The sequence may have growing k in the worst metric; the Choi equality is only claimed at k=1.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Basic
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Papers_Independent_Support50_P23
/-! Kong–Liu, arXiv:2102.11835v1. Root fidelity; binary logarithms.
Local constructions preserve the fixed physical wire ordering. Matrix integrals use the
finite-dimensional entrywise norm; conditional min-entropy reuses the accepted library.
Compilation pending the batch handoff. -/
noncomputable section
open MeasureTheory Filter
open scoped Matrix ComplexConjugate ComplexOrder ENNReal Matrix.Norms.Elementwise
namespace QAlgorithms.Papers.Independent.Extend50.P03
open QAlgorithms.Papers.Independent.Support50.P23 (minEntropy)
attribute [local instance] Classical.propDecidable
/-- PDF pp.20–21,25: matrix expectations use the continuous extended norm of
finite entrywise function spaces, with the existing product topology. -/
local instance matrixContinuousENorm {I J : Type*} [Fintype I] [Fintype J] :
ContinuousENorm (Matrix I J ℂ) :=
inferInstanceAs (ContinuousENorm (I → J → ℂ))
/-- The local continuity instance preserves the entrywise extended norm exactly. -/
example {I J : Type*} [Fintype I] [Fintype J] (M : Matrix I J ℂ) :
‖M‖ₑ = ‖(fun i j => M i j)‖ₑ := rfl
/-- Borel ensemble outcomes, PDF pp.6–7. -/
instance unitaryMeasurable (n : ℕ) : MeasurableSpace ((Matrix.unitaryGroup (Qubits n) ℂ)) := borel _
/-- PDF p.7: Hamming-weight charge. -/
def hammingCharge (n : ℕ) : (Matrix (Qubits n) (Qubits n) ℂ) := Matrix.diagonal fun x => (hammingWeight x : ℂ)
/-- PDF p.7: exp(+i theta Q). -/
def chargeRotation (n : ℕ) (theta : ℝ) : (Matrix (Qubits n) (Qubits n) ℂ) :=
Matrix.diagonal fun x => Complex.exp (Complex.I * (theta : ℂ) * (hammingWeight x : ℂ))
/-- PDF p.7: full centralizer, including all sector phases. -/
def Conserves {n : ℕ} (U : (Matrix.unitaryGroup (Qubits n) ℂ)) : Prop :=
(U : (Matrix (Qubits n) (Qubits n) ℂ)) * hammingCharge n = hammingCharge n * (U : (Matrix (Qubits n) (Qubits n) ℂ))
/-- PDF pp.6–7: Haar characterized by probability, support and full left invariance. -/
def ChargeHaar (n : ℕ) (mu : Measure ((Matrix.unitaryGroup (Qubits n) ℂ))) : Prop :=
IsProbabilityMeasure mu ∧ (∀ᵐ (U : Matrix.unitaryGroup (Qubits n) ℂ) ∂mu, Conserves U) ∧
∀ V : (Matrix.unitaryGroup (Qubits n) ℂ), Conserves V → Measure.map (fun U => V * U) mu = mu
/-- PDF p.12: full SU(2^n) Haar, inside the ambient unitary group. -/
def SpecialHaar (n : ℕ) (mu : Measure ((Matrix.unitaryGroup (Qubits n) ℂ))) : Prop :=
IsProbabilityMeasure mu ∧ (∀ᵐ (U : Matrix.unitaryGroup (Qubits n) ℂ) ∂mu, Matrix.det (U : (Matrix (Qubits n) (Qubits n) ℂ)) = 1) ∧
∀ V : (Matrix.unitaryGroup (Qubits n) ℂ), Matrix.det (V : (Matrix (Qubits n) (Qubits n) ℂ)) = 1 → Measure.map (fun U => V * U) mu = mu
/-- Definition 1, PDF p.7: split the first k wires. -/
def splitBits (n k : ℕ) (h : k ≤ n) (z : Qubits n) : Qubits k × Qubits (n-k) :=
qubitsAppendEquiv k (n-k) (fun i => z (Fin.cast (Nat.add_sub_of_le h) i))
/-- Definition 1, PDF p.7: fixed normalized charge eigenvector, independent of U. -/
structure Ancilla (n k alpha : ℕ) where
logical_le : k ≤ n
charge_le : alpha ≤ n-k
vector : EuclideanSpace ℂ (Qubits (n-k))
normalized : IsState vector
eigen : act (hammingCharge (n-k)) vector = (alpha : ℂ) • vector
/-- PDF p.7: append a fixed pure vector and apply U, on all matrix units. -/
def pureEncoder {n k : ℕ} (h : k ≤ n) (psi : EuclideanSpace ℂ (Qubits (n-k)))
(U : (Matrix.unitaryGroup (Qubits n) ℂ)) : Superop (Qubits k) (Qubits n) := fun rho =>
(U : (Matrix (Qubits n) (Qubits n) ℂ)) * (Matrix.of fun z w => rho (splitBits n k h z).1 (splitBits n k h w).1 *
psi (splitBits n k h z).2 * conj (psi (splitBits n k h w).2)) * (U : (Matrix (Qubits n) (Qubits n) ℂ))ᴴ
/-- Definition 1's encoding channel. -/
def chargeEncoder {n k alpha : ℕ} (A : Ancilla n k alpha) (U : (Matrix.unitaryGroup (Qubits n) ℂ)) :
Superop (Qubits k) (Qubits n) := pureEncoder A.logical_le A.vector U
/-- PDF p.5: channel covariance, with the ancilla scalar phase cancelled. -/
def U1ChargeCovariant {n k : ℕ} (E : Superop (Qubits k) (Qubits n)) : Prop :=
∀ theta : ℝ, ∀ rho : (Matrix (Qubits k) (Qubits k) ℂ), IsDensityMatrix rho →
E (chargeRotation k theta * rho * (chargeRotation k theta)ᴴ) =
chargeRotation n theta * E rho * (chargeRotation n theta)ᴴ
abbrev BitsOn {n : ℕ} (S : Finset (Fin n)) := {i : Fin n // i ∈ S} → Bool
/-- Join assignments on disjoint complementary physical wire sets. -/
def joinBits {n : ℕ} (S : Finset (Fin n)) (u : BitsOn S) (v : BitsOn Sᶜ) : Qubits n :=
fun i => if h : i ∈ S then u ⟨i,h⟩ else v ⟨i, by simpa using h⟩
/-- PDF p.8: partial trace retaining exactly S. -/
def retain {n : ℕ} (S : Finset (Fin n)) : Superop (Qubits n) (BitsOn S) :=
fun rho => Matrix.of fun u v => ∑ z : BitsOn Sᶜ, rho (joinBits S u z) (joinBits S v z)
/-- PDF p.12: classical distribution of t-wire erasure locations. -/
def PatternLaw (n t : ℕ) (p : Finset (Fin n) → ℝ) : Prop :=
(∀ S, 0 ≤ p S) ∧ (∑ S, p S) = 1 ∧ ∀ S, S.card ≠ t → p S = 0
/-- PDF p.12: direct-sum flagged erasure, padded with zeros on erased output wires. -/
def flaggedPatternErasure {n : ℕ} (p : Finset (Fin n) → ℝ) :
Superop (Qubits n) (Finset (Fin n) × Qubits n) :=
fun rho => Matrix.of fun y z =>
if y.1 = z.1 ∧ (∀ i ∈ y.1, y.2 i = false) ∧ (∀ i ∈ z.1, z.2 i = false) then
(p y.1 : ℂ) * ∑ e : BitsOn y.1,
rho (joinBits y.1 e (fun i => y.2 i)) (joinBits y.1 e (fun i => z.2 i))
else 0
/-- PDF p.3: purified distance from root fidelity. -/
def purified {I : Type*} [Fintype I] [DecidableEq I] (rho sigma : Matrix I I ℂ) : ℝ :=
Real.sqrt (1 - rootFidelity rho sigma ^ 2)
/-- PDF pp.3–4: optimal Choi fidelity. On channels, the feasible set is nonempty
and bounded in [0,1]; the reference is normalized k EPR pairs, not a Haar average. -/
def optimizedChoiFidelity {k : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(N : Superop (Qubits k) B) : ℝ :=
sSup {f : ℝ | ∃ D : Superop B (Qubits k), IsChannel D ∧
f = rootFidelity (pureDensity (maxEntangled k))
(idTensorSuperop (R := Qubits k) (D ∘ N) (pureDensity (maxEntangled k)))}
/-- PDF p.4: one decoder precedes all positive finite reference dimensions and
all normalized joint states. On channels both optimization sets are bounded/nonempty. -/
def worstFidelity {k : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(N : Superop (Qubits k) B) : ℝ :=
sSup {f : ℝ | ∃ D : Superop B (Qubits k), IsChannel D ∧
f = sInf {g : ℝ | ∃ r : ℕ, ∃ rho : Matrix (Fin (r+1) × Qubits k)
(Fin (r+1) × Qubits k) ℂ, IsDensityMatrix rho ∧
g = rootFidelity rho (idTensorSuperop (R := Fin (r+1)) (D ∘ N) rho)}}
/-- PDF pp.3–4: optimized error, with worst=true or Choi=false. -/
def optimizedCodeError {k : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(worst : Bool) (N : Superop (Qubits k) B) : ℝ :=
Real.sqrt (1 - (if worst then worstFidelity N else optimizedChoiFidelity N) ^ 2)
/-- Decoder receives the complement of the erased set S. -/
def siteError {n k alpha : ℕ} (worst : Bool) (A : Ancilla n k alpha)
(S : Finset (Fin n)) (U : (Matrix.unitaryGroup (Qubits n) ℂ)) : ℝ :=
optimizedCodeError worst (retain Sᶜ ∘ chargeEncoder A U)
/-- Optimized error with the erasure location flag. -/
def mixtureError {n k alpha : ℕ} (worst : Bool) (A : Ancilla n k alpha)
(p : Finset (Fin n) → ℝ) (U : (Matrix.unitaryGroup (Qubits n) ℂ)) : ℝ :=
optimizedCodeError worst (flaggedPatternErasure p ∘ chargeEncoder A U)
structure ChargeCodeParameters where
n : ℕ
k : ℕ
alpha : ℕ
t : ℕ
/-- PDF pp.7–8: nontrivial asymptotic parameters. Finite formulas also allow k,t=0. -/
def AdmissibleCodeSizes (d : ChargeCodeParameters) : Prop :=
1 ≤ d.n ∧ 1 ≤ d.k ∧ d.k ≤ d.n ∧ d.alpha ≤ d.n-d.k ∧ 1 ≤ d.t ∧ d.t ≤ d.n
/-- PDF pp.8,11: exact integer alpha=a*n; no rounding or floor. -/
def LinearSequence (a : ℝ) (d : ℕ → ChargeCodeParameters) : Prop :=
Tendsto (fun i => (d i).n) atTop atTop ∧
∀ i, AdmissibleCodeSizes (d i) ∧ ((d i).alpha : ℝ) = a * (d i).n
/-- Distinct relative remainders in Theorems 1 and 2. -/
def relativeRemainder (worst : Bool) (d : ChargeCodeParameters) : ℝ :=
if worst then (d.k : ℝ) * (d.t : ℝ)^2 / d.n
else (d.k : ℝ)^2 * (d.t : ℝ)^2 / d.n
/-- PDF pp.8,11: preserve every radical and factor. -/
def leadingError (worst : Bool) (a : ℝ) (d : ChargeCodeParameters) : ℝ :=
(if worst then (d.k : ℝ) * Real.sqrt d.t else Real.sqrt ((d.t : ℝ) * d.k)) /
(4 * d.n * Real.sqrt (a * (1-a)))
/-- Trivial regimes excluded from relative asymptotics: a zero logical register
needs no recovery, and a zero erased register permits exact recovery. PDF pp.3–8. -/
def ZeroErrorGuarantee (worst : Bool) : Prop :=
(∀ n alpha : ℕ, ∀ A : Ancilla n 0 alpha, ∀ S : Finset (Fin n),
∀ U : (Matrix.unitaryGroup (Qubits n) ℂ), siteError worst A S U = 0) ∧
(∀ n k alpha : ℕ, ∀ A : Ancilla n k alpha, ∀ U : (Matrix.unitaryGroup (Qubits n) ℂ),
siteError worst A ∅ U = 0)
/-- Theorem 1 or 2 with uniform C,c before sequences, ancillas, laws, and patterns.
Integrability is a conclusion; exponential probability is an upper bound only. -/
def AsymptoticGuarantee (L : (n : ℕ) → Measure ((Matrix.unitaryGroup (Qubits n) ℂ)) → Prop) (worst : Bool) : Prop :=
∀ a : ℝ, 0 < a → a < 1 → ∃ C : ℝ, 0 < C ∧ ∃ c : ℝ, 0 < c ∧
∀ d : ℕ → ChargeCodeParameters, LinearSequence a d →
Tendsto (fun i => relativeRemainder worst (d i)) atTop (nhds 0) →
∃ N : ℕ, ∀ i ≥ N, ∀ A : Ancilla (d i).n (d i).k (d i).alpha,
∀ mu : Measure ((Matrix.unitaryGroup (Qubits (d i).n) ℂ)), L (d i).n mu →
∀ S : Finset (Fin (d i).n), S.card = (d i).t →
let B := leadingError worst a (d i) * (1 + C * relativeRemainder worst (d i))
Integrable (siteError worst A S) mu ∧ (∫ U, siteError worst A S U ∂mu) ≤ B ∧
mu {U | B < siteError worst A S U} ≤ ENNReal.ofReal (Real.exp (-c * (d i).n))
/-- Entropy at the two charge interval endpoints. -/
def endpointEntropy (d : ChargeCodeParameters) : ℝ :=
min (binEntropy2 ((d.alpha : ℝ) / d.n))
(binEntropy2 (((d.alpha : ℝ) + d.k) / d.n))
/-- Compact interior charge endpoints for the linear-charge entropy estimate.
Unlike Appendix C, this imposes no small-erasure condition. -/
def ChargeInterior (b : ℝ) (d : ChargeCodeParameters) : Prop :=
1 ≤ d.n ∧ d.k ≤ d.n ∧ d.alpha ≤ d.n-d.k ∧ d.t ≤ d.n ∧
b ≤ (d.alpha : ℝ)/d.n ∧ ((d.alpha : ℝ)+d.k)/d.n ≤ 1-b
/-- PDF p.24: compact interior and valid-sector conditions used in Appendix C. -/
def Interior (b : ℝ) (d : ChargeCodeParameters) : Prop :=
AdmissibleCodeSizes d ∧ b ≤ (d.alpha : ℝ)/d.n ∧ ((d.alpha : ℝ)+d.k)/d.n ≤ 1-b ∧
d.t ≤ d.alpha ∧ d.alpha + d.k ≤ d.n-d.t
/-- Negative/too-large signed binomial lower indices give zero, never Nat truncation. -/
def chooseZ (n : ℕ) (q : ℤ) : ℝ :=
if 0 ≤ q ∧ q ≤ (n : ℤ) then (n.choose q.toNat : ℝ) else 0
/-- PDF p.7: Hamming-weight sector projector. Invalid sectors vanish. -/
def weightSectorProjector (n : ℕ) (q : ℤ) : (Matrix (Qubits n) (Qubits n) ℂ) :=
Matrix.diagonal fun x => if (hammingWeight x : ℤ) = q then 1 else 0
/-- PDF p.20: constructed joint averaged Choi state, reference first. -/
def averageChoi (n k alpha : ℕ) : Matrix (Qubits k × Qubits n) (Qubits k × Qubits n) ℂ :=
∑ j ∈ Finset.range (k+1), (((2 : ℝ)^k)⁻¹ / chooseZ n (j+alpha) : ℂ) •
Matrix.kronecker (weightSectorProjector k j) (weightSectorProjector n (j+alpha))
/-- PDF p.21: constructed first-t-wire marginal of averageChoi. -/
def reducedAverage (n k alpha t : ℕ) :
Matrix (Qubits k × Qubits t) (Qubits k × Qubits t) ℂ :=
∑ j ∈ Finset.range (k+1), ∑ i ∈ Finset.range (t+1),
((((2 : ℝ)^k)⁻¹ * chooseZ (n-t) ((j : ℤ)+alpha-i) /
chooseZ n ((j : ℤ)+alpha) : ℝ) : ℂ) •
Matrix.kronecker (weightSectorProjector k j) (weightSectorProjector t i)
/-- Eq.(27), PDF p.21. -/
def averageSectorWeight (n k alpha t i : ℕ) : ℝ :=
((2 : ℝ)^k)⁻¹ * ∑ j ∈ Finset.range (k+1),
(k.choose j : ℝ) * chooseZ (n-t) ((j : ℤ)+alpha-i) / chooseZ n ((j : ℤ)+alpha)
/-- PDF pp.21,25: computed environment marginal, not an arbitrary state. -/
def averageZeta (n k alpha t : ℕ) : (Matrix (Qubits t) (Qubits t) ℂ) :=
∑ i ∈ Finset.range (t+1), (averageSectorWeight n k alpha t i : ℂ) • weightSectorProjector t i
/-- PDF p.21: I_R/2^k tensor zeta. -/
def comparisonChoi (n k alpha t : ℕ) :
Matrix (Qubits k × Qubits t) (Qubits k × Qubits t) ℂ :=
Matrix.kronecker (((((2 : ℝ)^k)⁻¹ : ℝ) : ℂ) • (1 : (Matrix (Qubits k) (Qubits k) ℂ))) (averageZeta n k alpha t)
/-- PDF p.25: computed averaged environment output of a basis input. -/
def averageBasis {k : ℕ} (n alpha t : ℕ) (x : Qubits k) : (Matrix (Qubits t) (Qubits t) ℂ) :=
∑ i ∈ Finset.range (t+1),
((chooseZ (n-t) ((hammingWeight x : ℤ)+alpha-i) /
chooseZ n ((hammingWeight x : ℤ)+alpha) : ℝ) : ℂ) • weightSectorProjector t i
/-- PDF p.25: the actual full physical average, before taking any marginal. -/
def averageEncodedUnit {k : ℕ} (n alpha : ℕ) (x y : Qubits k) : (Matrix (Qubits n) (Qubits n) ℂ) :=
if x = y then ((chooseZ n ((hammingWeight x : ℤ)+alpha))⁻¹ : ℂ) •
weightSectorProjector n ((hammingWeight x : ℤ)+alpha) else 0
/-- PDF p.25: averaged environment matrix unit. -/
def averageMatrixUnit {k : ℕ} (n alpha t : ℕ) (x y : Qubits k) : (Matrix (Qubits t) (Qubits t) ℂ) :=
if x = y then averageBasis n alpha t x else 0
/-- PDF p.25: finite maximum auxiliary averaged-basis error. -/
def averageWorst (n k alpha t : ℕ) : ℝ :=
sSup {p : ℝ | ∃ x : Qubits k,
p = purified (averageBasis n alpha t x) (averageZeta n k alpha t)}
/-- Lemma 2, PDF pp.10–11: uniform polynomial prefactors, with n/4 and n/2.
No entropy conclusion is inserted as an assumption. -/
def ConcentrationGuarantee (L : (n : ℕ) → Measure ((Matrix.unitaryGroup (Qubits n) ℂ)) → Prop) : Prop :=
∀ b : ℝ, 0 < b → b < 1/2 → ∃ C : ℝ, 0 < C ∧ ∃ D : ℕ,
∀ d : ℕ → ChargeCodeParameters, Tendsto (fun i => (d i).n) atTop atTop →
(∀ᶠ i in atTop, Interior b (d i)) → ∃ N : ℕ, ∀ i ≥ N,
∀ A : Ancilla (d i).n (d i).k (d i).alpha,
∀ mu : Measure ((Matrix.unitaryGroup (Qubits (d i).n) ℂ)), L (d i).n mu →
∀ S : Finset (Fin (d i).n), S.card = (d i).t →
∀ epsilon delta deltaPrime : ℝ, 0 ≤ epsilon → 0 < delta → 0 < deltaPrime →
∀ zeta : (Matrix (Qubits (d i).t) (Qubits (d i).t) ℂ), IsDensityMatrix zeta →
(∀ x : Qubits (d i).k, purified (averageBasis (d i).n (d i).alpha (d i).t x) zeta ≤ epsilon) →
mu {U | epsilon + delta + (2 : ℝ)^(d i).k * Real.sqrt deltaPrime <
siteError true A S U} ≤ ENNReal.ofReal
(C * ((d i).n : ℝ)^D *
((2 : ℝ)^((d i).k - ((d i).n : ℝ)/4 * endpointEntropy (d i) + (d i).t/2) / delta +
(2 : ℝ)^(2*(d i).k - ((d i).n : ℝ)/2 * endpointEntropy (d i) + (d i).t) / deltaPrime))
/-- PDF p.12: one exceptional set for all sites and all flagged classical mixtures. -/
def PatternGuarantee (L : (n : ℕ) → Measure ((Matrix.unitaryGroup (Qubits n) ℂ)) → Prop) : Prop :=
∀ worst : Bool, ∀ a : ℝ, 0 < a → a < 1 → ∃ C : ℝ, 0 < C ∧ ∃ c : ℝ, 0 < c ∧
∀ d : ℕ → ChargeCodeParameters, LinearSequence a d →
Tendsto (fun i => relativeRemainder worst (d i)) atTop (nhds 0) →
∃ N : ℕ, ∀ i ≥ N, ∀ A : Ancilla (d i).n (d i).k (d i).alpha,
∀ mu : Measure ((Matrix.unitaryGroup (Qubits (d i).n) ℂ)), L (d i).n mu →
let B := leadingError worst a (d i) * (1 + C * relativeRemainder worst (d i))
(∀ p : Finset (Fin (d i).n) → ℝ, PatternLaw (d i).n (d i).t p →
Integrable (mixtureError worst A p) mu ∧ (∫ U, mixtureError worst A p U ∂mu) ≤ B) ∧
mu {U | (∃ S : Finset (Fin (d i).n), S.card = (d i).t ∧ B < siteError worst A S U) ∨
(∃ p : Finset (Fin (d i).n) → ℝ, PatternLaw (d i).n (d i).t p ∧
B < mixtureError worst A p U)} ≤ ENNReal.ofReal (Real.exp (-c * (d i).n))
/-- PDF p.14: matrix-entry (r,r) moments, including cross-sector correlations. -/
def unitaryEntryMoment {n : ℕ} (r : ℕ) (a b c d : Fin r → Qubits n) (U : (Matrix.unitaryGroup (Qubits n) ℂ)) : ℂ :=
(∏ i, (U : (Matrix (Qubits n) (Qubits n) ℂ)) (a i) (b i)) * conj (∏ i, (U : (Matrix (Qubits n) (Qubits n) ℂ)) (c i) (d i))
/-- PDF pp.14–15: exact full symmetric second twirl and its first twirl. -/
def ExactDesign (n : ℕ) (mu : Measure ((Matrix.unitaryGroup (Qubits n) ℂ))) : Prop :=
IsProbabilityMeasure mu ∧ (∀ᵐ (U : Matrix.unitaryGroup (Qubits n) ℂ) ∂mu, Conserves U) ∧
∃ nu : Measure ((Matrix.unitaryGroup (Qubits n) ℂ)), ChargeHaar n nu ∧
∀ r ∈ ({1,2} : Finset ℕ), ∀ a b c d : Fin r → Qubits n,
Integrable (unitaryEntryMoment r a b c d) mu ∧ Integrable (unitaryEntryMoment r a b c d) nu ∧
(∫ U, unitaryEntryMoment r a b c d U ∂mu) = ∫ U, unitaryEntryMoment r a b c d U ∂nu
/-- PDF p.18, Eq.(24): feasible for all PSD rho on finite nonempty registers,
with traces bounded below. Block inputs may be subnormalized or zero. -/
def minSdp {P Q : Type*} [Fintype P] [Fintype Q] [DecidableEq P] [DecidableEq Q]
(rho : Matrix (P × Q) (P × Q) ℂ) : ℝ :=
sInf {s : ℝ | ∃ sigma : Matrix Q Q ℂ, sigma.PosSemidef ∧
(Matrix.kronecker (1 : Matrix P P ℂ) sigma - rho).PosSemidef ∧ s = sigma.trace.re}
/-- PDF p.17: diagonal F on equal-charge A,Abar pairs. Its unused orthogonal
complement adds only zero rows on the unconditioned side. -/
def decouplingFactor (n : ℕ) (a b : Qubits n) : ℝ :=
if hammingWeight a = hammingWeight b then
Real.sqrt ((2 : ℝ)^n / chooseZ n (hammingWeight a)) else 0
/-- PDF p.18: normalized Choi matrix of tracing out the last n-t wires. -/
def erasureChoi (n t : ℕ) : Matrix (Qubits n × Qubits t) (Qubits n × Qubits t) ℂ :=
Matrix.of fun p q =>
if (∀ i : Fin t, ∀ h : i.val < n, p.1 ⟨i.val,h⟩ = p.2 i ∧ q.1 ⟨i.val,h⟩ = q.2 i) ∧
(∀ i : Fin n, t ≤ i.val → p.1 i = q.1 i) then (((2 : ℝ)^n)⁻¹ : ℂ) else 0
/-- Lemma 3, PDF p.17: F(Psi tensor tau)F†; P=(A,Abar), Q=(R,E). -/
def lambdaState {R : Type*} (n t : ℕ)
(Psi : Matrix (R × Qubits n) (R × Qubits n) ℂ) :
Matrix ((Qubits n × Qubits n) × (R × Qubits t))
((Qubits n × Qubits n) × (R × Qubits t)) ℂ :=
Matrix.of fun p q =>
(decouplingFactor n p.1.1 p.1.2 : ℂ) * (decouplingFactor n q.1.1 q.1.2 : ℂ) *
Psi (p.2.1,p.1.1) (q.2.1,q.1.1) * erasureChoi n t (p.1.2,p.2.2) (q.1.2,q.2.2)
/-- PDF p.17: pre-U Choi input with the fixed ancilla. -/
def ancillaChoiInput {n k alpha : ℕ} (A : Ancilla n k alpha) :
Matrix (Qubits k × Qubits n) (Qubits k × Qubits n) ℂ :=
idTensorSuperop (R := Qubits k) (chargeEncoder A 1) (pureDensity (maxEntangled k))
/-- Appendix A's entropy of the constructed Lambda state. -/
def choiEntropy {n k alpha : ℕ} (A : Ancilla n k alpha) (t : ℕ) : EReal :=
minEntropy (lambdaState n t (ancillaChoiInput A))
/-- Appendix C: normalized logical v appended with the ancilla, trivial reference. -/
def basisInput {n k alpha : ℕ} (A : Ancilla n k alpha)
(v : EuclideanSpace ℂ (Qubits k)) : Matrix (Unit × Qubits n) (Unit × Qubits n) ℂ :=
Matrix.of fun p q => chargeEncoder A 1 (pureDensity v) p.2 q.2
/-- PDF pp.23–24: entropy for a basis or two-basis input. -/
def decouplingInputEntropy {n k alpha : ℕ} (A : Ancilla n k alpha) (t : ℕ)
(v : EuclideanSpace ℂ (Qubits k)) : EReal :=
minEntropy (lambdaState n t (basisInput A v))
/-- PDF p.20, Eq.(26): all actual residual sectors, signed binomial indices,
positive denominator sectors under alpha≤n-k. -/
def choiSectorKappa (n k alpha t : ℕ) : ℝ :=
∑ i ∈ Finset.range (n-t+1), (∑ j ∈ Finset.range (k+1),
chooseZ t ((j : ℤ)+alpha-i) * (k.choose j : ℝ) /
Real.sqrt ((2 : ℝ)^k * chooseZ n ((j : ℤ)+alpha)))^2
/-- PDF p.24: sum of squares over valid residual sectors. -/
def basisKappa (n q t : ℕ) : ℝ :=
(∑ i ∈ Finset.range (n-t+1), (chooseZ t ((q : ℤ)-i))^2) / chooseZ n q
/-- PDF p.23: four superpositions; x≠y ensures norm one. -/
def twoBasis {k : ℕ} (x y : Qubits k) (imaginary negative : Bool) :
EuclideanSpace ℂ (Qubits k) :=
((Real.sqrt 2)⁻¹ : ℂ) • (ket x +
((if negative then -1 else 1) * (if imaginary then Complex.I else 1) : ℂ) • ket y)
/-- Lemma 4, PDF p.19: construct the orthogonal-block operator in order (P1,P2),Q. -/
def orthogonalBlockOperator {P1 P2 Q : Type*} {m : ℕ}
(Pi : Fin m → Matrix P1 P1 ℂ) (rho : Fin m → Matrix (P2 × Q) (P2 × Q) ℂ) :
Matrix ((P1 × P2) × Q) ((P1 × P2) × Q) ℂ :=
Matrix.of fun p q => ∑ i, Pi i p.1.1 q.1.1 * rho i (p.1.2,p.2) (q.1.2,q.2)
/-- PDF p.13: uniformly random single erasure with known location. -/
def singleErasureLaw (n : ℕ) (S : Finset (Fin n)) : ℝ :=
if S.card = 1 then (n : ℝ)⁻¹ else 0
/-- Eq.(21), PDF p.13: ceil(k/2)=(k+1)/2; lower coefficient cited from [11]. -/
def choiLowerCoefficient (k : ℕ) : ℝ :=
((k.choose ((k+1)/2) : ℝ) * (((k+1)/2 : ℕ) : ℝ)) / (2 : ℝ)^k
/-- PDF p.12: common charge-dependent leading factor. -/
def chargeCoefficient (a : ℝ) : ℝ := (4 * Real.sqrt (a*(1-a)))⁻¹
example : chooseZ 3 (-1) = 0 := by norm_num [chooseZ]
example : chooseZ 3 4 = 0 := by norm_num [chooseZ]
example : chooseZ 3 0 = 1 := by norm_num [chooseZ]
example : chargeCoefficient (1/2) = 1/2 := by norm_num [chargeCoefficient]
example : choiLowerCoefficient 1 = 1/2 := by norm_num [choiLowerCoefficient]
example : binEntropy2 0 = 0 := by simp [QAlgorithms.binEntropy2]
example {n : ℕ} (S : Finset (Fin n)) (rho : (Matrix (Qubits n) (Qubits n) ℂ)) (u v : BitsOn S) :
retain S rho u v = ∑ z : BitsOn Sᶜ, rho (joinBits S u z) (joinBits S v z) := rfl
example {k : ℕ} (n alpha t : ℕ) (x y : Qubits k) (h : x ≠ y) :
averageMatrixUnit n alpha t x y = 0 := by simp [averageMatrixUnit,h]
example (worst : Bool) (a : ℝ) (n alpha : ℕ) :
leadingError worst a ⟨n,0,alpha,0⟩ = 0 := by cases worst <;> simp [leadingError]
/-- Sanity: the zero group angle acts as identity on every basis amplitude. -/
example (n : ℕ) (x : Qubits n) : chargeRotation n 0 x x = 1 := by simp [chargeRotation]
/-- Sanity: the physical charge has the source's eigenvalues on basis strings. -/
example (n : ℕ) (x : Qubits n) : hammingCharge n x x = (hammingWeight x : ℂ) := by simp [hammingCharge]
/-- Sanity: the trivial complementary-channel Choi state is normalized. -/
example : erasureChoi 0 0 (fun _ => false, fun _ => false)
(fun _ => false, fun _ => false) = 1 := by simp [erasureChoi]
/-- Sanity: the scalar F on the zero-qubit charge sector is one. -/
example : decouplingFactor 0 (fun _ => false) (fun _ => false) = 1 := by
norm_num [decouplingFactor, chooseZ, hammingWeight]
/-- Sanity: a zero moment order has no spurious sector-phase restriction. -/
example {n : ℕ} (a b c d : Fin 0 → Qubits n) (U : (Matrix.unitaryGroup (Qubits n) ℂ)) :
unitaryEntryMoment 0 a b c d U = 1 := by simp [unitaryEntryMoment]
/-- Sanity: a distinct-input averaged physical coherence is zero. -/
example {k : ℕ} (n alpha : ℕ) (x y : Qubits k) (h : x ≠ y) :
averageEncodedUnit n alpha x y = 0 := by simp [averageEncodedUnit,h]
/-- Join the first t wires and last n-t wires with the exact size equality. -/
def joinFirst (n t : ℕ) (h : t ≤ n) (u : Qubits t) (v : Qubits (n-t)) : Qubits n :=
fun i => Fin.append u v (Fin.cast (Nat.add_sub_of_le h).symm i)
/-- The actual first-t-wire marginal, used to identify the constructed averages. -/
def firstTrace (n t : ℕ) (h : t ≤ n) : Superop (Qubits n) (Qubits t) :=
fun rho => Matrix.of fun u v => ∑ z : Qubits (n-t),
rho (joinFirst n t h u z) (joinFirst n t h v z)
/-- Appendix A, PDF p.20: alpha=a*n with fixed 0<a<1. The source permits
all legal k,t, including alpha+k=n; no compact upper-endpoint margin is assumed. -/
def ChoiEntropyGrowth : Prop :=
∀ a : ℝ, 0 < a → a < 1 → ∃ C : ℝ, 0 < C ∧ ∃ N : ℕ,
∀ d : ChargeCodeParameters, N ≤ d.n → 1 ≤ d.n → d.t ≤ d.n →
(d.alpha : ℝ) = a * d.n → ∀ A : Ancilla d.n d.k d.alpha,
((d.n * endpointEntropy d - 2*d.t - d.k - C*Real.logb 2 (d.n+1) : ℝ) : EReal) ≤
choiEntropy A d.t
/-- Appendix A, PDF p.20: the explicit Omega(n) corollary with k^2t^2=O(n).
The exponent constant depends only on a; the threshold may depend on the sequence
and its eventual O(n) constant. Ancilla choices remain uniform. -/
def ChoiEntropyLinear : Prop :=
∀ a : ℝ, 0 < a → a < 1 → ∃ c : ℝ, 0 < c ∧
∀ d : ℕ → ChargeCodeParameters, LinearSequence a d →
(∃ K : ℝ, 0 < K ∧ ∀ᶠ i in atTop, relativeRemainder false (d i) ≤ K) →
∃ N : ℕ, ∀ i ≥ N, ∀ A : Ancilla (d i).n (d i).k (d i).alpha,
((c*(d i).n : ℝ) : EReal) ≤ choiEntropy A (d i).t
/-- Appendix D, PDF p.25: equality to leading order, not a finite exact correction. -/
def AverageWorstExpansion : Prop :=
∀ a : ℝ, 0 < a → a < 1 → ∃ C : ℝ, 0 < C ∧
∀ d : ℕ → ChargeCodeParameters, LinearSequence a d →
Tendsto (fun i => relativeRemainder true (d i)) atTop (nhds 0) →
∃ N : ℕ, ∀ i ≥ N,
|averageWorst (d i).n (d i).k (d i).alpha (d i).t /
leadingError true a (d i) - 1| ≤ C * relativeRemainder true (d i)
/-- PDF p.13: ratios for mean flagged single-erasure errors. The sequence may
have growing k in the worst metric; the Choi equality is only claimed at k=1. -/
def OptimalSingleLimit (worst : Bool) : Prop :=
∀ d : ℕ → ChargeCodeParameters, LinearSequence (1/2) d →
(∀ i, (d i).t = 1 ∧ Even (d i).n) →
(if worst then Tendsto (fun i => ((d i).k : ℝ)/(d i).n) atTop (nhds 0)
else ∀ i, (d i).k = 1) →
∀ A : (i : ℕ) → Ancilla (d i).n (d i).k (d i).alpha,
∀ mu : (i : ℕ) → Measure ((Matrix.unitaryGroup (Qubits (d i).n) ℂ)), (∀ i, ChargeHaar (d i).n (mu i)) →
Tendsto (fun i => (∫ U, mixtureError worst (A i) (singleErasureLaw (d i).n) U ∂(mu i)) /
leadingError worst (1/2) (d i)) atTop (nhds 1)
end QAlgorithms.Papers.Independent.Extend50.P03
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Extend50.P03.AdmissibleCodeSizes
For any record consisting of natural numbers , this property means exactly , , , , , and . The subtraction is natural-number subtraction, truncated at zero, although the accompanying condition makes it ordinary subtraction here. Thus must be positive, while is allowed; in particular, forces , and is permitted.
QAlgorithms.Papers.Independent.Extend50.P03.Ancilla
For natural numbers , an object of this structure consists of proofs that and , together with a complex vector indexed by -bit strings, satisfying and , where is diagonal with entries counting true bits and its action is ordinary matrix-vector multiplication. Equivalently, at every such string . If , the requirements force , and has a single coordinate of modulus one; parameters violating either required inequality admit no object of this structure.
QAlgorithms.Papers.Independent.Extend50.P03.AsymptoticGuarantee
For an arbitrary predicate on natural numbers and measures on the unitary group of , where , and a fixed Boolean , this property means the following: for every real , there exist constants and such that, for every sequence of natural-number quadruples with , , , , and at every index, if , where when and otherwise, then there exists such that the following holds for every . For every norm-one ancilla satisfying , where counts the ones in , every measure satisfying , and every coordinate subset with , the function described below is integrable and
The measure inequality is in the extended nonnegative reals. To define , let encode as and then trace out , and put , using continuous functional calculus for square roots. For , , where , , and . For , is instead , with and ranging over positive semidefinite, trace-one matrices on . Each decoder is a finite Kraus map with . The constants precede the sequence quantifier, and precedes the ancilla, measure, and subset quantifiers. No probability, invariance, or support condition on is imposed separately from ; if no sequence satisfies the exact charge equalities, the requirement for that is vacuous.
QAlgorithms.Papers.Independent.Extend50.P03.AverageWorstExpansion
This proposition says that for every real , there exists a real such that, for every sequence of natural-number tuples satisfying ,
at every index, and satisfying , there is a natural number such that for all ,
To define , let , let be the diagonal projector onto strings of Hamming weight , and use the convention for integers . Set
and
The matrix square roots here are given by continuous functional calculus. The displayed denominator is positive under the sequence hypotheses. The exact integer relation is part of the hypotheses, so the implication is vacuous when no such sequence exists.
QAlgorithms.Papers.Independent.Extend50.P03.BitsOn
For every natural number and finite subset , this abbreviation denotes the type of all Boolean-valued functions on the elements of , namely assignments of one bit to each index belonging to . If is empty, including necessarily when , there is exactly one such assignment: the empty function.
QAlgorithms.Papers.Independent.Extend50.P03.ChargeCodeParameters
This structure consists of four natural numbers , , , and . It imposes no additional conditions or relations among them: each may be , and inequalities such as , , or are not required by the structure.
QAlgorithms.Papers.Independent.Extend50.P03.ChargeHaar
For every natural number and measure on the unitary group indexed by -bit strings, with its Borel measurable structure, this predicate requires that have total mass one, that for -almost every , and that for every unitary satisfying , the pushforward of under equal . Here is diagonal with entries equal to the number of true bits in each string. The definition includes , when the commutation conditions hold for every unitary.
QAlgorithms.Papers.Independent.Extend50.P03.ChargeInterior
For a real number and a quadruple of natural numbers, this property is exactly
Natural-number subtraction is truncated at zero, though prevents truncation here. Neither nor is required to be positive, and no separate restriction is imposed on .
QAlgorithms.Papers.Independent.Extend50.P03.ChoiEntropyGrowth
This proposition states that, for every real with , there exist a real and a natural number such that the following holds uniformly over natural parameters : if , , , and exactly, then every ancilla satisfying , , , and , where is diagonal with entry , the number of ones in , satisfies
Here . To specify the right-hand side, write for the first and last bits of an -bit string, and define
For , put when , and otherwise. For , let
and define the matrix , whose two grouped registers are indexed by and , by
The quantity is the supremum in the extended real numbers of all real for which there exists a positive semidefinite matrix of trace one on the register such that is positive semidefinite. Neither nor is required to be positive; a zero-length bit register has one element. The equality is an exact restriction on integer parameters, so no parameter choice in this assertion exists when is irrational.
QAlgorithms.Papers.Independent.Extend50.P03.ChoiEntropyLinear
This proposition says that for every real with , there exists a real such that the following holds for every sequence of natural-number tuples : assume , and for every ,
also assume there exists a real such that eventually . Then there exists a natural number such that for every and every unit vector supported on strings of Hamming weight , one has , as an inequality of extended real numbers. Here , and the matrix and entropy in this assertion are defined, writing , by
where is indexed by . The bounded-remainder hypothesis requires eventual boundedness, not convergence to zero. The exact equalities are required at every index; if no integer-valued sequence satisfies them, the corresponding conditional assertion is vacuous.
QAlgorithms.Papers.Independent.Extend50.P03.ConcentrationGuarantee
For an arbitrary predicate on natural numbers and measures on the unitary matrices of qubits, this property means the following. For every real with , there exist and a natural number such that, for every sequence of natural-number quadruples with and eventually
there is such that the following holds for every . Put . Take any ancilla vector on qubits with norm one and , where is diagonal with the Hamming weights of -bit strings; the ancilla data also include and . Take any measure satisfying , any set with , any reals , and any positive semidefinite trace-one matrix on qubits. Define for integers , and zero otherwise, and let be diagonal with . Suppose that, for every -bit string ,
For a unitary , let , using the first wires for , and define
Here ranges over recovery channels from the retained register to qubits; a channel means a map with finitely many Kraus matrices and . Writing and , the required bound is
with the right side embedded in the extended nonnegative reals. The constants precede the sequence, while may depend on it; has no separate probability or invariance assumption beyond , and the property imposes nothing on sequences that fail its hypotheses.
QAlgorithms.Papers.Independent.Extend50.P03.Conserves
For every natural number and unitary complex matrix indexed by -bit strings, the predicate means that , where is diagonal with entry at the bit string , and counts its true bits. For , , so every such satisfies this predicate.
QAlgorithms.Papers.Independent.Extend50.P03.ExactDesign
For any natural number and measure on the complex unitary matrices indexed by , this property says that is a probability measure, that for -almost every , and that there exists another measure on the same unitary matrices with the following properties: is a probability measure, for -almost every , and for every unitary commuting with , the pushforward of under equals . Here is diagonal with entry , the number of true bits of . For each and every four lists of -bit strings, the complex-valued function
must be integrable with respect to both and , and its two integrals must agree. This includes repeated indices and ; the matching requirement is only for .
QAlgorithms.Papers.Independent.Extend50.P03.Interior
For a real number and a quadruple of natural numbers, this property is exactly
Subtractions are natural-number subtractions truncated at zero, with the displayed bounds preventing truncation. There is no separate hypothesis on ; the conditions themselves exclude, for example, , , or .
QAlgorithms.Papers.Independent.Extend50.P03.LinearSequence
For a real number and a sequence of quadruples of natural numbers, this property means that and, for every natural index , , , , , and , with the last equality interpreted in . Natural-number subtraction is truncated at zero, although prevents truncation here. The equality is exact at every index; in particular, this property cannot hold unless is rational and .
QAlgorithms.Papers.Independent.Extend50.P03.OptimalSingleLimit
For either Boolean value , this proposition has the following meaning. Consider any sequence of natural-number tuples with , satisfying at every index
If is true, require ; if it is false, require for every . For every choice of unit ancilla vectors supported on strings of Hamming weight , and every sequence of probability measures on the unitary group of that are almost surely supported on unitaries commuting with the diagonal Hamming-weight operator and are invariant under left multiplication by every such commuting unitary, the proposition requires
Here , , with the first qubits carrying . The map chooses one erased site uniformly, records its singleton subset as a classical flag, traces out that site, and embeds the retained state into with the erased bit fixed to false; all other subset flags have zero blocks. For a map from qubits, define
where the inner matrices are indexed by , and each decoder ranges over maps admitting finitely many Kraus operators with and . The proposition itself includes no integrability assertion for the displayed integrals.
QAlgorithms.Papers.Independent.Extend50.P03.PatternGuarantee
For an arbitrary predicate on natural numbers and measures on -qubit unitary matrices, this property requires the following for each Boolean choice and every real with . There exist constants such that, for every sequence of natural-number quadruples satisfying , for every
and , there is for which the assertions below hold for every . Here
Put , take any norm-one ancilla on qubits satisfying , where is the diagonal Hamming-weight matrix, and take any measure satisfying . Encode by , with the logical register first. For a channel from qubits, define
and
where , and ranges over recovery channels to qubits. Channels are precisely finite Kraus sums satisfying . Write . For any real function on subsets of the wires satisfying , , and whenever , let output the classical flag , trace out the wires in , and put those erased wires in the all-false state, with weight ; explicitly its -block at bit strings is zero unless both vanish on , and otherwise is . Put . Every such must satisfy integrability of under and , and simultaneously
Thus the same event bound covers all eligible subsets and all eligible pattern laws. The constants precede the sequence, may depend on it, and no probability or invariance condition on is imposed separately from . The equality is exact; if no sequence satisfies the hypotheses, that instance of the requirement is vacuous.
QAlgorithms.Papers.Independent.Extend50.P03.PatternLaw
For natural numbers and a real-valued function on all subsets of , this property means that for every subset , that , and that whenever . Thus all mass is supported on subsets of exactly positions. The parameters include and : for the conditions force mass on the empty subset, while for they cannot be satisfied.
QAlgorithms.Papers.Independent.Extend50.P03.SpecialHaar
For every natural number and measure on the unitary group indexed by -bit strings, with its Borel measurable structure, this predicate requires that have total mass one, that for -almost every , and that for every unitary with , the pushforward of under equal . This includes , when the matrices have size and determinant one forces the matrix to be the identity.
QAlgorithms.Papers.Independent.Extend50.P03.U1ChargeCovariant
For natural numbers and any function from complex matrices on -bit strings to complex matrices on -bit strings, this predicate means that for every real and every positive semidefinite matrix of trace one on -bit strings, , where is diagonal with entry at each -bit string , and counts true bits. No linearity or channel assumption on is included. Both and are permitted.
QAlgorithms.Papers.Independent.Extend50.P03.ZeroErrorGuarantee
For a fixed Boolean , this property asserts both that the error defined below is zero for every , every admissible ancilla for , every subset , and every unitary on bits, and that the error is zero for every , every admissible ancilla, and every such when . Here ; an admissible ancilla consists of , , and a vector of norm one satisfying , where is diagonal with entry , the number of ones in . The encoder sends to , using the first coordinates for ; the channel whose error is measured then traces out the coordinates in . Write , with matrix square roots given by continuous functional calculus. If , the error is , where is the supremum, over decoding channels , of , with and . If , the same error formula uses instead the supremum over of the infimum of over all and all positive semidefinite, trace-one matrices on . A channel here is a map for a finite family satisfying . These assertions include and ; no charge-conservation assumption is imposed on .
QAlgorithms.Papers.Independent.Extend50.P03.ancillaChoiInput
For natural numbers , let consist of , , and a complex Euclidean vector on the Boolean strings of length , with , satisfying the charge eigenvector equation for every such string , where counts true bits. Split each length- string into its first bits and its remaining bits . This definition returns the complex matrix indexed by pairs consisting of a length- string and a length- string, with entries
Equivalently, it applies the identity to the first register and the map adjoining , with the identity unitary on the resulting bits, to the projector onto ; each is the coordinate vector equal to at and elsewhere. Zero-length registers, including and , are included.
QAlgorithms.Papers.Independent.Extend50.P03.averageBasis
For every natural number , arbitrary natural numbers , and every bit string , let be its number of true bits. Define when the integer lies in , and zero otherwise. The defined complex matrix on is diagonal, with
Equivalently, the coefficient of the projector onto strings of weight , for , is . The subtraction inside 's argument is integer subtraction; is truncated at zero. No parameter restrictions are imposed, and if , the entire matrix is zero.
QAlgorithms.Papers.Independent.Extend50.P03.averageChoi
For arbitrary natural numbers , this defines the complex matrix indexed by , where , by
Here , interpreted as a real number when the integer satisfies , and otherwise; is the diagonal complex matrix whose entry at a bit string is one exactly when has ones, and zero otherwise. The coefficients are cast to complex scalars. There are no size or charge assumptions, including no requirement that or ; a zero denominator gives coefficient zero. Zero values of any parameter are included, and every out-of-range weight projector is zero.
QAlgorithms.Papers.Independent.Extend50.P03.averageEncodedUnit
For every natural number , arbitrary natural numbers , and bit strings , define for integers , and zero otherwise. The defined complex matrix on has entries
where and count true bits. In particular, unequal give the zero matrix. No restrictions relate ; inverse zero is zero, so an out-of-range weight also gives the zero matrix. Empty bit strings are included when a register size is zero.
QAlgorithms.Papers.Independent.Extend50.P03.averageMatrixUnit
For every natural number , arbitrary natural numbers , and bit strings , define for integers , and zero otherwise. The defined complex matrix on is
where Hamming weight counts true bits. All parameters may be zero, and no size restrictions are assumed. The numerator's weight argument uses integer subtraction, is truncated at zero, and every quotient with zero denominator is zero.
QAlgorithms.Papers.Independent.Extend50.P03.averageSectorWeight
For arbitrary natural numbers , including zero, define when the integer satisfies , and otherwise. The defined real number is
where , while is integer subtraction. No bounds relating the parameters are assumed. A summand with zero denominator is zero, using the total real division convention .
QAlgorithms.Papers.Independent.Extend50.P03.averageWorst
For arbitrary natural numbers , define for integers , and zero otherwise. For each , let be the diagonal matrix on with entry at , and let be the diagonal matrix with entry
at . The defined real number is
where matrix square roots mean the continuous functional calculus of the real square-root function. The supremum ranges over a finite nonempty set, including the single empty string when . There are no density-matrix or parameter-bound hypotheses; zero denominators are interpreted as zero, and the real square root of a nonpositive argument is zero.
QAlgorithms.Papers.Independent.Extend50.P03.averageZeta
For arbitrary natural numbers , let , and let denote the number of true bits of . Define for integers , and zero otherwise, and set
The defined complex matrix , indexed by , is diagonal, with
Thus it is the sum, over , of times the diagonal projector onto strings of weight . All parameters may be zero, and no normalization or parameter bounds are hypotheses; zero denominators in the coefficients contribute zero.
QAlgorithms.Papers.Independent.Extend50.P03.basisInput
For natural numbers , let comprise , , and a norm-one complex vector on length- Boolean strings satisfying , with the number of true bits. For any complex Euclidean vector on length- Boolean strings, split each length- string into its first bits and remaining bits . This definition returns a complex matrix indexed by , where is a singleton and is the set of length- Boolean strings, with entries
Thus it is the matrix whose entries are , with , carrying an additional singleton index. There is no assumption that has norm or is a coordinate basis vector; and all zero-length registers are allowed.
QAlgorithms.Papers.Independent.Extend50.P03.basisKappa
For any natural numbers , define for integers , and otherwise. This definition returns the real number
where is integer subtraction, while reflects truncated natural-number subtraction in the summation bound. There are no assumptions or . Real division by zero is defined to be , so the value is whenever ; when , the numerator has just the term . All zero values of the parameters are included.
QAlgorithms.Papers.Independent.Extend50.P03.chargeCoefficient
For every real number , this defines
The square root and reciprocal are total real operations: the square root of a nonpositive number is , and the reciprocal of is . Consequently, the value is whenever or ; no hypothesis restricting to is imposed.
QAlgorithms.Papers.Independent.Extend50.P03.chargeEncoder
For natural numbers , an object supplying , , and a vector on -bit strings with and , and any unitary matrix on -bit strings, define the matrix-valued function , where . Here is diagonal with entries counting true bits, and the subscripts select the first and last bits. The input is any complex matrix on -bit strings, and no commutation condition is imposed on . The definition includes and .
QAlgorithms.Papers.Independent.Extend50.P03.chargeRotation
For every natural number and real number , define the diagonal complex matrix indexed by -bit strings by , where is the number of true bits in ; all off-diagonal entries are zero. For , this is the identity matrix.
QAlgorithms.Papers.Independent.Extend50.P03.choiEntropy
For arbitrary natural numbers , take ancilla data comprising , , and a norm-one vector on satisfying , where denotes length- Boolean strings and their numbers of true bits. Split as , and define a matrix on by
Here is when , and otherwise; requires for and for ; each indicator is or . The definition returns the supremum in the extended real numbers of all real for which there exists a positive semidefinite matrix on , with complex trace , such that
The supremum is if there are no such , and if they are unbounded above. There is no restriction , and all zero-length registers are included.
QAlgorithms.Papers.Independent.Extend50.P03.choiLowerCoefficient
For every natural number , this defines the real number
where the divisions by inside the binomial coefficient and its multiplier are natural-number division. In particular, the definition includes , for which its value is .
QAlgorithms.Papers.Independent.Extend50.P03.choiSectorKappa
For every four natural numbers , with no size or positivity restrictions, define when the integer satisfies , and otherwise. This definition returns
The arguments are computed as integers, so they can be negative; the outer upper limit comes from natural-number subtraction, which truncates at . All divisions are real divisions with , so a summand with zero denominator contributes . In particular, when the outer sum still contains the single term , and and are included.
QAlgorithms.Papers.Independent.Extend50.P03.chooseZ
For every natural number and integer , this defines the real number when , and zero otherwise. In the first case is converted to a natural number before taking the binomial coefficient. Thus negative and give zero, while gives one.
QAlgorithms.Papers.Independent.Extend50.P03.comparisonChoi
For arbitrary natural numbers , write and for Hamming weight, and define for integers , and zero otherwise. The defined complex matrix on is diagonal and has entries
Equivalently, it is tensored with the diagonal matrix whose weight- entry is . There are no positivity, normalization, or size hypotheses. Zero denominators give zero, and when or , the corresponding bit-string set consists of the single empty string.
QAlgorithms.Papers.Independent.Extend50.P03.decouplingFactor
For every natural number , including , and every pair of Boolean strings of length , let and denote their numbers of true bits. This definition returns the real number
Here the integer-indexed binomial function used in the code returns for an integer with , and otherwise; in this definition its argument is always the valid weight , so the denominator is positive. When , there is one empty string and the returned value is .
QAlgorithms.Papers.Independent.Extend50.P03.decouplingInputEntropy
For arbitrary natural numbers , let comprise , , and a norm-one vector on satisfying , where denotes length- Boolean strings and counts true bits. Given any complex Euclidean vector on , split into and , and put . Define a matrix on by
where if , and otherwise, and requires for and for . The definition returns the extended-real supremum of all real for which some positive semidefinite matrix on , with trace , satisfies
An empty feasible set has supremum , and an unbounded one has supremum . No normalization or basis-vector condition is imposed on , no assumption is made, and zero-length registers are allowed; in particular, gives and the returned value .
QAlgorithms.Papers.Independent.Extend50.P03.endpointEntropy
For any quadruple of natural numbers, this defines
There are no admissibility assumptions, and does not affect the result. The real logarithm and division are total, with and division by zero equal to zero; in particular the result is zero when . The arguments of are not required to lie in .
QAlgorithms.Papers.Independent.Extend50.P03.erasureChoi
For arbitrary natural numbers , let be the set of Boolean strings of length . This definition gives a complex matrix indexed by , whose entry at row and column is
The nonzero value is regarded as a complex number. There is no assumption : if , the bits of at positions at least are unconstrained. If , the matrix is times the identity on ; if , every entry is , for every .
QAlgorithms.Papers.Independent.Extend50.P03.firstTrace
For natural numbers with , this defines a map from arbitrary complex matrices indexed by length- Boolean strings to complex matrices indexed by length- Boolean strings by
where denotes concatenation. No positivity or normalization assumption is placed on . For , the result is the one-entry matrix containing ; for , the sum has the unique empty string as its sole index and returns .
QAlgorithms.Papers.Independent.Extend50.P03.flaggedPatternErasure
For every natural number and arbitrary real-valued function on subsets of the positions, this defines a function taking any complex matrix indexed by length- Boolean strings to a complex matrix indexed by pairs consisting of a subset and a full length- string. Its entry at row and column is zero unless and both and are false at every position in ; when those conditions hold, the entry is , where each union combines assignments on complementary sets of positions and is regarded as a complex scalar. There is no requirement that be nonnegative, normalized, or supported on subsets of any fixed size, and no requirement that be a density matrix. Empty and full subsets are included: their diagonal flag blocks are respectively and a matrix supported only at the all-false string with value . For , the sole output entry is times the sole input entry.
QAlgorithms.Papers.Independent.Extend50.P03.hammingCharge
For every natural number , define the complex matrix indexed by -bit strings by when and . Thus its diagonal entries count the true bits of each string. For , this is the zero matrix.
QAlgorithms.Papers.Independent.Extend50.P03.joinBits
For every natural number , including , every subset , and Boolean assignments and , this defines the Boolean string of length by for and for , where the complement is taken among the positions. Empty subsets and empty complements are allowed; for , the result is the unique empty string.
QAlgorithms.Papers.Independent.Extend50.P03.joinFirst
For natural numbers , a hypothesis , a Boolean string of length , and a Boolean string of length , this defines their concatenation as a Boolean string of length :
Here is natural-number subtraction, and the hypothesis ensures that the two lengths add to . The cases , , and are included, with the corresponding empty strings.
QAlgorithms.Papers.Independent.Extend50.P03.lambdaState
For any type , with no finiteness or nonemptiness assumption, any natural numbers , and any complex matrix indexed by , where denotes the Boolean strings of length , this definition constructs a complex matrix indexed by . For strings , , and , its entries are
where is when its condition holds and otherwise,
counts true bits, and means that and for all , and for all . The real factors are embedded into . No positivity, trace, or normalization condition is imposed on , and all , including and , are allowed; in the latter case the bits of beyond position are unconstrained.
QAlgorithms.Papers.Independent.Extend50.P03.leadingError
For either Boolean value , any real number , and any quadruple of natural numbers, this defines
No admissibility assumptions or restrictions on are imposed, and does not affect the value. Real square roots of nonpositive numbers are zero, and division by zero is zero; consequently the value is zero if or .
QAlgorithms.Papers.Independent.Extend50.P03.minSdp
For arbitrary finite types , each equipped with decidable equality and either of which may be empty, and any complex matrix indexed by , the defined real number is
where each inequality means positive semidefiniteness. There is no hypothesis that is Hermitian, positive, or normalized, and the definition asserts neither feasibility nor attainment. If the feasible set is empty, the real infimum used here is . If either indexing type is empty, the value is also .
QAlgorithms.Papers.Independent.Extend50.P03.mixtureError
For natural numbers , a Boolean , an ancilla datum , any real-valued function on subsets of the positions, and any unitary matrix on length- Boolean strings, this defines an error as follows. The datum provides , , and a unit vector on length- strings satisfying , where is diagonal with the number of true bits as its entries. Set , with logical positions first. Define on pairs of a subset and a full string by setting its entry at to zero unless and are both false on ; otherwise set that entry to . The result is : for , , and for , . Here uses continuous functional calculus, for equal logical strings and otherwise, and . The inner infimum ranges over all density matrices on the logical space with any reference dimension ; tensor extensions act blockwise. Decoders map the entire flagged output space back to the logical space and have finite Kraus representations with . The extrema are real-valued, and the outer real square root gives for a negative argument. There is no probability-law assumption on , no charge-conservation assumption on , and zero sizes are allowed whenever exists.
QAlgorithms.Papers.Independent.Extend50.P03.optimizedChoiFidelity
For every natural number , including , every finite type equipped with decidable equality, and every function from complex matrices on length- Boolean strings to complex matrices on , this defines the real supremum . Here if and otherwise, , and , with matrix square roots defined by continuous functional calculus. The supremum ranges over precisely those functions for which there are a natural number and matrices from to the length- string space satisfying and for every complex matrix . The operation applies separately to every matrix block determined by the two reference indices. No channel, linearity, positivity, or normalization condition is imposed on , and may be empty. This uses the real-valued supremum operation, without asserting that a maximizing decoder exists or that the values form a nonempty bounded set.
QAlgorithms.Papers.Independent.Extend50.P03.optimizedCodeError
For every natural number , finite type equipped with decidable equality, Boolean value , and arbitrary function from complex matrices on length- Boolean strings to complex matrices on , this defines as follows. Write using continuous functional calculus, and let decoders range over functions admitting finite Kraus representations with . If is true, then , with on a reference space of dimension and the length- string space; if it is false, then , where for and otherwise, and . Each tensor extension acts separately on reference-indexed blocks. The extrema are real-valued supremum and infimum operations, with no attainment asserted. The definition permits and empty , imposes no channel condition on , and uses the total real square root, so a negative outer radicand gives .
QAlgorithms.Papers.Independent.Extend50.P03.orthogonalBlockOperator
For arbitrary types , any natural number , a family of complex matrices indexed by , and a family of complex matrices indexed by , for , this definition returns the complex matrix indexed by with entries
No finiteness or nonemptiness assumptions are imposed on , and no projection, orthogonality, positivity, or normalization assumptions are imposed on either matrix family. If , the sum is empty and the resulting matrix is zero.
QAlgorithms.Papers.Independent.Extend50.P03.pureEncoder
For natural numbers , a supplied proof that , an arbitrary complex vector indexed by -bit strings, and a unitary matrix indexed by -bit strings, define a function from complex matrices indexed by -bit strings to matrices indexed by -bit strings by , where , and denote the first and last bits of , respectively, with the same convention for . No normalization of or density-matrix condition on is required. Empty logical or ancillary strings are allowed.
QAlgorithms.Papers.Independent.Extend50.P03.purified
For every finite index type equipped with decidable equality and any complex square matrices indexed by , this defines , where and each matrix square root is defined by continuous functional calculus applied to the real square-root function. Neither matrix is assumed positive semidefinite or normalized, and may be empty. The outer square root is the total real square-root function, which returns for a negative argument; consequently the formula is defined even when .
QAlgorithms.Papers.Independent.Extend50.P03.reducedAverage
For arbitrary natural numbers , this defines the complex matrix indexed by , where , by
Here the argument of is computed in the integers; as a real number for , and zero otherwise. The matrix is diagonal with entry one at precisely those -bit strings having ones, and zero elsewhere, and the displayed real coefficients are cast to complex scalars. No admissibility assumptions are imposed: is allowed and makes the first binomial parameter zero through truncated natural subtraction; negative or oversized binomial arguments give zero, and division by a zero denominator is zero. The definition also includes zero values of all parameters.
QAlgorithms.Papers.Independent.Extend50.P03.relativeRemainder
For either Boolean value and any quadruple of natural numbers, this defines the real number
There are no admissibility or positivity assumptions, and does not affect the value. Division by zero is defined to be zero, so the result is zero when .
QAlgorithms.Papers.Independent.Extend50.P03.retain
For every natural number and subset , this defines a function from complex matrices indexed by length- Boolean strings to complex matrices indexed by Boolean assignments on . For any input matrix , its output has entries , where is the full string equal to on and on its complement. No positivity or normalization is required of . When is empty, the output is the one-by-one matrix containing ; when contains every position, the sum has one term and retains all entries, under the corresponding identification of indices. The definition also includes .
QAlgorithms.Papers.Independent.Extend50.P03.singleErasureLaw
For every natural number and every finite subset , this definition returns the real number if , and otherwise. It is defined for as well: the only possible subset is empty, so its value is . For positive , every singleton has value , and every other subset has value .
QAlgorithms.Papers.Independent.Extend50.P03.siteError
For natural numbers , a Boolean , an ancilla datum , a subset of the positions, and any unitary matrix on length- Boolean strings, this defines the following error. The datum supplies , , and a vector on length- strings with and , where is diagonal with entry equal to the number of true bits. Define the encoding , placing the input positions first and the ancilla positions last, and define on assignments to by . Write using continuous functional calculus. The result is , where, if is true, , and otherwise , with for equal length- strings and otherwise and . In the first case ranges over matrices on the reference space of dimension and the logical string space; each tensor extension acts blockwise. Decoders map matrices on assignments to back to logical matrices and admit finite Kraus representations with . The extrema are real-valued, and the outer square root returns for a negative argument. No charge-conservation condition is imposed on , no size restriction is imposed on , and zero sizes are included whenever the ancilla datum exists.
QAlgorithms.Papers.Independent.Extend50.P03.splitBits
For natural numbers , a supplied proof that , and an -bit string , this function returns the pair consisting of its first bits and its remaining bits: for and for . When the first string is empty; when the second is empty.
QAlgorithms.Papers.Independent.Extend50.P03.twoBasis
For every natural number , any two length- Boolean strings , and two Boolean flags called imaginary and negative, this definition returns the complex Euclidean vector
Here is the coordinate vector equal to at and at every other string, and likewise for . No assumption is made: if , the result is , which is zero when imaginary is false and negative is true, and has norm when both flags are false. The case , where necessarily , is included.
QAlgorithms.Papers.Independent.Extend50.P03.unitaryEntryMoment
For any natural numbers , any four lists of bit strings of length , and any complex unitary matrix indexed by those -bit strings, the defined complex number is
Repeated indices are permitted. When , both products are empty and the value is ; when , the matrix is indexed by the single empty bit string.
QAlgorithms.Papers.Independent.Extend50.P03.unitaryMeasurable
For every natural number , equip the group of unitary complex matrices indexed by with the Borel -algebra generated by its topology. This includes , when contains the single empty bit string and these matrices have size .
QAlgorithms.Papers.Independent.Extend50.P03.weightSectorProjector
For every natural number and integer , this defines a complex matrix indexed by , whose entry at is one if and has exactly ones, and zero otherwise. It is therefore the diagonal matrix selecting bit strings of weight . It is zero for or ; for , its sole entry is one when and zero otherwise.
QAlgorithms.Papers.Independent.Extend50.P03.worstFidelity
For every natural number , every finite type equipped with decidable equality, and every function from complex matrices on length- Boolean strings to complex matrices on , this defines , where is indexed by . Here uses continuous functional calculus, and the tensor extension applies the function separately to the blocks determined by the reference indices. The outer supremum ranges over functions admitting a finite representation on every matrix , with ; the same decoder is used throughout its inner infimum. All positive finite reference dimensions occur, since may be , and is allowed. No channel or linearity assumption is imposed on , and may be empty. Both extrema are the real-valued supremum and infimum operations; no attainment or boundedness condition is part of the definition.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.