PyIntPak treats agreement with published operators and independent mathematics as the numerical standard. The historical Fortran program is not required to run the validation suite and is not the oracle for three- or four-electron integrals.
Scientific comparisons use both an absolute and a relative tolerance:
abs(calculated - reference) <= atol + rtol * abs(reference)
The absolute term controls values close to zero. The relative term scales the
allowed error for larger integrals. The authoritative constants are defined in
tests/tolerances.py:
| Check | rtol |
atol |
Purpose |
|---|---|---|---|
| Independent reference | 2e-10 |
2e-12 |
Dense Gaussian moments and direct Coulomb quadrature |
| Exact symmetry | 2e-12 |
2e-13 |
Algebraically identical operator permutations |
| Molecular dataset | 5e-11 |
5e-12 |
Frozen contracted He and H2 records |
| Vanishing-geminal limit | 2e-9 |
2e-11 |
Continuity between zero and a 1e-11 exponent |
These tolerances include headroom for differences among supported Python, NumPy, SciPy, compiler, and CPU combinations. A tolerance must not be loosened only to make a failing test pass: the numerical cause and the largest observed error must first be documented in the change.
tests/independent_reference.py does not import PyIntPak. It constructs the
full Gaussian exponent matrix, obtains correlated Cartesian moments from the
Gaussian covariance, and evaluates a Coulomb edge through direct Laplace
quadrature. This differs structurally from the production HRR/VRR dependency
graphs and generalized Boys implementation.
The oracle validates:
- all-s fundamental two-, three-, and four-electron integrals;
- Cartesian
F,G,H, andIfunctions on both bra and ket paths; - the Coulomb-geminal and pure-geminal three-electron operators;
- all three published four-electron operators.
The suite enumerates all independent bra/ket exchanges: 2^3 for each
three-electron operator and 2^4 for each four-electron operator. It also tests
particle permutations that preserve each labelled operator graph, including
the required exchange of unequal geminal exponents.
Zero-geminal reductions are compared directly with the independent oracle.
Continuity is checked at a geminal exponent of 1e-11, and positive all-s
integrals are checked for decay as the geminal exponent becomes tight.
tests/reference_data/small_molecules.json contains selected normalized 6-31G
contracted records for He and H2. It records all geometry, basis, Slater
expansion, operator, and value data required by the test. See
tests/reference_data/README.md for provenance and maintenance rules.
Run the complete suite:
python3 -m unittest discover -s tests -vRun the independent mathematical oracle tests only:
python3 -m unittest discover -s tests -p 'test_independent_validation.py' -v