B10 · Lesson 39 · Approximation methods lab
Perturbation theory, the variational principle and WKB, checked against exact numerical answers
Lessons 35 to 38 gave three ways to estimate energies when the Schrödinger equation can't be solved: perturbation theory, the variational principle and WKB. Each has a regime where it shines and one where it fails, and the only honest way to know which you're in is to compare with an exact answer. In this lab you'll compute exact levels by diagonalizing large matrices, then test each approximation against them on the anharmonic oscillator and the triangular well, the MOSFET channel's potential. Units are ħ = m = 1.
- A particle in the quartic well (ħ = m = 1). The curve is the variational energy for a Gaussian trial function against b; the dashed line is the exact ground-state energy.
- The curve's minimum always sits above the exact line, as the variational principle guarantees, here by 2%.
- Change g: both scale as , so the 2% stays put. The readouts give the variational minimum and the exact value.
Predict
WKB estimates the levels of the quartic well . Where is it least accurate?
The ground state, by 18%, while the second level is within 1.3% and the third within 0.6%. WKB assumes the wavelength changes slowly compared with itself, which holds for highly excited states with many wiggles and fails for the ground state, which has none. It's a semiclassical method: best where the motion is most classical.
Name it
Exact answers by matrix
Write the Hamiltonian in a large basis, here the harmonic oscillator's states, using and , and diagonalize. With 60 to 80 basis states the lowest levels converge to many digits. Choosing ω near the problem's natural scale speeds convergence.
The three approximations
- Perturbation theory for : the ground state shifts by in first order and in second; the series diverges for any λ, so it's useful only while λ is small.
- Variational: a Gaussian in gives , minimized at with : always above the truth.
- WKB: , which for becomes with .
Finite differences
For a potential with a hard wall, like the triangular well for x > 0, a finite-difference matrix on a grid gives the levels directly; they match with the Airy zeros = 2.33811, 4.08795, 5.52056.
Worked example
How well does perturbation theory do for at λ = 0.01 and λ = 0.1?
Show the solution
- At λ = 0.01. The exact ground state is 0.507256, and first order gives 0.5075, within 0.05%.
- At λ = 0.1, first order. The exact value is 0.559146, while first order gives 0.575, 2.8% high.
- At λ = 0.1, second order. Adding second order gives 0.54875, now 1.9% low.
- Why it stops helping. The corrections alternate in sign and eventually grow, since the series is asymptotic: past a few terms, more terms make it worse. For strong anharmonicity the matrix or variational method is the right tool.
Answer at λ = 0.01 first order is within 0.05%; at λ = 0.1 it's 2.8% high, and second order is 1.9% low.
Worked example
What does the Gaussian trial function give for the pure quartic well , and how close is it?
Show the solution
- Best width.
- Energy.
- The exact value. Diagonalizing in a basis of 80 oscillator states gives 0.667986, so the estimate is 2.0% high, with a single parameter.
- Why it does so well. A trial function with the right shape, smooth with no nodes, gets the energy right even when its details differ, because errors in the wave function enter the energy only at second order.
Answer the Gaussian gives 0.6814, 2.0% above the exact 0.667986.
Worked example
Compare WKB with the exact levels of the quartic well for n = 0, 1 and 2.
Show the solution
- WKB levels. WKB gives 0.5463, 2.3636 and 4.6705.
- Exact levels. They're 0.6680, 2.3936 and 4.6968.
- Errors. The errors are 18%, 1.3% and 0.6%.
- The pattern. It's typical: WKB improves rapidly with n, while the variational method is best for the ground state. Used together, they bracket a problem from both ends.
Answer WKB is 18% off for n = 0, 1.3% for n = 1 and 0.6% for n = 2.
Check
Step 1. Write anharmonic(lam, Nb) that builds in the first Nb oscillator states () and returns the lowest eigenvalue.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 2. Write variational(g) that minimizes over 30 000 values of b from 0.05 to 3 and returns (b, E).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. Write quartic_exact(Nb) returning the lowest three levels of by diagonalizing in Nb oscillator states of frequency ω = 2, with and .
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 4. Write wkb_quartic(n) returning the WKB estimate of level n of : compute with np.trapz (or np.trapezoid) on a million points, then .
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 5. Write triangular(F, n) returning the lowest n levels of for x > 0 with a hard wall at 0, from a finite-difference matrix on 2000 interior points spanning 0 to 20.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What does the Gaussian trial function give for the ground state of (ħ = m = 1)?
Check
Through second order, what is the ground state of ?
Explain why
Why is the variational method most accurate for the ground state, while WKB is least accurate there?
The variational principle bounds the ground-state energy from above, and its error is second order in the error of the trial function: a reasonable smooth guess with no nodes, close to the true ground state's shape, gives a very good energy. WKB instead assumes the wave function oscillates many times over distances where the potential barely changes, so the wavelength is well defined at each point. The ground state has no oscillations at all and its wavelength is comparable to the whole well, so that assumption fails worst there. Higher states oscillate many times, and WKB's description becomes excellent just as finding good variational trial functions becomes hard.
Practice
Keep practicing
4 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.