Hermite polynomials, Laguerre polynomials, and Fock states
Definitionwigner_statesPhysicists' Hermite polynomials, ordinary Laguerre polynomials, and the normalized Fock states of the harmonic oscillator. The Hermite polynomials are defined by the recurrence , , ; the Laguerre polynomials by , , . The -th normalized Hermite (Fock) wavefunction is
the -th number state of the quantum harmonic oscillator, in dimensionless units ().
Formalization Note The factor makes the states orthonormal in ; it is required for Groenewold's closed formula for the Wigner function of a Fock state. The source's displayed eigenfunctions omit this normalization, but its Fock-state formula is stated for the normalized number states.
import Mathlib
namespace Wigner
/-- The m-th physicists' Hermite polynomial H_m, defined by the three-term
recurrence H_0 = 1, H_1 (x) = 2 * x,
H_{n+1} (x) = 2 * x * H_n (x) - 2 * n * H_{n-1} (x). -/
def hermiteP : ℕ → ℝ → ℝ
| 0, _ => 1
| 1, x => 2 * x
| n + 2, x => 2 * x * hermiteP (n + 1) x - 2 * (n + 1) * hermiteP n x
/-- The m-th ordinary Laguerre polynomial L_m, defined by the three-term
recurrence L_0 = 1, L_1 (x) = 1 - x,
(m + 1) * L_{m+1} (x) = (2 * m + 1 - x) * L_m (x) - m * L_{m-1} (x). -/
noncomputable def laguerreL : ℕ → ℝ → ℝ
| 0, _ => 1
| 1, x => 1 - x
| m + 2, x => ((2 * (m + 1) + 1 - x) * laguerreL (m + 1) x - (m + 1) * laguerreL m x) / (m + 2)
/-- The m-th normalized Hermite (Fock) wavefunction of the harmonic oscillator,
u_m (x) = (2^m * m!)^(-1/2) * pi^(-1/4) * H_m (x) * exp (-x^2 / 2). -/
noncomputable def fockState (m : ℕ) (x : ℝ) : ℂ :=
(((Real.pi ^ (-(1 / 4 : ℝ)) * hermiteP m x * Real.exp (-(x ^ 2) / 2) /
Real.sqrt ((2 : ℝ) ^ m * ((Nat.factorial m : ℕ) : ℝ))) : ℝ) : ℂ)
end Wigner
Read-back
What the Lean code literally says, in plain math · glm-5-latest-short
The code declares three definitions in the namespace Wigner and proves nothing.
-
hermiteP is a function defined by recursion on the first argument: hermiteP ; hermiteP ; hermiteP .
-
laguerreL is a function : laguerreL ; laguerreL ; laguerreL , ordinary real division.
-
fockState is the complex number obtained from the real number , where is a real power, the square root is the nonnegative real square root (a total function on , with a junk value at negative arguments; here the argument is a positive natural number), and is the factorial of .
All three are total functions; no hypotheses.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.