hexpr: A Configuration State Function Based Hamiltonian Matrix Element Expression Library
We present hexpr, a C library with Fortran, Python, Julia, and Ruby bindings for generating expressions of the configuration state function (CSF)-based N-electron Hamiltonian matrix for quantum chemistry CI calculations on molecules without spatial symmetry. The library implements Sasaki’s spherical tensor-recoupling method, explicitly reduced here from its original atomic formulation to the molecular case, in combination with Shavitt’s Distinct Row Table (DRT) for CSF enumeration and Brooks-style loop traversal for matrix element generation. Two input modes are supported: an orbital classification specifying a first- or second-order CI (FOCI / SOCI) space; and an explicit list of CSFs. The output consists of parallel integer arrays encoding CSF-pair indices, orbital indices, and coefficients, to be combined with externally supplied MO integrals. The library is released under the MIT license. We validate the implementation against an OpenMolcas SOCI calculation on H2O / 6-31G(d), obtaining agreement in the SOCI total energy to within 10^(−8) hartree.
Authors
- Hiroaki Honda
- Takeshi Noro
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-26
- DOI
- https://doi.org/10.5281/zenodo.22977330
- Primary Topic
- Advanced Chemical Physics Studies
- Type
- preprint