module public import SubentropyCertificates.AncillaReplicatedFactor public import SubentropyCertificates.DeterminantRepresentation public import SubentropyCertificates.QuadraticStatistic public import SubentropyCertificates.SubentropyMaximum import all D5.S3.Quantum.Subentropy.DensityKernel import all SubentropyCertificates.MatrixStrongConcavity /-! Spectral formulas for the ancillary determinant factor and the original purity. -/ @[expose] public section noncomputable section open Matrix open scoped BigOperators ComplexOrder MatrixOrder Kronecker namespace SubentropyCertificates.AncillaLimit open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (density_posSemidef) open D5.S3.Quantum.Subentropy.DensityKernel (det_spectral) open SubentropyCertificates.BinarySpectra (densityMatrix) open SubentropyCertificates.SpectralContinuity (maximallyMixed) open SubentropyCertificates.Representations (determinantIntegrand) open SubentropyCertificates.Quadratic (purity) variable {D : Type*} [Fintype D] [DecidableEq D] /-- The reciprocal determinant for the integral in Appendix C repeats each eigenvalue of the signal matrix with ancillary multiplicity `k+1`. -/ theorem determinantIntegrand_replicated (M : Matrix D D ℂ) (hM : M.PosSemidef) (k : ℕ) (t : ℝ) : determinantIntegrand (M ⊗ₖ densityMatrix (maximallyMixed (Fin (k+1)))) t = ((1+t)⁻¹ - replicatedFactor hM.isHermitian.eigenvalues k t) / t^2 := by let K := Fin (k+1) let c := 1 / (Fintype.card K : ℝ) let A := fun _ : K ↦ c • M have htensor : M ⊗ₖ densityMatrix (maximallyMixed K) = blockDiagonal A := by change M ⊗ₖ diagonal (fun _ : K ↦ (c : ℂ)) = _ rw [kroneckerMap_diagonal_right (· * ·) mul_zero] ext ⟨i,x⟩ ⟨j,y⟩ by_cases h : x = y · subst y simp [A, Complex.real_smul, mul_comm] · simp [blockDiagonal_apply_ne _ _ _ h] have hshift : 1 + t • (M ⊗ₖ densityMatrix (maximallyMixed K)) = blockDiagonal (fun _ : K ↦ 1 + (t*c) • M) := by rw [htensor, ← blockDiagonal_one, ← blockDiagonal_smul, ← blockDiagonal_add] congr 1 funext x simp [A, smul_smul] let V := ∏ i, (1 + t * hM.isHermitian.eigenvalues i / (k+1 : ℕ)) have hbase : (1 + (t*c) • M).det = (V : ℂ) := by rw [det_spectral hM.isHermitian] simp only [V, Complex.ofReal_prod] apply Finset.prod_congr rfl intro i _ congr 2 simp [c, K, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] have hdet : (1 + t • (M ⊗ₖ densityMatrix (maximallyMixed K))).det = ((V^(k+1) : ℝ) : ℂ) := by rw [hshift, det_blockDiagonal] simp only [hbase, Finset.prod_const, Finset.card_univ, K, Fintype.card_fin, Complex.ofReal_pow] unfold determinantIntegrand replicatedFactor rw [hdet, Complex.ofReal_re] simp only [one_div, inv_pow, V] /-- The second moment of the eigenvalues is the original state's purity. -/ theorem sum_eigenvalues_sq_eq_purity (σ : DensityState D) : (∑ i, (density_posSemidef σ).isHermitian.eigenvalues i ^ 2) = purity σ := by have H := (density_posSemidef σ).isHermitian have h := SubentropyCertificates.StrongConcavity.hs_spectrum H simpa only [SubentropyCertificates.StrongConcavity.hsSquared, H.eq, SubentropyCertificates.StrongConcavity.energy, purity] using h.symm end SubentropyCertificates.AncillaLimit