This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

← Posts

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%).

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

H: 0.0993789
measured: [-0.000308821, -0.00154487, -0.00401889, -0.00773319, -0.0126901, -0.018892]
predicted: [-0.00030863, -0.00154315, -0.00401219, -0.00771575, -0.0126538, -0.0188264]
The three lowest eigenfunctions
n=0n=1n=2
−0.500.5−6−4−20246xψ

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)

Checked when the site was built: 3 of 3 tests passed, in 0.11 s. Download 2026-09-21-oscillator-levels.viv