Installation#
Python version#
DeepQMC is compatible with Python 3.10 and higher.
Dependencies#
These packages will be installed automatically when installing DeepQMC.
JAX is a popular Python framework that combines NumPy, Autograd and XLA to give highly efficient just-in-time compiled code with GPU and TPU support.
Haiku is a neural network library for JAX that enables object oriented programming of models in the purely functional jax environment.
uncertainties helps with propagation of uncertainties in calculations.
TQDM provides progress bars.
kfac is a jax implementation of the KFAC second order optimizer.
optax provides optimizers and loss functions for jax.
Tensorboard / TensorboardX are practical tools for monitoring training of neural networks.
hydra helps with constructing command-line interfaces.
PySCF implements quantum chemistry methods in Python. This is used to obtain the baseline for pretraining.
Optional dependencies#
The following dependencies are used for development and their installation must be requested explicitly, as documented below.
black formats code according to PEP 8 standard.
flake8 implement style guidelines.
isort helps to keep consistent order of imports.
pytest for testing the code.
pytest-regressions for testing numerical regressions in the code.
pydocstyle check compliance with Python docstring conventions.
Coverage.py measures code coverage for testig.
Virtual environments#
It is a good practice to separate the dependencies of different Python projects with the use of virtual environments:
$ mkdir myproject
$ cd myproject
$ python3 -m venv venv
$ source venv/bin/activate
This code creates a virtual environment in the venv
directory and actives it. As a result, the python
and pip
executables available in the shell are now in the venv/bin
directory, and any package and its dependencies are installed locally.
Install DeepQMC#
The latest official release of DeepQMC can be installed from the Python Package Index using Pip:
$ pip install -U deepqmc
Developing#
In order to have access to the source code and stay up-to-date with the latest developments, DeepQMC can be installed directly from the deepqmc/deepqmc GitHub repository.
To install DeepQMC from the Git repository run:
$ git clone https://github.com/deepqmc/deepqmc
$ cd deepqmc
$ pip install -e .[dev]
Note that the -e
option installs the repository in editable mode and the .[dev]
specification includes the optional dependencies for development.
If Pip complains about setup.py
not being found, please update pip to the latest version.
The above installation will result in the CPU version of JAX. However, running DeepQMC on the GPU is highly recommended. To enable GPU support make sure to upgrade JAX to match the CUDA and cuDNN versions of your system. For most users this can be achieved with:
$ # CUDA 12 installation
$ pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
If issues arise during the installation of JAX, or if errors related to CUDA or cuDNN occur at runtime, please visit the JAX Install Guide.