module public import SubentropyCertificates.CalibratedTensorGram import all D5.S3.Quantum.Subentropy.ClassicalQuantumGram import all SubentropyCertificates.MarginalEigenbasisTable /-! Gram representation of conditional subentropy for an ensemble with a fixed ancilla. -/ @[expose] public section noncomputable section set_option backward.isDefEq.respectTransparency false open Matrix open scoped Kronecker BigOperators ComplexOrder MatrixOrder namespace SubentropyCertificates.AncillaCalibration open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (productState) open D5.S3.Quantum.Information.OrthogonalRecordEntropy (recordState mixtureState) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram open D5.S3.Quantum.Subentropy.Basic open SubentropyCertificates.BinarySpectra (densityMatrix) open SubentropyCertificates.ConditionalContinuity (ancillaBlocks sum_ancillaBlocks) variable {X B C : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype C] [DecidableEq C] /-- The canonical CQ state of the product signals has the calibrated pinching gap of the original ensemble's Gram matrix as its conditional subentropy. -/ theorem conditional_product_eq_calibratedGap (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B) (ν : DensityState C) : conditionalSubentropy p hp hs (fun x ↦ productState (ρ x) ν) = calibratedGap ν ((cqRowSqrt p ρ).conjTranspose * cqRowSqrt p ρ) := by let V := cqRowSqrt p ρ let σ := fun x ↦ productState (ρ x) ν let e := (Equiv.prodAssoc X B C).symm have hpinch : blockPinch (V.conjTranspose * V) = densityMatrix (recordState p hp hs ρ) := by ext ⟨x,b⟩ ⟨y,d⟩ rw [show densityMatrix (recordState p hp hs ρ) (x,b) (y,d) = _ from record_entries p hp hs ρ (x,b) (y,d)] by_cases h : x = y · subst y simp only [blockPinch, ite_true] change ((weightedRoot p ρ x).conjTranspose * weightedRoot p ρ x) b d = _ rw [root_adjoint, root_square p hp ρ x] rfl · simp [blockPinch, h] have hrec : densityMatrix (recordState p hp hs σ) = ((densityMatrix (recordState p hp hs ρ)) ⊗ₖ densityMatrix ν).submatrix e e := by ext ⟨x,b,c⟩ ⟨y,d,k⟩ change _ = densityMatrix (recordState p hp hs ρ) (x,b) (y,d) * densityMatrix ν c k rw [show densityMatrix (recordState p hp hs σ) (x,b,c) (y,d,k) = _ from record_entries p hp hs σ (x,b,c) (y,d,k), show densityMatrix (recordState p hp hs ρ) (x,b) (y,d) = _ from record_entries p hp hs ρ (x,b) (y,d)] by_cases h : x = y · subst y simp only [ite_true] change (p x : ℂ) * (densityMatrix (ρ x) b d * densityMatrix ν c k) = _ exact (mul_assoc _ _ _).symm · simp [h] have hmix : densityMatrix (mixtureState p hp hs σ) = (V * V.conjTranspose) ⊗ₖ densityMatrix ν := by rw [show V * V.conjTranspose = ∑ x, p x • densityMatrix (ρ x) from row_mul_adjoint p hp ρ] rw [← sum_ancillaBlocks] change (∑ x, p x • (densityMatrix (ρ x) ⊗ₖ densityMatrix ν)) = _ simp only [ancillaBlocks, smul_kronecker] change matrixSubentropy (densityMatrix (recordState p hp hs σ)) - matrixSubentropy (densityMatrix (mixtureState p hp hs σ)) = matrixSubentropy (blockPinch (V.conjTranspose * V) ⊗ₖ densityMatrix ν) - matrixSubentropy ((V.conjTranspose * V) ⊗ₖ densityMatrix ν) rw [hrec, QubitDeficit.reindex_subentropy, hmix, hpinch, calibrated_rectangular_gram] end SubentropyCertificates.AncillaCalibration