Skip to main content

Module rys

Module rys 

Source
Expand description

Two-electron repulsion integrals (ERIs) by Rys quadrature.

This is the general ERI engine (see ARCHITECTURE.md, L1). It evaluates a Cartesian shell-quartet block (ab|cd) of the Coulomb kernel 1/r₁₂ over four primitive Gaussians and accumulates the coefficient-weighted result into a caller-provided block, mirroring the one-electron crate::os engine.

§Method

With the Gaussian-product centres P (bra, exponent p = a+b) and Q (ket, q = c+d), ρ = pq/(p+q), and T = ρ|P−Q|², the Coulomb integral is

  (ab|cd) = 2π^{5/2}/(p q √(p+q)) · K_ab · K_cd · Σ_α w_α Iˣ_α Iʸ_α Iᶻ_α,

where {x_α, w_α} are the nroots = ⌊L_total/2⌋+1 Rys roots/weights for T (integral_math::rys, L_total = la+lb+lc+ld) and I^w_α is the 2D integral along axis w for the four angular-momentum powers on that axis, normalized so the all-s case gives I = 1.

Per root and axis the 2D integrals are built by the standard Rys recurrences: a vertical recurrence (VRR) raises the combined bra power n and ket power m from (0,0), then two horizontal recurrences (HRR) split n → (i on A, j on B) using A−B and m → (k on C, l on D) using C−D. The recurrence coefficients reduce, in the appropriate limits, to the Obara–Saika (W−P)/(W−Q)/1/2p/1/2(p+q) terms (verified analytically for (ps|ss), (ss|ps), (ds|ss), (ps|ps)).

§Block layout

The output block for the quartet (la, lb, lc, ld) is row-major over the four Cartesian component indices (a, b, c, d):

  out[((ia · n_b + ib) · n_c + ic) · n_d + id] += scale · (ab|cd)[ia,ib,ic,id]

with n_x = n_cart(lx) and the component order of integral_math::am (fastest-varying index is d, slowest is a). The driver crate documents the same convention for the contracted builder.

Functions§

coulomb_into
Accumulate scale · (ab|cd) for the Coulomb kernel over four primitives into the row-major block out (shape [n_cart(la)·n_cart(lb)·n_cart(lc)·n_cart(ld)], see the module-level “Block layout”).