Skip to content

Notebooks for Perturbation Theory and WKB

Numerical calculations let you measure the accuracy of an analytic approximation and explore where it stops working. The two examples in this chapter use the anharmonic oscillator to compare perturbation theory and WKB with numerical spectra. The numerical answer has its own approximation errors, so the comparison begins by varying the basis, grid, and solver settings.

Helpful background. Approximation decision tree and small parameters and errors explain the analytic side of the comparison. Numerical mathematics introduces discretization, conditioning, and convergence.

Both examples use the dimensionless Hamiltonian

H(g)=P22+X22+gX4,g≥0,[X,P]=i.H(g)=\frac{P^2}{2}+\frac{X^2}{2}+gX^4, \qquad g\geq0,\quad [X,P]=i.

In perturbation theory benchmarks, compare low-order energy corrections with a harmonic-oscillator basis calculation. Begin at small gg, where known coefficients give a useful check. Then increase gg while independently increasing the basis size. This separates an inaccurate power-series truncation from an insufficient numerical basis.

In WKB versus numerical spectra, solve the action-quantization condition and compare it with eigenvalues of the Schrödinger problem. The harmonic limit g=0g=0 tests the factors in the action integral. For g>0g>0, compare several levels: a smooth-well semiclassical approximation typically improves at high excitation, while the basis size required to resolve those levels also grows.

The numerical reference approximates the exact Schrödinger spectrum. Except in a solvable limit, it still needs a numerical error estimate.

Let QappQ_{\mathrm{app}} be an analytic approximation, QnumQ_{\mathrm{num}} a numerical result, and QQ the exact quantity for the chosen model. Their observed difference is

Qapp−Qnum=(Qapp−Q)−(Qnum−Q).Q_{\mathrm{app}}-Q_{\mathrm{num}} =(Q_{\mathrm{app}}-Q)-(Q_{\mathrm{num}}-Q).

If the numerical error is comparable with the difference being measured, that comparison cannot establish the accuracy of the analytic method. Reduce the numerical error well below your target whenever practical.

For a basis calculation, increase its dimension and test any adjustable basis scale. For a grid calculation, refine the spacing and enlarge the domain separately before trying a joint refinement. An apparently stable result at fixed domain size can still have a substantial boundary error. A tiny matrix residual only shows that the represented matrix problem has been solved accurately.

Suppose a grid method is in a regime where

Qh=Q+Chp+o(hp),C≠0.Q_h=Q+Ch^p+o(h^p),\qquad C\ne0.

For a fixed refinement factor r>1r>1, the ratio of successive differences approaches

∣Qh−Qh/rQh/r−Qh/r2∣⟶rp.\left|\frac{Q_h-Q_{h/r}}{Q_{h/r}-Q_{h/r^2}}\right| \longrightarrow r^p.

For a second-order method with r=2r=2, the expected ratio is four. This is useful when discretization error dominates. Roundoff, an unresolved boundary, or a vanishing leading coefficient can spoil the pattern; one small difference between two resolutions is not a proof of convergence.

Use absolute errors or a meaningful reference scale when an observable approaches zero. This matters particularly for energy shifts and tunneling splittings: dividing by a nearly zero result can turn a modest absolute discrepancy into an uninformative relative error.

The following examples extend the same approach beyond eigenvalues:

Question Calculation
Does a nonlinear trial family reach its best energy? Variational optimization
How does a packet’s momentum spread affect transmission? Wave-packet scattering
How do numerical radial waves determine a cross section? Phase-shift extraction
When does a first Born prediction depart from the full scattering result? Born-approximation test
How do finite sweep endpoints affect a transition probability? Landau–Zener simulation
Can two close eigenvalues be subtracted accurately? Double-well instanton comparison
How does an approximate unitary propagator accumulate phase error? Magnus-expansion error

When adapting an example, keep the Hamiltonian, units, parameters, and boundary conditions alongside the numerical output. Save the settings used for each refinement and the values before plotting. Reproducible computation explains how to make a calculation repeatable by another reader.

Read a refinement sequence. Suppose Qh=1.0400Q_h=1.0400, Qh/2=1.0100Q_{h/2}=1.0100, and Qh/4=1.0025Q_{h/4}=1.0025. What order does this suggest, and what extrapolated value follows if one leading error term dominates?

Solution

The differences are 0.03000.0300 and 0.00750.0075, with ratio four. Doubling the resolution therefore suggests second-order error. Under the stated one-term model, Q≈(4Qh/4−Qh/2)/3=1.0000Q\approx(4Q_{h/4}-Q_{h/2})/3=1.0000. Other error sources must still be tested; this extrapolation is conditional, not a rigorous bound.

A tiny residual. An eigensolver returns ∥HNψ−Eψ∥<10−12\|H_N\psi-E\psi\|<10^{-12} for a matrix of dimension N=20N=20. Does this establish twelve-digit accuracy for the continuum Hamiltonian’s eigenvalue?

Solution

No. The residual concerns the finite matrix HNH_N. Increase the basis dimension and test the matrix-element construction and any other cutoffs. The matrix eigenvalue may be accurately computed while remaining a poor approximation to the continuum eigenvalue.

  • Higham, N. J. Accuracy and Stability of Numerical Algorithms. 2nd ed., SIAM (2002). Floating-point error, conditioning, and numerical stability.
  • Thijssen, J. M. Computational Physics. 2nd ed., Cambridge University Press (2007). Numerical quantum problems and practical convergence studies.
  • Trefethen, L. N., and D. Bau III. Numerical Linear Algebra. SIAM (1997). Eigenvalue computations and the interpretation of residuals.
  • Wilson, G., J. Bryan, K. Cranston, J. Kitzes, L. Nederbragt, and T. K. Teal. “Good Enough Practices in Scientific Computing.” PLOS Computational Biology 13, e1005510 (2017). doi:10.1371/journal.pcbi.1005510. Practical organization of repeatable calculations.