The Nuts and Bolts of Frst-Prncples Smulaton Lecture 14: Forces and Stresses Durham, 6th-13th December 2001 CASTEP Developers Group wth support from the ESF ψ k Network
Overvew of Lecture Why bother? Theoretcal background CASTEP detals Symmetry and User Constrants Concluson Nuts and Bolts 2001 Lecture 14: Forces and Stresses 2
Why bother? (I) Structure optmsaton Mnmum energy corresponds to zero force Much more effcent than just usng energy alone Equlbrum bond lengths, angles, etc. Mnmum enthalpy corresponds to zero force and stress Can therefore mnmse enthalpy w.r.t. supercell shape due to nternal stress and external pressure Pressure-drven phase transtons Nuts and Bolts 2001 Lecture 14: Forces and Stresses 3
Why bother? (II) Molecular dynamcs Can do classcal dynamcs of ons usng forces derved from ab nto electronc structure Copes wth unusual geometry, bond-breakng, chemcal reactons, catalyss, dffuson, etc Incorporates effects of fnte temperature of ons Can generate thermodynamc nformaton from ensemble averagng Tme dependent phenomena Temperature drven phase transtons Nuts and Bolts 2001 Lecture 14: Forces and Stresses 4
Theoretcal Background Hellman-Feynman Theorem basc Quantum Mechancs Densty Functonal Theory how t apples n DFT Nuts and Bolts 2001 Lecture 14: Forces and Stresses 5
Hellman-Feynman Theorem (I) Classcally we have the force F at poston R s determned from the potental energy as F = U R ( R) Quantum mechancally we therefore expect F = R E where E = H Nuts and Bolts 2001 Lecture 14: Forces and Stresses 6
Hellman-Feynman Theorem (II) If we wrte the three unt cell vectors a, b, c as the columns of a matrx h then the effect of an appled stran s to change the shape of the unt cell: h = ( I + å)h We then have the stress tensor s related to the stran tensor e by: where Ù = σ αβ = 1 Ω ε αβ s the volume of the unt cell. a b c ( ) E Nuts and Bolts 2001 Lecture 14: Forces and Stresses 7
Stress and stran n acton c c b α b α γ β a c s xx γ β a a+δa s xy b γ γ+δγ α β a NB Much messer f non-orthogonal cell Nuts and Bolts 2001 Lecture 14: Forces and Stresses 8
Nuts and Bolts 2001 Lecture 14: Forces and Stresses 9 Hellman-Feynman Theorem (III) The Hellman-Feynman Theorem states that for any perturbaton λ we have whch obvously ncludes the case we are nterested n. We have assumed that the wavefuncton s properly normalsed and s an exact egenstate of H. = + = + + = + + = λ λ λ λ λ λ λ λ λ λ H H E H E H H H E
Hellman-Feynman Theorem (IV) To evaluate <E> for an unknown wavefuncton we frst expand t n terms of a complete set of fxed bass functons ϕ = c ϕ and then use the Varatonal Prncple to fnd the set of complex coeffcents c that mnmse the energy. If the bass set s ncomplete then we arrve at an upperbound for the energy. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 10
Hellman-Feynman Theorem (V) If we have an approxmate egenstate, for example from usng an ncomplete bass set, then we must keep all 3 terms n the general expresson. If our bass set depends upon the onc postons, such as atomc centred Gaussans, then the other dervatves n the general expresson wll contrbute so-called Pulay forces (stresses). Note that Pulay forces (stresses) wll vansh n the lmt of a complete bass set, but that ths s never realzed n practce, or f poston ndependent bass functons, such as plane-waves, are used. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 11
Nuts and Bolts 2001 Lecture 14: Forces and Stresses 12 Hellman-Feynman Theorem (VI) If we choose plane-waves as our bass functons, then because these functons are ndependent of the onc coordnates, t can easly seen that the general expresson for the forces becomes: ( ) ( ) ( ) ( ) = = j j j j j j r R H r c c r c H r c R R E, * * * * ϕ ϕ ϕ ϕ
Hellman-Feynman Theorem (VII) That s, we can calculate the forces usng the same expanson coeffcents as we used to varatonally mnmse the energy, usng matrx elements of the onc dervatve of the Hamltonan. Ths makes calculaton of the forces relatvely cheap once the varatonal energy mnmsaton has been completed f we are usng a plane-wave bass set. Smlar expressons can also be derved for the stresses. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 13
Densty Functonal Theory (I) In DFT we have the Kohn-Sham Hamltonan: (, R ) = + V ( r) + V ( r, R ) + V ( r ) V ( R ) ˆ 2 r r e e on e XC on on H 1 2 + Therefore we only get contrbutons to the forces from the electron-on (pseudo)potental and the on-on Coulomb nteracton (the Ewald sum). Also contrbuton from exchange-correlaton potental f usng non-lnear core correctons. However, for the stresses, we also get a contrbuton from the knetc energy and Hartree terms. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 14
Densty Functonal Theory (II) As we do not have a complete bass, the wavefuncton wll not be exact even wthn DFT. If we use a varatonal method to mnmze the total energy, then we know that the energy and hence the wavefuncton wll be correct to second order errors. However, the forces wll only be correct to frst order need a larger bass set for accurate forces than for energes. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 15
Nuts and Bolts 2001 Lecture 14: Forces and Stresses 16
Densty Functonal Theory (III) However, f we use a non-varatonal mnmsaton technque, such as densty mxng, then such statements cannot be made. We can no longer guarantee that the energy found s an upper-bound on the true ground state energy. Ths complcates the applcaton of the Hellman- Feynman theorem. Consequently, non-varatonal forces and stresses are less relable. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 17
CASTEP detals (I) Forces and stresses are almost the hghest level functonalty Sngle subroutne call to frst dervatves module s all that s requred to return the forces for the current model f ground state s already known. Dtto stress. frstd puts together the dfferent contrbutons to the force (stress) usng other functonal modules so the physcs s obvous. These n turn call down to operatons on charge denstes and potentals. Even at ths level the physcs s obvous and the detals of USPs etc are hdden. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 18
CASTEP detals (II) The use of Ultra-Soft Pseudopotentals further complcates thngs, as there are now addtonal contrbutons to both the forces and the stresses from the charge augmentaton. However, the modular desgn of new CASTEP completely hdes ths from the hgher level programmer. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 19
CASTEP detals (III) There s a problem wth the applcaton of the Hellman-Feynman theorem wth non-varatonal mnmsers Consequently the CASTEP code contans a frst-order correcton to the forces derved from densty mxng. However, the correspondng correcton to the stresses s not known. Ths has mplcatons for structure optmsaton and molecular dynamcs wth densty mxng Therefore the more recent Ensemble DFT approach (whch s fully varatonal) s to be preferred. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 20
Nuts and Bolts 2001 Lecture 14: Forces and Stresses 21
CASTEP detals (IV) If the unt cell changes shape then the number of plane-waves and the FFT grd wll, at some pont, change dscontnuously. Consequently, t becomes dffcult to compare results at dfferent cell szes at the same nomnal bass set sze (cut-off energy) as the effectve qualty of the bass set s not the same, unless the bass set s fully converged (mpossble). Ths can be countered by usng the Fnte Bass Set Correcton, whch calculates the change n total energy upon changng the bass set sze at a fxed cell sze, and then uses ths to correct the total energy and stress at nearby cell szes. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 22
Nuts and Bolts 2001 Lecture 14: Forces and Stresses 23
Symmetry If the symmetry of the system has been calculated (controlled by keyword n nput fle) then ths can be used to symmetrse the forces and stresses. Ths ensures that the forces (stresses) have the same symmetry as the model. Consequently, the symmetry of the system wll be preserved n any structural relaxaton or dynamcs. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 24
User Constrants (I) Sometmes t s desred to mpose addtonal constrants on any structural relaxaton or dynamcs. Currently, CASTEP can apply any arbtrary number of lnear constrants on the atomc coordnates, up to the number of degrees of freedom. E.g. fxng an atom, constranng an atom to move n a lne or plane, fxng the relatve postons of pars of atoms, fxng the centre of mass of the system, etc. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 25
User Constrants (II) Both force and stress constrants work n the same way by Lagrange multplers n the extended Lagrangan of the system: d dt L cons ( q, q& ) = L ( q q& ) λs ( q ) L q& cons = 0, L q 0 λ S m q&& = F λ q So for a gven set of constrants S(q) we need to know the dervatves of the constrants and then f we can determne λ we have the constrant force. S q Nuts and Bolts 2001 Lecture 14: Forces and Stresses 26
Nuts and Bolts 2001 Lecture 14: Forces and Stresses 27 User Constrants (III) Lnear constrants for the onc moton makes the matrx of constrant dervatves trval and therefore determnng λ: ( ) = = = a m a F m a m a m F a q a q S λ λ 0
User Constrants (IV) If we have multple constrants, S(q), R(q), etc. then we may satsfy each constrant smultaneously f the constrant matrces are all mutually orthogonal and so we use Gram-Schmdt on the coeffcents. Wth non-lnear constrants, both the constrants and ther dervatves need to be specfed, and t s not possble n general to satsfy them all smultaneously. Consequently, teratve procedures such as SHAKE or RATTLE are requred. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 28
User Constrants (V) Constrants can also be appled to the unt cell lengths and angles (gvng 6 degrees of freedom). Any length (angle) can be held constant, or ted to one or both of the others. Ths s most useful f only a subset of the symmetres of the orgnal unt cell s to be enforced. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 29
User Constrants (VI) Cell constrants are mplemented n a slghtly dfferent way. The stress tensor s transformed from ts normal symmetrc representaton n Cartesan coordnates nto the space of cell lengths and angles. There s then a 1:1 correspondence between the stress components and the cell degrees of freedom and so the constrants may be trvally appled to the stress and hence to the evoluton of the system. Nuts and Bolts 2001 Lecture 14: Forces and Stresses 30
Concluson Hellman-Feynman Theorem gves us a smple recpe for calculatng ab nto forces and stresses plane-wave bass has bg advantage DFT mplementaton Can be combned wth symmetry and/or constrants Major use n structural relaxaton and molecular dynamcs Nuts and Bolts 2001 Lecture 14: Forces and Stresses 31