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/gh_onebody

Overlap and kinetic energy by Gauss-Hermite quadrature

The overlap and kinetic integrals of two Cartesian Gaussians factor into one integral per axis, and each of those is a polynomial times one Gaussian. The product of exp(-a (x-A)^2) and exp(-b (x-B)^2) is

exp(-mu (A-B)^2) exp(-p (x-P)^2),    p = a + b,  P = (aA + bB)/p,
                                     mu = ab/p,

so with x = P + t/sqrt(p)

int (x-A)^i (x-B)^j exp(...) dx
    = exp(-mu (A-B)^2)/sqrt(p) * int poly(t) exp(-t^2) dt.

An n-point Gauss-Hermite rule integrates poly(t) exp(-t^2) exactly when the polynomial has degree at most 2n - 1. So a quadrature, which is usually an approximation, gives these integrals exactly up to rounding. The module uses no recurrence at all: it evaluates the two Cartesian factors at the nodes and sums. That makes it independent of both McMurchie-Davidson (hermite.viv, md_*) and Obara-Saika (os_onebody.viv), which is its purpose: a third opinion on S and T that shares no algebra with the other two.

Kinetic energy. Integrating -1/2 d^2/dx^2 by parts once gives the symmetric form

T_x(i, j) = 1/2 int d/dx[(x-A)^i e^(-a(x-A)^2)] d/dx[(x-B)^j e^(-b(x-B)^2)] dx,
d/dx[u^i e^(-a u^2)] = (i u^(i-1) - 2a u^(i+1)) e^(-a u^2),

and T = Tx Sy Sz + Sx Ty Sz + Sx Sy Tz. The second-derivative form, j(j-1) u^(j-2) - 2b(2j+1) u^j + 4b^2 u^(j+2), subtracts terms of size b to get a result of size ab/p. For the oxygen 1s exponent 5484.67 against a valence exponent near 0.27 that is a factor of about 2 × 104 of cancellation, and the symmetric form avoids it. The polynomial degree is then i + j + 2, so n = lmax + 2 nodes are exact for every pair in the basis.

Nodes and weights. The nodes are the eigenvalues of the Jacobi matrix of the Hermite weight, the symmetric tridiagonal matrix with zero diagonal and off-diagonal sqrt(k/2) (Golub and Welsch 1969). Each one is bracketed by bisection on the Sturm count of that matrix and then polished by Newton's method on the orthonormal recurrence; its weight is the Christoffel number 1 / sum_k p_k(t)^2 over the orthonormal polynomials below degree n (W. Gautschi, Orthogonal Polynomials: Computation and Approximation, Oxford 2004; G. H. Golub and J. H. Welsch, Math. Comp. 23, 221 (1969)). The tests check the rule against the moments int t^(2k) e^(-t^2) dt = (2k-1)!!/2^k sqrt(pi).

Normalization is the library's unit-Cartesian convention (bas_contract and bas_nc from lib/hf/basis.viv). The stage members gh_overlap and gh_kinetic take (atoms, shells, prims) and return [nao_cart, nao_cart].

Used with import hf.gh_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 57–366