Ab initio Molecular Dynamics with FHIaims and iPI
Prepared by Karen Fidanyan, Eszter Sarolta Pós and Mariana Rossi (based on previous years tutorials with contributions from: Yair Litman, Marcin Krynski, Nathaniel Raimbault, Luca Ghiringhelli)
We aim to introduce techniques that solve the classical equations of motion for a system of interacting particles. The strategy we adopt is molecular dynamics (MD). In the MD framework, a system of particles is propagated in time, given initial positions and momenta, by numerical integration of Newton's equations of motion. This technique samples the potential energy surface of a system at constant energy (microcanonical ensemble) and at constant temperature (canonical ensemble). As long as the ergodic hypothesis is valid, we will be able to relate the timeaveraged parameters (or properties) to the thermodynamic averages over the corresponding statistical ensemble.
We will use the BornOppenheimer MD, that is, the degrees of freedom of the nuclei are decoupled from the degrees of freedom of the electrons (BornOppenheimer approximation). Additionally, the nuclei are treated as classical particles. Therefore, the forces between the particles are evaluated by performing DFT calculations for each time step.
Location of the tutorial material
All files related to the tutorial, including solutions, can be found at https://gitlab.com/FHIaimsclub/tutorials/moleculardynamicswithipi.
The Objective
In this tutorial, the electronic structure problem is solved via Density Functional Theory (DFT) using the FHIaims code and the nuclei problem is managed by the iPI code. iPI works through a clientserver paradigm, where the ab initio code, in this case FHIaims, is the client that provides the calculation of interatomic forces, and iPI is the server that provides the evolution of the equations of motion that sample the desired ensemble. You will learn the basics of driving FHIaims with iPI.
All the necessary theoretical background about statistical mechanics and ab initio molecular dynamics needed for a good understanding of this tutorial can be found in the 2019's lecture of Luca Ghiringhelli: Ab initio statistical mechanics and molecular dynamics. This year's lecture by Mariana Rossi is available following the link: Ab initio statistical mechanics and molecular dynamics.
Prerequisites

A sufficient understanding about the basics of running FHIaims is required. Please review our tutorial Basics of Running FHIaims if you have not yet done so and/or if you are unfamiliar with the code.

A sufficiently powerful computer. For this tutorial a laptop with at least four (physical cores) should be sufficient. Moreover, timing informations available at the front of each exercise denote approximate runtimes of each task on a 4core laptop. These include time spent on setting up input files and following instructions step by step, too.

The FHIaims and iPI code distribution must be present on this computer.

A Python installation, version
>=3.6
, and Numpy.
Summary of the tutorial
The tutorial consists of five exercises. All of them are based on a paradigmatic system, namely, the gasphase (isolated) H\(_5\)O\(_2\)\(^+\), the Zundel cation.
If you have not set up FHIaims and iPI on your machine, please start with the Preparations section.
Part 1 is a quick, introductory exercise that presents the machinery we will use through the tutorial. In particular, you will learn how to setup the iPI and FHIaims inputs.
Part 2 and Part 3 pose the problem of choosing the right settings for obtaining a stable and reliable molecular dynamics trajectory. In particular we will investigate the effect of the selfconsistent cycle and force convergence thresholds as well as the influence of the size of the time step.
Part 4 deals with the choice of a thermostat for simulating the canonical ensemble, i.e., the contact between your system of interest and a thermal reservoir. In this tutorial we will focus on the socalled stochastic thermostats. Other implementations, for example based on extended Lagrangians exist as well, and will be briefly explained in the exercise. Also, we will introduce the concept of statistical uncertainty and learn how to estimate it.
Part 5 shows how to perform vibrational analysis in harmonic approximation with iPI.
In Part 6, we focus on the free energy calculation. We look at the difference between harmonic approximation, obtained from lattice dynamics approach, and an anharmonic free energy, calculated using thermodynamic integration.
Part 7 introduces how to set up constant pressure dynamics runs using the barostat functionality of iPI combined with FHIaims. The example showcases dynamics on a periodic system of copperchloride.