magicFluctuation
def
For an n-qubit pure state ψ in Hn n, with D = 2^n, magicFluctuation n ψ is the scaled magic fluctuation statistic Real.sqrt D * (D * pauliLiouvilleMomentTwo n ψ - (7 - 14 / D + 8 / (D ^ 2))).
Statement
noncomputable def magicFluctuation (n : ℕ) (ψ : Hn n) : ℝ
- Defined in
- Quantum 8, 1422 (2024)
- Verified
- 06 Nov 2026
- Axioms
- none listed
- Built on 2
- pauliLiouvilleMomentTwoFor an n-qubit pure state ψ, the second Pauli-Liouville moment m_2(ψ) is (1/2^n) times the sum over all n-qubit Pauli strings P of…
- HnThe $n$-qubit Hilbert space $\mathcal{H}_n = \ell^2\!\bigl(\{0,1\}^n,\mathbb{C}\bigr)$, implemented as \texttt{EuclideanSpace ℂ (Fin n →…
- Used by 1
- cubicHypergraphFluctuationFor an n-qubit 3-uniform hypergraph H : CubicHypergraph n, cubicHypergraphFluctuation n H is the magic fluctuation magicFluctuation n…
Read back from the Lean
magicFluctuation is a function that takes a natural number n and a state vector ψ : EuclideanSpace ℂ (Fin n → Fin 2) and returns the real number:
$$\sqrt{D} \left( D \cdot \operatorname{pauliLiouvilleMomentTwo}(n, \psi) - \left(7 - \frac{14}{D} + \frac{8}{D^2}\right) \right)$$
where $D = 2^n$.
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 scaled second Pauli moment fluctuation statistic for an n-qubit pure state. -/ noncomputable def magicFluctuation (n : ℕ) (ψ : Hn n) : ℝ := let D : ℝ := (2 ^ n : ℝ); Real.sqrt D * (D * pauliLiouvilleMomentTwo n ψ - (7 - 14 / D + 8 / (D ^ 2)))