Installation#
Requirements#
Python 3.10 or newer
A working Quantum ESPRESSO or VASP installation (for DFT input generation; not required to import PAOFLOW itself)
Core Python dependencies are installed automatically:
numpy,scipy,mpi4py,pandas
Recommended: pip install#
The simplest way to install PAOFLOW is from PyPI:
pip install PAOFLOW
This installs PAOFLOW and its mandatory runtime dependencies.
Optional dependency groups#
PAOFLOW ships several optional extras. Install only what you need:
# Matplotlib + VTK plotting support (and mendeleev for the basis generator)
pip install "PAOFLOW[graphics]"
# Boltzmann transport extras (psutil, for the core budget of the joblib workers)
pip install "PAOFLOW[transport]"
# Fermi surface rendering (mayavi, scikit-image)
pip install "PAOFLOW[fermisurface]"
# Fermi surface extremal-orbit analysis, de Haas-van Alphen (pyskeaf)
pip install "PAOFLOW[pyskeaf]"
# Quantum-oscillation analysis workflow (pyskeaf orbits vs measured frequencies)
pip install "PAOFLOW[qo_analysis]"
# Optics vs experiment workflow: digitising figures from PDF and raster images
pip install "PAOFLOW[thermo_optics]"
# Phonons, Raman, quasi-harmonic approximation (phonopy, phono3py, seekpath)
pip install "PAOFLOW[phonon]"
# Weyl point search (z2pack, tbmodels)
pip install "PAOFLOW[weyl_search]"
# JIT compilation via Numba (speed-up for dense k-grids)
pip install "PAOFLOW[fast]"
# All common extras at once
pip install "PAOFLOW[graphics,transport,pyskeaf,phonon,fast]"
The electron-phonon, non-linear optics and ARPES modules need only the core dependencies;
the electron-phonon workflows read the ph.x and pw.x outputs of Quantum ESPRESSO directly
(EPW is optional).
Command-line tools#
The package installs five console commands:
Command |
Purpose |
|---|---|
|
Quantum ESPRESSO |
|
Driver scripts from a QE run: property run, ACBN0, phonons, electron-phonon system folder |
|
Atomic-orbital basis tables generated from the pseudopotentials |
|
Extremal Fermi-surface orbits (de Haas-van Alphen frequencies and masses) |
|
Fermi-surface and field-direction viewer for the quantum-oscillation analysis |
See CLI generators.
Optional Rust backend#
The heaviest kernels (ACBN0 Coulomb integrals, dielectric/JDOS loops, the phonon-assisted
absorption kernel) have an optional Rust implementation, paoflow_rs, that PAOFLOW imports
when present and otherwise replaces with the NumPy code (parity below 1e-12). Build and
install instructions are in rust/README.md of the repository.
Developer installation#
To work on PAOFLOW itself, or to run the latest unreleased code from the repository:
git clone https://github.com/marcobn/PAOFLOW.git
cd PAOFLOW
pip install -e ".[dev,graphics,transport]"
The -e flag installs the package in editable mode — changes to src/PAOFLOW/ take effect immediately without reinstalling. The dev extra adds pre-commit and pytest.
Conda / virtual environment (recommended for HPC)#
It is strongly recommended to work inside an isolated environment, especially on shared HPC clusters where MPI libraries must match the system’s MPI installation.
conda create -n paoflow python=3.12
conda activate paoflow
# Install MPI-compatible mpi4py via conda (links against the system MPI)
conda install -c conda-forge mpi4py
# Then install PAOFLOW from PyPI
pip install "PAOFLOW[graphics,transport]"
Warning
mpi4py and system MPI
On HPC systems, pip install mpi4py may build against the wrong MPI library.
Use conda install -c conda-forge mpi4py or load the correct MPI module and
install mpi4py from source to ensure ABI compatibility.
MPI and joblib workers#
A few modules (Slater–Koster fitting, sparse band structures, band unfolding, and
pyskeaf angle sweeps) can also spread work over joblib/loky worker processes via
n_jobs / n_workers. When a script is launched with mpirun -np N, PAOFLOW
automatically limits each rank’s joblib pool to that rank’s share of the node, so
the MPI and joblib layers never oversubscribe the cores:
n_jobs=-1resolves to the rank’s share (cores on the node divided by ranks on the node, bounded by any CPU binding set by the launcher). This also applies tojoblib.Parallelcalls in your own scripts, as long asPAOFLOWis imported first.Explicit requests larger than the share are reduced, with a single warning.
If the launcher binds each rank to one core (the default for many
mpirunsetups), joblib runs serially inside each rank. To mix MPI and joblib, give every rank several cores, e.g.mpirun -np 4 --map-by slot:pe=8ormpirun -np 4 --bind-to noneon a 32-core node.To set the per-rank budget yourself, export
LOKY_MAX_CPU_COUNTbefore launching.
Serial runs (no mpirun) are unaffected.
Verifying the installation#
Open a Python interpreter and run:
import PAOFLOW
print(PAOFLOW.__version__)
You should see the current version string (e.g. 3.0.0).