dft in practice part ii - the nomad laboratory · professor horst cerjak, 19.12.2005oliver t....

70
Professor Horst Cerjak, 19.12.2005 Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond: Accuracy, Efficiency and Reproducibility in Computational Materials Science DFT in practice part II Oliver T. Hofmann, Berlin August 1st

Upload: others

Post on 27-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1

Hands-on Workshop Density-Functional Theory

and Beyond: Accuracy, Efficiency and

Reproducibility in Computational Materials

Science

DFT in practice – part II

Oliver T. Hofmann,

Berlin August 1st

Page 2: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 2

Solving the Schrödinger equation

Full many body solution typically not attainable

Born-Oppenheimer Approximation

– Assumption: electrons are in an eigenstate of He

– Implication: separation of nuclear and electronic coordinates

Page 3: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 3

Outline

Solving the electronic part– Self-consistent field method

– Density mixing and preconditioner

– Broadening of states

Nuclear Structure optimization– (Global structure optimization)

– Local structure optimization

– „Forces“ in DFT

– Vibrations in the harmonic approximation

Page 4: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 4

Where are the electrons?

All ground state properties related to electron

distribution [1]

– Relative energy of conformers, dipole moments,

reactivities, etc.

– Density functional theory (DFT)

Kohn-Sham scheme [2]

– Map electron density on effective one-particle

orbitals

[1] P. Hohenberg, W. Kohn, Phys Rev. (1964), B864, [2]: W. Kohn, L.J. Sham, Phys. Rev. (1965), A1133

Page 5: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 5

Kohn-Sham DFT

We want to determine all Φi such that

• E[n] min

• H is consistent with Φi

Approaches

• Direct minimization (rarely used)

• Self-consistent field method

Page 6: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 6

Initial guess:

e.g. densityCalculate potential

Construct Hamiltonian

Obtain new eigenvalues,

eigenvectors, and density

Converged?

Update density /

density matrix

(mixer, preconditioner)

Update potential

Yes

No

n0

V0

n j

nj+1= nj+f(Δn)

V j+1

Self-consistent field method

Page 7: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 7

Initial guess:

e.g. densityCalculate potential

Construct Hamiltonian

Obtain new eigenvalues,

eigenvectors, and density

Converged?

Update density /

density matrix

(mixer, preconditioner)

Update potential

Yes

No

n0

V0

n j

nj+1= nj+f(Δn)

V j+1

Self-consistent field method (SCF)

Page 8: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 8

When is the calculation finished?

Answer: When „property“ does not change

Convergence

Convergence threshold Very strictVery loose

Typical „properties“ to converge:

➢ Change of the density Dn

➢ Change of the sum of eigenvalues

➢ Change of the total energy

Options differ between codes

Thresholds often historically grown

Page 9: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 9

What are safe convergence settings?

Short answer: It depends.

Convergence

Problem I: Connection between parameters and observables

➢ Adsorption / Cohensive / […] energy ↔ Total energy (1:1)

➢ Dipole moment ↔ Electron density (size dependent)

➢ Force constants of bonds ↔ sum of eigenvalues (????)

Problem II:

➢ Not transferrable between different systems (size dependence)

➢ Not necessarily transferrable between different codes

➢ Sometimes not even transferrable between different algorithms

within the same code

Page 10: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 10

What are safe convergence settings?

Convergence

Take-home messages

Solution I: Converge your convergence parameters

Solution II: Define convergence for your observable

Lejaeghere et al., Science 351 (2016)

Overconverged settings:

(Some) results are code-independent

Underconverged settings or

Non-trivial relation to observables:

Error bar unknown!

Page 11: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 11

Initial guess:

e.g. densityCalculate potential

Construct Hamiltonian

Obtain new eigenvalues,

eigenvectors, and density

Converged?

Update density /

density matrix

(mixer, preconditioner)

Update potential

Yes

No

n0

V0

n j

nj+1= nj+f(Δn)

V j+1

Self-consistent field method (SCF)

Page 12: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 12

Importance of the initial guess

Electronic structure exhibits multiple minima

• Qualitative different behavior

• Which is found depends (mostly) on guess

• Common issue for magnetic solids

1O2

3O2

How do we find a

stable, reasonable, fast-

converging initial guess?

Initial guess

Page 13: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 13

Random initialization

Traditional approach (for bandstructure codes)

http://web.cs.wpi.edu/~matt/courses/cs563/talks/noise/noise.html

Initial guess

Page 14: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 14

Superposition of spheric atomic densities

Most common (for bandstructure codes)

Initial guess

Page 15: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 15

Extended Hückel Model [1]

Semi-empirical method:

- Linear combination of atomic orbitals

- Hamiltonian parameterized:

- Density from orbitals:

Initial guess

[1] R. Hoffmann, J Chem. Phys (1963), 1397; [2] R. S. Mulliken, J. Chem. Phys. (1946) 497; [3] M. Wolfsberg and L. Helmholtz, J. Chem. Phys (1952), 837

Page 16: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 16

Initial guess:

e.g. densityCalculate potential

Construct Hamiltonian

Obtain new eigenvalues,

eigenvectors, and density

Converged?

Update density /

density matrix

(mixer, preconditioner)

Update potential

Yes

No

n0

V0

n j

nj+1= nj+f(Δn)

V j+1

Self-consistent field method (SCF)

Page 17: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 17

➢ Calculate new density from Kohn-Sham orbitals

➢ Replace old density by new density

nnn jj D1

Example: H2, d=1.5Å, projected in 1 dimension

Density Update

Naive Mixing

Typically does not work

- Best case: Oscillating, non-converging results

- Worst case: Bistable, apparently converged

solution

Page 18: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 18

➢ Calculate new density from Kohn-Sham orbitals

➢ Replace old density by new density

Example: H2, d=1.5Å, projected in 1 dimension

Density Update

Linear Mixing

nnn jj D 1

Page 19: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 19

➢ Calculate new density from Kohn-Sham orbitals

➢ Replace old density by new density

Example: H2, d=1.5Å, projected in 1 dimension

Density Update

Linear Mixing

nnn jj D 1

Page 20: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 20

➢ Calculate new density from Kohn-Sham orbitals

➢ Replace old density by new density

Example: H2, d=1.5Å, projected in 1 dimension

Density Update

Linear Mixing

nnn jj D 1

Ideal choice system dependent

No clear recipe to choose ideal α

Guaranteed convergence

Page 21: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 21

[1] P. Pulay, Chem. Phys. Lett. 73 , 393 (1980).

Density Update

➢ Define residual:

Change between input and output density

➢ Predict residual of next step from previous steps

Idea: obtain b from least-squares fit

Pitfall: Only use limited number of previous steps

Pulay Mixing [1]

(Direct Inversion of Iterative Subspace)

Page 22: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 22

[1] P. Pulay, Chem. Phys. Lett. 73 , 393 (1980).

Density Update

➢ Construct „optimal density“:

➢ Use underrelaxation

➢ Ideal case: convergence independent of

➢ Rules of thumb:➢ = 0.2 .. 0.6 for insulators

➢ = 0.05 for metals

Pulay Mixing [1]

(Direct Inversion of Iterative Subspace)

Much faster than linear mixing

No guarantee for congerence

Page 23: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 23

Charge preconditioning

Problem: Charge Sloshing

➢ Charge „bounces“ back and forth

➢ (Lack of) balance between long-range

and short-range charge re-distribution

➢ Often encountered in defect-ystems

➢ Localized defects (vacancies, interstitials)

➢ Surfaces, Slabs, Thin Films

➢ Etc.

Density Update

Page 24: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 24

Charge preconditioning

Solution: Make α depend on Δn(r)

Concept:

➢ Treat density change in Fourier space

➢ Damp long-range oscillations

Density Update

Page 25: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 25

Charge preconditioning

Solution: Make α depend on Δn(r)

Concept:

➢ Treat density change in Fourier space

➢ Damp long-range oscillations

Density Update

: Mixing parameter

q0: Screening parameter

➢ q >> Δ: G ≈

Normal mixing

➢ q << Δ: G ≈ D/q^2

Damping

Page 26: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 26

Charge preconditioning

Density Update

: Mixing parameter

q0: Screening parameter

8 layer Al slab, PBE calculation

no a priori known ideal

choice for q0

Reasonable guess from

Thomas-Fermi:

Page 27: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 27

A special problem: Metallic systems

Density Update

http://www.phys.ufl.edu/fermisurface/periodic_table.html

Metallic properties determined by Fermi surface

Fermi-surface: Collection at k-points at which e eFermi

At eFermi occupation changes from 1 to 0

Many-body self-interaction: Occupation changes energy of state

Problem: Frequent „level switching“ during SCF

Page 28: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 28

A special problem: Metallic systems

Density Update

Solution: Replace step function by a more smooth function

Methfessel-Paxton [3]

[1] N. Mermin, Phys. Rev.137 , A1441 (1965).[2] C.-L. Fu, K.-H. Ho, Phys. Rev. B 28 , 5480 (1983).

[3] M. Methfessel, A. Paxton, Phys. Rev. B 40 , 3616 (1989).

Gaussian [2]

Fermi [1]

Page 29: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 29

A special problem: Metallic systems

Density Update

Physical implications:

• States become fractionally occupied

• In DFT, well defined as ensemble average

• Do not confuse with fractional filling of bands

• Broadening is not electron temperature (except: Fermi)

• Chemical potential / EF in semiconductors not meaningful!

Numerical Implications

• Level switching is damped

• Much faster convergence

• Total energy now dependson σ, no longer variational

• Backextrapolation possible

Cu (111), 5 layer slab, aussian smearing, PBE

calculation, 12x12x1 k-points

Pitfall: Adsorption of molecules

Page 30: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 30

Summary SCF

Ground state electron density determined iteratively

Initial guess needs initial thought, can change results

qualiatively

Density update by– Linear mixing (slow)

– Pulay mixing

Convergence acceleration by – Preconditioner

– Broadening of states

Page 31: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 31

Structure optimization

Page 32: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 32

Structure optimization

Most electronic properties sensitive to geometry

Mobility

~3.0 cm2 V-1 s-1

~1.6 cm2 V-1 s-1

Insulating

Y. Zhang et al., Phys. Rev. Lett., 2016, 116, 016602.

Slide curtesy of Andrew Jones

Page 33: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 33

Global structure search

Born-Oppenheimer energy surface can contain several

minima– Constitution isomery

– Configuration isomery

– Conformation isomery

– Polymorphism

33

• System in equilibrium is given

by ensemble average over all

minima

• Often dominated by global

minimum (but watch out for

tautomers)

Page 34: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 34

Global structure search

Methods to find the global minimum:

o Experimental structure determination

o Stochastical or Monte-Carlo

o Basin Hopping

o Molecular dynamics: o Simulated annealing

o Minima Hopping

o Metadynamics

o Cluster expansion

o Genetic algorithm

o Diffusion methods

o Machine Learning / Bayes Optimization

Page 35: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 35

Local structure optimization

Once we have an reasonable guess, find closest minimum

Different approaches possible:– Mapping of the potential energy surface

• Requires a lot of calculations

• Typically only for dynamics

35

dCC

aCCO

Page 36: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 36

Local structure optimization

Once we have an reasonable guess, find closest minimum

Different approaches possible:– Mapping of the whole potential energy surface

– Gradient free methods: e.g,. Simplex method [1]

36

• Choose n+1 start points

• Determine best and worst

energy

• Remove worst point

• Project new point by reflection

• Expand, contract, compress

• Repeat until self-consistent

[1]: J. Nelder and R. Mead, Comp J (1965), 308

Page 37: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 37

Local structure optimization

Once we have an reasonable guess, find closest minimum

Different approaches possible:– Mapping of the whole potential energy surface

– Gradient free method: e.g., simplex

– Gradient-based methods

• Calculate gradient (a.k.a. „forces“)

Page 38: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 38

Total energy gradient

Search for minimum by following the gradient

Page 39: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 39

Total energy gradient

Search for minimum by following the gradient

affects only Vnuc-nuc and Ve-nuc

Page 40: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 40

Total energy gradient

Search for minimum by following the gradient

• First term vanishes

• Second term survives for

atom-centered basis functions

Page 41: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 41

Total energy gradient

Search for minimum by following the gradient

Additional contributions from atom-centered

approximations– Multipole expansion

– Relativistic corrections

– (Integration grids)

All straightforward but lengthy

Once we have the Force, how do we find the minimum?

Page 42: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 42

Geometry update – Steepest descent

Follow negative gradient to find minimum

Steplength α variable

Guaranteed but slow convergence

Oscillates near minimum

Not suitable for saddle points

Improved versions exists– Linie minimization

(optimal step length)

– Conjugated gradient [1]

42[1] M. Hestenes, E. Stiefel (1952). "Methods of Conjugate Gradients for Solving Linear Systems"

Page 43: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 43

Geometry update – (Quasi)Newton Methods

Approximate PES by quadratic function

Find minimum:

Newton: calculate exact HExpansive! Cheaper method needed

43

... Hessian

[1] J. Nocedal and S. J. Wright, “Numerical optimization” (Springer, 2006)

Page 44: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 44

Geometry update – (Quasi)Newton Methods

Approximate PES by quadratic function

Find minimum:– Newton: calculate exact H

– Quasi-Newton: approximate H

• Update as search progresses [1]

44

... Hessian

[1] J. Nocedal and S. J. Wright, “Numerical optimization” (Springer, 2006)

Page 45: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 45

Geometry update – (Quasi)Newton Methods

Guess initial Hessian

➢ Naive choice: Scaled unit matrix

➢ Chemically motivated choice (e.g.: Lindh [1])

45

[1] R. Lindh et al. , Chem. Phys. Lett. 241 , 423 (1995).

streching

bending

torsion

k parameterized [1]

Update as search progresses [2]

[2] J. Nocedal and S. J. Wright, “Numerical optimization” (Springer, 2006)

Page 46: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 47

Challenges of Quasi-Newton Methods

Soft degrees of freedom can cause large ΔR

Step control needed:– Line search method: If new point is worse than old, interpolate

– Trust radius method

• Enforce upper limit for ΔR

• Evaluate quality of quadratic model

• Adjust ΔRmax based on q

Page 47: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 48

Conclusions

(Global optimization: PES feature-rich, methods to find

global minima exist)

Local geometry optimization: Follow gradient– Hellman-Feynman from moving potentials

– Pulay from moving basis functions

– + additional terms

Quasi-Newton method de-facto standard– Require approximation and update of Hessian

– Step control by line search or trust radius method

Page 48: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 49

Vibrations

in the harmonic approximation

Page 49: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 50

Why calculating vibrations?

Vibrations give important information about the system:

– Classification of stationary points (minimum / saddle point)

– If saddle-point: Provides search direction

– Thermodynamic data

• Zero-point energy

• Partion sum

• Finite temperature effects

– Connection to experiment:

• Infra-red intensities: derivative of dipole moment

• Raman intensities: derivative of polarizabilty

Page 50: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 51

How good is the harmonic approximatino?

Morse-potential:

Morse:

Harmonic oscillator:

Harmonic osc.

Page 51: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 52

How good is the harmonic approximation?

Morse-potential:

Morse:

Harmonic oscillator:

Harmonic osc.

Morse:

Harmonic osc.

Reasonable model

for small displacements

(~10% of bond length)

Maximum displacement:

Ca. 0.1Å at room

temperature

Page 52: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 53

Vibrations

Expand Energy in Taylor series:

Hessian H

Page 53: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 54

Interpretation of results:

• Negative ω: Transition state

• Large ω = large force constant, e.g., bond streching

• Small ω : small force constant, e.g., out-of-plane vibrations

Calculating Vibrations

Solve Newtons equation of Motion:– Exponential ansatz:

– Leads to generalized eigenvalue problem:

Page 54: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 55

From vibrations to thermodynamic data

Free energy for finite temperature

Partition sum

Hessian from geometry optimization not sufficent– Analytic second derivative using perturbation theory [1]

– Numerical differentiation

• Computational very expensive

• Contains parameter (displacement), needs to checked carefully

• Often single displacement not sensible to sample all vibrations

[1] S. Baroni et al. , Rev. Mod. Phys. 73 , 515 (2001).

Page 55: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 56

Conclusions

Often calculated in harmonic approximation

Yield information about stability of geometry

Required for temperature effects

Anharmonic effects via molecular dynamics

Page 56: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 57

Summary

Electronic part– Careful with convergence parameters

– Mixing: Guaranteed or fast convergence

• DIIS / Pulay state of the art

– Convergence Accelaration: Preconditioner

and Smearing

– Initial Guess important

• Think first before starting a calculations

Page 57: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 58

Summary

Nuclear Structure Optimization– Local structure optimization

• Gradient-free method

• Gradients

• Model Hesse-matrix generated during search

– Vibrations in the harmonic approximation

• Model Hess-matrix not sufficent

Page 58: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 59

Thank you for your

attention

Page 59: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 60

Visualization

60

PBE: Electron density difference upon adsorption of p-bezoquinone on Li

Page 60: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 61

Visualization

Nuclear coordinates

Electron distribution

What else can we learn?

How can we visualize results that are not just

„numbers“

61

Page 61: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 62

Codes use different types of basis functions and grids to

store n / Ψ. No standard format to save information about

custom grids

Solution: Extrapolate and save quantities on evenly-spaced

grids– Common format: cube [1]

– Very memory intensive

3 examples:– Electron density

– Orbtials

– Scanning tunneling microcopy

Format for visualization

62[1] P. Bourke http://paulbourke.net/dataformats/cube/

Page 62: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 63

Electron density

Contains core and valence electrons

Resolution typically not sufficient for QM-postprocessing

Even electron counting can be challenging

Can be used, e.g., for charge differences (ΔSCF)

63

Total density of neutral pentacene Total density of the pentacene cation

ΔSCF density. Cyan are negative values

Page 63: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 64

Orbitals

Valence orbtials contain „chemical information“

Eigenstate densities– tend to agree well with ΔSCF

64ΔSCF density for electron removal

Cyan: electron density reduced: Magenta: Increased

The LUMO of p-Benzoquinone exhibits nodes on the

C=O double bond

Pentacene HOMO density

Page 64: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 65

Scanning Tunneling Microscopy

[1] OJ. Bardeen, Phys. Rev. Lett. 6, 57 (1961)

[2] J. Tersoff, Phys. Rev. B 40 (1989) 11990.

Scan over (x,y) and measure tunnel current

2 Modes: – Constant height

– Constant current

• Tunnel current

• Depends on energy (E) and

tunnel matrix elements (M) of

both tip (µ) and sample (ν)

Page 65: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 66

Scanning Tunneling Microscopy

Simulation by Tersoff-Hamann [1]– Neglect impact of tip

– Assume single point-like atom at apex

• Works only for s-type tips [2]

• CO-functionlized tips probe gradient

[1] J. Tersoff, Phys. Rev. B 40 (1989) 11990.

[2] L. Gross et al, Phys. Rev. Lett. (2011), 086101

EF

EF-V

Page 66: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 67

Scanning Tunneling Microscopy

Problem for adsorbate systems:• Point-like tip can penetrate layer

• Resulting pictures too „crisp“

• Solution:

• Average over adjacent points

• Model tip as extended object [1]

67[1] G. Heimel et al., Surface Science 600 (2006) 4548–4562

[2] W. Azzam et al., Langmuir 19 (2003) 4958.

Experimental STM [2] Simulated STM [1]

Page 67: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 68

Conclusion

Electronic Schrödinger equation– Solved by direct minimization or self-consistent field method

– Initial guess requires some thought

– Mixer: Tradeoff between stability and time

– Convergence accelleration: Preconditioner, Broadening

Structure optimization– Evaluate energy gradients

– Contribution from Hellman-Feynman and Pulay forces

– Solution by (Quasi)Newton-Methods

68

Page 68: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 69

Conclusion

Vibrations– Information about stability of geometry

– Characterization of thermodynamic properties

– Allow to account for temperature effects

Visualization– Fields saved on regular grid

– Helpful for direction connection with experiment, e.g.:

• Scanning tunneling microscopy

69

Page 69: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 70

Vibrations

Expand Energy in Taylor series:

Vanishes for R0

Page 70: DFT in practice part II - The NOMAD Laboratory · Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 1 Hands-on Workshop Density-Functional Theory and Beyond:

Professor Horst Cerjak, 19.12.2005Oliver T. Hofmann Solid State Physics / 71

Vibrations – beyond harmonic

For high T or double-well minima– Molecular dynamics: Luca Ghiringhelli

Re-introducting quantum nuclei:– See talk by Roberto Car