The Nuts and Bolts of FirstPrinciples Simulation Lecture
The Nuts and Bolts of First-Principles Simulation Lecture 18: First Look at Molecular Dynamics Durham, 6 th-13 th December 2001 Nuts and Bolts 2001 CASTEP Developers’ Group with support from the Lecture 18: �First look ESF at MD k Network
Overview of Lecture r Why bother? r What can you it tell you? r How does it work? r Practical tips r Future directions r Conclusions Nuts and Bolts 2001 Lecture 18: �First look�at MD 2
Why Bother? Atoms move! r Time dependant phenomena r l l r Ionic vibrations (phonons, IR spectra, etc) Diffusion, transport, etc. Temperature dependant phenomena l l Equilibrium thermodynamic properties Catalysis and reactions Free energies Temperature driven phase transitions, melting, etc Nuts and Bolts 2001 Lecture 18: �First look�at MD 3
Radiation damage in zircon T=300 K Nuts and Bolts 2001 T=600 K Lecture 18: �First look�at MD 4
Na+ diffusion in quartz Nuts and Bolts 2001 Lecture 18: �First look�at MD 5
What Can It Tell You? r Ensemble Averages l r Correlation Functions l l r Time dependent, e. g. velocity auto-correlation function Cvv(t) Spatially dependent, e. g. radial distribution function g(r) Fluctuations l r Temperature, pressure, density, configuration energy, enthalpy, structural correlations, time correlations, elastic properties, etc. Energy fluctuations Cv, enthalpy fluctuations Cp, etc. Distribution Functions l E. g. velocity distribution function, energy distribution function, etc. Nuts and Bolts 2001 Lecture 18: �First look�at MD 6
Velocity Auto-Correlation Function Cvv 1 Gas 0 t Solid Liquid Nuts and Bolts 2001 Lecture 18: �First look�at MD 7
Radial Distribution Function g(r) Solid Liquid 1 Gas 0 Nuts and Bolts 2001 1 2 3 4 r/a 0 Lecture 18: �First look�at MD 8
How Does It Work? r Classical dynamics of ions using ab initio forces derived from the electronic structure l l r Integrate classical equation of motion Discretise time step Different integration algorithms Trade-off time step n long-term stability vs. short-time accuracy Ergodic Hypothesis l l MD trajectory samples phase space time average = ensemble average Nuts and Bolts 2001 Lecture 18: �First look�at MD 9
Integration Algorithms (I) r Euler l r Runge-Kutta l r Excellent stability but too many force evaluations and not symplectic (time reversible) Predictor-Corrector l r Simplest method but unstable to error propagation Old CASTEP – not symplectic unsuitable for MD Verlet l l Position Verlet – not explicit velocities so using thermostats is not straightforward Velocity Verlet – current and new CASTEP Nuts and Bolts 2001 Lecture 18: �First look�at MD 10
Integration Algorithms (II) r Multiple time / lengths scale algorithms l l r Recent theoretical development Excellent results in special cases but hard to apply in general purpose code Car-Parrinello l l Combines electron and ion MD Time step dominated by electrons not ions Cannot handle metals Iterative ab initio methods such as CASTEP require more effort to minimize the electrons but compensate by taking larger time steps based upon ions – even better with constraints … Nuts and Bolts 2001 Lecture 18: �First look�at MD 11
Time Step r Should reflect physics not algorithm l l r e. g. smallest phonon period/10 Effects the conservation properties of system and longtime stability Typically ~ femto-sec for ab initio calculations Limitation on time scale of observations – total runlength ~pico-sec routine, nano-sec exceptional Use of constraints to increase time step l Freeze motions that are not of interest Nuts and Bolts 2001 Lecture 18: �First look�at MD 12
Types of MD r Micro-canonical l r = constant NVT Closer to experiment but need to add a thermostat Isobaric-Isothermal l r Simplest MD - purely Newtonian dynamics Canonical l r = constant NVE Closest to experimental conditions but need to add a barostat as well Grand Canonical l = constant NPT = constant m. VT Cannot do with ab initio MD but has been used with MC Nuts and Bolts 2001 Lecture 18: �First look�at MD 13
Micro-Canonical Ensemble r Suitable for investigating time dependent phenomena l E. g. simple way to sample a single normal modes/ vibrational frequency of complex systems n Set temperature=0 n Tweak relevant bond n Watch the system evolve Nuts and Bolts 2001 Lecture 18: �First look�at MD 14
Nuts and Bolts 2001 Lecture 18: �First look�at MD 15
Canonical Ensemble r Ensemble of choice for investigating finite temperature phenomena l l E. g. diffusion n Set appropriate temperature, let system evolve and monitor MSD E. g. vibrational spectra n Set appropriate temperature, let system evolve and calculate Fourier transform of velocity autocorrelation function Nuts and Bolts 2001 Lecture 18: �First look�at MD 16
Choice of Thermostat r Velocity rescaling l l r Nosé-Hoover l l r Simple, but breaks the smooth evolution of the system and without theoretical foundation Not used in CASTEP Couples system to external heat bath using an auxiliary variable Deterministic evolution but not always ergodic Langevin l l Based on fluctuation-dissipation theorem and coupling to an external heat bath Stochastic evolution but always ergodic Nuts and Bolts 2001 Lecture 18: �First look�at MD 17
Nosé-Hoover Thermostat (I) r Extended Lagrangian and Hamiltonian r Modified equations of motion Nuts and Bolts 2001 Lecture 18: �First look�at MD 18
Nosé-Hoover Thermostat (II) r Need to specify thermostat ‘mass’ Q l l Choose Q so as to cause thermostat-system coupling frequency to resonate with characteristic frequency of system – tricky! New CASTEP – input coupling frequency instead and code then estimates appropriate Q Nuts and Bolts 2001 Lecture 18: �First look�at MD 19
Nuts and Bolts 2001 Lecture 18: �First look�at MD 20
Langevin Thermostat (I) r Modified equation of motion r Fluctuation r Has proper statistical properties, e. g. thermal fluctuations of system obey Nuts and Bolts 2001 Lecture 18: �First look�at MD 21
Langevin Thermostat (II) r Time-scale of thermal fluctuations depends on the Langevin damping time t. L l r Need to choose s. t. t. L is greater than the characteristic period tc of the system s. t. short-time dynamics is accurately reproduced “Rule of 10 s” l l l Choose time step s. t. tc dt *10 Choose Langevin damping time s. t. t. L tc*10 Choose run length s. t. trun t. L*10 Nuts and Bolts 2001 Lecture 18: �First look�at MD 22
Nuts and Bolts 2001 Lecture 18: �First look�at MD 23
Influence of Electronic Minimizer r All-Bands l l r Density Mixing l l r Variational minimization accurate forces Problems with metals Non-variational minimization need higher accuracy Y to get same accuracy forces and need to correct forces less accurate MD OK with metals Ensemble DFT l l Variational minimization accurate forces Great with metals Nuts and Bolts 2001 Lecture 18: �First look�at MD 24
Wavefunction Extrapolation (I) r Advantages l l r Generate better guess for Y at new ionic configuration Less work for electronic minimizer faster Assumes can extrapolation Y forwards in time in similar manner to ionic positions l l Can either do first or second order extrapolation Can either used fixed values for (a, b) or those which minimize difference between MD and extrapolated coordinates Nuts and Bolts 2001 Lecture 18: �First look�at MD 25
Wavefunction Extrapolation (II) x Y- Y 0 t Y+ Nuts and Bolts 2001 Lecture 18: �First look�at MD 26
Wavefunction Extrapolation (III) r All bands / Ensemble DFT l r Extrapolate Y only Density-Mixing l l Must extrapolate Y and independently else Residual = 0 and not ground state! Decompose into atomic and non-atomic contributions Move the atomic charges onto the new ionic coordinate Extrapolate the non-atomic part only Nuts and Bolts 2001 Lecture 18: �First look�at MD 27
Nuts and Bolts 2001 Lecture 18: �First look�at MD 28
Practical Tips (I) r Equilibration l l Sensitivity of system to initial conditions Depends on quantity of interest E. g. if after equilibrium average, then must allow system to evolve to equilibrium before start data collection Auto-correlation functions give useful information on the “memory” of the system to the quantity of interest. Nuts and Bolts 2001 Lecture 18: �First look�at MD 29
equilibration Nuts and Bolts 2001 production Lecture 18: �First look�at MD 30
Practical Tips (II) r Sampling l l l It is very easy to over-sample the data and consequently under-estimate the variance Successive configurations are highly correlated - not independent data points Need to determine optimal sampling frequency of the quantity of interest ‘A’ and either save data at appropriate intervals or adjust error bars need to analyse variance in blocks of size tb Nuts and Bolts 2001 Lecture 18: �First look�at MD 31
Practical Tips (III) Nuts and Bolts 2001 Lecture 18: �First look�at MD 32
Future Directions r Isothermal-Isobaric Ensemble l l Variable cell MD Allow cell size and shape to evolve under internal stress and external pressure Closest to experimental conditions Important for generic phase transitions Nuts and Bolts 2001 Lecture 18: �First look�at MD 33
Conclusions r Two ensembles can be simulated in CASTEP using Velocity Verlet integration l Large time step, excellent long term energy conservation and stability Micro-Canonical (NVE) r Canonical (NVT) r l l r Nosé-Hoover thermostat – deterministic Langevin thermostat – stochastic Can be used to study many phenomena - see later talks for example applications! Nuts and Bolts 2001 Lecture 18: �First look�at MD 34
- Slides: 34