i-PI: A Python interface for ab initio path integral molecular dynamics simulations

https://doi.org/10.1016/j.cpc.2013.10.027Get rights and content

Abstract

Recent developments in path integral methodology have significantly reduced the computational expense of including quantum mechanical effects in the nuclear motion in ab initio molecular dynamics simulations. However, the implementation of these developments requires a considerable programming effort, which has hindered their adoption. Here we describe i-PI, an interface written in Python that has been designed to minimise the effort required to bring state-of-the-art path integral techniques to an electronic structure program. While it is best suited to first principles calculations and path integral molecular dynamics, i-PI can also be used to perform classical molecular dynamics simulations, and can just as easily be interfaced with an empirical forcefield code. To give just one example of the many potential applications of the interface, we use it in conjunction with the CP2K electronic structure package to showcase the importance of nuclear quantum effects in high-pressure water.

Program summary

Program title: i-PI

Catalogue identifier: AERN_v1_0

Program summary URL: http://cpc.cs.qub.ac.uk/summaries/AERN_v1_0.html

Program obtainable from: CPC Program Library, Queen’s University, Belfast, N. Ireland

Licensing provisions: GNU General Public License, version 3

No. of lines in distributed program, including test data, etc.: 138626

No. of bytes in distributed program, including test data, etc.: 3128618

Distribution format: tar.gz

Programming language: Python.

Computer: Multiple architectures.

Operating system: Linux, Mac OSX, Windows.

RAM: Less than 256 Mb

Classification: 7.7.

External routines: NumPy

Nature of problem:

Bringing the latest developments in the modelling of nuclear quantum effects with path integral molecular dynamics to ab initio electronic structure programs with minimal implementational effort.

Solution method:

State-of-the-art path integral molecular dynamics techniques are implemented in a Python interface. Any electronic structure code can be patched to receive the atomic coordinates from the Python interface, and to return the forces and energy that are used to integrate the equations of motion.

Restrictions:

This code only deals with distinguishable particles. It does not include fermonic or bosonic exchanges between equivalent nuclei, which can become important at very low temperatures.

Running time:

Depends dramatically on the nature of the simulation being performed. A few minutes for short tests with empirical force fields, up to several weeks for production calculations with ab initio forces. The examples provided with the code run in less than an hour.

Introduction

Molecular dynamics simulations are becoming increasingly capable not only of assisting the interpretation of experiments, but also of predicting the properties and the behaviour of new materials and compounds  [1]. Besides the increase in available computer power, these developments have been made possible by an increasingly accurate treatment of the interactions between the atoms, in particular by an explicit treatment of the electronic structure problem  [2], [3]. However, as the methods that are used to treat the quantum nature of the electrons improve, it becomes increasingly clear that in the presence of light atoms, such as hydrogen or lithium, the error due to approximating the nuclei as classical particles is at least as large as the errors due to the approximate modelling of the electrons. The importance of nuclear quantum effects (NQEs) is evident from the fact that the zero-point energy associated with a typical O–H stretching mode is in excess of 200 meV. This has significant implications: for example, one can show by extrapolating the experimental values for isotopically pure light, heavy and tritiated water that a hypothetical liquid with classical nuclei would have a 50% higher heat capacity than H2O and a pH of about 8.5.

Within the Born–Oppenheimer approximation, NQEs can be modelled using the imaginary time path integral formalism  [4], [5], [6], [7]. This formalism maps the quantum mechanical partition function for a set of distinguishable nuclei onto the classical partition function of a so-called ring polymer, composed of n replicas (beads) of the physical system connected by harmonic springs. The number of replicas needed to achieve a converged result is typically a small multiple of βħωmax, where β is the inverse temperature and ωmax is the largest vibrational frequency in the system. For the archetypical case of room-temperature liquid water, most properties are reasonably well converged with n=32—making the path integral simulation 32 times more expensive than a classical simulation.

As a consequence of this large overhead, NQEs were for many years only rarely considered in the context of ab initio molecular dynamics  [8], [9], [10]. However, with the advent of massively parallel computers, including these effects has become somewhat more affordable  [11], [12], and their simulation has also been facilitated by new methodological developments. In particular, it has recently been realised that an approximate modelling of NQEs can be obtained by applying a coloured (correlated)-noise Langevin equation thermostat to classical molecular dynamics  [13], [14], [15]. Moreover, this idea can be turned into a systematically convergent, accurate method  [16], [17] by combining coloured noise with path integral molecular dynamics (PIMD). To give an example, the PIGLET method  [17] makes it possible to treat NQEs in liquid water at 300 K with as few as 6 beads, which promises to make accurate ab initio PIMD calculations almost routine.

Unfortunately, most ab initio electronic structure codes only contain rudimentary implementations of PIMD, if any at all. We have developed i-PI in order to reduce the effort of introducing the latest PIMD developments into electronic structure codes, so as to make them readily available to a broader community. The framework we have adopted is a server–client model, in which i-PI acts as a server passing atomic coordinates to (multiple instances of) an electronic structure client program, and receiving the energy and forces in return. This allows all of the PIMD machinery to be confined to the Python server side, and minimises the modifications that have to be made to the electronic structure code.

Section snippets

Program overview

i-PI has been developed with the awareness that the cost of an ab initio PIMD simulation will be dominated by the electronic structure problem, and with a few clear goals:

  • to minimise the effort required to modify the client ab initio electronic structure code,

  • to include no feature specific to a particular client code,

  • to be modular, simple to extend and with a structure that reflects the underlying physics,

  • to be efficient, but never at the cost of clarity.

In order to achieve these goals we have

Program features

Integrating the PIMD equations of motion involves a number of technicalities. Fortunately, these can be kept to a minimum by using stochastic thermostatting  [18] — which avoids the complication of integrating Nosé–Hoover chain thermostats — and by formulating the time evolution using a symmetric Trotter splitting algorithm  [19]. This is the approach we have adopted in the i-PI program.

The program implements the most recent developments in path integral and coloured-noise molecular dynamics,

Constant-pressure path integral molecular dynamics

Most of the techniques listed above have been discussed in detail elsewhere. However, our implementation of PIMD in the NPT ensemble has not been described before now. The approach we have adopted for this is a relatively straightforward combination of ideas taken from path integral Langevin equation thermostats  [18], stochastic barostats for conventional MD  [34], and previous work on constant-pressure PIMD  [35]. We report it here as this combination is robust, transparent and streamlined,

An example application: high-pressure water

To highlight some of the more advanced features available in i-PI, we have used it to perform an illustrative ab initio PIGLET  [17] simulation of supercritical water at 750 K and 10 GPa. This simulation is both technically challenging and physically interesting. We shall use it to reveal the importance of NQEs under conditions similar to those explored in the pioneering work of Ref.  [39], in which calculations were performed at constant volume and without quantum effects in the nuclear motion.

Conclusions

In this paper we have introduced i-PI, a Python interface designed to facilitate including nuclear quantum effects in ab initio path integral molecular dynamics simulations. Our program delegates the calculation of the potential, forces and virial tensor to an external code, keeping the electronic structure calculation and the propagation of the nuclear dynamics separate. Communication between the codes is achieved using internet sockets, which exchange just the essential information, thereby

Acknowledgements

We would like to thank the early adopters of i-PI, including J. Cuny, E. Davidson, R. DiStasio, D. Donadio, F. Giberti, A. Hassanali, T. Markland, M. Rossi, B. Santra, D. Selassie, T. Spura, L. Wang, and D. Wilkins, who have helped immensely debugging the code and testing it on a variety of problems. A special thanks goes to A. Michaelides, who helped us to decide an acronym for the interface. We also acknowledge generous allocations of computer time from CSCS (project ID s338) and the Oxford

References (52)

  • T.E. Markland et al.

    A refined ring polymer contraction scheme for systems with electrostatic interactions

    Chem. Phys. Lett.

    (2008)
  • M. Ceriotti et al.

    The δ-thermostat: selective normal-modes excitation by colored-noise Langevin dynamics

    Procedia Comput. Sci.

    (2010)
  • C.C. Fischer et al.

    Predicting crystal structure by merging data mining with quantum mechanics

    Nat. Mater.

    (2006)
  • R. Car et al.

    Unified approach for molecular dynamics and density-functional theory

    Phys. Rev. Lett.

    (1985)
  • K. Burke

    Perspective on density functional theory

    J. Chem. Phys.

    (2012)
  • D. Chandler et al.

    Exploiting the isomorphism between quantum theory and classical statistical mechanics of polyatomic fluids

    J. Chem. Phys.

    (1981)
  • M. Parrinello et al.

    Study of an F center in molten KCl

    J. Chem. Phys.

    (1984)
  • D.M. Ceperley

    Path integrals in the theory of condensed helium

    Rev. Modern Phys.

    (1995)
  • R.P. Feynman et al.

    Quantum Mechanics and Path Integrals

    (1964)
  • M.E. Tuckerman et al.

    Efficient and general algorithms for path integral Car{–}Parrinello molecular dynamics

    J. Chem. Phys.

    (1996)
  • D. Marx et al.

    Ab initio path integral molecular dynamics: Basic ideas

    J. Chem. Phys.

    (1996)
  • D. Marx et al.

    The nature of the hydrated excess proton in water

    Nature

    (1999)
  • R.L. Hayes et al.

    Proton transport in triflic acid hydrates studied via path integral car-parrinello molecular dynamics

    J. Phys. Chem. B

    (2009)
  • J. Chen et al.

    Nature of proton transport in a water-filled carbon nanotube and in liquid water

    PCCP

    (2013)
  • S. Buyukdagli et al.

    Computation of the temperature dependence of the heat capacity of complex molecular systems using random color noise

    Phys. Rev. E

    (2008)
  • M. Ceriotti et al.

    Nuclear quantum effects in solids using a colored-noise thermostat

    Phys. Rev. Lett.

    (2009)
  • H. Dammak et al.

    Quantum thermal bath for molecular dynamics simulation

    Phys. Rev. Lett.

    (2009)
  • M. Ceriotti et al.

    Accelerating the convergence of path integral dynamics with a generalized Langevin equation

    J. Chem. Phys.

    (2011)
  • M. Ceriotti et al.

    Efficient first-principles calculation of the quantum kinetic energy and momentum distribution of nuclei

    Phys. Rev. Lett.

    (2012)
  • M. Ceriotti et al.

    Efficient stochastic thermostatting of path integral molecular dynamics

    J. Chem. Phys.

    (2010)
  • M. Tuckerman et al.

    Reversible multiple time scale molecular dynamics

    J. Chem. Phys.

    (1992)
  • T.E. Markland et al.

    An efficient ring polymer contraction scheme for imaginary time path integral simulations

    J. Chem. Phys.

    (2008)
  • G. Bussi et al.

    Canonical sampling through velocity rescaling

    J. Chem. Phys.

    (2007)
  • M. Ceriotti et al.

    Langevin equation with colored noise for constant-temperature molecular dynamics simulations

    Phys. Rev. Lett.

    (2009)
  • M. Ceriotti et al.

    Colored-noise thermostats à la Carte

    J. Chem. Theory Comput.

    (2010)
  • GLE4MD
  • Cited by (253)

    • Hydrogen trapping and embrittlement in metals – A review

      2024, International Journal of Hydrogen Energy
    • Three-Center Tight-Binding Together with Multipolar Auxiliary Functions

      2024, Journal of Chemical Theory and Computation
    View all citing articles on Scopus

    This paper and its associated computer program are available via the Computer Physics Communication homepage on ScienceDirect (http://www.sciencedirect.com/science/journal/00104655).

    View full text