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.
Two starting calculations
Section titled “Two starting calculations”Both examples use the dimensionless Hamiltonian
In perturbation theory benchmarks, compare low-order energy corrections with a harmonic-oscillator basis calculation. Begin at small , where known coefficients give a useful check. Then increase 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 tests the factors in the action integral. For , 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.
Separate the two errors
Section titled “Separate the two errors”Let be an analytic approximation, a numerical result, and the exact quantity for the chosen model. Their observed difference is
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.
A useful convergence pattern
Section titled “A useful convergence pattern”Suppose a grid method is in a regime where
For a fixed refinement factor , the ratio of successive differences approaches
For a second-order method with , 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.
Continue with a different observable
Section titled “Continue with a different observable”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.
Exercises
Section titled “Exercises”Read a refinement sequence. Suppose , , and . What order does this suggest, and what extrapolated value follows if one leading error term dominates?
Solution
The differences are and , with ratio four. Doubling the resolution therefore suggests second-order error. Under the stated one-term model, . Other error sources must still be tested; this extrapolation is conditional, not a rigorous bound.
A tiny residual. An eigensolver returns for a matrix of dimension . Does this establish twelve-digit accuracy for the continuum Hamiltonian’s eigenvalue?
Solution
No. The residual concerns the finite matrix . 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.
References
Section titled “References”- 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.