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/hf/md_onebody

Overlap, kinetic energy and nuclear attraction, one shell pair at a time

The one-electron part of the Fock matrix is H = T + V, and the orthogonalizer needs the overlap S. All three come from the Hermite tables of lib/hf/hermite, and all three are computed per shell pair: the E tables depend on the two exponents and the distance between the centers, not on which component of the shell is asked for. So one set of tables per primitive pair serves the 36 component pairs of a (d|d) block, and the loops run over the real primitive count of each shell.

For one primitive pair, one axis, with s(i, j) = E(i, j, 0) sqrt(pi/p):

  • overlap is s(i, j) on each axis, multiplied over x, y, z;
  • kinetic energy applies -1/2 d^2/dx^2 to the right-hand Gaussian, which gives three overlaps with the power of x_B shifted by -2, 0, +2:
t(i, j) = -2 b^2 s(i, j+2) + b (2j + 1) s(i, j) - j (j - 1)/2 s(i, j-2)

and T = t_x s_y s_z + s_x t_y s_z + s_x s_y t_z. That is why the E tables are built with lb + 2;

  • nuclear attraction from a charge Z at C is
V = -Z (2 pi / p) sum_tuv E_x(t) E_y(u) E_z(v) R(t, u, v)

with R at P - C and exponent p.

Each value is for unit-normalized Cartesian components: the contracted coefficients cn from bas_contract and the component factor bas_nc multiply every block, so the results compare directly with the _unit matrices of lib/hfref. Ghost atoms (Z = 0) are skipped.

Used with import hf.md_onebody.

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 37–255