Home / Installation

Installation

QEpy requires Python ≥3.8, Quantum ESPRESSO 7.2, NumPy, and f90wrap. MPI parallel builds also need mpi4py.

Requirements

Required
Recommended
  • mpi4py: MPI control from Python
  • ASE: atomic structures & calculators
  • DFTpy: custom XC, grid tools and density mixing
Note

QEpy is under active development. Non-backward-compatible changes can happen. Clone the latest release often.

Pip (serial only)

The PyPI package installs a serial build. For MPI parallel runs or custom features, install from source.

python -m pip install qepy

Source installation

1. Build Quantum ESPRESSO with -fPIC

QE must be compiled with position-independent code before building QEpy:

./configure CFLAGS=-fPIC FFLAGS=-fPIC
make all
export qedir=$(pwd)

2. Install QEpy

git clone --recurse-submodules https://github.com/Quantum-MultiScale/QEpy.git
qedir=/path/to/q-e python -m pip install ./QEpy

qedir must be the absolute path to your QE tree (the directory containing make.inc). If unset, the installer may download and compile QE automatically.

Build skills

For a full source build of QE 7.2 and QEpy (MPI, custom features, HPC clusters), use the build skills in the QEpy repository. These are step-by-step recipes for humans and AI coding assistants. They are not a substitute for pip install qepy, which uses prebuilt wheels and does not require a local QE tree.

Skills live in QEpy/skills/ on the dev branch. Start with the skills README to pick the right file for your system.

What every skill does

Platform skills differ in compilers, MPI, and BLAS setup. The core workflow is the same and is spelled out in common.md:

  1. Clone Quantum ESPRESSO 7.2
  2. Create a Python virtualenv
  3. Install QEpy linked to that QE build
  4. Run tests to verify the install

Choose your platform below, open the matching skill file, and follow it together with common.md.

Platform Stack Skill file
macOS Open MPI · Apple Accelerate qe72_qepy_macos_accelerate_skill.md
macOS · oneMKL Open MPI · Intel oneMKL qe72_qepy_macos_mkl_skill.md
Ubuntu Intel MPI · oneMKL qe72_qepy_ubuntu_intel_skill.md
Ubuntu · OpenBLAS Open MPI · OpenBLAS qe72_qepy_ubuntu_openblas_skill.md
RHEL 9 family Intel MPI · oneMKL qe72_qepy_rhel9_intel_skill.md
RHEL 9 · OpenBLAS Open MPI · OpenBLAS qe72_qepy_rhel9_openblas_skill.md
Amarel
Rutgers HPC
Intel 18 · SLURM · srun --mpi=pmi2 qe72_qepy_amarel_skill.md

Helper scripts (in skills/):

Pinned versions: QE tag qe-7.2, QEpy branch dev, GCC/GFortran 14, Python 3.10–3.12, f90wrap==0.2.14. Build QE with make all (not just pw.x) and always pass -fPIC.

Example: Ubuntu 22.04

sudo apt-get update
sudo apt-get install --upgrade -y make git python3-dev python3-pip wget
sudo apt-get install --upgrade -y gcc gfortran libblas-dev liblapack-dev libopenmpi-dev libfftw3-dev

git clone --depth=1 -b qe-7.2 https://gitlab.com/QEF/q-e.git
cd q-e
./configure CFLAGS=-fPIC FFLAGS='-fPIC -fallow-argument-mismatch' MPIF90=mpif90 \
  --with-scalapack=no BLAS_LIBS='-lblas' LAPACK_LIBS='-llapack'
make all -j 8
cd ..

git clone --recurse-submodules https://github.com/Quantum-MultiScale/QEpy.git
qedir=$(pwd)/q-e python3 -m pip install -U ./QEpy

Platform-specific QE configure flags

Linux / Unix
./configure \
  FFLAGS='-fPIC -fallow-argument-mismatch' \
  CFLAGS=-fPIC
macOS (Apple Silicon)
./configure \
  FFLAGS='-fPIC -fallow-argument-mismatch -ff2c -fno-second-underscore' \
  CFLAGS='-fPIC -arch arm64' \
  CPP='gcc -E' \
  LDFLAGS=-headerpad_max_install_names

Build options

After installation, verify with python -m qepy -h and see the tutorials for your first calculation.