Metadata-Version: 2.4
Name: hermi
Version: 0.1.0
Summary: A Python package for computing integrals over atom-centred Gaussian basis functions for us in quantum chemistry
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: numpy>=2.1.0
Requires-Dist: scipy>=1.12.0
Requires-Dist: basis-set-exchange>=0.4.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: mypy>=1.18.0; extra == "dev"
Requires-Dist: ruff>=0.14.0; extra == "dev"
Requires-Dist: scipy-stubs>=1.0.0; extra == "dev"
Requires-Dist: pyscf>=2.0.0; extra == "dev"
Requires-Dist: typing-extensions>=4.9.0; extra == "dev"

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/obackhouse/hermi/main/assets/hermi-banner-dark.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/obackhouse/hermi/main/assets/hermi-banner.svg">
  <img alt="hermi logo" src="https://raw.githubusercontent.com/obackhouse/hermi/main/assets/hermi-banner.svg">
</picture>

The `hermi` package implements integrals over atom-centred Gaussian basis functions for use in quantum chemistry.
It implements a generalised McMurchie--Davidson algorithm which targets matrix operations in order to effectively vectorise the workload via NumPy calls.
This permits efficient integral generation without any custom compiled code.

## Installation

The package can be installed from the PyPI repository:

```sh
pip install hermi
```

Alternatively, clone the repository and install via the source code:

```sh
git clone https://github.com/obackhouse/hermi.git
cd hermi && pip install .
```

## Usage

Helper classes for molecules and basis sets are implemented:

```python
from hermi import Molecule, Basis
molecule = Molecule.from_list(["Li", "H"], [[0.0, 0.0, 0.0], [0.0, 0.0, 1.64]])
basis = Basis.from_molecule(molecule, "6-31g")
```

The automatic basis construction uses the `basis-set-exchange` library.
Operators can then be constructed and evaluated over the basis set:

```python
from hermi import Overlap
overlap = Overlap()
matrix = overlap.collect(basis)
```

Operators are also composable; along with lazy evaluation and caching,
this can afford optimisations when computing molecular integrals summed over a number of operators:

```python
from hermi import Kinetic, Nuclear
core_hamiltonian = Kinetic() + Nuclear(molecule)
matrix = core_hamiltonian.collect(basis)
```

## Development

We recommend `uv` for development, install development dependencies and run the test suite with:

```sh
uv sync --extra dev
uv run pytest
```

The operator integration tests compare Cartesian and spherical integrals against PySCF.

## References

This work is based on several papers:
first, the [original paper of McMurchie and Davidson](https://doi.org/10.1016/0021-9991(78)90092-X),
and more specifically,
the modern implementations detailed in papers [by Neese](https://doi.org/10.1002/jcc.26942)
and [by Asadchev and Valeev](https://arxiv.org/abs/2506.12501).
