Skip to content

Perturbation Theory Benchmarks

This notebook benchmark compares perturbative predictions for the quartic anharmonic oscillator with direct diagonalization in a truncated harmonic-oscillator basis. Its purpose is to show where low-order perturbation theory is accurate, where it starts to drift, and how numerical truncation can be separated from approximation error.

Use dimensionless oscillator units

ℏ=m=ω=1\hbar=m=\omega=1

and study

H(g)=12P2+12X2+gX4.H(g) = \frac12P^2+\frac12X^2+gX^4.

The unperturbed basis is the harmonic oscillator basis {∣n⟩}\{\lvert n\rangle\} with

H0∣n⟩=(n+12)∣n⟩.H_0\lvert n\rangle = \left(n+\frac12\right)\lvert n\rangle.

The coupling gg is the dimensionless perturbation parameter.

For the ground state, perturbation theory gives

E0(g)=12+34g−218g2+O(g3).E_0(g) = \frac12 + \frac34g - \frac{21}{8}g^2 + O(g^3).

For general nn, the first-order shift is

En(1)=34g(2n2+2n+1).E_n^{(1)} = \frac34g \left( 2n^2+2n+1 \right).

The notebook should compare:

  • unperturbed energies,
  • first-order perturbation theory,
  • second-order ground-state perturbation theory,
  • exact diagonalization in a truncated basis.

Construct the ladder operators in an NN-dimensional basis:

an−1,n=n,an+1,n†=n+1.a_{n-1,n}=\sqrt n, \qquad a^\dagger_{n+1,n}=\sqrt{n+1}.

Then

X=a+a†2,X=\frac{a+a^\dagger}{\sqrt2},

Build the unperturbed Hamiltonian as the exact diagonal matrix

H0,N=diag⁡(12,32,52,…,N−12),H_{0,N} = \operatorname{diag} \left( \frac12,\frac32,\frac52,\ldots,N-\frac12 \right),

then add the truncated interaction matrix:

HN(g)=H0,N+gX4H_N(g) = H_{0,N}+gX^4

as an N×NN\times N Hermitian matrix and diagonalize it.

Constructing H0H_0 directly as a diagonal matrix avoids boundary artifacts that can appear if P2/2+X2/2P^2/2+X^2/2 is formed after truncating the ladder operators.

Because X4X^4 preserves parity, even and odd oscillator states do not mix. The notebook may diagonalize the full matrix or separate parity blocks as a convergence check.

Use a grid such as

g∈{0,0.001,0.003,0.01,0.03,0.1,0.3}.g\in \{0,0.001,0.003,0.01,0.03,0.1,0.3\}.

For each gg, compute low-lying eigenvalues for several truncations:

N=20,40,80,120.N=20,40,80,120.

The benchmark should report only eigenvalues that are stable under increasing NN to the chosen tolerance.

The notebook should generate:

  • ground-state energy versus gg, with numerical diagonalization and first- and second-order perturbation curves;
  • relative error versus gg on a log scale;
  • convergence of E0E_0 with basis size NN for representative couplings;
  • optionally, low-lying excited energies compared with first-order perturbation theory.

Axes should state the dimensionless units. Error plots should specify the numerical reference truncation.

At g=0g=0, the numerical spectrum must reproduce

En=n+12E_n=n+\frac12

to machine precision for the represented states.

Hermiticity should be checked:

∥HN−HN†∥≈0.\|H_N-H_N^\dagger\|\approx0.

Eigenpair residuals should be small:

∥HNvj−Ejvj∥≪1.\|H_Nv_j-E_jv_j\|\ll1.

Parity should be conserved. Numerically, matrix elements coupling even and odd states should vanish up to roundoff.

There are two different errors:

  • perturbative error: difference between the perturbative formula and the converged numerical eigenvalue;
  • truncation error: difference between numerical eigenvalues at finite NN and the large-NN reference.

Do not interpret a perturbative comparison until the truncation error is smaller than the effect being studied.

For the ground state, a useful diagnostic is

Δpert(g)=E0num(g)−(12+34g−218g2).\Delta_{\mathrm{pert}}(g) = E_0^{\mathrm{num}}(g) - \left( \frac12+\frac34g-\frac{21}{8}g^2 \right).

For small gg, this should scale approximately like g3g^3 until numerical error or higher-order asymptotic behavior becomes visible.

  • Too small a basis at larger gg, where the wavefunction samples larger ∣x∣|x|.
  • Comparing high excited states that are close to the truncation boundary.
  • Treating agreement at one gg as proof of convergence across the sweep.
  • Forgetting that the perturbation series is asymptotic at high order.
  • Losing parity structure through indexing mistakes in the ladder operators.

Record:

  • programming language and version;
  • linear algebra library and version;
  • matrix dimension NN;
  • coupling grid;
  • sorting convention for eigenvalues;
  • numerical precision;
  • residual tolerance;
  • hardware or backend if relevant.

The calculation is deterministic and should not require random seeds.

  • C. M. Bender and T. T. Wu, “Anharmonic oscillator,” Physical Review 184, 1231-1260, 1969.
  • G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed., Johns Hopkins University Press, 2013.
  • J. M. Thijssen, Computational Physics, 2nd ed., Cambridge University Press, 2007.
  • R. Shankar, Principles of Quantum Mechanics, 2nd ed., Springer, 1994.
  1. Why should E0num(g)−E0(2)(g)E_0^{\mathrm{num}}(g)-E_0^{(2)}(g) scale approximately as g3g^3 for sufficiently small gg?
Solution

The second-order perturbative expression includes terms through g2g^2. If the expansion is valid and the numerical result is converged, the first omitted perturbative term is order g3g^3. Thus the difference should scale like g3g^3 until numerical error or asymptotic effects dominate.

  1. Why is parity a useful diagnostic in this benchmark?
Solution

The Hamiltonian contains only even powers of XX, so it commutes with parity. Even and odd oscillator basis states should not mix. Nonzero even-odd matrix elements indicate an indexing, basis, or operator-construction error.