First radial workflow

This is the best first tutorial for a new user.

If you want the API details for the main objects used here, also see:

The first radial path is:

  1. choose a mapping and a radial basis recipe
  2. build the basis
  3. run a quick diagnostic check
  4. build a quadrature grid
  5. form one-body operators
  6. test the setup on hydrogen

A first working recipe

For a first atom-centered radial calculation, start with:

  • s = 0.2
  • c = s / (2Z)
  • rmax = 30.0 bohr

In code:

using LinearAlgebra
using GaussletBases

Z = 1.0
s = 0.2
c = s / (2Z)

map = AsinhMapping(c = c, s = s)

rb = build_basis(RadialBasisSpec(:G10;
    rmax = 30.0,
    mapping = map,
))

AsinhMapping(c = c, s = s) uses ordinary Julia keyword arguments. At this level, the only two parameters you need to recognize are:

  • s: roughly controls the overall radial spacing
  • c: roughly controls how much extra resolution is concentrated near the nucleus

The fuller tuning discussion lives in Recommended atomic setup.

The first-read workflow deliberately leaves deeper construction controls such as reference_spacing, tails, and odd_even_kmax at their defaults.

Diagnostics and quadrature

After building the basis, the first quick numerical check is:

diag = basis_diagnostics(rb)
diag.overlap_error
diag.D

Then build the explicit quadrature grid used for operator construction:

grid = radial_quadrature(rb)

One of the central ideas in the package is that the basis and the quadrature grid are separate objects.

First useful physical result: hydrogen

The cleanest first scientific check is the radial hydrogen ground state:

H = kinetic_matrix(rb, grid) +
    nuclear_matrix(rb, grid; Z = Z) +
    centrifugal_matrix(rb, grid; l = 0)

E0 = minimum(real(eigen(Hermitian(H)).values))
println("Lowest hydrogen energy: ", E0)

The exact nonrelativistic ground-state energy is -0.5 Ha, so this first result checks the basis and the quadrature together.

The corresponding runnable example is examples/04_hydrogen_ground_state.jl.

At this stage, centrifugal_matrix(rb, grid; l = 0) is only the radial block for one fixed angular momentum channel. The explicit atomic (l,m) layer comes one step later.

What you usually do next

Once hydrogen is working, the normal next steps are:

radial_ops = atomic_operators(rb, grid; Z = Z, lmax = 2)
atom = atomic_one_body_operators(radial_ops; lmax = 2)

That moves you from a one-electron radial test into the current explicit atomic line:

  • atomic_operators(...) builds the radial operator bundle for all l <= lmax
  • atomic_one_body_operators(...) repeats those radial blocks over the explicit (l,m) channels

For more detail after this tutorial, continue with: