hybrid qm/mm and related electronic structure methods ...jnh / lecture 1 3 • minimization in qm/mm...

17
Hybrid QM/MM and Related Electronic Structure Methods: Lecture 3 Jeremy Harvey Winter School in Multiscale Modeling December 1-12 2014, KTH Stockholm

Upload: others

Post on 29-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Hybrid QM/MM and Related Electronic Structure Methods: Lecture 3 Jeremy Harvey Winter School in Multiscale Modeling December 1-12 2014, KTH Stockholm

Page 2: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Lectures 3-4: Exploring QM/MM Potential and Free Energy Surfaces

JNH / Lecture 1 2

•  Energy minimization with QM/MM •  Reaction path methods •  Simulation with QM/MM •  Umbrella Sampling and related approaches •  Combining MM and QM/MM

Page 3: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Energy Minimization with QM/MM

JNH / Lecture 1 3

•  Minimization in QM/MM is possible for methods where the overall gradient is available

•  To minimize the whole system takes roughly N steps •  Best to use micro-iterations, so that many more steps are

carried out for the MM region for each step in the QM region •  Especially where this is not available, best to start by carrying

out MM minimization – perhaps freezing QM atoms •  The computational expense is rather similar to that of

minimization of the QM system alone •  A variety of algorithms can be used: Newton-Raphson, conjugate

gradients, steepest descent

Page 4: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Energy Minimization Reaches Local Minima

JNH / Lecture 1 4

•  Starting from a given structure, one reaches a local minimum (typically the ‘closest’ one)

•  A system with N atoms typically has a potential energy surface with ~exp(αN) local minima – a large number!!

•  There are also large numbers of saddle points •  One typically cannot find the global minimum, or the lowest

energy saddlepoint – unlike for systems with ~10s of atoms •  This is not a difficulty limited to QM/MM – it is rather a

property of large systems (MM, semiempirical, large QM)

CA CB CC

CD

Page 5: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Characterizing Minima

JNH / Lecture 1 5

•  For molecular systems, optimization is typically followed by calculating frequencies.

•  These require the Hessian, i.e. the terms:

@V 2QM

@Xi@Xj

@V 2MM

@Xi@Xj

@V

2MM

@xi@Xj

@V

2MM

@xi@xj

@V

2QM

@xi@xj

@V

2QM

@xi@Xj

Page 6: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Full and partial Hessian

JNH / Lecture 1 6

•  The full Hessian may be unavailable, or too large to store or diagonalize (e.g. 10,000 atoms => 30,000 x 30,000)

•  Also, typically in QM/MM, some atoms may be frozen during optimization => typically one does not have a minimum

•  Gradient norm not arbitrarily close to zero, so ‘frequencies’ for rotational modes may not be that close to zero.

•  It can be useful to diagonalize a block sub-Hessian (see Efficient Calculation of QM/MM Frequencies with the Mobile Block Hessian, Ghysels et al., JCTC 2011, 7, 496-514.)

•  Provided that eigenvectors for vibrational modes of interest (e.g. the reaction coordinate) are well within the block of atoms for which the Hessian is generated, then should be OK.

Page 7: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Reaction path study

JNH / Lecture 1 7

•  In molecular systems, a typical app- roach is to locate relevant minima for reactants, intermediates, products, then TSs separating them

•  This can be done also with QM/MM: algorithms for TS searching can be used more or less as such for QM/MM systems (using e.g. a partial block Hessian to guide the search)

•  The difficulty is that the particular minimum may not correspond to the TS located

•  The variance in energies of local minima typically exceeds the target relative energy.

TSA TSB TSC TSD

CA CB CC

CD

Page 8: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Reaction paths: Adiabatic mapping

JNH / Lecture 1 8

•  In order to obtain meaningful relative energies along e.g. a reaction path, one can use techniques such as adiabatic mapping

•  Special coordinate ‘q’ chosen •  Minima found for set of values

qi (enforced e.g. by adding harmonic term k(q-qi)2.

Page 9: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Adiabatic mapping Issues

JNH / Lecture 1 9

•  Works better than direct optimization of minimum + TS, provided q is well chosen and a small enough step Δq = qi+1 – qi is used.

•  A good choice of q is not always easy to make, and hysteresis can be a significant problem

•  This is almost always due to reaction path curvature: the reaction coordinate is poorly described by q in part of (or all…) of its length

•  The consequence is that smooth energy profiles are not always obtained – nor are energy profiles the same when q is scanned in both directions

Page 10: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Reaction path curvature

JNH / Lecture 1 10

Environment reorganization coordinate – smooth in free energy but not in potential energy

Reaction coordinate (~ smooth behaviour on energy surface)

Page 11: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Dealing with Reaction Path Curvature

JNH / Lecture 1 11

Reaction path curvature is a real phenomenon that needs to be captured by theoretical modeling One way to do this is to use reaction path optimization techniques that allow for curvature, e.g. the nudged elastic band method (NEB) However, for a genuine reaction path, the set of coordinates that change along the reaction path are usually local to one another Abrupt changes in atomic coordinates for atoms situated at large distance in the environment can also occur artefactually due to numerics of optimization For this reason, it is customary to freeze the coordinates of atoms ‘far’ from the reaction centre in adiabatic mapping and NEB

Page 12: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Nudged Elastic Bands

JNH / Lecture 1 12

Improved tangent estimate in the nudged elas- tic band method for finding minimum energy paths and saddle points, Henkelmann and Jónsson, J. Chem. Phys. 2000, 113, 9978-9985

For each image, one follows a modified gradient, the sum of a harmonic spring force in the direction tangent to reac- tion path, and the true gradient orthogonal to the tangent. This tangent direction is given by:

minima had dropped and the spacing between them in-creased enough to satisfy the stability condition, Eq. !6".Then the images at the minima were slowly pulled into placeby the spring force. In this way, chains with up to #80images were able to !slowly" converge. For more images, theminimization would not converge and some images werealways left in a jumble at the minima.

In order to further test the stability condition, the restor-ing force perpendicular to the path was doubled by settingAy!2. The stability condition predicts that a band with twicethe number of images, 24, will remain stable. Calculationsshowed that the band becomes unstable at 21 images. Thegood agreement between the simple prediction of Eq. !6" andthese simulations suggest that this is the correct origin of thekinks. The modified NEB method with the new tangent, pre-sented in the next section, converges well for both small andlarge numbers of images.

IV. THE NEW IMPLEMENTATION OF NEB

By using a different definition of the local tangent atimage i, the kinks can be eliminated. Instead of using boththe adjacent images, i"1 and i#1, only the image withhigher energy and the image i are used in the estimate. Thenew tangent, which replaces Eq. !2", is

!i!! !i" if Vi"1$Vi$Vi#1

!i# if Vi"1%Vi%Vi#1

, !8"

where

!i"!Ri"1#Ri , and !i

#!Ri#Ri#1 , !9"

and Vi is the energy of image i, V(Ri). If both of the adja-cent images are either lower in energy, or both are higher inenergy than image i, the tangent is taken to be a weightedaverage of the vectors to the two neighboring images. Theweight is determined from the energy. The weighted averageonly plays a role at extrema along the MEP and it serves tosmoothly switch between the two possible tangents !i

" and!i

# . Otherwise, there is an abrupt change in the tangent asone image becomes higher in energy than another and thiscan lead to convergence problems. If image i is at a mini-mum Vi"1$Vi%Vi#1 or at a maximum Vi"1%Vi$Vi#1 ,the tangent estimate becomes

!i!! !i"$Vi

max"!i#$Vi

min if Vi"1$Vi#1

!i"$Vi

min"!i#$Vi

max if Vi"1%Vi#1, !10"

where

$Vimax!max! "Vi"1#Vi", "Vi#1#Vi""

and !11"

$Vimin!min! "Vi"1#Vi", "Vi#1#Vi"".

Finally, the tangent vector needs to be normalized. With thismodified tangent, the elastic band is well behaved and con-verges rigorously to the MEP if sufficient number of imagesare included in the band.

Another small change from the original implementationof the NEB is to evaluate the spring force as

Fis" #!k! "Ri"1#Ri"#"Ri#Ri#1""!i !12"

instead of Eq. !5". This ensures equal spacing of the images!when the same spring constant, k, is used for the springs"even in regions of high curvature where the angle betweenRi#Ri#1 and Ri"1#Ri is large.

When this modified NEB method is applied to the sys-tem of Fig. 1 the band is well behaved as shown in Fig. 4.The energy and force of the NEB images is shown in Fig. 5along with the exact MEP obtained by moving along thegradient from the saddle point. The thin line though thepoints is an interpolation which involves both the energy andthe force along the elastic band. The details of the interpola-tion procedure is discussed in the Appendix.

The motivation for this modified tangent came from astable method for finding the MEP from a given saddle point.A good way to do this is to displace the system by someincrement from the saddle point and then minimize the en-ergy while keeping the distance between the system and thesaddle point configuration fixed. This gives one more pointalong the MEP, say M 1 . Then, the system is displaced againby some increment and minimized keeping the distance tothe point M 1 fixed, etc. The important fact is that the MEPcan be found by following force lines down the potentialfrom the saddle point, but never up from a minimum. If aforce line is followed up from a minimum, it will most likelynot go close to the saddle point. This motivated the choicefor the local tangent to be determined by the higher energyneighboring image in the NEB method.

A. Exchange diffusion process in Si crystalA particularly severe problem with kinks had been no-

ticed in calculations of self diffusion in a Si crystal. Forexample, one possible mechanism is the exchange of twoatoms on adjacent lattice sites.20 Both calculations usingDFT and empirical potentials could not converge the forcebecause of kinks. In calculations using 16 images and theTersoff potential,19 the force fluctuations remained at a level

FIG. 4. With the modified tangent, Eqs. !8"–!12", the nudged elastic bandmethod does not develop kinks and converges smoothly to the minimumenergy path !solid line".

9981J. Chem. Phys., Vol. 113, No. 22, 8 December 2000 Finding minimum energy paths and saddle points

Downloaded 08 Apr 2005 to 137.222.40.154. Redistribution subject to AIP license or copyright, see http://jcp.aip.org/jcp/copyright.jsp

X0, X1, X2, . . . , Xn�1, Xn

⌧i =Xi �Xi�1

|Xi �Xi�1|+

Xi+1 �Xi

|Xi+1 �Xi|

Page 13: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Simulation with QM/MM

JNH / Lecture 1 13

QM/MM potential energy surfaces can be used instead of MM forcefields to carry out simulations of extended systems For semiempirical QM/MM, this is more or less routine since the cost of the QM/MM energy and gradient is similar to that for MM For DFT, this is used occa- sionally, especially with AIMD-type DFT methods Typically, simulations are carried out in the NVT ensemble with large spherical models (~30 Å radius), and appropriate thermostats

F = ma@V (t)

@x

= F =�x(t ! t+�t)

�t

x(t) = v(t) =�x(t ! t+�t)

�t

Page 14: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Simulation: unbiased

JNH / Lecture 1 14

Unbiased simulation over a timescale Δt will lead to the observation processes with characteristic times smaller than Δt. The corresponding free energy barriers are related to Δt: Where kB is Boltzmann’s constant, h is Planck’s constant. At room temperature, this means that for Δt = 1 ps, processes with barriers of ~1 kcal/mol are witnessed; for Δt = 1 ns, ~ kcal/mol.

1

�t⇡ k =

kBT

hexp

✓��G‡

kBT

Page 15: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Free energy profiles

JNH / Lecture 1 15

During an unbiased simulation, the frequency with which particular values of a coordinate are observed can be related to the free energy along this coordinate (provided that other coordinates are well equilibrated on the timescale used): Where n(qi) is the number of times values of q close to qi are observed during the trajectory.

g(qi) = gref + kBT lnn(qi)

Page 16: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

Simulation: biased

JNH / Lecture 1 16

Unbiased simulations typically do not sample all relevant equilibration processes. In QM/MM, one is often interested in chemical reaction processes on ~ms timescale. Hence QM/MM simulations often use biased simulation techniques such as umbrella sampling, metadynamics, or related techniques. In umbrella sampling, simul- ations are performed with a set of umbrella biases around reference values qi

ref of the reaction coordinate. The resulting biased distributions of q can be unbiased to generate a potential of mean force along q.

V ! V +1

2kumb(q � qiref)

Page 17: Hybrid QM/MM and Related Electronic Structure Methods ...JNH / Lecture 1 3 • Minimization in QM/MM is possible for methods where the overall gradient is available • To minimize

QM/MM together with QM and MM

JNH / Lecture 1 17

Frequently QM/MM calculations are combined with QM and MM/MD calculations The QM calculations on a small ‘cluster’ of atoms, basically the QM region of the QM/MM calculations, provide a benchmark for the vacuum behaviour of the system The MM and especially MD simulations can be used to generate ensembles of starting configurations for QM/MM calculation. Typically standard MD simulation can access much longer timescales than sQM/MM simulations