Computational Materials Physics & DFT
Getting Started with Quantum ESPRESSO
Step-by-step installation, pseudopotential setup, verification, and core electronic-structure workflows for macOS, Linux, and Windows WSL2.
1. Installation by Operating System
macOS (Apple Silicon & Intel)
Install via Homebrew (recommended for quick academic setup) or build from source with OpenMPI and FFTW3:
brew install quantum-espresso open-mpi which pw.x pw.x --version
Linux (Ubuntu / Debian / Fedora)
Distribution packages provide serial and MPI-enabled binaries; for cluster workloads, compile from the official release tarball or use Spack:
# Ubuntu / Debian sudo apt update && sudo apt install -y quantum-espresso openmpi-bin # Fedora sudo dnf install -y quantum-espresso quantum-espresso-openmpi
Windows 10 / 11 (WSL2)
Run Quantum ESPRESSO inside Windows Subsystem for Linux (Ubuntu 22.04/24.04 LTS):
# In PowerShell (Administrator) wsl --install -d Ubuntu # Inside the Ubuntu WSL2 terminal sudo apt update && sudo apt install -y quantum-espresso openmpi-bin which pw.x
2. Pseudopotentials & Directory Layout
Download the verified Standard Solid State Pseudopotentials (SSSP) v1.3.0 (Efficiency or Precision) archive from Materials Cloud and place the .UPF files in a dedicated ./pseudo/ directory. Always match ecutwfc and ecutrho to the SSSP JSON recommendations for the hardest element in your cell.
mkdir -p ~/dft-runs/batio3/pseudo ~/dft-runs/batio3/tmp cd ~/dft-runs/batio3
3. Running Your First SCF Calculation
Generate a verified pw.in file using the Quantum ESPRESSO Input Generator, place it in your run directory, and execute:
# Serial run pw.x < pw.in > pw.out # MPI parallel run (4 ranks) mpirun -np 4 pw.x -in pw.in > pw.out # Verify clean completion grep -E "(!|convergence|JOB DONE)" pw.out
You can then inspect pw.out locally using the DFT Output Parser & Results Inspector.
4. Follow-On Production Workflows
- Convergence testing: Sweep
ecutwfcandK_POINTSand verify|Delta E / N_atom| < 1 meV/atomin the Convergence Analyser. - Structural relaxation: Run
calculation = 'vc-relax'followed by a fresh single-point'scf'on the relaxed geometry. - Band structure & DOS: Run
pw.x(bands/nscf), thenbands.x,dos.x, andprojwfc.x, and inspect outputs in the Band Structure and DOS/PDOS workspaces. - DFPT phonons: Tighten
conv_thr = 1.0d-10, relax forces below1e-5 Ry/Bohr, and runph.xfollowed byq2r.xandmatdyn.x.
5. Common Pitfalls & Troubleshooting
- Legacy vs modern DFT+U syntax: Quantum ESPRESSO >= 7.1 replaces
Hubbard_U(i)inside&SYSTEMwith the dedicatedHUBBARD (ortho-atomic)card. - Insufficient
ecutrho: Norm-conserving pseudopotentials useecutrho = 4 * ecutwfc, whereas ultrasoft (USPP) and PAW datasets require8 * ecutwfcto12 * ecutwfc. - Metallic smearing vs fixed occupations: Metals require
occupations = 'smearing'(e.g.marzari-vanderbilt,degauss = 0.015); insulators can usefixedonce a finite gap is confirmed.
References
- P. Giannozzi et al., “Quantum ESPRESSO toward the exascale,” J. Chem. Phys. 152, 154105 (2020).
- G. Prandini et al., “Precision and efficiency in solid-state pseudopotential calculations,” npj Comput. Mater. 4, 72 (2018).