15 Ab Initio 124 15 Ab Initio Molecular Dynamics

15.1 Why use ab initio methods in MD?

Most importantly ab initio methods are used to generate the forces needed for a MD simulation.

This can be done in two obvious ways:

• Fitting of an empirical potential using results from ab initio calcula- tions.

• Generating the forces directly from electronic structure calculations as the MD trajectory evolves.

In order to produce analytical potentials, accurate descriptions of interac- tions between all involved types of atoms are necessary. Experimental data for these interactions is, however, rare. Still, even the best fixed potential has some drawbacks, most importantly:

• Many different atom types included in a model give rise to a steeply rising number of interactions that need to be parametrized.

• Changes in electronic structure (bonding pattern) are generally not accounted for.

Thus, for the modelling of many phenomena, ab initio simulations are irreplaceable. Also, processes not foreseen (parametrized for) can take place – true predic- tive power. 15.2 What are ab initio calculations? 125

15.2 What are ab initio calculations?

The term „ab initio” (Latin for „from the beginning”) is generally understood to denote methods that are devoid of experimental input; in other words derived from „first principles”. As we will see, many of the methods generally referred to as ab initio contain empirical parameters. Therefore the expression „electronic structure calcula- tions” is often more appropriate. In one way or the other, electronic structure calculations are all based on the Schrödinger equation ∂ ih¯ Φ({ri}, {RI }; t) = HΦ({ri}, {RI }; t) (15.1) ∂t This neglects

• interactions between nucleons

– almost always appropriate

• relativistic effects.

– problematic for heavy elements

In principle, solution of the time-dependent Schrödinger equation descri- bes the dynamic behaviour of a system without any additional MD algorithm. To solve it is, however, almost always prohibitively expensive, therefore we must resort to different approximations.

15.3 Ab Initio MD

There are three main approaches for combining electronic structure calcula- tions with molecular dynamics:

• Born-Oppenheimer MD

• Ehrenfest MD

• Car-Parrinello MD

There is a variety of codes available to perform ab initio MD (AIMD) si- mulations, e.g. ABINIT, CPMD, CASTEP, CP2K, NWChem, VASP. (not GROMACS, though. . . ) 15.3 Ab Initio MD 126

15.3.1 Born-Oppenheimer MD

The Hamiltonian with electronic {ri} and nuclear {RI } degrees of freedom can be written as 2 2 X h¯ 2 X h¯ 2 H = − ∇I − ∇i 2MI 2me I i 2 2 2 ! 1 X e X e ZI e ZI ZJ + − + 4πε0 |ri − rj| |RI − ri| |RI − RJ | i

Here, He is assumed to be the Hamiltonian for the electronic system when the nuclei are stationary. Next, let’s assume that the exact solution of the corresponding time- independent electronic Schrödinger equation

He({ri}; {RI })Ψk = Ek({RI })Ψk({ri}; {RI }), (15.3) is known for all possible positions of the nuclei. Now it’s possible to expand the total wave function for the time-dependent Schrödinger equation as

∞ X Φ({ri}; {RI }; t) = Ψl({ri}; {RI })χl({RI }; t) (15.4) l=0 with the nuclear and electronic wave functions normalized. The sum includes the complete set {Ψl} of eigenfunctions for He, and the nuclear wave functions {χl} can be viewed to be time-dependent expansion coefficients. When inserted into the time-dependent Schrödinger equation, after mul- ∗ tiplication from the left by Ψk({ri}, {RI }) and integration over electronic coordinates r, a set of coupled differential equations result

" 2 # X h¯ 2 X ∂ − ∇I + Ek({RI }) χk + Cklχkl = ih¯ χk. (15.5) 2MI ∂t I l

Here Ckl are coupling operators, which depend on the kinetic energy and momenta of the nuclei. In adiabatic approximation the non-diagonal elements of Ckl are disre- garded. In Born-Oppenheimer approximation it is furthermore assumed that 15.3 Ab Initio MD 127

Ckk ≈ 0, which leads to:

" 2 # X h¯ 2 ∂ − ∇I + Ek({RI }) χk = ih¯ χk (15.6) 2MI ∂t I

This approximation is safe for most physically interesting cases. The next step is to approximate the nuclei as classical point particles. This is done by rewriting the corresponding wave function in terms of an amplitude factor Ak and a phase Sk

χk({RI }; t) = Ak({RI }; t) exp[iSk({RI }; t)/h¯] (15.7)

Using the following transformation for the momenta of the nuclei:

PI ≡ ∇I Sk, (15.8) ˙ the Newtonian equations of motion PI = −∇I Uk({RI }) can be written as

dPI dt = −∇I Ek or (15.9) ¨ BO MI RI (t) = −∇I Uk ({RI (t)}) which holds separately for each decoupled electronic state k.

• The nuclei move according to classical mechanics in an effective po- BO tential Uk , which is given by the Born-Oppenheimer potential energy surface Ek.

• Ek is obtained by solving the time-independent electronic Schrödinger equation for the kth state at the given nuclear configuration {Rl(t)}.

• Because we now directly obtain the forces from the Born-Oppenheimer total energy Ek, this approach is often called Born-Oppenheimer mo- lecular dynamics.

• Because the time-independent Schrödinger equation was utilized for the electronic system, this approach doesn’t maintain the quantum mecha- nical time evolution of the system. 15.3 Ab Initio MD 128

15.3.2 Ehrenfest MD

Another approach, which does maintain the QM time evolution, involves di- rectly separating the total wave function Φ({ri}, {RI }; t) so that the classical limit can be imposed for the nuclei only. The simplest form is a product  Z t  i ˜ 0 0 Φ({ri}, {RI }; t) ≈ Ψ({ri}; t)χ({RI }; t) exp Ee(t )dt , (15.10) h¯ t0 where both wave functions again are separately normalized at every instant of time. To simplify equations, a phase factor Z ˜ ∗ ∗ Ee = Ψ ({ri}; t)χ ({RI }; t)HeΨ({ri}; t)χ({RI }; t))drdR (15.11) is introduced. Inserting this wave function to the equations for the Hamiltonian and to the Schrödinger equation and implying conservation d hHi /dt ≡ 0 can be shown to lead to the following relations ∂Ψ X h¯ ih¯ = − ∇2Ψ ∂t 2m i i e Z  ∗ + χ ({RI }; t)Un−e({ri}, {RI })χ({RI }; t)dR Ψ (15.12)

∂χ X h¯ ih¯ = − ∇2χ ∂t 2M I i I Z  ∗ + Ψ ({ri}; t)He({ri}, {RI })Ψ({ri}; t)dr χ. (15.13)

These coupled time-dependent Schrödinger equations form the basis of the time-dependent self-consistent field (TDSCF) method introduced in 1930 by Paul . Both the electrons and the nuclei move quantum mechanically in time-dependent effective potentials (i.e., average fields, given in the curly brackets). Next step is to again approximate the nuclei as classical point particles, which is done similarly to what was shown for the Born-Oppenheimer case. This gives for the equations of motion: dP Z I = −∇ Ψ∗H Ψdr or dt I e ¨ E MI RI (t) = −∇I Ue ({RI (t)}) (15.14) 15.3 Ab Initio MD 129

E Here Ue = hΨ|He|Ψi is now the Ehrenfest potential, which is given by quantum dynamics of the electrons by solving the time-dependent electro- nic Schrödinger equation • The AIMD approach using these equations of motion simultaneous- ly to the time-dependent Schrödinger equation for electrons is called Ehrenfest molecular dynamics.

• This is a mixed approach where nuclei are treated as classical particles, but electrons retain their QM nature.

• As a limiting case to the Ehrenfest method, it can be reduced to the Born-Oppenheimer method by restricting the electronic system to its ground state.

15.3.3 Comparison Between BOMD and EMD

In the Born-Oppenheimer approach, the electronic state is obtained from the time-independent, i.e., stationary, Schrödinger equation. This implies that the time dependence of the electronic system is dictated by the motion of the nuclei, which it just follows. The method can be expressed for the electronic ground state as ¨ MI RI (t) = −∇I minΨ0 {hΨ0|He|Ψ0i}

E0Ψ0 = HeΨ0. (15.15)

It is possible to consider also a certain excited state Ψk, k > 0 within the Born-Oppenheimer method, but without any interferences with other states.

• The BOMD is very dependent on that a minimum hHei is reached in each time step to ensure good results. In the case of Ehrenfest MD, the forces are calculated „on-the-fly” as the nuclei are propagated using classical mechanics. They can be numerically solved simultaneously from the coupled set of quantum/classical equations Z ¨ ∗ MI RI (t) = −∇I Ψ HeΨdr = −∇I hHei (15.16)

" # ∂Ψ X h¯2 ih¯ = − ∇2 + U ({r }, {R (t)}) Ψ ∂t 2m i n−e i I i e = HeΨ. (15.17) 15.3 Ab Initio MD 130

This can be done conveniently by expanding the electronic wave function Ψ as ∞ X Ψ({ri}, {RI }; t) = cl(t)Ψl({ri}; {RI }), (15.18) l=0 where cl(t) are complex coefficients which determine the occupations of each state l and Ψl are solutions to the time-independent Schrödinger equation. This approach includes the transitions between different electronic states Ψk and Ψl within the framework of classical nuclear motion and the mean-field approximation of the coupled problem.

• The Ehrenfest method includes electron dynamics and requires there- fore a very short time step.

15.3.4 Car-Parrinello MD

Taking into account the strengths and weaknesses of BOMD and EMD, an ideal AIMD method would

1. integrate the equations of motion on long time scale, but also

2. take advantage of the smooth time evolution of the propagating elect- ronic wave function.

This is attempted in the Car-Parrinello method. The basic idea of this method can be viewed as a classical-mechanical adiabatic energy-scale sepa- ration performed on the fast electronic and slow nuclear motions. In order to do this, the energy of the electronic subsystem hΨ0|He|Ψ0i, which is a func- tion of {RI } is treated as a functional of the wave function Ψ0 and thus of a set of orbitals {φi}. In classical mechanics, the force on the nuclei is obtained from the deriva- tive of a Lagrangian with respect to {RI }. In a similar manner, a functional derivative with respect to {φi} yields correct force on the orbitals, given a suitably defined Lagrangian. To serve this purpose Car and Parrinello intro- duced the following class of Lagrangians: D E X 1 ˙ 2 X ˙ ˙ LCP = MI R + µ φi φi − hΨ0|He|Ψ0i + constraints . (15.19) 2 I | {z } I i | {z } orthonormality | {z } potential energy kinetic energy 15.3 Ab Initio MD 131

Correspondingly, equations of motion are obtained both for the nuclear po- sitions and the orbitals d ∂L ∂L d δL δL = , = , (15.20) ˙ ˙∗ ∗ dt ∂RI ∂RI dt δφi δφi which leads to the following equations of motion:

¨ ∂ ∂ MI RI (t) = − hΨ0|He|Ψ0i + {constraints} (15.21) ∂RI ∂RI ¨ δ δ µφi(t) = − ∗ hΨ0|He|Ψ0i + ∗ {constraints}. (15.22) δφi δφi Here µ is a fictitious mass assigned to the orbital degrees of freedom. According to the Car-Parrinello equations of motion, the nuclei evolve P ˙ 2 in time at a certain physical temperature ∝ MI R , whereas a „fictitious D E I I ∝ P µ φ˙ φ˙ temperature” i i i is associated with the electronic degrees of freedom. In this terminology, „low electronic temperature” or „cold electrons” means that the electronic subsystem is close to its instantaneous minimum energy, i.e. close to the exact Born-Oppenheimer energy surface. • A low fictitious temperature assures that the electronic subsystem is kept close to its ground state.

• Simultaneously, the nuclei must be kept at much higher temperatures.

• This is only possible if the energy transfer from the „hot nuclei” to the „cold electrons” remains practically impossible at the relevant time scales.

• This requires that the corresponding vibrational density of states do not substantially overlap.

Vibrational density of states of a elect- ronic system (continuous spectra) as compared to a harmonic approxima- tion (stick spectra) and the highest frequency phonon mode (triangle). He- re states are well separated. 16 Electronic Structure Methods 132

Still, the fictitious temperature oscillates around a constant value due to the drag caused by the movement of the nuclei, but these oscillations are several orders of magnitude smaller than what would affect the total energy of the system. Thus Car-Parrinello MD produces a constant energy for the relevant time scales, and thereby properly describes a microcanonical (NVE) system. In some cases heating of the electronic system can become a problem. For this situation two solutions have been proposed: • Separate Nosé-Hoover thermostats for electronic subsystem and nuclei, which keeps the electrons „cool”.

• Application of an additional constraint which prevents heating of the electronic system by the nuclei. A remaining question is if the forces acting on the nuclei correspond to the actual forces in the real system. When taking forces from well-converged Born-Oppenheimer MD simulations as a reference, it was found that Car- Parrinello forces at most instants deviate from these. However, the deviations were so small and oscillating within a few time steps that they were irrelevant for the simulation.

16 Electronic Structure Methods

For all types of AIMD we need to calculate the forces on the nuclei from ¨ MI RI = −∇I hΨ0|He|Ψ0i , (16.1) which essentially means solving the time independent electronic Schrödinger equation.

16.1 Hartree-Fock Method

Within the Hartree-Fock (HF) method the electronic wave function is repre- sented by a single Slater determinant

φ1(r1, σ1) φ1(r2, σ2) . . . φ1(rN , σN )

1 φ2(r1, σ1) φ2(r2, σ2) . . . φ2(rN , σN )

Φ = √ . . . . (16.2) N! . . .. .

φN (r1, σ1) φN (r2, σ2) . . . φN (rN , σN ) 16.1 Hartree-Fock Method 133 with φi(rj, σj) being single particle spin-orbital, which can be expressed as σ product of a spatial and a spin function φi(rj, σj) = ψi (rj)αi(σj). Spin- orbitals are also chosen to be orthonormal. The use of a Slater determinant instead of a simple product is required in order to fulfil the antisymmetry requirement due to the Pauli principle.

The expectation value of the Hamiltonian can now be written as

P R σ∗  1 2  σ hΦ|He|Φi = i,α drψi (r) − 2 ∇ + Uext(r) ψi (r) + EII

+ 1 P R drdr0ψσi∗(r)ψσj ∗(r0) 1 ψσi (r)ψσj (r0) 2 i,j,σi,σj i j |r−r0| i j (16.3)

1 P R 0 σ∗ 0 σ∗ 1 σ σ 0 − 2 i,j,σ drdr ψi (r )ψj (r) |r−r0| ψi (r)ψj (r ) with

• first line including sums over single particles

• second line containing the Coulomb interactions between two particles

• third line containing the exchange interactions between two particles of the same(!) spin.

The wave function is optimized by minimization of the expectation value. This gives the best single-determinant wave function for the system (con- strained by the basis functions used to represent the orbitals).

• Obtained orbitals can be interpreted using Koopman’s theorem: The eigenvalue of a filled orbital is equal to the change in energy, if an electron is subtracted from the system, keeping all other orbitals the same. I.e. the eigenvalue of an orbital can be seen as approximation for the ionization energy.

• Interactions between electrons are only included in an average way, the- refore correlation effects beyond electron exchange are neglected. Correlation always stabilizes a system, the HF energy is thus an upper limit for the exact energy.

• Correlation effects can be accounted for in post-HF methods by sys- tematically using additional Slater determinants in the construction of the wave function. This is computationally very demanding. 16.2 Density Functional Theory 134

16.2 Density Functional Theory

The use of density functional theory in electronic structure calculations is based on two theorems by Hohenberg and Kohn. It has since then developed to become the most widespread (set of) method(s) used in electronic structure calculations. The theorems are:

• For any system of interaction particles in Vext, the potential is defined uniquely, except for a constant, by the ground state particle density n0(r). Corollary: The ground state density uniquely determines the poten- tial, thus the Hamiltonian, and thereby the many-body wave functions for all states. Thus all properties of the system are determined by n0(r).

• A universal functional for the energy E[n] in terms of the density n(r) can be defined, valid for any external potential Vext. The exact ground state energy of the system is the global minimum value of this functio- nal, and the density which minimizes the functional is the exact ground state density n0(r). Corollary: The functional E[n] alone is sufficient to determine the exact ground state energy and density.

This allows us in principle to derive all properties of the system directly from the electron density without having to solve the Schrödinger equation.

• While the many-body wave function of N particles depends on 3N variables, the electron density in principle depends only on 3 spatial coordinates.

However, even though the existence of a functional connecting the electron density to the energy has been proven,

• the form of the functional is not known,

• and no method has been given to find the functional.

Still, a huge number of approximate functionals have been developed that give very good results. 16.2 Density Functional Theory 135

16.2.1 Kohn-Sham Theory

• Nearly all practically relevant functionals are based on the Kohn-Sham (KS) ansatz.

The largest problem in early DFT has been the representation of the kinetic energy of the electrons. The idea of the KS formalism is to split the kinetic energy into two terms - one that can be calculated exactly, and a small correction term. • The electron density of the original interacting system is equal to that of some arbitrary non-interacting system.

• The kinetic energy of the non-interacting system can be exactly calcu- lated. The exact kinetic energy of the non-interacting system of N electrons is given as N 1 X 2 TS = − ψi ∇ ψi (16.4) 2 i=1 However, this calculations requires the use of orbitals again, thus the calcula- tion depends on 3N coordinates again. These orbitals (denoted Kohn-Sham orbitals) are not identical with orbitals derived from Hartree-Fock theory and lack strictly speaking physical meaning. The classical Coulomb energy can be directly calculated from the electron density 1 Z n(r)n(r0) J[n] = drdr0 (16.5) 2 |r − r0| The total electronic energy can now be written as

EDFT[n] = TS[n] + Ene[n] + J[n] + Exc[n] (16.6) with the exchange-correlation energy Exc[n] being the difference of the kinetic and internal interaction energies between the true and the fictitious non- interacting system.

Exc[n] = (T [n] − TS[n]) + (Eee[n] − J[n]) (16.7)

So, now only a correct functional Exc[n] is needed in order to give the exact ground state energy and electron density. Unfortunately this is not known. But the portion of the total energy that has to be approximated is much smaller than without the Kohn-Sham method. 16.2 Density Functional Theory 136

• DFT wouldn’t have acchieved it’s current status without practical, ap- proximate functionals, which are possible because of the Kohn-Sham ansatz, which separates the exchange-correlation functional from other interactions.

• Even though the exact functional Exc[n] must be very complex, great progress has been made with rather simple approximations.

• Unfortunately, no systematic way exists to improve the results (as there is in HF theory by including additional determinants).

16.2.2 Functionals

• Local (Spin) Density Approximation (L(S)DA) The local spin density approximation is based on the assumption that the system can locally be treated as an uniform electron gas. For this case the exchange energy is known exactly. Z LSDA 1/3 X 4/3 Ex [n] = −2 Cx nσ (r)dr (16.8) σ

Also, the correlation energy has been derived for the high and low den- sity limit; for intermediate densities several different parametrizations exist.

– LSDA is exact for uniform electron gas. – Can be expected to work for metals with nearly-free electrons. – For system with strongly varying electron density (like molecules) LSDA often fails dramatically.

• Generalized Gradient Approximation (GGA) Improvements over LSDA must consider variations in the electron den- sity. A step in this direction is to make the exchange and correlation energies dependent not only on the electron density, but also on de- rivatives thereof. Straightforward inclusion of terms depending on the first derivative, however, leads often to worse results than the uncorrec- ted functional. Generalized gradient approximation functionals include first derivatives together with terms ensuring correct behaviour. 16.2 Density Functional Theory 137

– Many GGA functionals give reasonably good results for chemically complex systems. – Common exchange functionals include B (or B88) and OPTX. – Common correlation funcitonals are LYP, PW86, PW91, and PBE.

• Meta-GGA functionals A logical extension of the GGA is the inclusion of higher order deriva- tives into the functional form. These functionals are called meta-GGA functionals. Commonly used functional of this group is B95 and TPSS.

• Hybrid functionals Hybrid functionals approximate part of the exchange energy using the exchange energy of the Kohn-Sham orbital Slater determinant as obtai- ned from Hartree-Fock theory. The ratio between this exact exchange and exchange energy from LSDA or GGA functionals that is to be used in a hybrid functional is often obtained in a fitting process. The extremely common B3LYP functional belongs to this category.

16.2.3 Basis Sets & Pseudopotentials

While in calculations on isolated molecules, usually atom centred basis func- tions are used to generate orbitals, this approach is not not practical for extended (infinite) systems, like a box with periodic boundary conditions. In these the use of plane wave functions

ik·r χk(r) = e (16.9) is more adequate. This way, the number of basis functions required to describe a system depends only on the dimensions of the periodic cell, and does not grow linearly with the system size. Plane wave functions are ideal for describing delocalized slowly varying electron densities, such as valence bands in metals. Core electrons, howe- ver, are strongly localized around the nucleus and valence orbitals have a number of rapid oscillations in the core region. Describing the core region appropriately would thus require a large number of rapidly oscillating func- tions. Therefore, plane wave basis sets need to be used in combination with pseudopotentials for smearing out the nuclear charge and modelling the effect of the core electrons. 16.2 Density Functional Theory 138

Requirements for a „good” pseudopotential are

• All-electron and pseudo valence eigenvalues agree.

• Wave functions agree beyond a chosen Rc.

• Logarithmic derivatives agree at Rc.

• The integrated charge inside Rc for each wave function agrees (norm- conservation).

• First energy derivative of the logarithmic derivatives of the wave func- tions agree at all r ≥ Rc.

Especially the projector augmented wave (PAW) formulation of pseudopo- tentials has made them appropriate for DFT calculations of total energies and forces. 16.3 Scaling of Methods 139

16.3 Scaling of Methods

Summary

Comparison of the different AIMD equations√ of motion for a single-determinant electronic structure method, Ψ0 = 1/ N!det{ψi}. The Λij employs con- straints on the electronic structure.

AIMD Nuclei Electronic structure ¨ P BO MI RI (t) = −∇I min{φi}{hΨ0|He|Ψ0i} 0 = −Heφi + j Λijφj ¨ ¨ P CP MI RI (t) = −∇I hΨ0|He|Ψ0i µφi(t) = −Heφi + j Λijφj ¨ ˙ E MI RI (t) = −∇I hΨ0|He|Ψ0i ih¯Ψ0(t) = −HeΨ0

• BO uses the ground state electronic structure, solved self-consistently for each positions of the nuclei.

• CP employs fictitious dynamics for the electronic structure, which en- sures propagation from one time step to the next so that the electronic subsystem remains close to the ground state (cool electrons).

• E relies on true QM dynamics for the electronic subsystem. 16.3 Scaling of Methods 140

The forces needed for AIMD can be generated using a variety of methods of electronic structure calculation.

• HF theory gives the best possible solution of the time-independent Schrödinger equation that can be represented by a single Slater deter- minant. Except for electron exchange, no correlation effects are inclu- ded.

• Results from HF theory can be systematically improved by inclusion of additional determinants. This is however computationally very expen- sive.

• DFT provides a different (although related) approach to electronic structure calculations, including exchange and correlation in a com- putationally cheap way. A large number of functionals have been sug- gested, many giving good results for many systems. However, there is no systematic way to improve results.

• Electronic structure calculations rely on basis functions (forming a basis set) for the representation of orbitals. For periodic systems plane wave basis sets are advisable; these should be combined with appropriate pseudopotentials.