Installation#

Python version#

DeepQMC is compatible with Python 3.9 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.

  • h5py handles IO for HDF5 files.

  • Tensorboard is a practical tool 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#

In order to install DeepQMC, an appropriate version of the JAX library has to be installed first. The necessary version of JAX depends on whether one intends to run DeepQMC on GPUs or CPUs, and in the case of GPUs the version of the CUDA libraries installed on the machine.

Running on CPUs#

To install a CPU-only version of JAX, use the command:

$ pip install --upgrade "jax[cpu]"

Installing the DeepQMC package#

Once the appropriate version of JAX is installed, the latest official release of DeepQMC can be installed from the Python Package Index using Pip:

$ pip install --upgrade 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.

In order to contribute directly to the repository, the pull requests and code have to conform to our contributing guidelines. Most of these can be automatically checked/enforced using our pre-commit hooks, which can be enabled by issuing the following command from the root directory of the repository:

$ pre-commit install