Skip to main content

"Torch Autodiff Libcint Interface"

Project description

PyTorch-based Libcint Interface

Compatibility: Python Versions PyTorch Versions Operating Systems
Availability: Release PyPI Apache-2.0
Status: Test Status Build Status Documentation Status pre-commit.ci Status Coverage

Content

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.

Installation

pip

The tad-libcint package can be obtained from pip.

pip install tad-libcint

Build from source

You can also build the Python wheels from source.

  1. 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
  1. 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
  1. Build the wheel on your system.
python -m build --wheel
  1. Repair the wheels for cross-distribution packaging.
auditwheel repair -w wheels --plat manylinux_2_12_x86_64 dist/*-cp310-cp310-linux_x86_64.whl
  1. Or only install this project with pip in the environment.
pip install .

Development

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tad_libcint-0.0.1.tar.gz (43.9 MB view hashes)

Uploaded Source

Built Distributions

tad_libcint-0.0.1-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (19.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.12+ x86-64

tad_libcint-0.0.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (19.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

tad_libcint-0.0.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (19.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

tad_libcint-0.0.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (19.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page