DFT Hands On Nguyen PDF
DFT Hands On Nguyen PDF
Quantum ESPRESSO
1
What we will do today
Hands-on #1: Total energy and relaxations for Silicon
Basic self consistent calculation (scf)
Convergence of total energy & plane waves cutoff (ecut)
Convergence of total energy & BZ sampling (k-point)
Lattice constant (vc-relax)
Files for practice
/silicon/ scf
ecut
Hands-on #1
k-point
vc-relax
rho Silicon
dos
bands
phonon
2
Exercise #1
Do it by yourself: Graphene’s calculation!
Basic self consistent calculation (scf)
Convergence of total energy & plane waves cutoff (ecut)
Convergence of total energy & BZ sampling (k-point)
Lattice constant (vc-relax)
Files for exercise
/graphene/ scf
ecut
Hands-on #1
k-point
vc-relax
rho
dos
bands
phonon
3
What we will do today
Hands-on #2: Charge density, Band structure, DOS, Phonon
ecut
k-point
vc-relax
rho Silicon
dos
Hands-on #2
bands
phonon
4
Exercise #2
Do it by yourself: Graphene’s calculation!
Energy (eV)
Band structure (bands) 1
0
-1
Files for exercise -2
-3
/graphene/ scf -4
-5
Γ M K Γ DOS
ecut b 18
LO
15
TO
rho 3 TA
ZA
0
Γ M K Γ DOS
dos
Hands-on #2
bands
phonon
5
Structure of QE I/O file
Hands-on #1
Binary file
Text file Text file
Data file
tmp folder
6
Structure of QE I/O file
Hands-on #1
Binary file
Text file Text file
7
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS
mixing_beta=0.7, Silicon
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
8
Kohn-Sham equations
IN RUN OUT
Model: Physical quantities:
unit cell charge density
lattice vectors total energy
basis KS wavefunctions
KS energies
Physical approx:
xc-approximation
GGA, LDA, …
Numerical approx:
energy cut-off n-D 3D
k-points grid
SCF procedure
H[n(r)]
10
Structure of QE input file
&CONTROL Construct Vion (r)
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/', Initial guess n(r)
outdir=‘../tmp/',
/
&SYSTEM
ibrav=2, Compute VH [n] + VXC [n]
celldm(1)=10.2625,
nat=2,
ntyp=1, Vef f = Vion + VH [n] + VXC [n]
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS ⇥ 1 2 ⇤
mixing_beta=0.7, Solve r + Vef f (r) i (r) = "i i (r)
conv_thr=1d-8,
2
/
ATOMIC_SPECIES X
Si 28.0855 Si.pbe-rrkj.UPF Compute n(r) = | i (r)|2
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic NO YES Energy
4 4 4 1 1 1 Self-consistent?
Forces
11
Structure of QE input file
&CONTROL Construct Vion (r) ???
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/', Initial guess n(r)
outdir=‘../tmp/',
/
&SYSTEM
ibrav=2, Compute VH [n] + VXC [n]
celldm(1)=10.2625,
nat=2,
ntyp=1, Vef f = Vion + VH [n] + VXC [n]
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS ⇥ 1 2 ⇤
mixing_beta=0.7, Solve r + Vef f (r) i (r) = "i i (r)
conv_thr=1d-8,
2
/
ATOMIC_SPECIES X
Si 28.0855 Si.pbe-rrkj.UPF Compute n(r) = | i (r)|2
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic NO YES Energy
4 4 4 1 1 1 Self-consistent?
Forces
12
Periodic boundary conditions
Crystal structure: Bravais lattice + Atomic basis
a1
a2
☞ Bravais lattice: (shape of unit cell & how it repeats). Specified by primitive
lattice vectors a1, a2, a3
R = n1a1 + n2a2 + n3a3, where n1, n2, n3 are integers.
☞ Atomic basis: how many atoms are in the unit cell, and how they are arranged.
13
Periodic boundary conditions
4 Lattice types
7 Crystal classes
14
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir=‘../tmp/',
/
&SYSTEM ibrav = 1 (SC)
ibrav=2, ibrav = 2 (FCC)
celldm(1)=10.2625, ibrav = 4 (Hexagonal)
nat=2, …
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0, simple cubic:
/ v1 = a(1,0,0)
&ELECTRONS v2 = a(0,1,0)
mixing_beta=0.7, v3 = a(0,0,1)
conv_thr=1d-8,
/ face centered cubic:
ATOMIC_SPECIES v1 = (a/2)(-1,0,1)
Si 28.0855 Si.pbe-rrkj.UPF v2 = (a/2)(0,1,1)
ATOMIC_POSITIONS (alat) v3 = (a/2)(-1,1,0)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
15
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1, v1 v2
ecutwfc=60.0,
ecutrho=720.0, v3
/
&ELECTRONS Silicon
mixing_beta=0.7,
conv_thr=1d-8,
/ face centered cubic:
ATOMIC_SPECIES v1 = (a/2)(-1,0,1)
Si 28.0855 Si.pbe-rrkj.UPF v2 = (a/2)(0,1,1)
ATOMIC_POSITIONS (alat) v3 = (a/2)(-1,1,0)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
16
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2, unit bohr
celldm(1)=10.2625, a
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/ a a
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/ face centered cubic:
ATOMIC_SPECIES v1 = (a/2)(-1,0,1)
Si 28.0855 Si.pbe-rrkj.UPF v2 = (a/2)(0,1,1)
ATOMIC_POSITIONS (alat) v3 = (a/2)(-1,1,0)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic 1 bohr = 0.529177 Å
4 4 4 1 1 1
17
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625, a
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/ a a
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
18
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625, a
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/ a a
&ELECTRONS
mixing_beta=0.7, Silicon
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
19
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625, a
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/ a a
&ELECTRONS
mixing_beta=0.7, Silicon
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00 Mass of Si
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
20
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2, PP file
celldm(1)=10.2625, a
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/ a a
&ELECTRONS
mixing_beta=0.7, Silicon
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
21
Structure of QE input file
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si', FCC structure
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625, a
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/ a a
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF atomic positions are in cartesian
ATOMIC_POSITIONS (alat) coordinates, in units of the lattice
Si 0.00 0.00 0.00 parameter.
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
22
How to check model structure
Xcrysden: http://www.xcrysden.org/ 23
How to check model structure
24
How to check model structure
Input file
25
How to check model structure
26
External nuclear potential
Construct Vion (r) ???
⇥ 1 2 ⇤
Solve r + Vef f (r) i (r) = "i i (r)
2
X
Compute n(r) = | i (r)|2
NO YES Energy
Self-consistent?
Forces
27
External nuclear potential
Electrons experience a Coulomb valence valence
electrons
potential due to the nuclei with electrons
simple form:
core pseudo-
Z electrons potential
Vion =
r
But this leads to computational problems!
Pseudopotential (PP):
Replace the strong Coulomb
potential of the nucleus and
tightly bound core electrons by
an effective ionic potential
acting on the valence electrons. all-electron potential
28
Pseudopotential
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF Name of the pseudopotential file
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
29
How to get pseudopotential
http://www.quantum-espresso.org/pseudopotentials/
Si.pbe-rrkj.UPF
type of exchange-
correlation functional
type of pseudopotential
30
Pseudopotential
&CONTROL Si.pbe-rrkj.UPF
calculation='scf', <PP_INFO>
Generated using Andrea Dal Corso code (rrkj3)
restart_mode='from_scratch', Author: Andrea Dal Corso Generation date: unknown
Info: Si PBE 3s2 3p2 RRKJ3
prefix='si', 0 The Pseudo was generated with a Non-Relativistic Calculation
2.50000000000E+00 Local Potential cutoff radius
pseudo_dir='../pseudo/', nl pn l occ Rcut Rcut US E pseu
3S 1 0 2.00 2.50000000000 2.60000000000 0.00000000000
outdir='../tmp/', 3S 1 0 0.00 2.50000000000 2.60000000000 0.00000000000
3P 2 1 2.00 2.50000000000 2.70000000000 0.00000000000
/ 3D 3 2 0.00 2.50000000000 2.50000000000 0.00000000000
</PP_INFO>
&SYSTEM
ibrav=2, <PP_HEADER>
0 Version Number
celldm(1)=10.2625, Si Element
NC Norm - Conserving pseudopotential
nat=2, F Nonlinear Core Correction
SLA PW PBE PBE PBE Exchange-Correlation functional
ntyp=1, 4.00000000000 Z valence
-7.47480832270 Total energy
ecutwfc=60.0, 0.0000000 0.0000000 Suggested cutoff for wfc and rho
2 Max angular momentum component
ecutrho=720.0, 883 Number of points in mesh
2 3 Number of Wavefunctions, Number of Projectors
/ Wavefunctions nl l occ
3S 0 2.00
&ELECTRONS 3P 1 2.00
</PP_HEADER>
mixing_beta=0.7,
conv_thr=1d-8, <PP_MESH>
<PP_R>
/ 1.77053726905E-04 1.79729551320E-04 1.82445815642E-04 1.85203131043E-04
1.88002117930E-04 1.90843406086E-04 1.93727634813E-04 1.96655453076E-04
ATOMIC_SPECIES 1.99627519645E-04 2.02644503249E-04 2.05707082721E-04 2.08815947154E-04
2.11971796056E-04 2.15175339506E-04 2.18427298316E-04 2.21728404189E-04
Si 28.0855 Si.pbe-rrkj.UPF 2.25079399889E-04 2.28481039403E-04 2.31934088115E-04 2.35439322975E-04
2.38997532677E-04 2.42609517831E-04 2.46276091150E-04 2.49998077629E-04
ATOMIC_POSITIONS (alat) 2.53776314730E-04 2.57611652573E-04 2.61504954124E-04 2.65457095393E-04
2.69468965628E-04 2.73541467517E-04 2.77675517391E-04 2.81872045428E-04
Si 0.00 0.00 0.00 2.86131995864E-04 2.90456327206E-04 2.94846012447E-04 2.99302039285E-04
3.03825410344E-04 3.08417143402E-04 3.13078271619E-04 3.17809843768E-04
Si 0.25 0.25 0.25 3.22612924472E-04 3.27488594446E-04 3.32437950735E-04 3.37462106965E-04
3.42562193593E-04 3.47739358159E-04 3.52994765549E-04 3.58329598249E-04
K_POINTS automatic
4 4 4 1 1 1
31
Plane wave expansion
In a periodic system we can write the KS states as a
superposition of plane waves:
1 X G i(k+G)·r
k,n (r) = ck,n e
⌦
G
~2 2
|k + G| Ecut
2m
32
Plane wave expansion
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1, ~2
ecutwfc=60.0, |k + G|2 Ecut
ecutrho=720.0, 2m
/
&ELECTRONS Units: Ry (1 Ry = 0.5 Ha = 13.6057 eV)
mixing_beta=0.7, For ultrasoft pseudopotentials we have also:
conv_thr=1d-8, ecutrho = usually 8-12 ⨉ ecutwfc
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
33
Initial n(r)
Construct Vion (r) ✔
⇥ 1 2 ⇤
Solve r + Vef f (r) i (r) = "i i (r)
2
X
Compute n(r) = | i (r)|2
NO YES Energy
Self-consistent?
Forces
34
Initial n(r)
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS startingwfc = ‘atomic’(DEFAULT)
mixing_beta=0.7, = ‘random’
conv_thr=1d-8, = ‘file’
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
35
Sampling of the Brillouin zone
Many quantities we need to compute involve an integral over the BZ:
Z
1
Ā = A(k)d(k)
⌦BZ BZ
1 XZ
2
n(r) = | i,k (r)| f (✏i,k ✏F )d(k)
⌦BZ i BZ
36
Monkhorst and Pack (1976)
4 ⇥ k1 ! !1 = 4/16 = 1/4
4 ⇥ k2 ! !2 = 4/16 = 1/4
8 ⇥ k3 ! !3 = 8/16 = 1/2
Z
1 1 1 1
A(k)d(k) ' A(k1 ) + A(k2 ) + A(k3 )
⌦BZ BZ 4 4 2
37
Sampling of the Brillouin zone
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
ATOMIC_SPECIES K_POINTS automatic
Si 28.0855 Si.pbe-rrkj.UPF nk1, nk2, nk3, k1, k2, k3
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00 nk1, nk2, nk3 as in Monkhorst-Pack
Si 0.25 0.25 0.25 grids k1, k2, k3 must be 0 ( no offset ) or
K_POINTS automatic 1 ( grid displaced by half a grid step in
4 4 4 1 1 1 the corresponding direction )
38
QE run
Construct Vion (r) ✔
⇥ 1 2 ⇤
Solve r + Vef f (r) i (r) = "i i (r)
2
X
Compute n(r) = | i (r)|2
NO YES Energy
Self-consistent?
Forces
39
QE run
Construct Vion (r) ✔
⇥ 1 2 ⇤
Solve r + Vef f (r) i (r) = "i i (r)
2
X
Compute n(r) = | i (r)|2
NO YES Energy
Self-consistent?
Forces
40
QE run
Construct Vion (r) ✔
X
Compute n(r) = | i (r)|2
NO YES Energy
Self-consistent?
Forces
41
Solve wave equation
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS diagonalization = ‘david’ (DEFAULT)
mixing_beta=0.7, = ‘cg’
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
42
QE run
Construct Vion (r) ✔
NO YES Energy
Self-consistent?
Forces
43
QE run
Construct Vion (r) ✔
44
Self-consistency
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS
mixing_beta=0.7, Convergence threshold for self-consistency:
conv_thr=1d-8, estimated energy error > conv_thr (NO)
/
ATOMIC_SPECIES or energy error < conv_thr (YES)
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
45
QE run
Construct Vion (r) ✔
46
new n(r)
&CONTROL
calculation='scf',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS Mix new and old density:
mixing_beta=0.7, 0.7 = 70% of the new density and
conv_thr=1d-8, 30% of old density at first step
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
47
QE run
Construct Vion (r) ✔
48
Total energy
$ pw.x <Si.scf.in> Si.scf.out &
$ vi Si.scf.out
or
$ grep ! Si.scf.out
49
QE run
Construct Vion (r)
Fixed ions
⇥ 1 2 ⇤
Solve r + Vef f (r) i (r) = "i i (r)
2
X
Compute n(r) = | i (r)|2
NO YES Energy
Self-consistent?
Forces
50
Structure optimization
&CONTROL
calculation=‘vc-relax',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir=‘../tmp/',
forc_conv_thr=1d-5,
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
&IONS Broyden–Fletcher–Goldfarb–Shanno (BFGS)
ion_dynamics='bfgs',
/ algorithm is an iterative method for solving
&CELL unconstrained nonlinear optimization problems.
cell_dynamics='bfgs',
press=0.0,
press_conv_thr=0.5,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
51
Structure optimization
&CONTROL
calculation=‘vc-relax',
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir=‘../tmp/',
forc_conv_thr=1d-5,
/
&SYSTEM Cell lattice parameters and free (internal)
ibrav=2, coordinates of the atoms may be changed by
celldm(1)=10.2625,
nat=2, relaxation
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
/
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
&IONS
ion_dynamics='bfgs',
/
&CELL
cell_dynamics='bfgs',
press=0.0,
press_conv_thr=0.5,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
4 4 4 1 1 1
52
What we will do today
Hands-on #1: Total energy and relaxations for Silicon
Basic self consistent calculation (scf)
Convergence of total energy & plane waves cutoff (ecut)
Convergence of total energy & BZ sampling (k-point)
Lattice constant (vc-relax)
Files for practice
/silicon/ scf
ecut
Hands-on #1
k-point
vc-relax
rho Silicon
dos
bands
phonon
53
Result
Hands-on #1
/silicon/ scf
54
Result
Hands-on #1
/silicon/ ecut
Time (s)
55
Result
Hands-on #1
/silicon/ k-point
offset
Total energy (Ry)
no offset
Time (s)
no offset
offset
k points k points
56
Result
Hands-on #1 a
57
Exercise #1
Do it by yourself: Graphene’s calculation!
Basic self consistent calculation (scf)
Convergence of total energy & plane waves cutoff (ecut)
Convergence of total energy & BZ sampling (k-point)
Lattice constant (vc-relax)
Files for exercise
/graphene/ scf
ecut
Hands-on #1
k-point
vc-relax
rho
dos
bands
phonon
58
Structure of QE I/O file
Hands-on #1
Binary file
Text file Text file
59
Charge density
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pp.x < Si.pp.in > Si.pp.out Step 2: Visual charge density
(*.exe for Windows users)
/silicon/ scf
ecut
k-point
vc-relax
rho
dos
bands
phonon
60
Charge density
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pp.x < Si.pp.in > Si.pp.out Step 2: Visual charge density
(*.exe for Windows users)
Si.pp.in
&INPUTPP
outdir='../tmp/', Data of wavefunctions in step SCF
prefix='si',
plot_num=0,
/ VESTA: http://jp-minerals.org/vesta/en/
&PLOT
iflag=3,
output_format=6, Data of
fileout='si_rho.cube', charge
nx=64,ny=64,nz=64, density
/
61
Charge density
Charge density
Silicon atoms
62
Density of states (DOS)
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ dos.x < Si.dos.in > Si.dos.out Step 3: Plot DOS
(*.exe for Windows users)
/silicon/ scf
ecut
k-point
vc-relax
rho
dos
bands
phonon
63
Density of states (DOS)
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ dos.x < Si.dos.in > Si.dos.out Step 3: Plot DOS
(*.exe for Windows users)
Si.nscf.in
&CONTROL
calculation='nscf', non-SCF calculation
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
nbnd=8,
occupations='tetrahedra', Linear tetrahedron method
/
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
12 12 12 1 1 1 High density k-point 64
Density of states (DOS)
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ dos.x < Si.dos.in > Si.dos.out Step 3: Plot DOS
(*.exe for Windows users)
Si.dos.in
&DOS
prefix='si',
outdir='../tmp/',
fildos='si.dos' Data file of DOS (state/eV)
emin=-9.0,
emax=16.0,
/ Command:
$ gnuplot < si_dos.gnu
2.5
2.0
1.5
DOS
1.0
0.5
0.0
-20 -15 -10 -5 0 5 10
ε (eV)
65
Band structure
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ bands.x <Si.bands.in > Si.bands.out Step 3: Data of bands structure
$ plotband.x <Si.plotband Step 4: Plot band structure
(*.exe for Windows users)
/silicon/ scf
ecut
k-point
vc-relax
rho
dos
bands
phonon
66
Band structure
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ bands.x <Si.bands.in > Si.bands.out Step 3: Data of bands structure
$ plotband.x <Si.plotband Step 4: Plot band structure
(*.exe for Windows users)
Si.nscf.in
&CONTROL
calculation='bands', non-SCF calculation
restart_mode='from_scratch',
prefix='si',
pseudo_dir='../pseudo/',
outdir='../tmp/',
/
&SYSTEM
ibrav=2,
celldm(1)=10.2625,
nat=2,
ntyp=1,
ecutwfc=60.0,
ecutrho=720.0,
nbnd=8,
/
&ELECTRONS
mixing_beta=0.7,
conv_thr=1d-8,
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic
K_POINTS {crystal_b} Selected special k-point coordinates
5
0.0000000000 0.0000000000 -0.5000000000 20 L
0.0000000000 0.0000000000 0.0000000000 30 Γ
-0.5000000000 0.0000000000 -0.5000000000 10 X
-0.3750000000 0.0000000000 -0.6250000000 30 U
0.0000000000 0.0000000000 0.0000000000 20 67
Γ
XCrySDen k-Path
Xcrysden: http://www.xcrysden.org/ 68
XCrySDen k-Path
69
Band structure
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ bands.x <Si.bands.in > Si.bands.out Step 3: Data of bands structure
$ plotband.x <Si.plotband Step 4: Plot band structure
(*.exe for Windows users)
Si.bands.in
&BANDS
outdir='../tmp/',
prefix='si',
filband='si.bands', Name of data file
/
70
Band structure
Command:
$ pw.x < Si.scf.in > Si.scf.out Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.nscf.in > Si.nscf.out Step 2: Non-SCF calculation
$ bands.x <Si.bands.in > Si.bands.out Step 3: Data of bands structure
$ plotband.x <Si.plotband Step 4: Plot band structure
(*.exe for Windows users)
Si.plotband
si.bands Data file
-6.0 10
3.0
si.bands.xmgr 2.0
si.bands.ps 1.0
6.255 0.0
1.0 6.255 -1.0
Energy (eV)
-2.0
-3.0
-4.0
-5.0
-6.0
-7.0
-8.0
-9.0
-10.0
-11.0
-12.0
L Γ X U Γ
71
Phonon
Command: Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.scf.in > Si.scf.out Step 2: Calculation of dynamical matrices on q-vectors
$ ph.x < Si.ph.in > Si.ph.out
$ q2r.x <Si.q2r.in > Si.q2r.out Step 3: Calculation of IFC's in real space
$ matdyn.x <Si.matdyn.in > Si.matdyn.out Step 4: A plot of the phonon DOS
(*.exe for Windows users)
/silicon/ scf
ecut
k-point
vc-relax
rho
dos
bands
phonon
72
Phonon
Command: Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.scf.in > Si.scf.out Step 2: Calculation of dynamical matrices on q-vectors
$ ph.x < Si.ph.in > Si.ph.out
$ q2r.x <Si.q2r.in > Si.q2r.out Step 3: Calculation of IFC's in real space
$ matdyn.x <Si.matdyn.in > Si.matdyn.out Step 4: A plot of the phonon DOS
(*.exe for Windows users)
Si.pp.in
phonon calc. Interatomic force constants (IFC’s) in real space
&inputph
outdir="../tmp/", q2r.x
prefix="si",
tr2_ph = 1d-14,
ldisp = .true.,
nq1=4, nq2=4, nq3=4, q-point
amass(1)=28.0855,
fildyn='si.dyn', ph.x
/
Si.q2r.in
&input
fildyn='si.dyn',
zasr='simple',
flfrc='si.fc',
/
Density functional
perturbation theory (DFPT):
direct calculation of second-
order derivatives of the energy
73
Phonon
Command: Step 1: SCF calculation (Hands-on #1)
$ pw.x < Si.scf.in > Si.scf.out Step 2: Calculation of dynamical matrices on q-vectors
$ ph.x < Si.ph.in > Si.ph.out
$ q2r.x <Si.q2r.in > Si.q2r.out Step 3: Calculation of IFC's in real space
$ matdyn.x <Si.matdyn.in > Si.matdyn.out Step 4: A plot of the phonon DOS
(*.exe for Windows users)
Si.matdyn.in
&input
asr='simple',
dos=.true.,
amass(1)=28.0855,
flfrc='si.fc', Interatomic force constants (IFC’s) in real space
fldos='si.phdos',
nk1=50,nk2=50,nk3=50,
/ Data file of phonon DOS
Si (p=0, diamond phase)
0.10
0.09
Command: 0.08
$ gnuplot < si_phdos.gnu
0.07
0.06
φ-DOS
0.05
0.04
0.03
0.02
0.01
0.00
0 100 200 300 400 500 600
ω (cm-1)
74
Exercise #2
Do it by yourself: Graphene’s calculation!
Energy (eV)
Band structure (bands) 1
0
-1
Files for exercise -2
-3
/graphene/ scf -4
-5
Γ M K Γ DOS
ecut b 18
LO
15
TO
rho 3 TA
ZA
0
Γ M K Γ DOS
dos
Hands-on #2
bands
phonon
75