introduction to the elk code 0.5cm...

32
Introduction To The Elk Code Kay Dewhurst 1 , Sangeeta Sharma 1 , Lars Nordstr¨ om 2 , Francesco Cricchio, Fredrik Bultmark, Hardy Gross 1 1 Max-Planck-Institut f¨ ur Mikrostrukturphysik, Halle 2 Division of Materials Theory, Uppsala University

Upload: others

Post on 29-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Introduction To The Elk Code

Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstrom2,Francesco Cricchio, Fredrik Bultmark, Hardy Gross1

1Max-Planck-Institut fur Mikrostrukturphysik, Halle2Division of Materials Theory, Uppsala University

Page 2: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

What is Elk?

I Elk is an all-electron LAPW+l.o. code

I In development for about 8 years (originally theEXCITING code)

I Simple as possible (∼ 40k lines of Fortran 90)

I Aims to be trustworthy

I Aims to be feature-complete

I Aims to be fully documented

I Released under the GPL

I Website: http://elk.sourceforge.net/

Page 3: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Contributors

JKD, Sangeeta Sharma, Lars Nordstrom, Francesco Cricchio,Fredrik Bultmark, Hardy Gross, Claudia Ambrosch-Draxl, ClasPersson, Christian Brouder, Rickard Armiento, AndrewChizmeshya, Per Anderson, Igor Nekrasov, Sushil Auluck,Frank Wagner, Fateh Kalarasse, Jurgen Spitaler, StefanoPittalis, Nektarios Lathiotakis, Tobias Burnus, StephanSagmeister, Christian Meisenbichler, Sebastien Lebegue, YigangZhang, Fritz Kormann, Alexey Baranov, Anton Kozhevnikov,Shigeru Suehara, Frank Essenberger, Antonio Sanna, TyrelMcQueen, Tim Baldsiefen, Marty Blaber, Anton Filanovich,Torbjorn Bjorkman, Martin Stankovski, Jerzy Goraus, MarkusMeinert, Daniel Rohr and Vladimir Nazarov

D. J. Singh, Planewaves, Pseudopotentials and the LAPWMethod (Kluwer Academic Publishers, Boston, 1994)

Page 4: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

Basic aim of Elk is to solve the Kohn-Shamequations for external fields

External field Conjugate field

Vext(r) ρ(r)Bext(r) m(r)

E(r) (= −∇V (r)) ρ(r)A j

Page 5: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Magnetisation m(r) of a Cr monolayer

Page 6: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Kohn-Sham equations solved in two-step process:

First-variational step: scalar potential and E only

H = Ts + Vext + E · r + Vxc

and solve Hφi = εiφi

Second-variational step: add magnetic fields, spin-orbitcoupling and A field

Hij = εiδij + 〈φi|σ · (Bext + Bxc) + σ · L+ A · ∇|φj〉

Page 7: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Full spinor wavefunctions:

φik(r) =

(U↑ik(r)

U↓ik(r)

)× eik·r

I Spin-spiral states also available:

φik(r) =

(U↑ik(r)ei(k+q/2)·r

U↓ik(r)ei(k−q/2)·r

)

(Frank Essenberger’s talk)

Page 8: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I APW radial derivative matching to arbitrary orders atmuffin-tin surface

I Arbitrary number of local-orbitals allowed

I LSDA and GGA functions available

I Interface to libxc, > 100 functionals (Miguel Marques)

I Fully non-collinear implementation using Kubler’s ‘trick’

I fixed spin moment or direction

I spin-orbit coupling

I LDA+U available (Lars Nordstrom, Francesco Chricchio)

I Spin-current tensor decomposition (LN, FC)

Page 9: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Automatic determination of spacegroup symmetry

I Automatic reduction to primitive cell

I Generation of unit cell with spacegroup and Wyckoffcoordinates (with spacegroup utility)

I Inversion symmetry exploited for real diagonalisation

I Iterative diagonalisation

I Automatic determination and reduction of k-point set

I Symmetrisation of density, potential and fields

Page 10: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Forces (works with magnetism, etc)

I Structural optimisation

I Various mixing schemes (adaptive, Pulay, Broyden)

I Total DOS, partial DOS in irreducible representations

I Electron localisation function (ELF)

I Electron localisability indicator (ELI) plots with DGrid(Alexey Baranov)

I Plots of wavefunctions, band structures, potentials, etc.

I STM plots

Page 11: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Core states solved with the Dirac equation

I c is a global constant in the code

I Polarised cores

I Mossbauer isomer shift, EFG and hyperfine fields

I Effective masses

I Fermi surface plots

I Equation of state fitting (with eos utility)

Page 12: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Momentum matrix elements with s.o. correction

I Macroscopic RPA dielectric function

I Kerr angle and Magneto-Optic Kerr Effect (MOKE) output

I Energy loss near edge structure (ELNES) for arbitraryq-vectors

I Non-linear optical (NLO) second-harmonic generation

I Core-state optical spectra (XPS, XAS)

Page 13: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Hartree-Fock

I Optimised effective potential (OEP) with exact exchangefunctional

I Reduced density matrix functional theory (RDMFT)(Sangeeta Sharma, Tim Baldseifen, Florian Eich)

I Microscopic RPA function ε(G,G′,q, w) in retarded,advance, time-ordered and Matsubara form

I Bethe-Salpeter equation (BSE) beyond Tamm-Dankoff(Matteo Gatti)

I Linear-response time-dependent density functional theory(TDDFT) (SS)

Page 14: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Phonons for arbitrary q-vectors

I Thermodynamic quantities: zero point, free energy,entropy, heat capacity

I Electron-phonon coupling matrices

I Phonon linewidths

I Eliashberg function α2F (ω)

I Electron-phonon coupling constant λ

I McMillan-Allen-Dynes superconducting Tc

I Eliashberg equations (Antonio Sanna)

Page 15: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Features

I Everything is interoperable, so you can run:

A structural optimisation calculation with A, B and E fields, inconjunction with a non-collinear, spin-spiral, fixed spin moment,GGA+U calculation, whilst constraining ∇ ·Bxc = 0, and thencompute a BSE core-state spectra beyond the Tamm-Dankoffapproximation on top of this.

This interoperability makes for robust code

Page 16: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Limitations

Can’t (yet) perform

I Molecular dynamics

I Automatic stress/strain/elastic tensor

I Automatic isobaric/isovolumetric optimisation

I GW approximation

I Dynamical mean field theory (DMFT)

I Superconducting density functional theory (SCDFT)

I True non-collinear functional for spin-dynamics (F. Eich)

I TDDFT in real-time for attosecond electron dynamics

I Berry phase

I Meta-GGA and van der Waals functionals

I . . .

Page 17: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Requirements

Minimum requirements:

I UNIX/Linux based computer

I Optimising Fortran 90 compiler

Recommended requirements:

I Multi-node computer cluster

I OpenMP + Message Passing Interface (MPI) environment

I Optimised BLAS/LAPACK and FFT libraries

Page 18: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Parallelism in Elk

Page 19: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Parallelism in Elk

Page 20: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Parallelism in Elk

Code parallelised in three ways:

I OpenMP(also in MKL/ACML BLAS/LAPACK/FFT libraries)

I Message Passing Interface (MPI)

I Phonon calculations via networked filesystem

Page 21: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr
Page 22: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr
Page 23: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr
Page 24: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr
Page 25: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

I Parallelised over k-points with MPI and OpenMP

I Parallelised over states, atoms, G-vectors with OpenMP

I Parallelised over q-points, atoms and polarisations forphonon calculations with NFS

I BLAS/LAPACK/FFT parallelised with MKL/ACML

Page 26: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Compiling Elk

1. Download and unpack elk-1.3.24.tgz

2. Run setup

3. Edit make.inc for optimimal performance

4. Run make

The executable is elk and in the directory elk/src/

Page 27: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Running Elk

Normally, only one input file is required: elk.in

All output files are in uppercase and have the extension .OUT

Some are binary, others are human-readable

General information in the file INFO.OUT

Page 28: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Elk.intasks

0 : ground-state run

10 : total and partial DOS

120 : momentum matrix elements

180 : RPA ε−1(G,G′,q, w)185 : Bethe-Salpeter equation (BSE)

avec

5.13 5.13 0.00

5.13 0.00 5.13

0.00 5.13 5.13

atoms

1

’Si.in’

2

0.0 0.0 0.0

0.25 0.25 0.25

ngridk

5 5 5

Page 29: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Species files

Species files are required to tell the code things like muffin-tinradius, type of (L)APW, local-orbitals and which states are inthe core

Elements from H to Rf available in the elk/species/ directory

Page 30: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Running Elk

Full test suite, just runmake test

Wide range of examples available in elk/examples/ whichdemonstrate many features of the code

Also available is the Elk manual and a very active forum on theElk website

Page 31: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Units

All input and output units are atomic: Units obtained bysetting

me = 1 e = 1 ~ = 1 4πε0 = 1

Dervied units:

I Length: 1 Bohr a0 = 4πε0/mee2 ∼ 0.52918 A

I Energy: 1 Hartree EH = mee4/(4πε0~)2 ∼ 27.211 eV

I Time: ~/Eh ∼ 2.418× 10−17 s

I Magnetic field: e/a20 ∼ 1715.255 Tesla

Also note α = e2/(4πε0)~c, thus

c =1

α∼ 1/137

Globally adjustable in Elk

Page 32: Introduction To The Elk Code 0.5cm to[scale=0.04]elksilhouetteelk.sourceforge.net/CECAM/Dewhurst-Elk.pdf · Introduction To The Elk Code Kay Dewhurst1, Sangeeta Sharma1, Lars Nordstr

Beware

It’s easy to generate rubbish with electronic structure codes

Always check for convergence with respect to relevant variables:

I rgkmax: planewave cut-off for APWs

I lmaxapw, lmaxvr, lmaxmat: angular momentum cut-offs

I nempty: number of first-variational states, and thereforesecond-variational basis size(essential for magnetism, optics, . . .)

I ngridk: k-point grid

I . . .

Also compare with other codes: ABINIT, VASP, PWSCF,Wien2k, EXCITING, FLEUR, RSPt, SIESTA, CASTEP, etc.