|q⟩ Bad Qubits

intermediate · Physics · The Variational Method & WKB

Checkpoint: Approximate a Spectrum

This checkpoint puts the module's two big tools side by side on one system — the infinite square well — and asks them to agree. You will quantize the spectrum with WKB and bound the ground state with the variational method, then verify the variational principle is respected.

The system

A particle of mass mm confined to 0xL0 \le x \le L with infinite walls, in natural units =m=1\hbar = m = 1 and L=1L = 1. The exact spectrum is

Enexact=n2π222mL2=n2π22.E_n^{\text{exact}} = \frac{n^2 \pi^2 \hbar^2}{2 m L^2} = \frac{n^2 \pi^2}{2}.

For n=1n = 1 this is π2/24.9348\pi^2/2 \approx 4.9348.

(A) WKB with hard walls

Inside the box V=0V = 0, so the momentum p=2mEp = \sqrt{2mE} is constant. The two confining walls are hard turning points, where the wavefunction must vanish rather than turn smoothly. Each hard wall contributes a π/2\pi/2 phase (not π/4\pi/4), so the Maslov correction cancels and the quantization condition becomes

0Lpdx=nπ        pL=nπ        EnWKB=n2π22.\int_0^L p\,dx = n\pi\hbar \;\;\Longrightarrow\;\; pL = n\pi \;\;\Longrightarrow\;\; E_n^{\text{WKB}} = \frac{n^2\pi^2}{2}.

WKB reproduces the exact spectrum here, because the wavefunction inside the box is a pure sinusoid with no curvature in the "wavelength" — the slowly-varying assumption is trivially satisfied.

(B) Variational bound on the ground state

Use the smooth trial state that vanishes at both walls,

ψ(x)=x(Lx).\psi(x) = x(L - x).

With H^=12d2/dx2\hat{H} = -\tfrac{1}{2}\,d^2/dx^2 inside the box, the needed integrals are

T^=120L(ψ)2dx=L36,ψψ=0Lψ2dx=L530,\langle \hat{T}\rangle = \frac{1}{2}\int_0^L (\psi')^2\,dx = \frac{L^3}{6}, \qquad \langle \psi|\psi\rangle = \int_0^L \psi^2\,dx = \frac{L^5}{30},

so the variational energy is

Evar=T^ψψ=L3/6L5/30=5L2=5(L=1).E_{\text{var}} = \frac{\langle \hat{T}\rangle}{\langle\psi|\psi\rangle} = \frac{L^3/6}{L^5/30} = \frac{5}{L^2} = 5 \quad (L = 1).

The cross-check

Compare the two estimates against the truth:

E1WKB=π224.9348,Evar=5,E1exact=π224.9348.E_1^{\text{WKB}} = \frac{\pi^2}{2} \approx 4.9348, \qquad E_{\text{var}} = 5, \qquad E_1^{\text{exact}} = \frac{\pi^2}{2} \approx 4.9348.

WKB is exact for the box; the variational bound sits about 1.3%1.3\% above the true ground state, on the correct side of the inequality EvarE1exactE_{\text{var}} \geq E_1^{\text{exact}} — the variational principle is respected. Two independent approximations, agreeing with each other and with the exact result, is the kind of consistency check that builds confidence in either method when the exact answer is unknown.

Try it

Compute the n=1n = 1 WKB and exact energies, the variational bound from ψ=x(Lx)\psi = x(L-x), and a boolean saying the bound is respected. return the object { wkb1, exact1, varBound, boundHolds }.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.