openmaterials.ai / codes / i-PI
i-PI: path integral molecular dynamics with forces over a socket
A Python force engine that moves the nuclei, classical or as ring polymers, while an external code returns energies and forces over a socket.
What it is and how it works
Ring polymers from any force code
i-PI is the server. It sends positions and cell vectors to clients, receives energy, forces and stress, and moves the atoms. With several beads, one forcefield serves several clients in parallel (Litman 2024).
Sampling methods
MD and PIMD in the NVE, NVT, NPT and NsT ensembles, GLE and PIGLET thermostats, RPMD, CMD, TRPMD, ring polymer instantons, replica exchange, metadynamics (Litman 2024).
Socket protocol
UNIX domain sockets on one host or TCP/IP across a network. Clients start on their own and must keep the atom count and order fixed for the whole run (Litman 2024).
Clients
Examples ship for ASE, CASTEP, CP2K, LAMMPS, DFTB+, FHI-aims, Quantum ESPRESSO and VASP. A new Python interface is one small file under drivers/py/pes/ (Litman 2024).
Overhead per step
i-PI 3.0 cut the base NVE overhead from 0.47 ms to 0.09 ms per step and the TCP/IP constant from 21.54 ms to 1.26 ms by disabling Nagle's algorithm (Litman 2024).
Committee models
An ffcommittee block averages several potentials and reports their spread as the error, with a weighted baseline model and a store of high-error structures (Litman 2024).
What people do with it
- 2.16ns/day, 4096 H2O, DeePMD, 8 V100 GPUs, via i-PILitman 2024
- 0.09 msbase overhead per NVE step in i-PI 3.0Litman 2024
- 0.6%CH4+H tunneling factors vs an independent codeKapil 2019
Infrared spectrum of liquid water
Thermostatted RPMD in i-PI with LAMMPS, 216 q-TIP4P/F waters and 32 beads, washes out the RPMD resonances. The OH stretch peak sits about 75 cm-1 below the classical one (Rossi 2014). Rossi 2014
Fourth-order path integrals for ice
Finite-difference Suzuki-Chin PIMD, implemented in i-PI, reaches an error of a few meV per molecule for hexagonal ice at 100 K with 48 beads. Trotter PIMD needs more than 128 (Kapil 2016). Kapil 2016
Melting point of ab initio water
i-PI with LAMMPS and a revPBE0-D3 neural network potential gives Tm = 267(2) K for H2O and 275(2) K for D2O, against 273.15 K and 276.97 K measured (Cheng 2019). Cheng 2019
How it is used
Write the XML input
One XML file with <system>, <ensemble>, <ffsocket> blocks and a <motion> mode.
Start i-PI
i-PI opens its sockets and waits for clients to connect.
Launch the clients
Start the force code (LAMMPS fix_ipi, the ASE driver, a DFT code) at the socket address.
Run and restart
Each step trades positions for energy, forces and stress. Restart files are written.
Post-process
Print properties and trajectories (x_centroid, f_centroid) and run the i-pi tools.
What i-PI is
i-PI is a Python driver for molecular dynamics that separates the nuclear propagation from the force evaluation. It runs path-integral and ring-polymer molecular dynamics, thermostats and enhanced sampling, and talks to electronic structure and potential codes over a socket. On the map it serves the quantities obtained from its trajectories.
WebsiteOn the mapAll codesLicense: GPL-2.0-or-later OR MIT (user's choice, dual license)
In more detail
Architecture
i-PI is a client-server code in Python 3 under a dual GPL and MIT license (Litman 2024). The System class holds the atoms, the number of beads, the ensemble and the initialization. The Forces class sums several force components, each computed by a Forcefield instance with its own client, so one input can mix a cheap and an expensive potential, or treat an adsorbate and its surface with different numbers of beads (Kapil 2019). The Motion class evolves the atoms, and SMotion classes act across systems for replica exchange. A client may return a JSON extras string with further quantities, such as Born effective charges or committee energies, which i-PI attaches to the force (Litman 2024).
Numerics and scale
The overhead per step is modelled as A + B N_a. In i-PI 3.0 the NVE integrator costs 0.09 ms plus 0.02 us per atom on one core, and UNIX socket communication adds 0.25 ms plus 0.06 us per atom (Litman 2024). With LAMMPS and a DeePMD potential for 4096 water molecules, i-PI matches LAMMPS up to 288 CPU cores and reaches 2.16 ns/day against 2.54 ns/day for LAMMPS alone on 8 V100 GPUs with a 0.5 fs step (Litman 2024). Bosonic PIMD scales quadratically with particle number instead of exponentially. At N = 1024 the exchange costs 44 times a distinguishable run (Litman 2024). Fourth-order and perturbed path integrals, PIGLET and ring polymer contraction cut the number of beads needed (Kapil 2019).
Interfaces
Any code that can open a socket can drive i-PI. The distribution includes a Fortran and a Python driver as templates, and LAMMPS ships fix_ipi (Litman 2024). The ASE and LAMMPS interfaces give access to the potentials those packages wrap, among them MACE, DeePMD and n2p2 (Litman 2024). i-PI links PLUMED natively as a ForceField, so metadynamics hills and restarts stay in sync (Kapil 2019). The documentation has examples for ASE, CASTEP, CP2K, LAMMPS, DFTB+, ffsGDML, FHI-aims, librascal, Quantum ESPRESSO, VASP, elphmod and YAFF, with HPC submission scripts (Litman 2024).
Validation
Continuous integration runs every example for a few steps and a regression suite against stored reference outputs (Litman 2024). The ring polymer instanton rates for CH4 + H with the CBE potential agree within 0.6% with an independent implementation, with tunneling enhancement 9.75 at 300 K and 94992 at 150 K (Kapil 2019). Bosonic PIMD of 512 trapped non-interacting bosons with 42 beads is plotted against the analytical energy per particle with a 0.5% error band (Litman 2024). The perturbed path integral estimator recovers the nuclear quantum contribution to the energy of aspirin to 0.5% with six beads, where the virial estimator is off by 2.5% with twenty-eight (Kapil 2019).
What it computes on the map
4 quantities, drawn by tier with the data flow between them. Dashed boxes are intermediate quantities. Select one for its formula and the other codes that compute it.
Embed this submap
<iframe src="https://openmaterials.ai/m/c56731602651/40000000010018?embed=1" title="i-PI on the OpenMaterials map" width="100%" height="480" loading="lazy" style="border:1px solid #EBEBEB;border-radius:6px"></iframe>
Each quantity with the interface the representation records.
- HeatCapacity[method=pimd]output property 'scaledcoords' (eps_v, eps_v') post-processed into C_V, or the i-pi-getacf / heat-capacity example scripteV_per_K
- QuantumKineticEnergyoutput property 'kinetic_cv{electronvolt}' (centroid-virial); per-atom / tensor via 'kinetic_od', 'kinetic_tens_cv'ev
- Temperature<initialize><cell>/<system> ... ensemble temperature; output property 'temperature{kelvin}'kelvin
- Trajectoryoutput <trajectory filename='pos' stride=... > positions{angstrom} (per bead, or the centroid x_centroid)
References
The code
The papers that describe the code; cite them when you use it.
- V. Kapil, M. Rossi, O. Marsalek et al., i-PI 2.0: A universal force engine for advanced molecular simulations, Computer Physics Communications, 2019. doi.org/10.1016/j.cpc.2018.09.020
- Y. Litman, V. Kapil, Y. M. Y. Feldman et al., i-PI 3.0: A flexible and efficient framework for advanced atomistic simulations, The Journal of Chemical Physics, 2024. doi.org/10.1063/5.0215869
Applications
Highly cited studies that cite the code, with a few picked by hand.
- M. Rossi, M. Ceriotti, D. E. Manolopoulos, How to remove the spurious resonances from ring polymer molecular dynamics, The Journal of Chemical Physics, 2014. doi.org/10.1063/1.4883861
- V. Kapil, J. Behler, M. Ceriotti, High order path integrals made easy, The Journal of Chemical Physics, 2016. doi.org/10.1063/1.4971438
- B. Cheng, E. A. Engel, J. Behler et al., Ab initio thermodynamics of liquid and solid water, Proceedings of the National Academy of Sciences, 2019. doi.org/10.1073/pnas.1815117116
How to cite
Y. Litman, V. Kapil, Y. M. Y. Feldman, et al., i-PI 3.0: a flexible and efficient framework for advanced atomistic simulations, J. Chem. Phys. 161, 062504 (2024)