Skip to content

molmod/psiflow

Repository files navigation

psiflow psiflow

License Docs Build Status Python Code style DOI

NOTE: psiflow is still heavily in development. API is tentative, and docs are still largely TODO.

Scalable Molecular Simulation

Psiflow is a scalable molecular simulation engine for chemistry and materials science applications. It supports:

  • quantum mechanical calculations at various levels of theory (GGA and hybrid DFT, post-HF methods such as MP2 or RPA, and even coupled cluster; using CP2K|GPAW|ORCA)
  • trainable interaction potentials as well as easy-to-use universal potentials, e.g. MACE-MP0
  • a wide range of sampling algorithms: NVE|NVT|NPT, path-integral molecular dynamics, alchemical replica exchange, metadynamics, phonon-based sampling, ... (thanks to i-PI)

Users may define arbitrarily complex workflows and execute them automatically on local, HPC, and/or cloud infrastructure. To achieve this, psiflow is built using Parsl: a parallel execution library which manages job submission and workload distribution. As such, psiflow can orchestrate large molecular simulation pipelines on hundreds or even thousands of nodes.

Setup

Use the following one-liner to create a lightweight micromamba Python environment with all dependencies readily available:

curl -L molmod.github.io/psiflow/install.sh | bash

The environment can be activated by sourcing the activate.sh file which will be created in the current working directory. Next, create a config.yaml file which defines the compute resources. For SLURM-based HPC systems, psiflow can initialize your configuration automatically via the following command:

python -c 'import psiflow; psiflow.setup_slurm()'

Example configuration files for LUMI, MeluXina, or VSC can be found here. No additional software compilation is required since all of the heavy lifting (CP2K/ORCA/GPAW, PyTorch model training, i-PI dynamics) is executed within preconfigured Apptainer/Singularity containers which are production-ready for most HPCs.

That's it! Contrary to frameworks like pyiron or aiida, psiflow does not require any databases or annoying web servers. The only requirement is that you set up a Python environment and provide a config.yaml.

Examples

  • Replica exchange molecular dynamics | alanine dipeptide: replica exchange molecular dynamics simulation of alanine dipeptide, using the MACE-MP0 universal potential. The inclusion of high-temperature replicas allows for fast conformational transitions and improves ergodicity.

  • Geometry optimizations | formic acid dimer: approximate transition state calculation for the proton exchange reaction in a formic acid dimer, using simple bias potentials and a few geometry optimizations.

  • Static and dynamic frequency analysis | dihydrogen: Hessian-based estimate of the H-H bond strength and corresponding IR absorption frequency, and a comparison with a dynamical estimate from NVE simulation and Fourier analysis.

  • Bulk modulus calculation | iron: estimate of the bulk modulus of fcc iron using a series of NPT simulations at different pressures

  • Solid-state phase stabilities | iron: estimating the relative stability of fcc and bcc iron with anharmonic corrections using thermodynamic integration (see e.g. Phys Rev B., 2018)

  • DFT singlepoints | water: analysis of the numerical noise DFT energy and force evaluations using CP2K and the RPBE(D3) functional, for a collection of water molecules.

  • Path-integral molecular dynamics | water: demonstration of the impact of nuclear quantum effects on the variance in O-H distance in liquid water. Path-integral molecular dynamics simulations with increasing number of beads (1, 2, 4, 8, 16) approximate the proton delocalization, and lead to systematically larger variance in O-H distance.

  • Machine learning potential training | water: simple training and validation script for MACE on a small dataset of water configurations.