1 st Sum m er School in Theoretical
and Com p utational Chem istry of
Catalonia
July 2 5 -2 9 , 2 0 0 7
Directors : Feliu Maseras and Pere Alem any
MODULE C
Introd uction to electronic
structure calculations using
SIESTA
Director: Pab lo Ord ejn
Institut d e Cincia d e Materials d e Barcelona ( CSIC)
PROGRAM OF THE MODULE
Theory
Introd uction
Basic Execution
Pseud op otentials
Basis Sets
Matrix Elem ents
Diag onalization
Ord er-N Solvers
System atic Converg ence
Molecular Dynam ics
Structural Op tim izations
Parallelization
Analysis and p ost-p rocessing tools
+ Hand s-o n Sessions
TEACHERS OF THE MODULE
Ed uard o Ang lad a
UAM and NANOTEC, Mad rid
Javier Junq uera
Universid ad d e Cantab ria, Santand er
And rei Postnikov
Paul Verlaine University, Metz (France)
Pab lo Ord ejn
ICMAB and CIN2 ( CSIC) , Barcelona
SUMMARY OF THIS INTRODUCTION
Com p uter Sim ulations
The ab -initio m od el for atom istic
sim ulations in cond ensed m atter system s Ap p roxim ations!!
Density Functional Theory in a nutshell
SIESTA: a tool for larg e-scale DFT
calculations
What is Computer Simulation?
Com p uter Sim ulations : use a com p uter to solve
num erically the eq uations that g overn a certain
p rocess.
Sim ulation is p resent in every b ranch of science,
and even increasing ly in everyd ay life ( e. g . :
sim ulations in f in ances; w eather forecast; f lig ht
sim ulators )
Sim ulation in m aterials: Stud y the w ay in w hich the
b locks that b uild the m aterial interact w ith one
another and w ith the environm ent, and d eterm ine
the internal structure, the d ynam ic p rocesses and
the resp onse to external factors ( p ressure,
tem p erature, rad iation, etc ) .
Why are simulations interesting?
Sim ulations are the only g eneral m ethod to
solve m od els d escrib ing m any p articles
interacting am ong them selves.
Exp erim ents are som etim es lim ited ( control
of cond itions, d ata acq uisition,
interp retation) and g enerally exp ensive.
Sim ulations scale up w ith the increase of
com p uter p ow er ( that roug hly d oub les
every year!!)
Why are simulations interesting?
Alternative to ap p roxim ate solutions for
m od els ( trad itional theory )
Com p lem ent and alternative to
exp erim ental research
Increasing scop e and p ow er w ith im p roving
com p uters and cod es
Components of a Simulation
1 . A m od el of the interactions
b etw een the b locks that
b uild the m aterial.
Here: atom istic m od els &
DFT
2 . A sim ulation alg orithm : the
num erical solution to the
eq uations that d escrib e the
m od el.
3 . A set of tools for the
analysis of the results of the
sim ulation.
Challenges of Simulation of Materials
Physical and m athem atical found ations:
W hat ap p ro xim atio ns co m e in?
The sim ulatio n is o nly as g o o d as the m o d el b eing so lved
System s w ith m any p articles and lo ng -tim e scales are p ro b lem atical.
Co m p uter tim e is lim ited : few p articles fo r sho rt tim e.
Sp ace-Tim e is 4 d .
2 x L i CPU x 1 6
Mo o re s Law im p lies leng ths and tim es w ill d o ub le every 4 years
if O( N)
How d o w e estim ate errors? Statistical and system atic. ( b ias)
Ho w d o w e m anag e ever m o re co m p lex co d es?
Challenges of Simulation of Materials
Multip les scales:
leng ths
1 cm --- 1 (10-10 m)
times:
years --- fs (10-15 s)
Challenges of Simulation of Materials
Multip le
scales
Macro and
m esoscop ic
p henom ena;
Therm od ynam ics
Atom ic structure and
d ynam ics
Electronic states
Chem ical b ond s and
reactions,
excitations
Taken from : Cep erley /Johnson UIUC
s
ms
ns
e
e
t iv
c
fe
Ef
Density
Functio nal
theo ries
ps
fs
e
b
m
g
d in
Quantum
Chem istry
theo ries
Co ntinuum
Pheno m eno lo g ical
m o d els
Ato m ic
Fo rce-f ie ld
m o d els
fe
f
E
e
v
i
t
Ha
lt
mi
n
n ia
100 101 102 103 104 105 106
Complexity of a Simulation
The relation b etw een com p uting tim e T ( CPU)
and d eg rees of freed om N
( num b er of atom s, electrons, leng th
T O( N)
in the b est ( sim p lest) cases
( linear scaling )
T O( N 3 )
q uantum m echanics
( Matrix d iag o nalisatio n and inversio n)
T eN
so m e m o d els and system s
( Quantum chem istry; m ultip le m inim a p ro b lem s,
etc)
Estimate: accessible time and size limits
Mod ern Com p uters: 1 TFlop = 1 0 1 2 Flop s -- w ith 3 x 1 0 7 s/year
~ 1 0 1 9 Flop s/year
W ith O( N) m ethod s:
# op s = 1 0 1 9 1 0 0 N n t N n t 1 0 1 7
( at least a factor 1 0 0 - 1 0 neig hb ors x 1 0 operations, to calculate distances)
N scales as Volum e, w hich scales as L 3
Tim e ( n t ) scales as L ( for inform ation to p rop ag ate along the system ) n t ~ 1 0 L
Therefore:
N nt ~
L3 1 0 L
1 0 L4
In silicon: 1 0 4 atom s/b ox sid e:
N ~ 1 0 1 2 atom s
L ~ 2 m !!
n t ~ 105
t ~ 1 fs t ~ 10-10 s = 0.1 ns
1 0 17
L 1 0 4 ato m s/b o x
sid e
Plan your
sim ulation
intellig ently
!!
Algorithms
Structural
Op tim ization
m inim um energ y
conf ig urations
T= 0
Monte Carlo
T> 0
T> 0
t herm od ynam ics:
statistical averag es
t herm od ynam ics:
statistical averag es
several ensem b les
several ensem b les
no inform ation
on real d ynam ics
no tem p erature
local m inim a
Molecular
Dynam ics
long tim e
scales
( eq uilib rium )
no inform ation o n
d ynam ics
inform acin o n real
d ynam ics ( non-eq uil)
no real tim e
( kMC)
o nly at
eq uilib rium
lim ited tim e scale
( accelerated d yn. )
erg od icity p rob lem s
larg e com p utational
cost
Structure of a simulation: questions
w hat interactions m od el should I use ( level of
theory) ?
how d o I b eg in the sim ulation?
how m any m olecules d o I need to consid er?
w hat is the size of m y sim ulation b ox?
how d o I take the ensem b le averag e in a MC
sim ulation?
how d o I take the tim e averag e in a MD sim ulation?
how reliab le are m y sim ulation results?
MODELS - The ab-initio approach
The g eneral theory of q uantum m echanics is
now alm ost com p lete. The und erlying
p hysical law s necessary for the m athem atical
theory of a larg e p art of p hysics and the
w hole of chem istry are thus com p letely
know n, and the d iff ic ulty is only that the
exact ap p lication of these law s lead s to
eq uations m uch too com p licated to b e
solub le.
Dirac, 1 9 2 9
MODELS - The ab-initio approach
Schrdingers equation (assuming non-relativistic)
What are the main approximations?
Born-Op p enhaim er
Deco up le the m o vem ent o f the electro ns and the
nuclei.
Density Functional Theory
Treatm ent o f the electron electron interactions.
Pseud op otentials
Treatm ent o f the ( nuclei + co re) valence.
Basis set
To expand the wave functions.
Numerical evaluation of matrix elements
E fficient and self-consistent com putations of H and S.
Sup ercells
To deal with periodic system s
Adiabatic or Born-Oppenheimer approx.
Nuclei much slower
than the electrons
At any moment the electrons will be in their ground state for that particular
instantaneous ionic configuration.
Solve electronic equations assuming
fixed positions for nuclei
(1)
Move the nuclei as classical particles
in the potential generated by the e-
(2)
Wave function decoupled, Classical nuclei
Fixed potential
external to e-
Electrons
Nuclei
Classical dynamics
Constant
(scalar)
Density Functional Theory... in a nutshell
1.
p article d ensity
( Ho henb erg -Ko hn
Theo rem s)
2 . Interacting electro ns: As if non-interacting electro ns in an
effective p otential ( Ko hn-Sham A nsatz )
3 . A p p ro xim atio n:
n the effective XC p o tential
Lo cal and
Quasilo cal,
Hyb rid s
LDA
GGA
Density Functional Theory... in a nutshell
Ground State (HK)
One electron (KS)
Kohn-Sham Eqs.: Self-consistency
Initial guess
Calculate effective potential
Solve the KS equation
No
Compute electron
density
Yes
Self-consistent?
Output quantities
Energy, forces,
stresses
Density Functional Theory
LDA and GGA:
Practical schem e for up to ~ 1 0 0 0
atom s
Pred ictive Pow er:
A ccuracy in g eo m etries: b etter than 0 . 1
Accuracy in (relative) energies: better than 0.2 eV
(often much better -- 0.01 eV)
Caveats (many! ):
Pro b lem s d escrib ing w eak interactio ns ( Van d er W aals)
Pro b lem s d escrib ing stro ng ly co rrelated system s
Excited electro nic states
Typical Accuracy of the xc functionals
LDA
GGA
-1% , -3%
+1%
+10, +40%
-20%, +10%
Ec
+15%
-5%
Egap
-50%
-50%
LDA: crude aproximation but sometimes is accurate enough (structural properties, ).
GGA: usually tends to overcompensate LDA results, not always better than LDA.
In many cases, GGA is a must:
Ground state of Iron
LSDA
NM
fcc
in contrast to
GGA
LSDA
exp erim ent
GGA
LSDA
Results obtained with Wien2k.
Courtesy of Karl H. Schwartz
GGA
FM
b cc
Correct lattice
constant
Exp erim ent
FM
b cc
Treatment of the boundary conditions
Isolated objects (atoms, molecules, clusters)
open boundary conditions
(defined at infinity)
3D periodic objects (crystals)
periodic boundary conditions
(might be considered as the repetition of a
building block, the unit cell)
Mixed boundary conditions
1D periodic (chains)
2D periodic (slabs and interfaces)
Supercells
Systems with open and mixed periodic boundary
conditions are made artificially periodic
Defects
Molecules
Surfaces
M. C. Payne et al., Rev. Mod. Phys., 64, 1045 (1992)
A periodic potential: Blochs theorem
Bloch Theorem: The eigenstates of the one-electron Hamiltonian in a
periodic potential can be chosen to have the form of a plane wave times a
function with the periodicity of the Bravais lattice.
Periodicity in reciprocal space
k-points Sampling
Finite number of wave functions (bands)
at an infinite number of k-points.
Instead of computing an infinite
number of electronic wave functions
r
!( r ) =
#"
i
r r
r 2
dk n( k )$ i ( k )
BZ
In practice: electronic wave functions at k-points that are very
close together will be almost identical
k-point Sampling
k-points Sampling
Essential for:
Sm all cells
Metals
Mag netic system s
Good d escrip tion of the Bloch
states at the Ferm i level
Real sp ace Recip rocal sp ace
Larg e cells: p oint
k = ( 0 ,0 ,0 )
A code for DFT simuls. in large systems
Sp anish Initiative fo r Electro nic
Sim ulatio ns w ith Tho usand s o f Ato m s
So ler, Artacho , Gale, Garca, Junq uera, Ord ej n and Snchez -Po rtal
J. Phys. : Co nd . Matt 1 4 , 2 7 4 5 ( 2 0 0 2 )
Num erical ato m ic o rb itals
O( N) m etho d o lo g y
Very eff ic ient
Parallelized ( 1 3 2 . 0 0 0 ato m s in 6 4 no d es)
The SIESTA code
http : //w w w . uam . es/siesta
Linear-scaling DFT
Num erical atom ic orb itals, w ith q uality control.
Forces and stresses for g eom etry op tim ization.
Diverse Molecular Dynam ics op tions.
Cap ab le of treating larg e system s w ith m od est
hard w are.
Parallelized .
The SIESTA Team
Em ilio Artacho
Julian Gale
Perth)
Alb erto Garca
Javier Junq uera
Richard Martin
Pab lo Ord ejn
Daniel Snchez-Portal
Jos M. Soler
( Cam b rid g e University)
( Curtin Inst. of Tech.,
( ICMAB, Barcelona)
( U. Cantab ria, Santand er)
( U. Illinois, Urb ana)
( ICMAB, Barcelona)
( UPV, San Seb astin)
( UAM, Mad rid )
The SIESTA Manager
Ed uard o A ng lad a
Mad rid )
( UAM and Nanotec,
Main SIESTA Reference
BASIC REFERENCE:
J. Soler et al, J. Phys: Cond ens. Matter, 1 4 , 2 7 4 5
(2002)
3 5 0 citations ( Dec 2 0 0 5 )
> 7 0 0 ( June 2 0 0 7 )
More than 1 0 0 0 reg istered users
( SIESTA is free for acad em ic use)
More than 4 5 0 p ub lished p ap ers
have used the p rog ram
Siesta resources (I)
W eb page: http://www.uam.es/siesta
Pseudos and basis database
M ailing list
Usage manual
Soon: http://cygni.fmc.uam.es/mediawiki
Issue tracker (for bugs, etc)
M ailing list archives
W iki
Siesta resources (2)
And rei Postnikov Siesta utils p ag e:
http : //w w w . ho m e. uni-o snab rueck. d e/ap o stnik/d o w nlo ad . htm l
Lev Kantorovich Siesta utils p ag e:
http : //w w w . cm m p . ucl. ac. uk/~ lev/co d es/lev0 0 /ind ex. htm l
Basics of Electronic Structure Methods
comprehensive review of DFT,
including most relevant references and exercises
Basics of DFT
Rigorous and unified account of the fundamental principles of DFT
OUTLOOK FOR THE COURSE
Tutorial: Theory & Practical Sessions
Basic Und erstand ing of concep ts involved in the
calculations
Practical know -how
Meaning ful ( not b lind ) Sim ulations!!
DO ASK W HAT YOU DO NOT UNDERSTAND!!