Home / Science / Physics / Quantum mechanics / Perturbation theory checkerTool #928

Perturbation theory checker: first, second and third order corrections against exact diagonalisation

Type or paste a Hamiltonian H₀ and a perturbation V as matrices (real or complex, up to 40 × 40), choose λ, and get every level's first, second and third order corrections, degenerate levels included, side by side with the exact eigenvalues of H₀ + λV, a convergence warning and a plot of the exact levels against the second-order curves.

Keep it one tap away for everyday use.

Bookmark Perturbation theory checker?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. H₀ and V
  2. Orders
  3. Exact
  4. Compare
Nothing is uploadedWorks offline once open

Matrices

Square Hermitian matrices up to 40 × 40 (real symmetric, or complex with entry (j, i) the conjugate of (i, j); write complex numbers as 1+2i). H₀ need not be diagonal: the tool works in its eigenbasis. Levels of H₀ that are equal are treated by degenerate perturbation theory. Units are whatever your matrices use.

Corrections and the exact answer

Download

What it does

Perturbation theory is the workhorse approximation of quantum mechanics: when a Hamiltonian is a solvable part H₀ plus a small extra piece λV, the energies can be written as a series E = E⁽⁰⁾ + λE⁽¹⁾ + λ²E⁽²⁾ + λ³E⁽³⁾ + … . Homework and exams ask for the first and second order terms; this tool computes them for any matrices, and shows how good they are by diagonalising H₀ + λV exactly.

For a non-degenerate level n (in the eigenbasis of H₀):

  • First order: E⁽¹⁾ = V_nn, the average of the perturbation in the unperturbed state.
  • Second order: E⁽²⁾ = Σ_m |V_mn|² / (E_n − E_m), which always pushes the lowest level down.
  • Third order: E⁽³⁾ = Σ_k,m V_nk V_km V_mn / ((E_n − E_k)(E_n − E_m)) − V_nn Σ_m |V_mn|² / (E_n − E_m)².

When several levels of H₀ are equal (degenerate), these formulas divide by zero. The tool then diagonalises V inside the degenerate set: its eigenvalues are the first-order shifts and its eigenvectors the “good” states for second order. If V does not split the set at first order, it diagonalises the second-order effective Hamiltonian instead.

How to use it

  1. Pick an example or type your own H₀ and V, one row per line, numbers separated by spaces, commas or tabs. Complex entries are written 1+2i. You can also open a CSV, TSV, text or Excel file for each.
  2. Set λ.
  3. Read the table: each level’s corrections, the sums to first, second and third order, the exact value and the error. The coupling ÷ gap figure warns when λ is too big for the series.
  4. The plot shows the exact levels (solid) from λ = 0 to 1.5λ with the second-order parabolas (dashed): where they part company, perturbation theory stops working.

Worked example

The page opens with three made-up levels, H₀ = diag(0, 1, 2.5), a symmetric V and λ = 0.2. For the lowest level, E⁽¹⁾ = 0.2 and E⁽²⁾ = −0.094, so second order gives 0 + 0.2 × 0.2 − 0.04 × 0.094 = 0.03624, against the exact 0.03609767; adding third order (E⁽³⁾ = −0.01724) brings it to 0.03610, within 5 × 10⁻⁶. Choose the anharmonic oscillator with λ = 0.01: the ground state comes out as 1/2 + 3λ/4 − 21λ²/8 + 333λ³/16, the famous series, and the exact value 0.5072562 sits between second and third order.

FAQ

Why do I get a different order of levels from my textbook? Rows are numbered by the unperturbed energies, lowest first. Each row’s exact value is followed continuously from λ = 0, so it stays with its own level even through crossings.

Is the truncated oscillator exact? Only approximately: 20 states are kept, which is plenty for the lowest levels at small λ but not for the top ones.

Can I rely on it for research? It is for study and planning, not a substitute for professional judgement. Nothing you type leaves your device.

Where the numbers come from

  • Rayleigh–Schrödinger perturbation theory, non-degenerate (to third order) and degenerate (first order and the second-order effective Hamiltonian): standard textbook results, for example Sakurai, J. J. and Napolitano, J., Modern Quantum Mechanics, and Griffiths, D. J., Introduction to Quantum Mechanics.
  • Anharmonic oscillator series 1/2 + 3λ/4 − 21λ²/8 + 333λ³/16: Bender, C. M. and Wu, T. T. (1969), Physical Review 184, 1231 (a textbook result, used only as a check).
  • Checked against NumPy (numpy.linalg.eigvalsh, eigvals, direct sums and polynomial fits of exact eigenvalues) written for the tests.
  • The example matrices are made up, except the oscillator, which is built from x = (a + a†)/√2.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials. Hückel MO calculator #92 Hückel molecular orbitals for any conjugated π system, from 17 presets (butadiene, benzene, naphthalene, pyridine and more) or your own atoms, bonds, heteroatoms and charge: energy diagram, coefficients, π energy, delocalisation energy, charges, bond orders and free valence. Quantum circuit simulator #927 Write or open an OpenQASM 2.0 program, or build a circuit gate by gate, and simulate it exactly in your browser for up to 20 qubits: circuit diagram, outcome probabilities and simulated shot counts, each qubit's Bloch vector, the full state vector, and the circuit saved back as OpenQASM 2.0. Operator algebra helper #929 Work with quantum operators as matrices: Pauli matrices, spin-j angular momentum (Jx, Jy, Jz, J±, J²) up to j = 5, two spin-½ particles, and the truncated harmonic oscillator (a, a†, n, x, p). Type any expression with products, powers, commutators, anticommutators and daggers, and get the matrix, whether it is Hermitian or unitary, its eigenvalues, trace and determinant, and a check against what you expect. Wave packet tunnelling #924 Send a Gaussian wave packet at a rectangular barrier, double barrier, step, well or smooth barrier and watch it split into reflected and transmitted parts. The time evolution runs in your browser by the split-step Fourier method, and the reflection and transmission it finds are compared with the exact stationary transmission averaged over the packet's energies. Hydrogen orbital viewer #925 See any hydrogen-like orbital up to n = 7, real (pₓ, d_z², f_xyz ...) or complex: a slice of ψ coloured by sign, a turnable cloud of dots drawn from |ψ|², and the radial function and radial probability, with the energy, mean and most probable radius, nodes and the radius holding 90 % of the electron.