Compatibility: | |
Availability: | |
Status: |
This package contains a PyTorch-based interface to the libcint high-performance integral library. The interface facilitates automatic differentiation with custom backward functions that call libcint's C backend for derivative calculation.
It is based on PySCF's lib directory. Modifications include
- removal of unnecessary code
- minor adaptation of build instructions (CMakeLists.txt)
The project was heavily inspired by diffqc/dqc and diffqc/dqclibs.
This interface was mainly written for the calculation of integrals within grimme-lab/dxtb.
The tad-libcint
package can be obtained from pip.
pip install tad-libcint
You can also build the Python wheels from source.
- Get the repository (including libcint submodule).
git clone --recursive git@github.com:grimme-lab/tad-libcint.git
cd tad-libcint
The libcint fork contains some additional integrals required for dxtb
. Therefore, downloading from our fork is recommended.
If you already have the repository, you can update the submodule with
git submodule update --remote
- Create an environment (
conda
) for building the wheels. The example here uses Python 3.10, but we support 3.8-3.11.
mamba create -n wheel-310 --yes python=3.10 auditwheel c-compiler cxx-compiler fortran-compiler cffi cmake git make meson ninja numpy patchelf pkgconfig pip python-build unzip wheel
mamba activate wheel-310
- Build the wheel on your system.
python -m build --wheel
- Repair the wheels for cross-distribution packaging.
auditwheel repair -w wheels --plat manylinux_2_12_x86_64 dist/*-cp310-cp310-linux_x86_64.whl
- Or only install this project with
pip
in the environment.
pip install .
For development, additionally install the following tools in your environment.
mamba install black covdefaults coverage mypy pre-commit pylint tox
With pip, add the option -e
for installing in development mode, and add [dev]
for the development dependencies
pip install -e .[dev]
The pre-commit hooks are initialized by running the following command in the root of the repository.
pre-commit install
For testing all Python environments, simply run tox
.
tox
Note that this randomizes the order of tests but skips "large" tests. To modify this behavior, tox
has to skip the optional posargs.
tox -- test