Lesson 6 of 15

Hermite Polynomials

Hermite Polynomials

Hermite polynomials (physicists' convention) Hn(x)H_n(x) appear as the eigenfunctions of the quantum harmonic oscillator. They satisfy the differential equation:

Hn(x)2xHn(x)+2nHn(x)=0H_n''(x) - 2x\, H_n'(x) + 2n\, H_n(x) = 0

Three-Term Recurrence

The most efficient way to evaluate Hn(x)H_n(x) is via the recurrence relation:

H0(x)=1,H1(x)=2xH_0(x) = 1, \quad H_1(x) = 2x

Hn+1(x)=2xHn(x)2nHn1(x)H_{n+1}(x) = 2x\, H_n(x) - 2n\, H_{n-1}(x)

The first few polynomials are:

nnHn(x)H_n(x)
011
12x2x
24x224x^2 - 2
38x312x8x^3 - 12x
416x448x2+1216x^4 - 48x^2 + 12

Quantum Harmonic Oscillator

The normalized energy eigenstates of the quantum harmonic oscillator (in dimensionless units) are:

ψn(x)=12nn!πHn(x)ex2/2\psi_n(x) = \frac{1}{\sqrt{2^n\, n!\, \sqrt{\pi}}}\, H_n(x)\, e^{-x^2/2}

These satisfy ψn(x)2dx=1\int_{-\infty}^{\infty} |\psi_n(x)|^2\, dx = 1.

The probability density of finding the particle at position xx in state nn is:

Pn(x)=ψn(x)2=Hn(x)2ex22nn!πP_n(x) = |\psi_n(x)|^2 = \frac{H_n(x)^2\, e^{-x^2}}{2^n\, n!\, \sqrt{\pi}}

Your Task

Implement hermite_H(n, x) using the three-term recurrence. Implement qho_wavefunction(n, x) for the normalized wavefunction ψn(x)\psi_n(x). Implement qho_probability(n, x) for the probability density ψn(x)2|\psi_n(x)|^2.

All constants (factorials, normalization, etc.) must be computed inside the function bodies.

Python runtime loading...
Loading...
Click "Run" to execute your code.