Installation#

Python version support#

Officially Python 3.11, 3.12, 3.13, and 3.14.

Installing from PyPI#

pyscfad can be installed via pip from PyPI.

pip install pyscfad

To install the CUDA compatible version, run

pip install pyscfad[cuda12]

Installing from source#

The source code of pyscfad can be obtained by cloning the Github repository.

cd $HOME
git clone https://github.com/fishjojo/pyscfad.git

The main part of pyscfad is pure Python. One can simply add the top directory of pyscfad to the environment variable PYTHONPATH.

export PYTHONPATH=$HOME/pyscfad:$PYTHONPATH

Alternatively, one can install pyscfad locally via pip by running the following command at the top directory of pyscfad.

cd $HOME/pyscfad
pip install -e .

Installing pyscfadlib (CPU only)#

pyscfadlib is the C extension to pyscfad that provides efficient gradient backpropagation implementations. Similarly, one can install pyscfadlib locally via pip.

cd $HOME/pyscfad/pyscfadlib
pip install -e .

Or one can manually compile the C code, and then add pyscfadlib to PYTHONPATH.

cd $HOME/pyscfad/pyscfadlib/pyscfadlib
mkdir build
cd build
cmake ..
make
export PYTHONPATH=$HOME/pyscfad/pyscfadlib:$PYTHONPATH

Note

For Mac with ARM64 architectures, one needs to set the environment variable CMAKE_OSX_ARCHITECTURES=arm64.

Dependencies#

pyscfad requires the following dependencies.

Package

supported versions

jax

>=0.7.1,<0.9

pyscfadlib

>=0.2

pyscf

>=2.3

pyscf-properties

>=0.1