| Compatibility: |
|
| Availability: |
|
| Status: |
|
This package contains a PyTorch-based interface to the libcint high-performance integral library (check version here). 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-libcintYou can also build the Python wheels from source.
Get the repository (including libcint submodule).
git clone --recursive git@github.com:tad-mctc/tad-libcint.git
cd tad-libcintThe libcint fork contains additional integrals required for dxtb and removes unneccessary ones.
Therefore, downloading from our fork is recommended.
If you already have the repository, you can update the submodule with
git submodule update --remoteBuilding with cibuildwheel is as simple as running
cibuildwheel --platform linuxFor a specific version, use
CIBW_BUILD="cp312-manylinux_x86_64" CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014" cibuildwheel --platform linux- 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_17_x86_64 dist/*-cp310-cp310-linux_x86_64.whl- Or only install this project with
pipin the environment.
pip install .| PyTorch \ Python | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 |
|---|---|---|---|---|---|---|---|
| 1.11.0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 1.12.1 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 1.13.1 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| 2.0.1 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| 2.1.2 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| 2.2.2 | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| 2.3.1 | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| 2.4.1 | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| 2.5.1 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| 2.6.0 | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| 2.7.1 | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| 2.8.0 | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| 2.9.1 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 2.10.0 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
Note that only the latest bug fix version is listed, but all preceding bug fix minor versions are supported. For example, although only version 2.2.2 is listed, version 2.2.0 and 2.2.1 are also supported.
For development, additionally install the following tools in your environment.
mamba install black covdefaults coverage mypy pre-commit pylint toxWith 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 installFor testing all Python environments, simply run tox.
toxNote that this randomizes the order of tests but skips "large" tests. To modify this behavior, tox has to skip the optional posargs.
tox -- test