First-principles Molecular Dynamics Simulations François Gygi University of California, Davis fgygi@ucdavis.edu http://eslab.ucdavis.edu http://www.quantum-simulation.org MICCoM Computational School, Jul 17-19, 2017 1
Outline Molecular dynamics simulations Electronic structure calculations First-Principles Molecular Dynamics (FPMD) Applications 2
Molecular Dynamics An atomic-scale simulation method Compute the trajectories of all atoms extract statistical information from the trajectories Atoms move according to Newton s law: m i!! Ri = F i
Molecular dynamics: general principles Integrate Newton s equations of motion for N atoms m!! i Ri (t) = F i (R 1,, R N ) i =1,, N F i (R 1,, R N ) = i E(R 1,, R N ) Compute statistical averages from time averages (ergodicity hypothesis) A = Ω dr 3N dp 3N A(r, p)e βh (r,p) 1 T A(t)dt Examples of A(t): potential energy, pressure, T 0
Simple energy model Model of the hydrogen molecule (H 2 ): harmonic oscillator E(R 1, R 2 ) = E( R 1 R 2 ) = α( R 1 R 2 d 0 ) 2 This model does not describe intermolecular interactions
Simple energy model Model of the hydrogen molecule including both intra- and intermolecular interactions: E(R 1,, R N ) = E intra ( R i R j ) + E inter ( R i R j ) {i, j} M i M j M ' This model does not describe adequately changes in chemical bonding
Simple energy model Description of the reaction H 2 +H H + H 2 The model fails!
What is a good energy model?
Atomistic simulation of complex structures Complex structures Nanoparticles Assemblies of nanoparticles Embedded nanoparticles Liquid/solid interfaces 9
A difficult case: Structural phase transitions in CO 2 Molecular phases polymeric phase
The energy is determined by quantum mechanical properties First-Principles Molecular Dynamics: Derive interatomic forces from quantum mechanics Ni-tris(2-aminoethylamine)
First-Principles Molecular Dynamics Monte Carlo Molecular Dynamics Statistical Mechanics FPMD Electronic Structure Theory Quantum Chemistry Density Functional Theory R. Car and M. Parrinello (1985) 12
Electronic structure calculations Problem: determine the electronic properties of an assembly of atoms using the laws of quantum mechanics. Solution: solve the Schroedinger equation!
The Schroedinger equation for N electrons A partial differential equation for the wave function ψ: r i R 3, ψ L 2 (R 3N ) i! t ψ(r 1,, r N,t) = H(r 1,, r N,t) ψ(r 1,, r N,t) H is the Hamiltonian operator: H 2! 2 r1,, rn, t) = i + V ( r,, rn, t) 2m ( 1 i
The time-independent Schroedinger equation If the Hamiltonian is time-independent, we have ψ(r 1,, r N,t) = ψ(r 1,, r N ) e iet/! where ψ(r) is the solution of the timeindependent Schroedinger equation: H( r,, rn ) ψ ( r1,, rn ) = Eψ ( r1,, r 1 N ) energy
Solving the Schroedinger equation The time-independent Schroedinger equation can have many solutions: H(r 1,, r N )ψ n (r 1,, r N ) = E n ψ n (r 1,, r N ) n = 0,1, 2 The ground state wave function ψ 0 describes the state of lowest energy Ε 0 Excited states are described by ψ 1, ψ 2,.. and have energies Ε 1, Ε 2,.. > Ε 0
Hamiltonian operator for N electrons and M nuclei Approximation: treat nuclei as classical particles Nuclei are located at positions R i, electrons at r i H(r 1,, r N, R 1,, R M ) =!2 2m e N 2 i i=1 N M i=1 j=1 Z j e 2 r i R j + M Z + i Z j e 2 + 1 M M! 2 i R i R i R j 2 i< j i=1 N i< j e 2 r i r j
The adiabatic approximation The Hamiltonian describing an assembly of atoms is time-dependent because atoms move: ) ( )) ( ( ), ( ), ( 2 ), ( e-e ion 2 2 r r r r V t R r V t V t V m t H j j i i + = + =! time-dependence through ionic positions
The adiabatic approximation If ions move sufficiently slowly, we can assume that electrons remain in the electronic ground state at all times ψ ( r, t) = ψ ( r) H ( r,{ Ri ( t)}) ψ 0( r) = 0 E ψ ( r) 0 0 Ground state energy Ground state wave function
Mean-field approximation The problem of solving the N-electron Schroedinger equation is formidable (N! complexity). Wave functions must be antisymmetric (Pauli principle) Assuming that electrons are independent (i.e. feel the same potential) reduces this complexity dramatically. The potential is approximated by an average effective potential ),,,,,, ( ),,,,,, ( 1 1 N i j N j i r r r r r r r r ψ ψ = exchanged ),, ( ),, ( ),, ( 1 1 1 N n n N n N E H r r r r r r ψ ψ =
Independent particles, solutions are Slater determinants A Slater determinant is a simple form of antisymmetric wave function : ψ ( r 1,, r N ) = det{ ϕ i ( r j )} The one-particle wave functions ϕ i satisfy the one-particle Schroedinger equation: h( r) ϕ ( r) h( r) i = ε ϕ ( r) 2! = 2m i 2 i + V eff ( r) Note: effective potential
Electron-electron interaction H(r 1,, r N, R 1,, R M ) =!2 2m e N 2 i i=1 N M i=1 j=1 Z j e 2 r i R j + M Z + i Z j e 2 + 1 M M! 2 i R i R i R j 2 i< j i=1 N i< j e 2 r i r j
Density Functional Theory Introduced by Hohenberg & Kohn (1964) Chemistry Nobel prize to W.Kohn (1999) The electronic density is the fundamental quantity from which all electronic properties can be derived E = E ρ [ ] E [ ρ] = T [ ρ] + V(r)ρ(r)dr + E xc ρ [ ] Problem: the functional E[ρ] is unknown!
The Local Density Approximation Kohn & Sham (1965) E ρ [ ] = T ρ [ ] + V Approximations: (r)ρ(r)dr + E xc ρ [ ] The kinetic energy is that of a non-interacting electron gas of same density The exchange-correlation energy density depends locally on the electronic density E xc = E xc [ ρ(r) ] = ε xc (ρ(r))ρ(r)dr
The Local Density Approximation V e-e = ρ( r!) r r! d r! +V (ρ(r)) XC The mean-field approximation is sometimes not accurate, in particular for strongly correlated electrons excited state properties
The Kohn-Sham equations Coupled, non-linear, integro-differential equations: ( Δφ i +V(ρ, r)φ i = ε i φ i i =1 N el * * ρ( r #) V(ρ, r) = V ion (r)+ r r# d r # +V XC (ρ(r), ρ(r)) * ) N el * ρ(r) = φ i (r) 2 * i=1 * + * φ i (r)φ j (r)dr = δ ij
Numerical methods Basis sets: solutions are expanded on a basis of N orthogonal functions φ i (r) = N c ij ϕ j (r) j=1 ϕ j (r)ϕ k (r) = δ jk Ω R 3 Ω The solution of the Schroedinger equation reduces to a linear algebra problem
Numerical methods: choice of basis Gaussian basis (non-orthogonal) ϕ i (r) = e α i r R 2 Plane wave basis (orthogonal) ϕ q (r) = e iq R Other representations of solutions: values on a grid finite element basis
Numerical methods: choice of basis Hamiltonian matrix: H ij = ϕ i H ϕ j = ϕ i (r) Hϕ j (r) Ω d 3 r Schroedinger equation: an algebraic eigenvalue problem Hc n = ε n c n c n C N
Numerical methods: choice of basis Non-orthogonal basis sets lead to generalized eigenvalue problems S ij = φi φ j = Ω i φ ( r) φ ( r) j d 3 r δ ij Hc n = ε n Sc n c n C N
Solving large eigenvalue problems The size of the matrix H often exceeds 10 3-10 4 Direct diagonalization methods cannot be used Iterative methods: Lanczos type methods subspace iteration methods Many algorithms focus on one (or a few) eigenpairs Electronic structure calculations involve many eigenpairs (~ # of electrons) robust methods are necessary
Solving the Kohn-Sham equations: fixed-point iterations The Hamiltonian depends on the electronic density ( Δφ i +V(ρ, r)φ i = ε i φ i i =1 N el * * ρ( r #) V(ρ, r) = V ion (r)+ r r# d r # +V XC (ρ(r), ρ(r)) * ) N el * ρ(r) = φ i (r) 2 * i=1 * + * φ i (r)φ j (r)dr = δ ij
Self-consistent iterations For k=1,2, Compute the density ρ k Solve the Kohn-Sham equations The iteration may converge to a fixed point
Simplifying the electron-ion interactions: Pseudopotentials The electron-ion interaction is singular V e-ion (r) = Ze2 r R Only valence electrons play an important role in chemical bonding Valence electrons core electrons
Simplifying the electron-ion interactions: Pseudopotentials The electron-ion potential can be replaced by a smooth function near the atomic core " $ V e-ion (r) = Ze2 # r R $ % f ( r R ) r R > r cut r R < r cut Core electrons are not included in the calculation (they are assumed to be "frozen")
Pseudopotentials: Silicon Solutions of the Schroedinger equation for Si including all electrons (core+valence): ψ 3s ψ 3p Potential = -Z/r Core Valence wavefunctions
Pseudopotentials: Silicon Solutions of the Schroedinger equation for Si including all electrons (zoom on core region): rψ 1s rψ 2s rψ 2p Potential = -Z/r Core region
Pseudopotentials: Silicon The electron-ion potential can be replaced by a smooth function near the atomic core ψ 3s ψ 3p pseudopotentials -Z/r Core Valence wavefunctions
Summary: First-principles electronic structure Time-independent Schroedinger equation Mean-field approximation Simplified electron-electron interaction: Density Functional Theory, Local Density Approximation Simplified electron-ion interaction: Pseudopotentials
Molecular dynamics: Computation of ionic forces Hamiltonian: H(λ) Hellman-Feynman theorem: if ψ 0 (λ) is the electronic ground state of H(λ) E λ λ0 = λ ψ 0 (λ) H(λ) ψ 0 (λ) = ψ 0 (λ 0 ) H(λ) λ λ0 ψ 0 (λ 0 ) For ionic forces: λ=r i (ionic positions) F i = E R i = ψ 0 H ψ 0 = ψ 0 V e-ion (r R j ) ψ 0 R i R i j
Integrating the equations of motion: the Verlet algorithm The equations of motion are coupled, second order ordinary differential equations Any ODE integration method can be used Time-reversible integrators are preferred The Verlet algorithm (or leapfrog method) is time-reversible x(t + Δt) = 2x(t) x(t + Δt) + Δt 2 m F(x(t))
Integrating the equations of motion: the Verlet algorithm Derivation of the Verlet algorithm: Taylor expansion of x(t) x(t + Δt) = x(t) + Δt dx dt + Δt 2 2 x(t Δt) = x(t) Δt dx dt + Δt 2 2 d 2 x dt + Δt 3 2 6 d 2 x dt Δt 3 2 6 d 3 x dt +O(Δt 4 ) 3 d 3 x dt +O(Δt 4 ) 3 Add the two Taylor expansions: x(t + Δt) + x(t Δt) = 2x(t) + Δt 2 d 2 x dt 2 +O(Δt 4 )
Integrating the equations of motion: the Verlet algorithm use Newton s law m d 2 x dt 2 = f (x(t)) x(t + Δt) + x(t Δt) = 2x(t) + Δt 2 d 2 x dt 2 +O(Δt 4 ) x(t + Δt) = 2x(t) x(t Δt) + Δt 2 m F(x(t)) +O(Δt 4 )
First-Principles Molecular Dynamics Molecular Dynamics Density Functional Theory m i d 2 dt 2 R i = F i FPMD ( Δ +V eff )ϕ i (x) = ε i ϕ i (x) ( ) = ϕ i (x) 2 ρ x n i=1 Newton equations Kohn-Sham equations R. Car and M. Parrinello (1985) 44
FPMD: the Recipe Choose a starting geometry: atomic positions Choose an exchange-correlation functional Choose appropriate pseudopotentials Run! Publish!! 45
FPMD: the Recipe Choose a starting geometry: atomic positions Choose an exchange-correlation functional Choose appropriate pseudopotentials Run! Publish!! Test! Test sensitivity to starting geometry, finite size effects Test sensitivity to duration of the simulation Test accuracy of the basis set Test choice of exchange-correlation functionals Test accuracy of pseudopotentials 46
First-Principles Molecular Dynamics applications Solid state physics Surface physics Nanotechnology High pressure physics Chemical Physics Biochemistry Mechanisms of drug action Solvation processes The absence of empirical parameters makes this approach widely applicable and predictive.
Nanoparticles Exploration of multiple locally stable structures Electronic properties at finite temperature Cd 34 Se 34 48
Embedded nanoparticles, Liquids and Liquid-Solid Interfaces assemblies of nanoparticles Annealing of structures at finite temperature Calculation of band gaps and band alignments Si/ZnS S. Wippermann, M. Vörös, A. Gali, F. Gygi, G. Zimanyi, G.Galli, Phys. Rev. Lett. 112, 106801 (2014).
Liquids and Liquid-Solid Interfaces Structure of water at the interface Electronic structure band alignment of bulk solid and liquid Spectroscopy IR and Raman spectra H 2 O/Si(100)H 50
Liquid-solid interfaces Water on oxide surfaces H 2 O/WO 3 Simulation of surface relaxation and dynamics structure of defects electronic structure spectroscopic signature of water at the interface H 2 O/WO 3 51
Electronic properties: Polarization The electronic polarization (per unit cell) of an infinite periodic system is ill-defined P = 1 % Ω e Z R ( ' l l + rρ(r) dr* & ) l P depends on the choice of origin The change in polarization caused by a small perturbation is well defined The electric current caused by a perturbation (e.g. a deformation) can be computed R. Resta, Rev. Mod. Phys. 66, 899 (1994). 52
Electronic properties: Polarization The electronic polarization (per unit cell) of an infinite periodic system is ill-defined P = 1 % Ω e Z R ( ' l l + rρ(r) dr* & ) l P depends on the choice of origin The change in polarization caused by a small perturbation is well defined The electric current caused by a perturbation (e.g. a deformation) can be computed R. Resta, Rev. Mod. Phys. 66, 899 (1994). 53
Wannier functions A set of localized orbitals that span the same subspace as the Kohn-Sham eigenvectors minimize the spread σ 2 = φ ( x φ x φ ) 2 φ Wannier centers: centers of charge of each Wannier function Polarization can be expressed in terms of the centers P = 1 % Ω e Z ( ' lr l + e r w n (r) dr* & ) l n N. Marzari, A. Mostofi, J. Yates, I. Souza and D. Vanderbilt, Rev. Mod. Phys. 84, 1419 (2012). 54
Time-dependent polarization of nanoparticles PBE DFT MD 300K dt=1.9 fs Cd 34 Se 34 12 Debye 55
IR Spectroscopy IR spectra during MD simulations Autocorrelation function of P(t) ( ) = 2πω 2 β 3cVn ( ω) α ω e iωt P µ ( 0) P ν ( t) µν dt 56
Raman Spectroscopy Compute the polarizability at each MD step Use Density Functional Perturbation Theory (Baroni, Giannozzi, Testa, 1987) Use a finite-difference formula with P(t) and finite field 57
On-the-fly Computation of Raman spectra (D 2 O) 64 Position of O-D stretching band: PBE functional yields a red shifted peak, compared to expt. Low frequency bands: satisfactory agreement with expt. Peak Intensities in good agreement with expt. Q. Wan, L. Spanu, G. Galli, F. Gygi, JCTC 9, 4124 (2013)
Solving the Kohn-Sham equations in a finite electric field In finite systems: add a linear potential H KS = p2 2m +V(r) eex The spectrum is not bounded below (no "ground state") In periodic systems: define the electric enthalpy: F φ [ ] = E KS φ [ ] ΩP φ [ ] E I. Souza, J. Iniguez, D. Vanderbilt, Phys. Rev. Lett. 89, 117602 (2002). 59
Si(100):H-H2O interface DFT MD of the Si/H2O interface under finite field Si(100)-(3x3):H-H2O, canted dihydride surface termination, 116 water molecules Analysis of time-dependent polarization Comparison with IR spectra L. Yang, F. Niu, S. Tecklenburg, M. Pander, S. Nayak, A. Erbe, S. Wippermann, F. Gygi, G. Galli 60
Validation of DFT: PBE vs PBE0 vs Oxygen-oxygen pair correlation function in (H 2 O) 32 PBE (439±29K) PBE (367±25K) PBE0 (438±29K) PBE0 (374±27K) Exp (300K) C.Zhang, D.Donadio, F.Gygi, G.Galli, JCTC 7, 1443 (2011) 61
Is my simulation reproducible? D 2 O Power spectrum of ionic velocities (32 x 10 ps runs) 0.25 0.2 intensity (arb. units) 0.15 0.1 0.05 0 2000 2200 2400 2600 2800 3000 frequency(cm -1 ) 62
Validating/comparing levels of theory Need for (quantitative) statistical analysis compute confidence intervals An accurate determination of structural and electronic properties requires multiple uncorrelated simulations Autocorrelation times may vary for different quantities Example: the PBE400 dataset First-principles MD simulations of water http://www.quantum-simulation.org/reference/h2o/pbe400 63
Summary Basic features of FPMD Approximations of electronic structure calculations Extensions: polarization, finite electric field Applications Next FPMD steps: Today 1:45 pm: Qbox tutorial Tomorrow 1:30 pm: Qbox hands-on exercises 64