demoAINumerics
How far a finite-difference Hamiltonian's levels sit below n + 1/2
Put on a grid and diagonalize: the levels come out at , a little low. How low is predictable. First-order perturbation theory gives , and for the six lowest levels the measured shift matches it to within half a percent (the test allows 4%).
Open in the workbenchDownload .vivOutputs below are from the site build’s run; Run all runs it again in your browser.
Look inside this program
- Atlas
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.
The three-point second difference is , so the grid Hamiltonian is the true one plus . To first order the level moves by the expectation of that, and for the oscillator . The grid's error is a small perturbation of the Hamiltonian, so the perturbation theory used for the Stark shift predicts it.
Printed
Tests 3 of 3 pass
- the ground state is at 1/2, to a part in a thousand (passes)
- each of the first six levels is low, because the grid's p^4 term is negative (passes)
- each shift is within 4% of what perturbation theory predicts (passes)