Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

2 Installation

This section shows briefly how to set your machine up to work through the rest of this tutorial for more detail, refer to the documentations of ALF and pyALF.

2.1ALF prerequisites

To install the ALF dependencies.

Linux

Execute one of these installation command on your shell.

Debian/Ubuntu/Linux Mint
Red Hat/Fedora/CentOS/Rocky Linux/AlmaLinux
OpenSuSE/SLES
Arch Linux
sudo apt install make gfortran libopenblas-dev \
           python3 libopenmpi-dev g++ curl libghc-zlib-dev \
           git ca-certificates cmake bash
Other Unixes

GNU Fortran and the LAPACK implementation from netlib.org should be available for your system. Consult the documentation of your system on how to install the relevant packages. The package names from linux should give good starting points for your search.

MacOS

For MacOS, you will need to have Xcode as well as the Apple developer tools installed. The rest of the necessary packages can e.g. be installed via Homebrew:

brew install gcc mpich cmake
Windows

For Windows, we recommend using the Windows Subsystem for Linux, which can be installed following this guide and then proceed according to the instructions for Linux.

2.2pyALF installation

pyALF can be installed via the Python package installer pip. If you do not yet have a Python environment with working pip, we recommend miniforge. Miniforge is recommended due to its convenience, but any other solution, e.g. uv or the system package manager with Python-venv will also work.

pip install pyALF

2.3Setting ALF directory through environment variable

Since pyALF is set up to automatically clone ALF with git, it is not strictly necessary to download ALF manually, but pyALF will download ALF every time it does not find it. Therefore it is recommended to clone ALF once manually from here and setting its location in the environment variable ALF_DIR. This way, pyALF will use the same ALF source code directory every time.

ALF can be cloned with the Unix shell command

git clone https://github.com/ALF-QMC/ALF.git

This will create a folder called ALF in the current working directory of the terminal and download the repository there.

The environment variable can then be set with:

Bash
Zsh
Fish
Tcsh / Csh
PowerShell
Windows cmd.exe
export ALF_DIR="/path/to/ALF"

where /path/to/ALF is the location of the ALF code, for example /home/jonas/Programs/ALF.

Add the line to ~/.bashrc (Linux, interactive shells) or to ~/.bash_profile / ~/.profile (macOS, or login shells), then reload with:

source ~/.bashrc

2.4Using Jupyter Notebooks

The tutorial heavily utilizes Jupyter Notebooks that you will have to download and execute yourself. For this, we recommend to install either JupyterLab or Visual Studio Code.

2.5Test setup

To check if most things have been set up correctly, the script minimal_ALF_run can be used. It utilizes pyALF to run a short ALF simulation in the folder ALF_data. It ships with pyALF, one should therefore be able to run it by executing

minimal_ALF_run

in the Unix shell. If it does clone the ALF repository, ALF_DIR has not been set up correctly. Note that on the first compilation, ALF downloads and compiles HDF5, which can take several minutes.

To test the execution of Jupyter Notebooks on can download the “minimal ALF run” example from the next page through the download button on the top right (Download button).