pauliLiouvilleMomentTwo
For 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 |⟨ψ|P|ψ⟩|^4.
Statement
noncomputable def pauliLiouvilleMomentTwo (n : ℕ) (ψ : Hn n) : ℝ
- Defined in
- arXiv:2404.14488, Quantum 8, 1422 (2024)
- Verified
- 06 Nov 2026
- Axioms
- none listed
- Built on 4
- pauliOpFor $p \in \mathrm{PauliString}\,n$, the associated Pauli operator $\hat{p} : \mathcal{H}_n \to \mathcal{H}_n$.
- HnThe $n$-qubit Hilbert space $\mathcal{H}_n = \ell^2\!\bigl(\{0,1\}^n,\mathbb{C}\bigr)$, implemented as \texttt{EuclideanSpace ℂ (Fin n →…
- PauliStringA Pauli string of length $n$ is a function $p : \mathrm{Fin}\,n \to \mathrm{PauliBasis}$.
- instFintypePauliStringinstFintypePauliString
- Used by 2
- magicFluctuationFor an n-qubit pure state ψ in Hn n, with D = 2^n, magicFluctuation n ψ is the scaled magic fluctuation statistic Real.sqrt D * (D *…
- pauli_moment_two_eq_four_replica_sumFor every natural number n and n-qubit pure state ψ in Hn n, the second Pauli-Liouville moment (pauliLiouvilleMomentTwo n ψ as a complex…
Read back from the Lean
For a natural number n and a vector ψ : EuclideanSpace ℂ (Fin n → Fin 2) (representing an $n$-qubit state in $\mathbb{C}^{2^n}$), pauliLiouvilleMomentTwo n ψ is the real number defined by:
$$\frac{1}{2^n} \sum_{p \in \mathrm{PauliString}(n)} \|\langle \psi, \mathrm{pauliOp}(p)(\psi) \rangle_{\mathbb{C}}\|^4$$
where:
- PauliString n is the finite type of functions Fin n → PauliBasis (with PauliBasis consisting of $I, X, Y, Z$);
- pauliOp p is the linear map on EuclideanSpace ℂ (Fin n → Fin 2) represented by the matrix whose $(i, j)$-entry is $\prod_{k=0}^{n-1} (p(k))_{i(k), j(k)}$;
- $\langle \cdot, \cdot \rangle_{\mathbb{C}}$ is the standard Euclidean complex inner product (conjugate-linear in the first argument, linear in the second);
- $\|\cdot\|$ is the complex modulus.
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 second Pauli-Liouville moment m_2(ψ) = (1/2^n) ∑_P |⟨ψ|P|ψ⟩|^4 of an n-qubit pure state ψ. -/ noncomputable def pauliLiouvilleMomentTwo (n : ℕ) (ψ : Hn n) : ℝ := (1 / (2 ^ n : ℝ)) * ∑ p : PauliString n, ‖inner (𝕜 := ℂ) ψ (pauliOp p ψ)‖ ^ 4