← Notes
The quantum harmonic oscillator, gently
Ladder operators turn a differential equation into algebra. Here is the idea in five minutes.
The harmonic oscillator is the hydrogen atom of physics courses: simple enough to solve exactly, rich enough to show up everywhere.
The Hamiltonian
We start from and define the ladder operator
(1)
With it, the Hamiltonian becomes beautifully compact:
(2)
Check it numerically
python
import numpy as np
N = 40
a = np.diag(np.sqrt(np.arange(1, N)), k=1)
H = a.T @ a + 0.5 * np.eye(N)
print(np.linalg.eigvalsh(H)[:5]) # [0.5 1.5 2.5 3.5 4.5]The spectrum is evenly spaced, exactly as the algebra promised.