Definitions for Private Quantum Channels and the Cost of Randomizing Quantum Information
DefinitionQAlgorithms_Papers_Independent_Advance50_P18The objects the formalized statements of Private Quantum Channels and the Cost of Randomizing Quantum Information (arXiv:quant-ph/0003101) are stated in. Each was checked against the paper by a blind read-back and a moderator.
KeyedUnitaryEnsemble: PDF pp.3–4: finite classical law and keyed full-space matrices, fixed before the input. Validity is separate so that explicit constructed ensembles carry no unproved proof fields.KeyedUnitaryEnsemble.Valid: PDF p.3: nonnegative probabilities of total mass one; each keyed operator is unitary. Zero-probability key labels are allowed, and still have unitary operators.keyEntropy: PDF p.3, §2.2: Shannon entropy in bits, including the convention 0 log 0 = 0.encrypt: PDF p.3: the average conjugation map, with probability p (not its square root). The source's Kraus operator for key k is sqrt(p k) times U k.sourceMixedIdentity: PDF p.3: normalized identity; all uses below have a nonempty qubit basis.allPure: PDF p.3: the set of all normalized pure states.classicalSource: PDF p.6: classical messages are precisely computational-basis vectors.BarePQC: PDF p.4, Definition 3.1, with no ancilla. The key is independent of the input; unitarity gives exact inverse decoding for each key, without an extra recovery assumption.PQC: PDF p.4, Definition 3.1: an exact private quantum channel with a fixed mixed ancilla. All of I × A is transmitted. The same ancilla, law and unitaries serve every source state.IsSourceMixture: PDF p.4: a density is a finite probability mixture of normalized source-state projectors. The empty mixture is excluded by the sum-one condition, even when S is empty.ExactSourceRandomization: PDF p.8, §6: forgetting only the classical key in the same full-output model.BareRandomizes: PDF pp.8–9: the same randomization model with no ancillary environment.sourcePauli: PDF p.3: sigma_0, sigma_1, sigma_2, sigma_3 are I, X, Y, Z in this order.fullPauli: PDF p.5, Theorem 4.1: uniform, phase-zero tensor Paulis, each of probability 2^(-2n).realPauli: PDF p.5, Theorem 4.2: independent uniform choices of I and Y, each string of probability 2^(-n). A true bit selects sigma_2 = Y.realProductVector: PDF p.5: tensor product of the real qubits cos(theta_j)|0> + sin(theta_j)|1>. For n = 0 the amplitude of the empty bit string is the empty product, namely 1.realProductSource: PDF p.5: exactly B tensor n, not its linear span or all real entangled vectors.exampleSource: PDF p.5: the particular source {|0>, |+>} in the nonmaximal-output example.exampleEnsemble: PDF p.5: the example's two equally likely unitaries I and H.hadamardExampleDensity: PDF p.5: the example's fixed output [[3/4,1/4],[1/4,1/4]], in basis order 0,1.reductionOutput: PDF pp.6–7, Theorem 5.2: (I/2^n) tensor rho0, reassociated from I × (I × A) to (I × I) × A. No register is discarded.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Defs_Stabilizer
import Definitions.Def_QAlgorithms_Defs_LocalHamiltonian
/-!
Private Quantum Channels and the Cost of Randomizing Quantum Information,
arXiv:quant-ph/0003101v2. All new interfaces are local to this paper.
Matrix and EuclideanSpace are used directly from Mathlib; no local type aliases
duplicate accepted-library declarations. Same-named definitions in other accepted
papers were checked for equivalence; incompatible source models are not imported.
Product basis indices keep the entire ancillary output visible. No partial trace
occurs in the security condition. A bare channel is the canonical ancilla-free
version, so there is no artificial zero-qubit tensor factor in its statements.
-/
namespace QAlgorithms.Papers.Independent.Advance50.P18
open scoped ComplexConjugate
noncomputable section
/-- PDF pp.3–4: finite classical law and keyed full-space matrices, fixed before the input.
Validity is separate so that explicit constructed ensembles carry no unproved proof fields. -/
structure KeyedUnitaryEnsemble (K I : Type*) where
p : K → ℝ
U : K → (Matrix I I ℂ)
variable {K I A : Type*} [Fintype K] [DecidableEq K]
[Fintype I] [DecidableEq I] [Fintype A] [DecidableEq A]
/-- PDF p.3: nonnegative probabilities of total mass one; each keyed operator is unitary.
Zero-probability key labels are allowed, and still have unitary operators. -/
def KeyedUnitaryEnsemble.Valid (E : KeyedUnitaryEnsemble K I) : Prop :=
(∀ k, 0 ≤ E.p k) ∧ (∑ k, E.p k) = 1 ∧
∀ k, E.U k ∈ Matrix.unitaryGroup I ℂ
/-- PDF p.3, §2.2: Shannon entropy in bits, including the convention 0 log 0 = 0. -/
def keyEntropy (p : K → ℝ) : ℝ :=
-∑ k, if p k = 0 then 0 else p k * (Real.log (p k) / Real.log 2)
/-- PDF p.3: the average conjugation map, with probability p (not its square root).
The source's Kraus operator for key k is sqrt(p k) times U k. -/
def encrypt (E : KeyedUnitaryEnsemble K I) (rho : (Matrix I I ℂ)) : (Matrix I I ℂ) :=
∑ k, (E.p k : ℂ) • (E.U k * rho * (E.U k).conjTranspose)
/-- PDF p.3: normalized identity; all uses below have a nonempty qubit basis. -/
def sourceMixedIdentity (I : Type*) [Fintype I] [DecidableEq I] : (Matrix I I ℂ) :=
((Fintype.card I : ℂ)⁻¹) • 1
/-- PDF p.3: the set of all normalized pure states. -/
def allPure (I : Type*) [Fintype I] : Set ((EuclideanSpace ℂ I)) :=
{psi | IsState psi}
/-- PDF p.6: classical messages are precisely computational-basis vectors. -/
def classicalSource (I : Type*) [DecidableEq I] : Set ((EuclideanSpace ℂ I)) :=
Set.range (fun x : I => ket x)
/-- PDF p.4, Definition 3.1, with no ancilla. The key is independent of the input;
unitarity gives exact inverse decoding for each key, without an extra recovery assumption. -/
def BarePQC (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K I) (rho0 : (Matrix I I ℂ)) : Prop :=
E.Valid ∧ IsDensityMatrix rho0 ∧
∀ psi ∈ S, IsState psi ∧ encrypt E (pureDensity psi) = rho0
/-- PDF p.4, Definition 3.1: an exact private quantum channel with a fixed mixed ancilla.
All of I × A is transmitted. The same ancilla, law and unitaries serve every source state. -/
def PQC (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K (I × A))
(anc : (Matrix A A ℂ)) (rho0 : (Matrix (I × A) (I × A) ℂ)) : Prop :=
E.Valid ∧ IsDensityMatrix anc ∧ IsDensityMatrix rho0 ∧
∀ psi ∈ S, IsState psi ∧
encrypt E (Matrix.kronecker (pureDensity psi) anc) = rho0
/-- PDF p.4: a density is a finite probability mixture of normalized source-state projectors.
The empty mixture is excluded by the sum-one condition, even when S is empty. -/
def IsSourceMixture (S : Set ((EuclideanSpace ℂ I))) (rho : (Matrix I I ℂ)) : Prop :=
∃ (r : ℕ) (q : Fin r → ℝ) (psi : Fin r → (EuclideanSpace ℂ I)),
(∀ j, 0 ≤ q j) ∧ (∑ j, q j) = 1 ∧
(∀ j, psi j ∈ S ∧ IsState (psi j)) ∧
rho = ∑ j, (q j : ℂ) • pureDensity (psi j)
/-- PDF p.8, §6: forgetting only the classical key in the same full-output model. -/
def ExactSourceRandomization (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K (I × A))
(anc : (Matrix A A ℂ)) (rho0 : (Matrix (I × A) (I × A) ℂ)) : Prop :=
PQC S E anc rho0
/-- PDF pp.8–9: the same randomization model with no ancillary environment. -/
def BareRandomizes (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K I) (rho0 : (Matrix I I ℂ)) : Prop :=
BarePQC S E rho0
/-- PDF p.3: sigma_0, sigma_1, sigma_2, sigma_3 are I, X, Y, Z in this order. -/
def sourcePauli (j : Fin 4) : Stabilizer.Pauli :=
if j.val = 0 then .I else if j.val = 1 then .X else if j.val = 2 then .Y else .Z
/-- PDF p.5, Theorem 4.1: uniform, phase-zero tensor Paulis, each of probability 2^(-2n). -/
def fullPauli (n : ℕ) : KeyedUnitaryEnsemble (Fin n → Fin 4) (Qubits n) where
p := fun _ => ((2 : ℝ) ^ (2 * n))⁻¹
U := fun x => (Stabilizer.PauliString.mk 0 (fun j => sourcePauli (x j))).toMatrix
/-- PDF p.5, Theorem 4.2: independent uniform choices of I and Y, each string of
probability 2^(-n). A true bit selects sigma_2 = Y. -/
def realPauli (n : ℕ) : KeyedUnitaryEnsemble (Qubits n) (Qubits n) where
p := fun _ => ((2 : ℝ) ^ n)⁻¹
U := fun x => (Stabilizer.PauliString.mk 0
(fun j => if x j then Stabilizer.Pauli.Y else Stabilizer.Pauli.I)).toMatrix
/-- PDF p.5: tensor product of the real qubits cos(theta_j)|0> + sin(theta_j)|1>.
For n = 0 the amplitude of the empty bit string is the empty product, namely 1. -/
def realProductVector {n : ℕ} (theta : Fin n → ℝ) : (EuclideanSpace ℂ (Qubits n)) :=
WithLp.toLp 2 (fun b => ∏ j, ((if b j then Real.sin (theta j)
else Real.cos (theta j)) : ℂ))
/-- PDF p.5: exactly B tensor n, not its linear span or all real entangled vectors. -/
def realProductSource (n : ℕ) : Set ((EuclideanSpace ℂ (Qubits n))) :=
{psi | ∃ theta : Fin n → ℝ,
(∀ j, 0 ≤ theta j ∧ theta j < 2 * Real.pi) ∧ psi = realProductVector theta}
/-- PDF p.5: the particular source {|0>, |+>} in the nonmaximal-output example. -/
def exampleSource : Set ((EuclideanSpace ℂ Bool)) :=
{psi | psi = ket false ∨ psi = act hadamard (ket false)}
/-- PDF p.5: the example's two equally likely unitaries I and H. -/
def exampleEnsemble : KeyedUnitaryEnsemble Bool Bool where
p := fun _ => 1 / 2
U := fun k => if k then hadamard else 1
/-- PDF p.5: the example's fixed output [[3/4,1/4],[1/4,1/4]], in basis order 0,1. -/
def hadamardExampleDensity : (Matrix Bool Bool ℂ) :=
fun b c => if b = false ∧ c = false then 3 / 4 else 1 / 4
/-- PDF pp.6–7, Theorem 5.2: (I/2^n) tensor rho0, reassociated from
I × (I × A) to (I × I) × A. No register is discarded. -/
def reductionOutput {n a : ℕ} (rho0 : (Matrix (Qubits n × Qubits a) (Qubits n × Qubits a) ℂ)) :
(Matrix ((Qubits n × Qubits n) × Qubits a) ((Qubits n × Qubits n) × Qubits a) ℂ) :=
fun x y => sourceMixedIdentity (Qubits n) x.1.1 y.1.1 * rho0 (x.1.2, x.2) (y.1.2, y.2)
/-! Local definition sanity examples; none use a theorem under draft. -/
example : sourcePauli 2 = Stabilizer.Pauli.Y := by rfl
example : (fullPauli 0).p (fun j => Fin.elim0 j) = 1 := by
simp [fullPauli]
example : (realPauli 1).p (fun _ => true) = 1 / 2 := by
norm_num [realPauli]
example : keyEntropy (fun _ : Fin 1 => (0 : ℝ)) = 0 := by
simp [keyEntropy]
example (E : KeyedUnitaryEnsemble (Fin 0) Bool) : ¬ E.Valid := by
simp [KeyedUnitaryEnsemble.Valid]
example (theta : Fin 0 → ℝ) (b : Qubits 0) : realProductVector theta b = 1 := by
simp [realProductVector]
example : hadamardExampleDensity false false = 3 / 4 := by rfl
example : hadamardExampleDensity true false = 1 / 4 := by rfl
example (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K (I × A)) (anc : (Matrix A A ℂ))
(rho0 : (Matrix (I × A) (I × A) ℂ)) : ExactSourceRandomization S E anc rho0 ↔ PQC S E anc rho0 := by
rfl
example : sourceMixedIdentity Bool false false = 1 / 2 := by
norm_num [sourceMixedIdentity]
example (E : KeyedUnitaryEnsemble K I) : encrypt E 0 = 0 := by
simp [encrypt]
end
end QAlgorithms.Papers.Independent.Advance50.P18
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Advance50.P18.BarePQC
For finite types and , with decidable equality on , a set of complex Euclidean vectors indexed by , an ensemble , and a complex matrix , the predicate holds precisely when for every key, , every is unitary, is positive semidefinite with trace one, and every satisfies both and
The real weights are interpreted as complex scalars. If is empty, the conditions quantified over its vectors are vacuous, but ensemble validity and the conditions on remain required. Empty or empty makes the predicate impossible.
QAlgorithms.Papers.Independent.Advance50.P18.BareRandomizes
For finite types and , with decidable equality on , a set of complex Euclidean vectors indexed by , an ensemble , and an complex matrix , this predicate means that all , , every is unitary, is positive semidefinite with trace one, and every has norm one and satisfies
Real weights act as complex scalars. If is empty, the vector conditions are vacuous while ensemble validity and the conditions on remain. Empty or empty makes the predicate impossible.
QAlgorithms.Papers.Independent.Advance50.P18.ExactSourceRandomization
For finite types , with decidable equality on and , a set of complex Euclidean vectors indexed by , an ensemble of matrices indexed by , an matrix , and a matrix indexed by , exact source randomization means that all , , every is unitary, and are positive semidefinite with trace one, and every has norm one and satisfies
Real weights act as complex scalars. If is empty, the vector conditions are vacuous while all other conditions remain. Empty , , or makes the predicate impossible.
QAlgorithms.Papers.Independent.Advance50.P18.IsSourceMixture
For a finite type , a set of complex Euclidean vectors indexed by , and any complex matrix , this predicate means that there exist a natural number , real weights , and vectors , indexed by , such that every , , every has norm one, and
The weights are interpreted as complex scalars in the matrix sum. Repeated vectors and zero weights are allowed, but even a vector with zero weight must belong to and have norm one. Although is quantified over, it cannot satisfy the weight normalization; consequently the predicate cannot hold when or is empty.
QAlgorithms.Papers.Independent.Advance50.P18.KeyedUnitaryEnsemble.Valid
For finite types and , with decidable equality on , an ensemble is valid precisely when every is nonnegative, , and every is unitary, meaning . Unitarity is required even for keys with weight zero. If is empty, validity is impossible because the weight sum is zero.
QAlgorithms.Papers.Independent.Advance50.P18.KeyedUnitaryEnsemble
For arbitrary types and , a keyed unitary ensemble consists of a function and a function assigning to each a complex matrix whose rows and columns are indexed by . This structure imposes no finiteness, nonnegativity, normalization, or unitarity conditions.
QAlgorithms.Papers.Independent.Advance50.P18.PQC
For finite types , with decidable equality on and , a set of complex Euclidean vectors indexed by , an ensemble of matrices indexed by , a complex matrix , and a complex matrix indexed by , the predicate holds precisely when for every key, , every is unitary, both and are positive semidefinite with trace one, and every satisfies and
The real weights are interpreted as complex scalars. For empty , only the conditions quantified over its vectors become vacuous. Empty , , or makes the predicate impossible.
QAlgorithms.Papers.Independent.Advance50.P18.allPure
For any finite type , is the set of all vectors in the complex Euclidean space indexed by satisfying . If is empty, its Euclidean space contains only the zero vector, so this set is empty.
QAlgorithms.Papers.Independent.Advance50.P18.classicalSource
For any type with decidable equality, the classical source is the set of coordinate vectors in the complex Euclidean space indexed by , where when and otherwise. No finiteness assumption on appears in this definition. If is empty, the source is empty.
QAlgorithms.Papers.Independent.Advance50.P18.encrypt
For finite types and , an ensemble of complex matrices, and any complex matrix , encryption is defined by
where each real weight is regarded as a complex scalar and is the conjugate transpose. No validity condition on , and no positivity or trace condition on , is assumed. If is empty, the result is the zero matrix.
QAlgorithms.Papers.Independent.Advance50.P18.exampleEnsemble
This defines an ensemble with Boolean keys, each having weight , acting on the complex coordinate space indexed by Booleans. The key selects the identity matrix, and the key selects
where rows and columns are ordered as .
QAlgorithms.Papers.Independent.Advance50.P18.exampleSource
This defines the set of vectors in the complex Euclidean space indexed by that equal either the basis vector at , whose coordinates are , or the result of multiplying that vector by
Thus the set is exactly , with coordinates ordered as .
QAlgorithms.Papers.Independent.Advance50.P18.fullPauli
For every natural number , this defines an ensemble indexed by strings , acting on the complex coordinate space indexed by Boolean strings . Every key has weight , and its matrix is
where rows and columns of each matrix are ordered as . The Pauli string has phase , so its phase factor is . When , there is one empty key, its weight is , and the empty product gives the matrix .
QAlgorithms.Papers.Independent.Advance50.P18.hadamardExampleDensity
This defines the complex matrix indexed by Booleans whose entry is and whose other three entries are . With rows and columns ordered as , it is
QAlgorithms.Papers.Independent.Advance50.P18.keyEntropy
For a finite type and any function , the key entropy is the real number
There is no assumption that the weights are nonnegative or sum to one. Negative weights are included using the real logarithm as defined in the code, which satisfies for negative . For empty , the value is zero.
QAlgorithms.Papers.Independent.Advance50.P18.realPauli
For every natural number , this defines an ensemble whose keys and coordinate indices are Boolean strings of length . Each key has weight , and
with rows and columns ordered as . The Pauli string has phase , hence phase factor . When , the sole empty key has weight and matrix .
QAlgorithms.Papers.Independent.Advance50.P18.realProductSource
For every natural number , this defines the set of complex vectors indexed by Boolean strings of length for which there exists a real angle assignment satisfying for every , such that
The real products are regarded as complex coordinates. For , the angle restrictions are vacuous and the set consists of the vector whose sole coordinate is .
QAlgorithms.Papers.Independent.Advance50.P18.realProductVector
For every natural number and every assignment of real angles , this defines a vector in the complex Euclidean space indexed by Boolean strings of length , with coordinate
Each real factor is regarded as a complex number. There are no restrictions on the angles. For , the sole coordinate is the empty product .
QAlgorithms.Papers.Independent.Advance50.P18.reductionOutput
For arbitrary natural numbers and an arbitrary complex matrix indexed by pairs consisting of an -bit Boolean string and an -bit Boolean string, this defines a matrix indexed by triples grouped as , where are -bit strings and is an -bit string, by
Thus the factor on the first register is the identity matrix divided by its dimension . No positivity, trace, or normalization assumption is imposed on . Both and are included; a zero-length Boolean register has one possible string.
QAlgorithms.Papers.Independent.Advance50.P18.sourceMixedIdentity
For any finite type with decidable equality, the source mixed identity is , where is the identity matrix indexed by . If is empty, the scalar inverse is , so the definition gives the unique empty matrix.
QAlgorithms.Papers.Independent.Advance50.P18.sourcePauli
For each , this function returns the Pauli label , , , or , respectively:
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.