The Harmonic Oscillator
The Harmonic Oscillator
If you learn one potential perfectly, make it this one. Every smooth well looks harmonic near its bottom, every mode of the electromagnetic field is a harmonic oscillator, and every superconducting qubit is one with a deliberate flaw. We solve it twice: the brute-force analytic way (Hermite series), and the elegant algebraic way (ladder operators) that the rest of the program — and half of modern physics — runs on. Like a cat and a staircase: once you know the steps are all the same height, you own the whole house.
Learning Objectives
After this lesson you will be able to:
- Justify why the harmonic oscillator approximates any smooth potential minimum, and derive the classical probability density .
- Solve the oscillator analytically: Hermite series, the recursion relation, and quantization by series termination to .
- Solve it algebraically: construct ladder operators , prove , and generate the whole spectrum from .
- Compute matrix elements like and with ladder algebra and show saturates the uncertainty principle.
- Interpret Fock states , zero-point energy, and the classical limit .
- Explain how this oscillator becomes a photon mode, an LC circuit, and — with anharmonicity — a transmon qubit.
Intuition
Why does one potential deserve a whole lesson? Take any smooth potential and Taylor-expand around a stable minimum :
Near the bottom, everything is a harmonic oscillator with — molecular bonds, crystal vibrations, currents sloshing in superconducting circuits. Quantum mechanically, the oscillator is also where two threads of this course meet: the shooting picture of Lesson 1 (only special energies let decay both ways) will give us the spectrum numerically, while a purely algebraic trick — factoring the Hamiltonian — will give it exactly, without solving any ODE at all. That trick is the one this course exists to hand you.
Theory
The classical oscillator
For , the Lagrangian/Hamiltonian machinery of P.1.2 and P.1.3 gives , so with energy , any allowed. Where would a snapshot find the particle? The probability of being in is proportional to the time spent there, (factor 2: two passes per period ). With ,
normalized since . It diverges at the turning points — the pendulum lingers where it moves slowest — and is smallest in the middle. Hold that picture; the quantum ground state will invert it.
Method 1 — analytic (Hermite series)
The TISE is . Nondimensionalize with
Asymptotics. For , , solved approximately by (check: ). Normalizability keeps only the decaying branch, so peel it off:
Substituting (, ) turns the TISE into the Hermite equation
Series solution. Try . Then and , so matching powers of :
Two seeds, (even series) and (odd series) — parity, exactly as Lesson 1 promised.
Termination or death. If the series never terminates, then for large , — precisely the tail behavior of , whose coefficients satisfy for . So a non-terminating grows like , overwhelming : , not normalizable. The only escape is a numerator that hits zero: for some integer (and the other-parity series switched off). Hence
The polynomials the recursion produces are the Hermite polynomials (conventionally scaled so the top coefficient is ):
| 0 | ||
| 1 | ||
| 2 | ||
| 3 |
and the normalized eigenfunctions are
Even spacing — the spectrum is a ladder. That word is a hint.
Method 2 — algebraic (ladder operators)
The Hamiltonian is a sum of squares — if and were numbers we would factor . They are not numbers, and their failure to commute is exactly where the physics goes. Define (Griffiths convention)
Multiply out, keeping order:
using the canonical commutator from P.4.3 (so and ). Swapping the factors flips one sign: . Subtracting,
The ladder property. From the boxed relations, . So if :
and likewise : raises the energy by one quantum, lowers it. But the ladder cannot descend forever: for any state, , so and there must be a bottom rung annihilated by :
This first-order ODE separates and integrates immediately:
a Gaussian, normalized via (Appendix E). Its energy is , and climbing gives the whole spectrum, — no series, no Hermite functions, three lines of algebra.
Fock states and the number operator. Define , so and the eigenstates are labeled with (Fock states). Fixing norms: and , hence
Caution. counts energy quanta, not location — is a standing wave, not a particle sitting on rung of anything. And the leftover is physical: it survives at and shows up in measurable places (molecular zero-point vibration, the Lamb shift, Casimir forces). The oscillator cannot sit still at the bottom of the well — and exactly would violate .
Matrix elements without integrals
Invert the definitions of :
Every polynomial matrix element now reduces to ladder bookkeeping. In : terms change and average to zero, so
(the cross-terms enter with after squaring the ). Since (Exercise E2),
the ground state saturates the Heisenberg bound of P.4.3 exactly — no state in nature is more classical-in-both-variables than a Gaussian in a parabola.
The classical limit
For large , oscillates rapidly under an envelope that hugs with : highest near the turning points, lowest at the center, with quantum tails leaking past . Locally averaged, quantum → classical (see the Hands-on overlay at ). At the shapes are opposite — the Gaussian peaks dead center — a reminder that the correspondence principle (P.2.3) is a large- statement.
Why this lesson exists: from ladder algebra to qubits
- It is pure linear algebra. Nothing in Method 2 used wavefunctions until we solved for : the spectrum followed from one commutator, exactly the operator technology of 0.1.5 Eigenvalues & the Spectral Theorem. This is the first place the program's two doors — wave mechanics and matrix mechanics — visibly open into the same room.
- Every field mode is this oscillator. Each mode of the electromagnetic field, and each superconducting LC circuit, has Hamiltonian ; the Fock state counts photons in the mode. "Creation" and "annihilation" operators are these ladders, verbatim.
- Break the ladder, get a qubit. An LC oscillator's levels are evenly spaced, so you cannot address one transition without driving them all. A Josephson junction (Lesson 2's tunneling element) replaces the linear inductor and adds anharmonicity: level spacings now differ, and the bottom two levels can be isolated as a qubit. That is the transmon story of Term 4.4.
- Driving that transition is Rabi physics. Once isolated, coherently driving is exactly 1.6.2 Two-Level Dynamics & Rabi Oscillations — every single-qubit gate ever executed on superconducting hardware is this lesson plus that one.
Worked Examples
Example 1 — Climbing the ladder to and
In the variable , and (absorbing into the measure). Then
matching the Hermite form with . ✓ Once more, with the bookkeeping:
using ; this equals with . ✓ The ladder manufactures the Hermite table on demand.
Example 2 — A 5 GHz superconducting oscillator
A typical transmon-style circuit oscillates at . One quantum is
corresponding to a temperature . To keep the circuit in you must make thermal excitation rare: at a dilution-refrigerator temperature of , the excited-state occupancy is — cold enough that the qubit starts each computation on the bottom rung. This single ratio, vs , is why quantum computers live at millikelvin.
Hands-on (Python)
Shooting method (Lesson 1's sign-flip, now with bisection) in oscillator units (length unit , energy unit ): the TISE is .
import numpy as np
import matplotlib.pyplot as plt
from math import factorial
from scipy.integrate import solve_ivp
from scipy.optimize import brentq
from scipy.special import eval_hermite
def tail(E, x_max=8.0):
"""psi(x_max), integrating from the left forbidden region on the decaying branch."""
rhs = lambda x, y: [y[1], (x**2 - 2.0*E) * y[0]]
kappa = np.sqrt(x_max**2 - 2.0*E)
sol = solve_ivp(rhs, [-x_max, x_max], [1e-10, kappa * 1e-10],
max_step=0.02, rtol=1e-10)
return sol.y[0][-1]
print(" n E_shoot exact rel. error")
for n in range(4):
E = brentq(tail, n + 0.2, n + 0.8, xtol=1e-13) # bisect the tail's sign flip
print(f" {n} {E:.9f} {n + 0.5} {abs(E - (n + 0.5))/(n + 0.5):.1e}")
# 0 0.500000000 0.5 1.0e-13
# 1 1.500000000 1.5 6.6e-13
# 2 2.500000000 2.5 2.4e-12
# 3 3.500000000 3.5 6.2e-12 <- (n + 1/2) hbar*omega, nailed
def psi_exact(n, x): # normalized Hermite eigenfunctions
return (eval_hermite(n, x) * np.exp(-x**2 / 2)
/ np.sqrt(2.0**n * factorial(n) * np.sqrt(np.pi)))
x = np.linspace(-6, 6, 800)
for n in range(4): # psi_0 .. psi_3, offset by E_n
plt.plot(x, psi_exact(n, x) + (n + 0.5), label=f"n={n}")
plt.plot(x, x**2 / 2, "k--", lw=0.8); plt.ylim(0, 5)
plt.xlabel("x"); plt.title("Oscillator eigenfunctions on their energy rungs"); plt.show()
# n humps -> n nodes (node theorem); wider spread as E_n rises past the parabola.# --- Classical limit: |psi_20|^2 vs P_cl --- and the finite-difference bonus ---
n = 20
A = np.sqrt(2 * (n + 0.5)) # classical amplitude, ~6.40
x = np.linspace(-8, 8, 2000)
plt.plot(x, psi_exact(n, x)**2, lw=0.8, label=r"$|\psi_{20}|^2$")
xa = np.linspace(-A + 1e-3, A - 1e-3, 1000)
plt.plot(xa, 1/(np.pi*np.sqrt(A**2 - xa**2)), "r--", label=r"$P_{cl}$")
plt.legend(); plt.xlabel("x"); plt.show()
# The classical arch threads the rapid quantum oscillations; tails leak past |x| = A.
# Matrix bonus: discretize H = -1/2 d^2/dx^2 + x^2/2 and diagonalize.
N, xm = 2000, 10.0
xg = np.linspace(-xm, xm, N); dx = xg[1] - xg[0]
H = (np.diag(1.0/dx**2 + 0.5*xg**2)
+ np.diag(np.full(N - 1, -0.5/dx**2), 1)
+ np.diag(np.full(N - 1, -0.5/dx**2), -1))
evals = np.linalg.eigh(H)[0]
print(np.round(evals[:4], 6)) # [0.499997 1.499984 2.499959 3.499922]
# O(dx^2) agreement with (n + 1/2) — the TISE as an eigenvalue problem, literally:
# exactly the spectral-theorem picture the main program takes as its starting point.Exercises
E1 (easy). A mass oscillates at with total energy . Find its quantum number and the fractional energy resolution . Why do we never notice quantization?
Solution
. The levels are spaced by of the total energy — immeasurably fine. Quantization is real but invisible at ; this is the correspondence principle in one number.
E2 (easy). Using ladder operators only, show .
Solution
, so by orthogonality of Fock states; identically for . Moral: an energy eigenstate has no mean displacement or drift — it is a standing wave.
E3 (medium). Prove the virial result for every .
Solution
From the text, and . Then and : equal, and their sum is . Kinetic and potential energy share every rung evenly, just as they do on classical time-average.
E4 (medium). The half-oscillator: for , for . Find the exact spectrum without solving any new ODE.
Solution
The wall demands . On the TISE is the full oscillator's, so every solution is the restriction of a full-oscillator eigenfunction — but only the odd ones vanish at the origin. Keeping (renormalized by on the half-line): , The ground state energy is — walls raise zero-point energy, they never lower it.
E5 (hard). Define a coherent state as an eigenstate of the lowering operator, , . Expand , find the , normalize, and show the photon-number distribution is Poissonian with mean .
Solution
Apply : . Matching coefficients of : , so by induction . Normalization: , giving . Hence
a Poisson distribution with mean . Coherent states are minimum-uncertainty Gaussians whose center oscillates classically — they are what a laser or a microwave drive line emits, and the natural "most classical" states of the field driving the Rabi oscillations of 1.6.2.
Checkpoint
- Why does the harmonic oscillator show up in essentially every branch of physics?
- In the analytic method, what exactly forces ?
- In the algebraic method, why can't the lowering ladder descend forever, and what determines ?
- Is the zero-point energy removable bookkeeping or physics? Defend your answer in two sentences.
- What does a Josephson junction change about an LC oscillator, and why is that change necessary for a qubit?
Answers
- Any smooth potential is near a stable minimum, and every field/circuit mode has exactly the oscillator Hamiltonian.
- A non-terminating Hermite series grows like , making non-normalizable; the series must terminate, which requires .
- bounds the energy below, so some state must satisfy — a first-order ODE whose unique normalizable solution is the Gaussian with .
- Physics: it survives at and has measurable consequences (zero-point vibration, Casimir effect). It exists because and simultaneously would violate .
- It adds anharmonicity — unequal level spacings — so the transition can be driven without leaking into ; a perfectly linear oscillator cannot be a two-level system (Term 4.4).
Further Reading
- [Gri] Griffiths & Schroeter, §2.3 — both methods, in the notation used here.
- [Sha] Shankar, Ch. 7 — the oscillator three ways, including the path-integral tease.
- [Sak] Sakurai & Napolitano, §2.3 — ladder operators as the modern default.
- [Gold] Goldstein, Poole & Safko, Ch. 6 — small oscillations: the classical side of "everything is harmonic."
- [ER] Eisberg & Resnick, Ch. 6 — the oscillator with historical context and lab numbers.
← Prev: Step, Well & Barrier · Up: Pre-Term · Next: Central Potentials & Orbital Angular Momentum →