# DFT in practice - th.fhi-berlin.mpg.de

of 91/91

date post

26-Oct-2021Category

## Documents

view

0download

0

Embed Size (px)

### Transcript of DFT in practice - th.fhi-berlin.mpg.de

Outline

• General concepts:

- basis sets - integrals and grids, electrostatics, molecules and clusters versus periodic systems - scalar relativity - solution of the eigenvalue problem

Equations to be solved

, = Ψ∗ ,,… Ψ ′,,… …

, = Ψ∗ ,′, … Ψ ,′,,… …

Problem: kinetic energy and electron-electron interaction energy as a functional of () -- ?

Equations to be solved

Converged? Update density / density matrix

(mixer, preconditioner)

Update potential

V j+1

Self-consistent field method

When is the calculation finished? • Answer: When „property“ does not change

Convergence

Typical „properties“ to converge:

Change of the sum of eigenvalues

Change of the total energy

Options differ between codes

Initial guess: e.g. density

Converged? Update density / density matrix

(mixer, preconditioner)

Update potential

Importance of the initial guess Electronic structure exhibits multiple minima

• Qualitatively different behavior depending on guess

• Common issue for magnetic solids

1O2

3O2

Importance of the initial guess Electronic structure exhibits multiple minima

• Qualitatively different behavior depending on guess

• Common issue for magnetic solids

1O2

3O2

Initial guess

codes)

Initial guess

- Hamiltonian parameterized:

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

Initial guess: e.g. density

Converged? Update density / density matrix

(mixer, preconditioner)

Update potential

nnn jj =1

Density Update

Naive Mixing

nnn jj =1

Density Update

Naive Mixing

solution

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

Density Update

Linear Mixing

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

Density Update

Linear Mixing

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

Density Update

Linear Mixing

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

Density Update

Linear Mixing

Guaranteed convergence

Density Update

Define residual:

Predict residual of next step from previous steps

Idea: obtain b minimizing norm ∫

Pitfall: Only use limited number of previous steps

Pulay Mixing [1] (Direct Inversion of Iterative Subspace)

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

Density Update

Learning from previous steps

Rules of thumb:

- a = 0.05 for metals

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

Density Update

Learning from previous steps

Rules of thumb:

- a = 0.05 for metals

Much faster than linear mixing

No guarantee for congerence

(Lack of) balance between long-range and short-range charge re-distribution

Typical for metals

Surfaces, Slabs, Thin Films

Concept:

Damp long-range oscillations:

Damping

no a priori known ideal choice for q0

Reasonable guess from Thomas-Fermi:

Density Update

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

At eFermi occupation changes from 1 to 0

Problem: Frequent „level switching“ during SCF

A special problem: Metallic systems

Density Update

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]

Density Update

Physical implications:

Numerical Implications

• Back-extrapolation possible

Cu (111), 5 layer slab, Gaussian smearing, PBE calculation, 12x12x1 k- points

Pitfall: Adsorption of molecules

Initial guess needs initial thought, can change results qualiatively

Density update by – Linear mixing (slow)

– Pulay mixing

The tool for this workshop: FHI-aims (NAOs)

Our choice: Numeric atom-centered basis functions

Our choice: Numeric atom-centered basis functions

Constructing a basis-set library

Result: Hierarchical basis set library for all elements

Accuracy: (H2O)2 hydrogen bond energy

Basis-set superposition error (BSSE)

By construction, our NAO basis sets are close to completeness for very small BSSE for atomic dimers

Basis-set superposition error (BSSE)

Overlapping atom-centered grids: “Partitioning of unity”

Integration in practice: Large systems - small errors!

Hartree potential (electrostatics): Overlapping multipoles

Electrostatics: convergence with

– Configuration isomery

– Conformation isomery

– Polymorphism

50

• System in equilibrium is given by ensemble average over all minima

• Often dominated by global minimum (but watch out for tautomers)

Global structure search

o Basin Hopping

o Minima Hopping

• Requires a lot of calculations

• Typically only for dynamics

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

– Gradient free method: e.g., simplex

– Gradient-based methods

(vanish when basis set approaches completeness)

Total energy gradient

– Relativistic corrections

– (Integration grids)

All straightforward but lengthy

Step-length α variable

(optimal step length)

– Conjugated gradient [1]

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

Geometry update – (Quasi)Newton Methods

Find minimum:

... Hessian

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

Δ ≈ +

Find minimum: – Newton: calculate exact H

– Quasi-Newton: approximate H

• Update as search progresses [1]

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

... Hessian

Δ ≈ +

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

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

streching

bending

torsion

Update as search progresses [2]

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

Geometry update – (Quasi)Newton Methods

May even influence result

(combination with convergence thresholds)

Courtesy of Elisabeth Wruss

Lower in energy

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

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

Vibrations in the harmonic approximation

Why calculating vibrations?

– If saddle-point: Provides search direction

– Thermodynamic data

• Zero-point energy

• Partition sum

• Finite-temperature effects

• Raman intensities: derivative of polarizabilty

How good is the harmonic approximatino?

Morse-potential:

Morse:

Morse-potential:

Morse:

Maximum displacement:

Vibrations

Hessian H

Calculating Vibrations

– Leads to generalized eigenvalue problem:

~ /

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

– Numerical differentiation

• Often single displacement is not sensible to sample all vibrations

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

Conclusions

Yield information about stability of geometry

Required for temperature effects

Relativity

Fixing ZORA

Computational scaling: two subproblems

ELPA: Performance

Resolution of identity (RI)

Periodic GaAs, HSE06 hybrid functional

Hybrid functionals -- CPU scaling

Summary

Volker Blum (Duke Univ.)

Igor Ying Zhang (FHI)

Karsten Reuter (TU Munich)

• General concepts:

- basis sets - integrals and grids, electrostatics, molecules and clusters versus periodic systems - scalar relativity - solution of the eigenvalue problem

Equations to be solved

, = Ψ∗ ,,… Ψ ′,,… …

, = Ψ∗ ,′, … Ψ ,′,,… …

Problem: kinetic energy and electron-electron interaction energy as a functional of () -- ?

Equations to be solved

Converged? Update density / density matrix

(mixer, preconditioner)

Update potential

V j+1

Self-consistent field method

When is the calculation finished? • Answer: When „property“ does not change

Convergence

Typical „properties“ to converge:

Change of the sum of eigenvalues

Change of the total energy

Options differ between codes

Initial guess: e.g. density

Converged? Update density / density matrix

(mixer, preconditioner)

Update potential

Importance of the initial guess Electronic structure exhibits multiple minima

• Qualitatively different behavior depending on guess

• Common issue for magnetic solids

1O2

3O2

Importance of the initial guess Electronic structure exhibits multiple minima

• Qualitatively different behavior depending on guess

• Common issue for magnetic solids

1O2

3O2

Initial guess

codes)

Initial guess

- Hamiltonian parameterized:

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

Initial guess: e.g. density

Converged? Update density / density matrix

(mixer, preconditioner)

Update potential

nnn jj =1

Density Update

Naive Mixing

nnn jj =1

Density Update

Naive Mixing

solution

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

Density Update

Linear Mixing

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

Density Update

Linear Mixing

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

Density Update

Linear Mixing

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

Density Update

Linear Mixing

Guaranteed convergence

Density Update

Define residual:

Predict residual of next step from previous steps

Idea: obtain b minimizing norm ∫

Pitfall: Only use limited number of previous steps

Pulay Mixing [1] (Direct Inversion of Iterative Subspace)

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

Density Update

Learning from previous steps

Rules of thumb:

- a = 0.05 for metals

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

Density Update

Learning from previous steps

Rules of thumb:

- a = 0.05 for metals

Much faster than linear mixing

No guarantee for congerence

(Lack of) balance between long-range and short-range charge re-distribution

Typical for metals

Surfaces, Slabs, Thin Films

Concept:

Damp long-range oscillations:

Damping

no a priori known ideal choice for q0

Reasonable guess from Thomas-Fermi:

Density Update

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

At eFermi occupation changes from 1 to 0

Problem: Frequent „level switching“ during SCF

A special problem: Metallic systems

Density Update

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]

Density Update

Physical implications:

Numerical Implications

• Back-extrapolation possible

Cu (111), 5 layer slab, Gaussian smearing, PBE calculation, 12x12x1 k- points

Pitfall: Adsorption of molecules

Initial guess needs initial thought, can change results qualiatively

Density update by – Linear mixing (slow)

– Pulay mixing

The tool for this workshop: FHI-aims (NAOs)

Our choice: Numeric atom-centered basis functions

Our choice: Numeric atom-centered basis functions

Constructing a basis-set library

Result: Hierarchical basis set library for all elements

Accuracy: (H2O)2 hydrogen bond energy

Basis-set superposition error (BSSE)

By construction, our NAO basis sets are close to completeness for very small BSSE for atomic dimers

Basis-set superposition error (BSSE)

Overlapping atom-centered grids: “Partitioning of unity”

Integration in practice: Large systems - small errors!

Hartree potential (electrostatics): Overlapping multipoles

Electrostatics: convergence with

– Configuration isomery

– Conformation isomery

– Polymorphism

50

• System in equilibrium is given by ensemble average over all minima

• Often dominated by global minimum (but watch out for tautomers)

Global structure search

o Basin Hopping

o Minima Hopping

• Requires a lot of calculations

• Typically only for dynamics

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

– Gradient free method: e.g., simplex

– Gradient-based methods

(vanish when basis set approaches completeness)

Total energy gradient

– Relativistic corrections

– (Integration grids)

All straightforward but lengthy

Step-length α variable

(optimal step length)

– Conjugated gradient [1]

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

Geometry update – (Quasi)Newton Methods

Find minimum:

... Hessian

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

Δ ≈ +

Find minimum: – Newton: calculate exact H

– Quasi-Newton: approximate H

• Update as search progresses [1]

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

... Hessian

Δ ≈ +

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

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

streching

bending

torsion

Update as search progresses [2]

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

Geometry update – (Quasi)Newton Methods

May even influence result

(combination with convergence thresholds)

Courtesy of Elisabeth Wruss

Lower in energy

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

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

Vibrations in the harmonic approximation

Why calculating vibrations?

– If saddle-point: Provides search direction

– Thermodynamic data

• Zero-point energy

• Partition sum

• Finite-temperature effects

• Raman intensities: derivative of polarizabilty

How good is the harmonic approximatino?

Morse-potential:

Morse:

Morse-potential:

Morse:

Maximum displacement:

Vibrations

Hessian H

Calculating Vibrations

– Leads to generalized eigenvalue problem:

~ /

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

– Numerical differentiation

• Often single displacement is not sensible to sample all vibrations

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

Conclusions

Yield information about stability of geometry

Required for temperature effects

Relativity

Fixing ZORA

Computational scaling: two subproblems

ELPA: Performance

Resolution of identity (RI)

Periodic GaAs, HSE06 hybrid functional

Hybrid functionals -- CPU scaling

Summary

Volker Blum (Duke Univ.)

Igor Ying Zhang (FHI)

Karsten Reuter (TU Munich)