Expand description
integral — native-Rust Gaussian integrals for quantum mechanics.
This is the public, Layer-3 crate: basis/molecule description and the
one-electron integral drivers (see ARCHITECTURE.md, L3). It exposes overlap,
kinetic, nuclear-attraction, and dipole integrals over contracted Cartesian
(and real-spherical) Gaussian shells, two ERI engines, geometric first
derivatives, and a one-electron operator DSL (Operator /
Basis::int1e) over polynomials in the position r and momentum p = −i∇
operators — adding a new 1e integral type is a single Operator
declaration, not an engine change.
§Quick start
use integral::{Basis, Shell};
// A single normalized s function (one primitive) at the origin.
let s = Shell::new(0, [0.0, 0.0, 0.0], vec![0.8], vec![1.0]).unwrap();
let basis = Basis::new(vec![s]);
let ovlp = basis.overlap();
assert_eq!(ovlp.len(), 1);
assert!((ovlp[0] - 1.0).abs() < 1e-12); // self-overlap of a normalized s = 1§Conventions
- Storage. Dense
f64, row-major. Square one-electron matrices arenao × naowithnao =Basis::nao_cart; dipole returns three such matrices[x, y, z]. - Cartesian or spherical. Shells default to Cartesian, with components in
integral_math::amordering (e.g.d:xx, xy, xz, yy, yz, zz).Shell::new_sphericalrequests the2l+1real spherical-harmonic components instead (seeShellKind); a basis may mix the two. - Normalization. Each primitive is scaled by the shell-level constant
N(α, l)(seeShell::primitive_coeff) and the user-supplied contraction coefficients. The Cartesian convention normalizes each monomial so that the stretched componentx^lhas unit self-overlap (cart_norm); off-axis components such asd_xytherefore have a smaller self-overlap. (This differs from the solid-harmonic Cartesian normalization by a single scalar per shell —1fors/p; the relative pattern of components is the same in both.) - Units. Atomic units (bohr) throughout.
The C ABI lives in the separate integral-sys crate and is stubbed until a
later release.
Structs§
- Basis
- An ordered collection of shells defining the atomic-orbital basis.
- BraPair
Fill - One unit of parallel work: the output rows owned by a single canonical bra-pair
(i, j), handed out byEriBuilder::partition. - EriBuilder
- A reusable plan for assembling the dense
(ij|kl)ERI tensor in parallel over canonical bra shell-pairs, with no in-crate threading runtime. - Gradient1e
- Per-atom geometric gradient of a one-electron matrix.
- Gradient
Eri - Per-atom geometric gradient of the electron-repulsion tensor.
- Operator
- A one-electron operator: a sum of
Terms, polynomial inrandp, with a documentedoriginfor itsrfactors (the multipole / gauge origin). - Operator
Matrix - The complex matrix of a one-electron operator, stored as separate real and
imaginary parts. Both are dense row-major
nao × nao(same ordering/strides as the value builders). - Screening
Stats - Outcome of a Schwarz-screened ERI build (
Basis::eri_screened). - Shell
- A contracted Cartesian Gaussian shell: several primitives sharing a center and angular momentum, combined with contraction coefficients.
- Term
- One product term of an operator: a real scalar
coefftimes an ordered product ofFactors, applied right-to-left to the ket.
Enums§
- Engine
- Which two-electron engine evaluates an ERI quartet.
- Factor
- An elementary factor of a one-electron operator product, along a Cartesian
axis (
0 = x,1 = y,2 = z). - Integral
Error - Errors returned when constructing or using a
Shell/Basis. - Shell
Kind - Whether a shell’s integrals are returned over Cartesian or real spherical-harmonic components.
Constants§
- MAX_
GRAD_ L - Maximum shell angular momentum for which a gradient can be built. The
derivative raises the shell to
l + 1, which must stay≤ MAX_L.
Functions§
- select_
engine - Dispatch policy: pick OS/HGP vs Rys from a quartet’s total angular momentum
l_total = la+lb+lc+ldand its primitive-quartetcontraction_degree(n_prim_a·n_prim_b·n_prim_c·n_prim_d).