16
Localized atomic orbitals in GPAW or as we like to call it: “LCAO mode” Ask Hjorth Larsen Nano-bio Spectroscopy Group Departamento de F´ ısica de Materiales Universidad del Pa´ ıs Vasco UPV/EHU May 21, 2013

Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Embed Size (px)

Citation preview

Page 1: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitalsin GPAW

or as we like to call it:

“LCAO mode”

Ask Hjorth Larsen

Nano-bio Spectroscopy GroupDepartamento de Fısica de MaterialesUniversidad del Paıs Vasco UPV/EHU

May 21, 2013

Page 2: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Real-space mode, mode=’fd’

I Very accurate

I Excellent parallelization (k-points, domains, bands)

I Can be a bit expensive at times

LCAO mode, mode=’lcao’

I Very efficient, particularly for large systems

I Good parallelization (k-points, domains, bands/orbitals)

I Not all that accurate

Planewave mode, mode=’pw’

I Very accurate, planewaves are very neat

I But less parallel than ’fd’ (k-points, bands only)

Page 3: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Localized basis sets

I Expand pseudowavefunctions in fixed orbitals:

|ψn〉 =∑µ

|Φµ〉 cµn

I Now cµn are the variational variables, and |Φµ〉 are fixedlocalized functions

I Derive new Kohn–Sham equations and solve:∑ν

Hµνcνn =∑ν

Sµνcνnεn

Thanks to Marco Vanin for the collaboration back in the days

Page 4: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Advantages

I More locality → better scaling of many operations

I Smaller dimension of Hamiltonian → we can use direct solver

I Direct solver → easier to converge (fewer steps)

I Small basis allows e.g. Green’s function based transportcalculations

Disadvantages

I Basis set is much less “complete” than real-space/planewaves

I Binding energies not so accurate

I (Alternatively: Spend ages choosing good basis functions)

I No simple way to crank up precision

Page 5: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Using LCAO mode

from ase.structure import molecule

from gpaw import GPAW

system = molecule(’H2O’)

system.center(vacuum =5.0)

calc = GPAW(mode=’lcao’, # important

basis=’dzp’, # also important

h=0.18 , # (the usual stuff)

xc=’PBE’)

system.set_calculator(calc)

system.get_potential_energy ()

Page 6: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Choosing basis functions — atomic orbitals

0 2 4 6 8 10Radius [Bohr]

Basi

s fu

nctio

ns o

f Fe 4s

4s conf.3d3d conf.

I Solve spherical Kohn–Sham equations for isolated atom

I Use external potential to confine wavefunctions within somecutoff

I Cutoff defined by requiring that each orbital increases inenergy a bit (e.g. 0.1 eV)

Page 7: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Choosing basis functions

0 2 4 6 8 10Radius [Bohr]

Basi

s fu

nctio

ns o

f Fe 4s

3d4s-dz3d-dzp polarization

I Obtain one atomic orbital from each valence state l, n bysolving radial atomic equation

I Add more functions with different radial parts

I Add more functions with different angular momentum

Page 8: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Basis set quality

Basis set

15

14

13

12

11

H 2O

tota

l ene

rgy

[eV]

szp

dz

dzp

tz qz

tzp

qzp d

zdp

tzdp

qzd

p tz

tp q

ztp

fd

Reasonably optimizedNot optimized at all!!

I Convergence of total energies with basis

I Basis sets are optimized only up to dzp!

I LCAO is better suited for structures

I (Note: Energy differences converge faster)

Page 9: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Calculation procedure

Solve ∇2vH(r) = −4πρ(r), ρ(r) = n(r) + atoms... O(N)

Calculate Vµν =

∫Φ∗µ(r)[vH(r) + vxc(r) + v(r)]Φν(r) dr O(N)

Calculate Hµν = Tµν + Vµν +∑aij

P a∗iµ ∆HaijP

ajν O(N)

with: Tµν = 〈Φµ|T |Φν〉 , P aiµ = 〈pai |Φµ〉 O(N)

Solve∑ν

Hµνcνn =∑ν

Sµνcνnεn O(N3)

Calculate ρνµ =∑n

cνnfnc∗µn O(N3)

Calculate n(r) =∑µν

Φ∗µ(r)Φν(r)ρνµ + ncore(r) O(N)

(Repeat as necessary)

Page 10: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Operation Parallelization Complexity

Multigrid Poisson r O(N)Density n(r) r, σ O(N)

XC vxc(r) r, σ O(N)Potential Vµν ν, r, σ, k O(N)

Diagonalize Hµν µ, ν, σ, k O(N3)Density matrix ρµν µ, ν, σ, k O(N3)

1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6log10(Number of atoms)

−2.5

−2.0

−1.5

−1.0

−0.5

0.0

0.5

1.0

1.5

log1

0(tim

e/sc

fste

p/se

cond

s)

[1.26] Vµν , n(r)

[0.71] xc[0.92] poisson[2.80] serial diag[2.56] parallel diag[2.75] ρµν

Page 11: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Parallelization of O(N 3) operations

0 2 4 6 0 2 4 6

0 2 4 6

1 3 5 7 1 3 5 70 2 4 6 0 2 4 61 3 5 7 1 3 5 70 2 4 6 0 2 4 61 3 5 7 1 3 5 7

I Left: 2D block cyclic layout for diagonalization

Hµν , cµn, ρµν

I Right: 1D columnated layout∑µν

Φ∗µ(r)Φν(r)ρµν → n(r)

I Must transfer back and forth between two layouts

Page 12: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Parallelization modes

I Parallelize over k-points/spins first (NK cores)

I Parallelize over domains next (ND = Nx ×Ny ×Nz)

I Parallelize over bands to use less memory (NB)

I Total number of CPUs should be NK ×ND ×NB

I CPUs for ScaLAPACK are taken within groups of ND ×NB

Rules of thumb for LCAO calculations

I ScaLAPACK might help beyond 30–60 atoms

I ScaLAPACK operations require high bandwidth (run withinsame node/infiniband)

I Parallelize a lot more over domains than bands

I Band parallelization helps reduce memory usage

I Band parallelization is useless without ScaLAPACK

Page 13: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Parallelization

from ase.io import read

from gpaw import GPAW

system = read(’hundredsofatoms.traj’)

# Assume we have 32 cores

calc = GPAW(mode=’lcao’, basis=’dzp’,

parallel=dict(domain =(2, 2, 4),

band=2,

sl_default =(4, 2, 64)),

nbands = len(system) * 6,

xc=’PBE’)

system.set_calculator(calc)

system.get_potential_energy ()

Page 14: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Example application

I Large numbers of similar calculations to investigate trends

I Study of reactivity of metal clusters of 20–200 atoms

Page 15: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Application: Size effects in transition metal clusters

20 40 60 80 100 120 140 160 180 200Number of atoms

6.0

5.5

5.0

4.5

4.0

3.5

3.0

2.5

O ad

sorp

tion

ener

gy [e

V]

PdRhRu

AuAg

Figure: Adsorption energies of oxygen ondifferent transition metal clusters

s1 d7

s1 d8

s1 d9

s1 d10

s2 d10

Fe Co Ni Cu Zn

Ru Rh Pd Ag Cd

Os Ir Pt Au Hg

I Smooth variationscan be attributed to“geometric effects”

I Noble metals showstrong oscillationsfrom electronic shellstructure

Page 16: Localized atomic orbitals in GPAW or as we like to … · Localized atomic orbitals in GPAW ... 13 12 11 H 2 O t o t a l e n e r g y [e V] szp dz dzp tz qz tzp qzp dzdp tzdp qzdp

Localized atomic orbitals in GPAW

Conclusions

I LCAO calculations are quite fast

I Do mind the parallelization options

I We should work on improving basis sets

I Maybe some day we should implement sparse / iterativeeigensolver

I Thank you for listening!