Car-Parrinello molecular dynamics

www.cpmd.org This article was rated ”Number Five” in the ”Physical Review Letters’ Top 10” papers. Here it is again! The essay! Read this article and write a 2 page report of the famous Car-Parrinello approach. (1) The CPMD code is a parallellized plane wave / pseudopotential implementation of DFT, particularly designed for molecular dynamics (MD) simulations. It is distributed free of charge for non-profit organizations (academic users). (2) CPMD is especially suitable for systems with large band gaps, such as covalent molecules , metal clusters (not all), and semiconductor materials . Several thousands of researchers use it, and correspondingly, it contains numerous advanced options. (3) In the context of DFT computing, the program is old- fashioned (plane waves, periodic boundary conditions, pseudopotentials) but reliable and robust. Capabilities

• Wavefunction optimization : direct minimization (ODIIS) and diagonalization (Lanczos, Davidson) • Geometry optimization : local optimization and simulated annealing • Molecular dynamics : NVE , NVT , NPT ensembles • Path integral MD, free-energy path-smapling methods • Response functions and many electronic structure properties (e.g. Wannier functions) • Time-dependent DFT (excitations, MD in excited states) • LDA, LSD, and many popular GGAs (and others, TPSS, hybrids) • Isolated systems and systems with periodic boundary conditions (with k-points) • Hybrid quantum chemical / molecular mechanics calculations (QM/MM) • Coarse-grained non-Markovian metadynamics • Works with norm-conserving and ultrasoft pseudopotentials Methods to compute the ground state wavefunction in CPMD program:

 Default settings: ODIIS (Direct Inversion of the Iterative Subspace), uses occupied orbitals only, not suitable for metals  Steepest descent : simplest minimization algorithm, occupied orbitals only, rather slow  Preconditioned conjugate gradient (PCG ): the minimizer improves steepest descent, occupied orbitals only  Lanczos diagonalization : full diagonalization with unoccupied orbitals, compatible with a free-energy functional, suitable for all kinds of systems, expensive  Davidson diagonalization : faster than Lanczos, but not compatible with the novel free-energy functional  CP-dynamics with simulated annealing : gradual removal of kinetic energy, fixed (see the original Car-Parrinello article) Molecular dynamics and ab initio molecular dynamics

The aim is to model detailed microscopic dynamical behavior of many different types of systems in , chemistry, and biology. The history goes back to 1950’s when first computer simulations of simple systems were performed (Fermi and colleagues).

MD is a technique to investigate equilibrium and transport properties of many-body systems . The nuclear motion of the particles is modeled using the laws of classical mechanics. This is a good approximation as far as the properties are not related to the motion of light atoms (i.e., hydrogens) or vibrations with a frequency ν such that hν > kBT. Equations of Motion

Let us consider a system of N particles moving under the influence of a potential function U. Particles are described by ionic positions and momenta.

Hamiltonian:

Forces:

Equations of motion:

Newtons second law: The equations of motion can be achieved also by using the Lagrange formalism. The Lagrange function is

and the associated Euler-Lagrange equation

leads to the same final result. The two formulations are equivalent, but the ab initio literature almost exclusively uses the Lagrangian techniques. The equations of motion are time-reversible and the the total energy is a constant of motion . Statistical ensembles

 Statistical mechanics connects the microscopic details of a system (molecular dynamics) with physical observables (thermodynamic properties, diffusion, spectra).  Statistical mechanics is based on Gibb’s ensemble concept: Many individual microscopic configurations of a very large system lead to the same macroscopic properties (it is not necessary to know them all).  Statistical ensembles are usually characterized by fixed values of thermodynamical variables (E,T,P,V,N,)  Fundamental ensembles: Microcanonical (NVE ), canonical (NVT ), isothermal-isobaric (NPT ), and grand canonical (VT ).  The thermodynamic variables that characterize the ensemble can be regarded as experimental control parameters. Numerical integration

In computer experiments, one cannot generate the true trajectory of a system with a given set of initial positions and velocities. For all potentials U, only numerical integration techniques can be applied (discretization of time). Many methods have been developed; we are interested in the ones that exhibit long-time energy conservation and short-time reversibility . Velocity –Verlet algorithm looks like a Taylor expansion for the coordinates:

This equation is combined with the updated velocities

To perform a computer experiment, one has to choose the initial values for the positions and velocities together with an appropriate time step. The first part of the simulation is the equilibration phase in which strong fluctuation may occur. Once all important properties are sufficiently equlibrated, the actual simulation is performed (data collecting ). Finally, observables are calculated from the trajectory. Some quantities that can be easíly calculated are:  The average (ionic) temperature

 The diffusion constant for large time τ

 The pair correlation function

 Temporal Fourier of the velocity-velocity autocorrelation function is proportional to the density of normal modes (vDOS). Thermostats and barostats

In the framework statistical mechanics, all ensembles can be formally obtained from the microcanonical NVE ensemble by suitable Laplace transforms of its partition function (cf. bath or reservoir in thermodynamics). The same basic idea is used in computer simulations: additional degrees of freedom for controlling selected quantities (e.g. temperature, pressure). The simulation is performed in an extended NVE ensemble with a modified total energy, and the resulting distribution function is that of the targeted ensemble. Thermostats and barostats are used to impose temperature instead of energy and / or pressure instead of volume as external control parameters. Thermostats: Temperature is not a control variable in standard NVE molecular dynamics simulations. A deterministic algorithm of achieving temperature control in the spirit of extended system dynamics was devised by Nosé and Hoover during the 1980s. The original method by these authors suffered from non-ergodicity problems for certain classes of Hamiltonians (e.g. harmonic oscillator). A closely related technique, the so-called Nosé-Hoover-chain thermostat , cures the problem. The basic idea is thermostatting the original thermostat by another thermostat, which in turn is thermostatted and so on… The underlying equations of motion read:

Dynamical friction coefficients

There is a conserved energy quantity for the extended (thermostatted) system. Barostats:  Keeping the pressure constant is a desirable feature for many MD applications.  The concept of barostats and constant-pressure MD was introduced by Andersen in 1980. His method was devised for isotropic fluctuations in the volume of the supercell.  An extension consists in allowing for changes of the the shape of the computational cell to occur as a result of applying external pressure, including the possibility of non-isotropic external stress. The additional degrees of freedom in the Parrinello-Rahman approach are the lattice vectors of the supercell.  The variable-cell approaches make it possible to study dynamically structural phase transitions in solids at finite temperatures.

 The lattice vectors a1, a2 and a3 of the simulation cell are expressed as additional dynamical variables in the extended Lagrangian of the system.  A moder formulation of barostats combines the equation of motion also with thermostats (Martyna et al.) Ab initio MD - preface

In the following, two most popular extensions of classical molecular dynamics to include first-principles derived potential functions will be discussed. The focus is in the KS method of DFT. The general form of KS equations :

A unitary transformation within the space of occupied orbitals yields the canonical (familiar) form and the KS force acting on the orbitals can be expressed as Born-Oppenheimer MD

The interaction energy U( RN) in classical MD has the same physical meaning as the KS energy within the Born-Oppenheimer (BO) approximation. The KS energy depends only on the nuclear positions and defines a ”hypersurface” for the movement of the nuclei. The Lagrangian in BO dynamics is therefore

and the minimization is constraint to orthogonal sets of KS orbitals. The equations of motion are

A classical MD program can be easily turned into a BOMD program by replacing the energy and force routines by the corresponding routines from a quantum chemistry program. Extensions to other ensembles are also straightforward. Forces in BOMD: The forces needed in BOMD implementation are

They can be calculated from the extended energy functional

The KS orbitals are assumed to be optimized, i.e. the term in brackets is (almost) zero and the forces simplify

The accuracy of the forces in BOMD depends on the accuracy of the energy functional minimization (has to be done separately for each time step). Car-Parrinello MD

The basic idea of Car-Parrinello approach can be viewed to exploit the time- scale separation of fast electronic and slow nuclear motion by transforming that into classical-mechanical adiabatic energy-scale separation in the framework of dynamical systems theory. The two component quantum / classical problem is mapped onto two- component purely classical problem with two separate energy scales at the expense of loosing the explicit time-dependence of the quantum subsystem dynamics. This is achieved by considering the the extended KS energy functional , εKS , to be dependent on the orbitals and nuclear positions. Similarly, as nuclear forces can be achieved as derivatives of the Lagrangian with respect to the nuclear coordinates, one can assume that forces on orbitals (now interpreted as classical fields) can be obtained as functional derivatives of εKS with respect to the orbitals . In CPMD, there is deterministically only one ”wavefunction optimization” step per time step (cf. several iterations in BOMD). Car and Parrinello postulated the following Lagrangian :

The corresponding Newtonian equations of motion are obtained from the associated Euler-Lagrange equations

as in classical mechanics, but here both for the nuclear positions and the orbitals. The resulting Car-Parrinello equations of motion are

Where is the ”fictious ” or inertia parameter assigned to the orbital degrees of freedom. Note that the constraints within εKS lead to ”constraint forces” in the equations of motion. The constant of motion is

According to the CP equations of motion, the nuclei evolve in time at a certain (instantaneous) physical temperature, whereas a “fictitious temperature" is associated to the electronic degrees of freedom. In this terminology, “low electronic temperature" or “cold " means that the electronic subsystem is close to its instantaneous minimum energy, i.e. close to the exact BO surface. Thus, a ground-state wavefunction optimized for the initial conguration of the nuclei will stay close to its ground state also during time evolution if it is kept at a sufficiently low temperature.

The remaining task is to separate in practice nuclear and electronic motion such that the fast electronic subsystem stays cold also for long times but still follows the slow nuclear motion adiabatically. Simultaneously, the nuclei are kept at a much higher temperature. This can be achieved in nonlinear classical dynamics via decoupling of the two subsystems and adiabatic time evolution. This is possible if the power spectra of both dynamics do not have substantial overlap in the frequency domain so that energy transfer from the “hot nuclei“ to the “cold electrons" becomes practically impossible on the relevant time scales. Forces in CPMD: The forces needed are the partial derivative of the KS energy with respect to the independent variables (nuclear coordinates and orbitals). The orbital forces are calculated as the action of the KS Hamiltonian on the orbitals

The forces with respect to nuclear positions are (as in BOMD)

In CPMD these are the correct forces and calculated from the analytic energy expression. Constraint forces are

where the latter arises only for atomic basis sets (not present for plane waves). How to control adiabaticity? A simple harmonic analysis of the frequency spectrum of the orbital classical fields close to the minimum defining the ground state yields

where εj and εi are the eigenvalues of occupied and unoccupied orbitals, respectively. This is in particular true for the lowest frequency, and an analytic estimate for the lowest possible electronic frequency

shows that this frequency increases like the square root of the electronic energy difference Egap between the lowest unoccupied and the highest occupied orbital. On the other hand, it increases similarly for a decreasing fictitious mass parameter . min max For adiabatic separation, the frequency difference ωe - ωn should be large. Both the highest phonon frequency and the energy gap are quantities that are dictated by the physics of the system. Therefore, the only parameter to control adiabatic separation is the fictitious mass . However, decreasing not only shifts the electronic spectrum upwards on the frequency scale, but also stretches the entire frequency spectrum. This leads to an increase of the maximum frequency according to

where Ecut is the largest kinetic energy in terms of a plane wave . Here, a limitation to decrease arbitrarily kicks in due to the maximum length of the molecular dynamics time step tmax that can be used. The time step is inversely proportional to the highest frequency in the system, and thus

governs the largest time step that is possible . One has to make a compromise on the control parameter :

 Typical values for large-gap systems are =300-1500 a.u. together with a time step 2-10 a.u. (0.048-0.242 fs)  For systems involving hydrogen , I have previously used =400 a.u. and time step 3 a.u. (0.072 fs)  Long trajectories with better statistics make the errors from large fictitious more evident; there is a trend to stay away from aggressively large fictitious masses and time steps, and use more concervative parameters .  Poor man’s choice for keeping and time step larger , is to choose heavier nuclear masses (isotopes, e.g. deuterium). That depresses the largest phonon or vibrational frequency of the nuclei (renormalization of dynamical quantities, isotope effect). Velocity-Verlet equations for CPMD: The constrain forces complicate the velocity-Verlet method slightly for CPMD.

The Lagrange parameters Λij have to be calculated to be consistent with the discretization method employed. For the case of overlap matrices that are not position dependent (plane wave basis set) the constraint term only appears in the equation for orbitals

The velocity-Verlet scheme for wavefunctions has to incorporate the constraint by using the RATTLE algorithm. Comparing BOMD and CPMD

The comparison between the two methods is a delicate issue. It depends on the chosen accuracy of energy conservation .

Microcanonical simulation of 8 Si atoms at 360-370 K.

CPMD: time step 5/10 a.u. =400 me BOMD: time step 10/100 a.u. (0.24 and 2.4 fs) One major advantage of CPMD is the fact that a full wavefunction optimization has to be performed only once (beginning). A disadvantage is the red-shift in the dynamics of light atoms (”drag”) due to the fictitious electron dynamics. BO dynamics does not suffer from the latter, but it may be expensive for systems where the convergence of the wavefunction is difficult . Recent developments in using wavefunction extrapolation to improve the quality of the initial guess wavefunction have improved the situation considerably. In conclusion, BOMD can be made as fast as CPMD (as measured as the amount of CPU time spent per picosecond) at the expense of sacrificing accuracy in terms of energy conservation.

The CPMD program itself contains options for both MD alternatives! My examples:

ATP hydrolysis in water and melt-quenching of amorphous DVD-RAM materials ATP hydrolysis in water:  Methyltriphosphate (reactive part of ATP) complexed with Mg 2+ and embedded in a box of water (54 H 2O molecules, box side 13.1 Å), periodic boundary conditions  Plane wave cutoff 70 Ry , PBE96 functional  Electron fictitious mass =400 a.u. and time step 3 a.u  Temperature 310 K , rescaling  Three reactions (constrained), duration 9-13 ps

J. Akola and R.O. Jones, J. Phys. Chem. B 107 , 11774 (2003). Ge 2Sb 2Te 5 alloys

DVD-RAM (and Blu-ray) Simulation method

• Density functional theory (DFT) of electronic structure • Car-Parrinello molecular dynamics (CPMD , www.cpmd.org ) with periodic boundary conditions • Scalar-relativistic TM91 pseudopotentials 1 • PBE96 2 for the exchange-correlation energy functional (GGA) • Born-Oppenheimer MD (time step 125-250 a.u.  3-6 fs), wavefunction extrapolation • Nosé-Hoover-chain thermostat, chain length 4, frequency 800 cm -1 • plane wave basis set, cut-off energy 20 Ry • Melt-quenching from the ”hot liquid” to solid ”amorphous” phase (process duration 0.3-0.5 ns ) • Massively-parallel DFT/MD simulations (thousands of CPUs) on IBM Blue Gene/L/P in FZ Jülich

1N.L. Troullier and J.L. Martins, PRB 43 , 1993 (1991). 2J.P. Perdew, K. Burke, and Ernzerhof, PRL 77 , 3865 (1996). FinalStarting structure, structure, a- GSTc-GST

 512 atomic sites, rocksalt (NaCl) structure (c-GST)  Te occupies Cl sites (256 atoms)  Ge , Sb , and vacancies occupy Na sites randomly  10% vacancies  460 atoms MetastableAmorphous ordered altogether (”crystalline”)disordered phase phase  Box size 24.6 Å (ρ=5.9 g/cm 3) Radial distribution functions (a-GST)

l-GST, red (900 K); Wrong bonds: c-GST, blue (300 K)

Ge-Ge Dominant, partial coordination 0.4 coordination numbers 3.6 (Ge) and 2.9 (Sb) Ge-Sb almost negligible

Few Te-Te bonds, Sb-Sb bonds long-range order present (0.6) (>10 Å).

Coordination numbers: Ge 4.2 , Sb 3.7 , and Te 2.9 (compare with 8-N rule)

J. Akola and R.O. Jones, PRB 76 , 235201 (2007). Diffusion at 900 K (melting point)

• Linear mean-square displacement (MSD)  diffusion constants • Sb is more mobile -5 2 -1 (DSb =4.7x10 cm s ) • Fluctuations due to concerted motion (creation/annihilation of cavities) • Viscocity 1.2 cP (expt. ~1.9 cP, GeTe) GST - vibrational frequencies (vDOS)

Two methods:  Finite differences (energy gradients for the optimized geometry, bottom curve)  Power spectra (MD at 300 K, FFT of the velocity-velocity autocorrelation function)

Projections onto different elements enable vibrational mode characterization  Visible contribution from tetrahedral Ge! Tetrahedral Ge Ge-Ge bonds (few)

J. Akola and R.O. Jones, J. Phys.: Cond. Mat. 20 , 465103 (2008).