AFTD Auto-Formalizing Theoretical Domains

energy_filter_sequence_purity

deforiginal

Given a sequence filter a : ℤ → ℝ and a parameter k : ℕ, energy_filter_sequence_purity a k is the Renyi-2 purity Tr((Tr_B |psi_n><psi_n|)^2) of the energy-filtered state on n = 4k spins with equal bipartition into two subsystems of 2k spins, given by Tr((M M^T)^2) / (Tr(M M^T))^2 where M(sA, sB) = a(2k - |sA| - |sB|).

Statement

noncomputable def energy_filter_sequence_purity (a : ℤ → ℝ) (k : ℕ) : ℝ
Related work
arXiv:2405.02158 Energy-filtered quantum states and the emergence of non-local correlations
Verified
02 Nov 2026
Axioms
none listed
Used by 4

Read back from the Lean

Given a function a : ℤ → ℝ and a natural number k : ℕ, energy_filter_sequence_purity a k is the real number defined as follows: 1. Let w : (Fin (2 * k) → Bool) → ℤ map each Boolean sequence s of length 2 * k to its Hamming weight (the count of indices j : Fin (2 * k) for which s j = true), cast to ℤ. 2. Let M be the (Fin (2 * k) → Bool) × (Fin (2 * k) → Bool) matrix over ℝ whose entry at (sA, sB) is a (2 * (k : ℤ) - w sA - w sB). 3. Let R = M * Mᵀ be the product of M and its transpose. 4. The output is (R * R).trace / (R.trace)^2 (the trace of R^2 divided by the square of the trace of R).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The bipartite Renyi-2 purity Tr((Tr_B |psi_n><psi_n|)^2) of the energy-filtered state on n = 4k spins with equal bipartition. -/
noncomputable def energy_filter_sequence_purity (a : ℤ → ℝ) (k : ℕ) : ℝ :=
  let w : (Fin (2 * k) → Bool) → ℤ := fun s => ∑ j : Fin (2 * k), if s j then 1 else 0
  let M : Matrix (Fin (2 * k) → Bool) (Fin (2 * k) → Bool) ℝ :=
    fun sA sB => a (2 * (k : ℤ) - w sA - w sB)
  let R := M * M.transpose
  (R * R).trace / (R.trace)^2
See it in the graphDiscuss this resultChallenge it