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

Notebooks · lib/radial

The radial Schrodinger equation, the way dftatom solves it

An atom's orbitals are one-dimensional. Separate the angular part out and what is left is

u'' = [ l(l+1)/r^2 + 2(V(r) - E) ] u,    u = r R(r),

on 0 < r < infinity, with u(0) = 0 and u -> 0 at infinity. Two boundary conditions and one unknown E too many, which is what makes it an eigenvalue problem: only particular energies admit a solution that vanishes at both ends.

The mesh. The 1s of uranium lives inside a hundredth of a Bohr while the outer shells run to tens, so the mesh is exponential -- r = alpha (e^(beta t) - 1) + r_min on a uniform t. The one used here is dftatom's own: r_min = 1e-8, r_max = 50, a ratio of 1e6 between the last interval and the first, 3000 intervals.

The integrator. Changing variable from r to t puts a first derivative into the equation, and Numerov's method cannot have one. Substituting w = u / sqrt(dr/dt) takes it back out, at the cost of one extra term which for an exponential mesh is the constant beta^2/4:

w'' = [ (dr/dt)^2 ( l(l+1)/r^2 + 2(V - E) ) + beta^2/4 ] w.

That is Numerov's form on a uniform grid: fourth order, and it reads only mesh points, so no interpolation is needed between them.

The shooting. Integrate out from r_min, where u ~ r^(l+1), and in from r_max, where u ~ e^(-sqrt(-2E) r). Each direction is integrated the way it grows, which is the stable way to do it. They meet at the classical turning point; where the two logarithmic derivatives agree, E is an eigenvalue. Node counting brackets it and the derivative mismatch refines it.

The test is dftatom's own: hydrogen-like uranium, Z = 92, where every eigenvalue is known exactly to be -Z^2/2n^2. It is chosen because it is hard. The 1s state sits at -4232 Hartree and is squeezed into the first thousandth of the mesh.

Used with import radial.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 44–357