
# 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:

1. Justify why the **harmonic oscillator** approximates any smooth potential minimum, and derive the **classical probability density** $P_{cl}(x)$.
2. Solve the oscillator analytically: **Hermite series**, the **recursion relation**, and quantization by **series termination** to $E_n = (n + \tfrac12)\hbar\omega$.
3. Solve it algebraically: construct **ladder operators** $\hat a_\pm$, prove $[\hat a_-, \hat a_+] = 1$, and generate the whole spectrum from $\hat a_-\psi_0 = 0$.
4. Compute **matrix elements** like $\langle x^2\rangle$ and $\langle p^2\rangle$ with ladder algebra and show $\psi_0$ **saturates** the uncertainty principle.
5. Interpret **Fock states** $\lvert n\rangle$, **zero-point energy**, and the classical limit $\lvert\psi_n\rvert^2 \to P_{cl}$.
6. 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 $x_0$:

$$
V(x) = V(x_0) + \underbrace{V'(x_0)}_{=\,0}(x - x_0) + \tfrac12 V''(x_0)(x - x_0)^2 + \cdots
\;\approx\; \tfrac12 V''(x_0)\,(x - x_0)^2 + \text{const}.
$$

Near the bottom, *everything* is a harmonic oscillator with $\omega = \sqrt{V''(x_0)/m}$ — 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 $\psi$ 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 $V(x) = \tfrac12 m\omega^2x^2$, the Lagrangian/Hamiltonian machinery of
[P.1.3](../c01-theoretical-mechanics/03-lagrangian-mechanics.md) and
[P.1.4](../c01-theoretical-mechanics/04-hamiltonian-mechanics.md) gives $\ddot x = -\omega^2 x$, so
$x(t) = A\sin(\omega t + \varphi)$ with energy $E = \tfrac12 m\omega^2A^2$, *any* $A \ge 0$ allowed.
Where would a snapshot find the particle? The probability of being in $dx$ is proportional to the
time spent there, $P_{cl}(x)\,dx = \frac{2\,dt}{T}$ (factor 2: two passes per period $T = 2\pi/\omega$).
With $\lvert v\rvert = \omega\sqrt{A^2 - x^2}$,

$$
P_{cl}(x) = \frac{2}{T\,\lvert v\rvert} = \frac{1}{\pi\sqrt{A^2 - x^2}}, \qquad \lvert x\rvert < A,
$$

normalized since $\int_{-A}^{A}\frac{dx}{\pi\sqrt{A^2 - x^2}} = 1$. 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 $-\frac{\hbar^2}{2m}\psi'' + \tfrac12 m\omega^2x^2\psi = E\psi$. Nondimensionalize with

$$
\xi \equiv \sqrt{\frac{m\omega}{\hbar}}\,x, \qquad K \equiv \frac{2E}{\hbar\omega}
\qquad\Longrightarrow\qquad
\frac{d^2\psi}{d\xi^2} = (\xi^2 - K)\,\psi .
$$

**Asymptotics.** For $\xi^2 \gg K$, $\psi'' \approx \xi^2\psi$, solved approximately by
$e^{\pm\xi^2/2}$ (check: $(e^{-\xi^2/2})'' = (\xi^2 - 1)e^{-\xi^2/2} \approx \xi^2 e^{-\xi^2/2}$).
Normalizability keeps only the decaying branch, so peel it off:

$$
\psi(\xi) = h(\xi)\,e^{-\xi^2/2}.
$$

Substituting ($\psi' = (h' - \xi h)e^{-\xi^2/2}$, $\psi'' = (h'' - 2\xi h' + (\xi^2 - 1)h)e^{-\xi^2/2}$)
turns the TISE into the **Hermite equation**

$$
h'' - 2\xi h' + (K - 1)\,h = 0 .
$$

**Series solution.** Try $h(\xi) = \sum_{j=0}^{\infty} a_j\,\xi^j$. Then
$h'' = \sum_j (j+1)(j+2)a_{j+2}\xi^j$ and $2\xi h' = \sum_j 2j\,a_j\xi^j$, so matching powers of
$\xi^j$:

$$
(j+1)(j+2)\,a_{j+2} - 2j\,a_j + (K - 1)\,a_j = 0
\qquad\Longrightarrow\qquad
\boxed{\ a_{j+2} = \frac{2j + 1 - K}{(j+1)(j+2)}\,a_j\ } .
$$

Two seeds, $a_0$ (even series) and $a_1$ (odd series) — parity, exactly as Lesson 1 promised.

**Termination or death.** If the series never terminates, then for large $j$,
$a_{j+2}/a_j \to 2/j$ — precisely the tail behavior of $e^{\xi^2} = \sum_k \xi^{2k}/k!$, whose
coefficients satisfy $c_{k+1}/c_k = 1/(k+1) \approx 2/j$ for $j = 2k$. So a non-terminating $h$
grows like $e^{\xi^2}$, overwhelming $e^{-\xi^2/2}$: $\psi \sim e^{+\xi^2/2}$, not normalizable. The
only escape is a numerator that hits zero: $K = 2n + 1$ for some integer $n \ge 0$ (and the
other-parity series switched off). Hence

$$
\boxed{\ E_n = \Bigl(n + \tfrac12\Bigr)\hbar\omega, \qquad n = 0, 1, 2, \dots\ }
$$

The polynomials the recursion produces are the **Hermite polynomials** (conventionally scaled so the
top coefficient is $2^n$):

| $n$ | $H_n(\xi)$ | $E_n$ |
|---|---|---|
| 0 | $1$ | $\tfrac12\hbar\omega$ |
| 1 | $2\xi$ | $\tfrac32\hbar\omega$ |
| 2 | $4\xi^2 - 2$ | $\tfrac52\hbar\omega$ |
| 3 | $8\xi^3 - 12\xi$ | $\tfrac72\hbar\omega$ |

and the normalized eigenfunctions are

$$
\psi_n(x) = \Bigl(\frac{m\omega}{\pi\hbar}\Bigr)^{1/4}\frac{1}{\sqrt{2^n\,n!}}\,H_n(\xi)\,e^{-\xi^2/2}.
$$

Even spacing $\hbar\omega$ — the spectrum is a *ladder*. That word is a hint.

### Method 2 — algebraic (ladder operators)

The Hamiltonian $\hat H = \frac{1}{2m}\bigl[\hat p^2 + (m\omega\hat x)^2\bigr]$ is a sum of squares —
if $\hat x$ and $\hat p$ were numbers we would factor $u^2 + v^2 = (iu + v)(-iu + v)$. They are not
numbers, and their failure to commute is exactly where the physics goes. Define (Griffiths
convention)

$$
\hat a_\pm \equiv \frac{1}{\sqrt{2\hbar m\omega}}\bigl(\mp i\hat p + m\omega\hat x\bigr),
\qquad \hat a_-^{\dagger} = \hat a_+ .
$$

Multiply out, keeping order:

$$
\hat a_-\hat a_+ = \frac{1}{2\hbar m\omega}\Bigl[\hat p^2 + (m\omega\hat x)^2 + im\omega\,[\hat p,\hat x]\Bigr]
= \frac{\hat H}{\hbar\omega} + \frac12,
$$

using the canonical commutator $[\hat x, \hat p] = i\hbar$ from
[P.4.3](../c04-schrodinger-equation/03-matter-waves-uncertainty-momentum.md) (so
$[\hat p, \hat x] = -i\hbar$ and $im\omega(-i\hbar) = +\hbar m\omega$). Swapping the factors flips one
sign: $\hat a_+\hat a_- = \frac{\hat H}{\hbar\omega} - \frac12$. Subtracting,

$$
\boxed{\ [\hat a_-, \hat a_+] = 1\ }, \qquad
\boxed{\ \hat H = \hbar\omega\Bigl(\hat a_+\hat a_- + \tfrac12\Bigr)\ }.
$$

**The ladder property.** From the boxed relations, $[\hat H, \hat a_+] = \hbar\omega\,\hat a_+[\hat a_-, \hat a_+] = \hbar\omega\,\hat a_+$.
So if $\hat H\psi = E\psi$:

$$
\hat H(\hat a_+\psi) = \hat a_+\hat H\psi + \hbar\omega\,\hat a_+\psi = (E + \hbar\omega)\,(\hat a_+\psi),
$$

and likewise $\hat H(\hat a_-\psi) = (E - \hbar\omega)(\hat a_-\psi)$: $\hat a_+$ **raises** the
energy by one quantum, $\hat a_-$ **lowers** it. But the ladder cannot descend forever: for any
state, $\lVert\hat a_-\psi\rVert^2 = \langle\psi|\hat a_+\hat a_-|\psi\rangle = \bigl(\tfrac{E}{\hbar\omega} - \tfrac12\bigr)\ge 0$,
so $E \ge \tfrac12\hbar\omega$ and there must be a bottom rung annihilated by $\hat a_-$:

$$
\hat a_-\psi_0 = 0
\ \Longleftrightarrow\
\frac{1}{\sqrt{2\hbar m\omega}}\Bigl(\hbar\frac{d}{dx} + m\omega x\Bigr)\psi_0 = 0
\ \Longleftrightarrow\
\frac{d\psi_0}{dx} = -\frac{m\omega}{\hbar}x\,\psi_0 .
$$

This first-order ODE separates and integrates immediately:

$$
\psi_0(x) = \Bigl(\frac{m\omega}{\pi\hbar}\Bigr)^{1/4} e^{-m\omega x^2/2\hbar},
$$

a **Gaussian**, normalized via $\int e^{-m\omega x^2/\hbar}dx = \sqrt{\pi\hbar/m\omega}$
([Appendix E](../../appendix/E-math-identities.md)). Its energy is
$\hat H\psi_0 = \hbar\omega(\hat a_+\hat a_- + \tfrac12)\psi_0 = \tfrac12\hbar\omega\,\psi_0$, and
climbing gives the whole spectrum, $E_n = (n + \tfrac12)\hbar\omega$ — no series, no Hermite
functions, three lines of algebra.

**Fock states and the number operator.** Define $\hat N \equiv \hat a_+\hat a_-$, so
$\hat H = \hbar\omega(\hat N + \tfrac12)$ and the eigenstates are labeled $\lvert n\rangle$ with
$\hat N\lvert n\rangle = n\lvert n\rangle$ (**Fock states**). Fixing norms:
$\lVert\hat a_+\lvert n\rangle\rVert^2 = \langle n\rvert\hat a_-\hat a_+\lvert n\rangle = n + 1$ and
$\lVert\hat a_-\lvert n\rangle\rVert^2 = n$, hence

$$
\hat a_+\lvert n\rangle = \sqrt{n+1}\,\lvert n+1\rangle, \qquad
\hat a_-\lvert n\rangle = \sqrt{n}\,\lvert n-1\rangle, \qquad
\psi_n = \frac{(\hat a_+)^n}{\sqrt{n!}}\,\psi_0 .
$$

> **Caution.** $n$ counts **energy quanta**, not location — $\lvert n\rangle$ is a standing wave, not
> a particle sitting on rung $n$ of anything. And the leftover $\tfrac12\hbar\omega$ is *physical*:
> it survives at $T = 0$ 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 — $x = 0$ *and*
> $p = 0$ exactly would violate $\Delta x\,\Delta p \ge \hbar/2$.

### Matrix elements without integrals

Invert the definitions of $\hat a_\pm$:

$$
\hat x = \sqrt{\frac{\hbar}{2m\omega}}\,(\hat a_+ + \hat a_-), \qquad
\hat p = i\sqrt{\frac{\hbar m\omega}{2}}\,(\hat a_+ - \hat a_-).
$$

Every polynomial matrix element now reduces to ladder bookkeeping. In $\lvert n\rangle$: terms
$\hat a_\pm^2$ change $n$ and average to zero, so

$$
\langle x^2\rangle = \frac{\hbar}{2m\omega}\,\langle n\rvert(\hat a_+\hat a_- + \hat a_-\hat a_+)\lvert n\rangle
= \frac{\hbar}{2m\omega}\,(2n + 1),
\qquad
\langle p^2\rangle = \frac{\hbar m\omega}{2}\,(2n + 1),
$$

(the $p^2$ cross-terms enter with $+$ after squaring the $i(\hat a_+ - \hat a_-)$). Since
$\langle x\rangle = \langle p\rangle = 0$ (Exercise E2),

$$
\Delta x\,\Delta p = \Bigl(n + \tfrac12\Bigr)\hbar
\quad\xrightarrow{\ n = 0\ }\quad
\Delta x\,\Delta p = \frac{\hbar}{2}:
$$

the ground state **saturates** the Heisenberg bound of
[P.4.3](../c04-schrodinger-equation/03-matter-waves-uncertainty-momentum.md) *exactly* — no state in
nature is more classical-in-both-variables than a Gaussian in a parabola.

### The classical limit

For large $n$, $\lvert\psi_n\rvert^2$ oscillates rapidly under an envelope that hugs
$P_{cl}(x) = 1/(\pi\sqrt{A_n^2 - x^2})$ with $A_n = \sqrt{2E_n/m\omega^2}$: highest near the turning
points, lowest at the center, with quantum tails leaking past $\pm A_n$. Locally averaged, quantum →
classical (see the Hands-on overlay at $n = 20$). At $n = 0$ the shapes are *opposite* — the Gaussian
peaks dead center — a reminder that the correspondence principle
([P.2.3](../c02-radiation-old-quantum/03-correspondence-and-limits.md)) is a large-$n$ 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
  $\psi_0$: the spectrum followed from one commutator, exactly the operator technology of
  [0.1.5 Eigenvalues & the Spectral Theorem](../../term-0-foundations/c01-linear-algebra/05-eigen-spectral-theorem.md).
  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 $\hbar\omega(\hat a_+\hat a_- + \tfrac12)$; the Fock
  state $\lvert n\rangle$ *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 $\lvert 0\rangle, \lvert 1\rangle$ 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
  $\lvert 0\rangle \leftrightarrow \lvert 1\rangle$ is exactly
  [1.6.2 Two-Level Dynamics & Rabi Oscillations](../../term-1-quantum-mechanics/c06-dynamics/02-two-level-rabi.md)
  — every single-qubit gate ever executed on superconducting hardware is this lesson plus that one.

---

## Worked Examples

### Example 1 — Climbing the ladder to $\psi_1$ and $\psi_2$

In the variable $\xi$, $\hat a_+ = \frac{1}{\sqrt2}\bigl(\xi - \frac{d}{d\xi}\bigr)$ and
$\psi_0 = \pi^{-1/4}e^{-\xi^2/2}$ (absorbing $(m\omega/\hbar)^{1/4}$ into the measure). Then

$$
\psi_1 = \hat a_+\psi_0 = \frac{\pi^{-1/4}}{\sqrt2}\Bigl(\xi - \frac{d}{d\xi}\Bigr)e^{-\xi^2/2}
= \frac{\pi^{-1/4}}{\sqrt2}\,(2\xi)\,e^{-\xi^2/2},
$$

matching the Hermite form $(2^1 1!)^{-1/2}H_1(\xi)\,\pi^{-1/4}e^{-\xi^2/2}$ with $H_1 = 2\xi$. ✓ Once
more, with the $1/\sqrt{n!}$ bookkeeping:

$$
\psi_2 = \frac{\hat a_+}{\sqrt2}\,\psi_1
= \frac{\pi^{-1/4}}{2}\Bigl(\xi - \frac{d}{d\xi}\Bigr)\bigl(2\xi\,e^{-\xi^2/2}\bigr)\cdot\frac{1}{\sqrt2}\cdot\sqrt2
= \frac{\pi^{-1/4}}{\sqrt2}\,(2\xi^2 - 1)\,e^{-\xi^2/2},
$$

using $\bigl(\xi - \frac{d}{d\xi}\bigr)\xi e^{-\xi^2/2} = (2\xi^2 - 1)e^{-\xi^2/2}$; this equals
$(2^2 2!)^{-1/2}H_2\,\pi^{-1/4}e^{-\xi^2/2}$ with $H_2 = 4\xi^2 - 2$. ✓ The ladder manufactures the
Hermite table on demand.

### Example 2 — A 5 GHz superconducting oscillator

A typical transmon-style circuit oscillates at $\omega/2\pi = 5\ \mathrm{GHz}$. One quantum is

$$
\hbar\omega = 1.055\times 10^{-34} \times 2\pi\times 5\times 10^{9}\ \mathrm{J} \approx 3.3\times 10^{-24}\ \mathrm{J} \approx 20.7\ \mathrm{\mu eV},
$$

corresponding to a temperature $\hbar\omega/k_B \approx 240\ \mathrm{mK}$. To keep the circuit in
$\lvert 0\rangle$ you must make thermal excitation rare: at a dilution-refrigerator temperature of
$20\ \mathrm{mK}$, the excited-state occupancy is
$\sim e^{-\hbar\omega/k_BT} = e^{-12} \approx 6\times 10^{-6}$ — cold enough that the qubit starts
each computation on the bottom rung. This single ratio, $\hbar\omega$ vs $k_BT$, is why quantum
computers live at millikelvin.

---

## Hands-on (Python)

Shooting method (Lesson 1's sign-flip, now with bisection) in oscillator units $\hbar = m = \omega = 1$
(length unit $\sqrt{\hbar/m\omega}$, energy unit $\hbar\omega$): the TISE is $\psi'' = (x^2 - 2E)\psi$.

```python
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.
```

```python
# --- 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 $1\ \mathrm{kg}$ mass oscillates at $1\ \mathrm{Hz}$ with total energy $1\ \mathrm{J}$.
Find its quantum number $n$ and the fractional energy resolution $\hbar\omega/E$. Why do we never
notice quantization?

<details><summary>Solution</summary>

$n \approx E/\hbar\omega = 1/(1.055\times 10^{-34}\times 2\pi) \approx 1.5\times 10^{33}$. The levels
are spaced by $\hbar\omega/E \approx 6.6\times 10^{-34}$ of the total energy — immeasurably fine.
Quantization is real but invisible at $n \sim 10^{33}$; this is the correspondence principle in one
number.
</details>

**E2 (easy).** Using ladder operators only, show $\langle n\lvert\hat x\rvert n\rangle = \langle n\lvert\hat p\rvert n\rangle = 0$.

<details><summary>Solution</summary>

$\hat x \propto (\hat a_+ + \hat a_-)$, so
$\langle n\rvert\hat x\lvert n\rangle \propto \sqrt{n+1}\,\langle n\vert n+1\rangle + \sqrt{n}\,\langle n\vert n-1\rangle = 0$
by orthogonality of Fock states; identically for $\hat p \propto (\hat a_+ - \hat a_-)$. Moral: an
energy eigenstate has no mean displacement or drift — it is a *standing* wave.
</details>

**E3 (medium).** Prove the virial result $\langle T\rangle = \langle V\rangle = E_n/2$ for every
$\lvert n\rangle$.

<details><summary>Solution</summary>

From the text, $\langle p^2\rangle = \tfrac{\hbar m\omega}{2}(2n+1)$ and
$\langle x^2\rangle = \tfrac{\hbar}{2m\omega}(2n+1)$. Then
$\langle T\rangle = \frac{\langle p^2\rangle}{2m} = \frac{\hbar\omega}{4}(2n+1)$ and
$\langle V\rangle = \frac{m\omega^2}{2}\langle x^2\rangle = \frac{\hbar\omega}{4}(2n+1)$: equal, and
their sum is $(n + \tfrac12)\hbar\omega = E_n$. Kinetic and potential energy share every rung evenly,
just as they do on classical time-average.
</details>

**E4 (medium).** The **half-oscillator**: $V(x) = \tfrac12 m\omega^2x^2$ for $x > 0$, $V = \infty$
for $x \le 0$. Find the exact spectrum without solving any new ODE.

<details><summary>Solution</summary>

The wall demands $\psi(0) = 0$. On $x > 0$ 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 $n = 1, 3, 5, \dots$ (renormalized by $\sqrt2$ on the half-line):
$E_k = \bigl(2k + \tfrac32\bigr)\hbar\omega$, $k = 0, 1, 2, \dots$ The ground state energy is
$\tfrac32\hbar\omega$ — walls raise zero-point energy, they never lower it.
</details>

**E5 (hard).** Define a **coherent state** as an eigenstate of the lowering operator,
$\hat a_-\lvert\alpha\rangle = \alpha\lvert\alpha\rangle$, $\alpha \in \mathbb{C}$. Expand
$\lvert\alpha\rangle = \sum_n c_n\lvert n\rangle$, find the $c_n$, normalize, and show the photon-number
distribution is Poissonian with mean $\lvert\alpha\rvert^2$.

<details><summary>Solution</summary>

Apply $\hat a_-$: $\sum_n c_n\sqrt{n}\,\lvert n-1\rangle = \alpha\sum_n c_n\lvert n\rangle$. Matching
coefficients of $\lvert n\rangle$: $c_{n+1}\sqrt{n+1} = \alpha\,c_n$, so by induction
$c_n = \frac{\alpha^n}{\sqrt{n!}}\,c_0$. Normalization:
$\sum_n\lvert c_n\rvert^2 = \lvert c_0\rvert^2\sum_n\frac{\lvert\alpha\rvert^{2n}}{n!} = \lvert c_0\rvert^2 e^{\lvert\alpha\rvert^2} = 1$,
giving $c_0 = e^{-\lvert\alpha\rvert^2/2}$. Hence

$$
P(n) = \lvert c_n\rvert^2 = e^{-\lvert\alpha\rvert^2}\,\frac{\lvert\alpha\rvert^{2n}}{n!},
$$

a Poisson distribution with mean $\langle\hat N\rangle = \lvert\alpha\rvert^2$. 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](../../term-1-quantum-mechanics/c06-dynamics/02-two-level-rabi.md).
</details>

**E6 (medium).** *The inverse problem.* A particle of mass $m$ is in a stationary state
$\psi(x) = Ae^{-x^2/2L^2}$ with energy $E = \hbar^2/2mL^2$. (a) Find the potential $V(x)$ using
$V = E + \frac{\hbar^2}{2m}\psi''/\psi$ ([P.5.1](01-free-particle-constant-potentials.md)), identify the
system and its angular frequency, and say which energy level this state is. (b) What potential results
if the same $\psi$ is assigned the energy $E' = 3\hbar^2/2mL^2$ instead?

<details><summary>Solution</summary>

(a) $\psi' = -(x/L^2)\psi$ and $\psi'' = \big(x^2/L^4 - 1/L^2\big)\psi$, so
$V = \frac{\hbar^2}{2mL^2} + \frac{\hbar^2}{2m}\Big(\frac{x^2}{L^4} - \frac{1}{L^2}\Big) = \frac{\hbar^2x^2}{2mL^4}$.
That is $\tfrac12 m\omega^2x^2$ with $\omega = \hbar/mL^2$: a harmonic oscillator, and $L = \sqrt{\hbar/m\omega}$
is its natural length. The energy is $\hbar^2/2mL^2 = \tfrac12\hbar\omega$, and the state has no
nodes, so it is the ground state $\psi_0$, matching the Gaussian found in Method 1.
(b) $V' = V + (E' - E) = \frac{\hbar^2x^2}{2mL^4} + \hbar\omega$: the same oscillator lifted by a
constant. Shifting the zero of energy shifts $V$ by the same amount and changes no physics, which is
why "the potential" an eigenfunction fixes is only fixed up to a constant.
</details>

---

## Checkpoint

1. Why does the harmonic oscillator show up in essentially every branch of physics?
2. In the analytic method, what exactly forces $E_n = (n + \tfrac12)\hbar\omega$?
3. In the algebraic method, why can't the lowering ladder descend forever, and what determines $\psi_0$?
4. Is the zero-point energy removable bookkeeping or physics? Defend your answer in two sentences.
5. What does a Josephson junction change about an LC oscillator, and why is that change necessary for a qubit?

<details><summary>Answers</summary>

1. Any smooth potential is $\approx \tfrac12 V''(x_0)(x - x_0)^2$ near a stable minimum, and every
   field/circuit mode has exactly the oscillator Hamiltonian.
2. A non-terminating Hermite series grows like $e^{\xi^2}$, making $\psi \sim e^{+\xi^2/2}$
   non-normalizable; the series must terminate, which requires $K = 2n + 1$.
3. $\lVert\hat a_-\psi\rVert^2 = (E/\hbar\omega - \tfrac12) \ge 0$ bounds the energy below, so some
   state must satisfy $\hat a_-\psi_0 = 0$ — a first-order ODE whose unique normalizable solution is
   the Gaussian with $E_0 = \tfrac12\hbar\omega$.
4. Physics: it survives at $T = 0$ and has measurable consequences (zero-point vibration, Casimir
   effect). It exists because $x = 0$ and $p = 0$ simultaneously would violate
   $\Delta x\,\Delta p \ge \hbar/2$.
5. It adds anharmonicity — unequal level spacings — so the $\lvert 0\rangle \leftrightarrow \lvert 1\rangle$
   transition can be driven without leaking into $\lvert 2\rangle$; a perfectly linear oscillator
   cannot be a two-level system (Term 4.4).

</details>

---

## 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](02-step-well-barrier.md) · Up: [Pre-Term](../README.md) · Next: [Central Potentials & Orbital Angular Momentum](../c06-angular-momentum/01-central-potentials-angular-momentum.md) →
