QE intro
I need a DFT, very first steps
- find the best code for the problem
- download & install
- benchmark
- setup run and run calculation
- postprocess results
Quantum-Espresso
the poor man's plane-vawe code
1. find the best code for the problem
the chemists' choice
go for Siesta instead...
"etalon code"
Gaussian
+ orthonormal
+ independent of atomic positions
+ no BSSE
± naturally periodic
– many functions needed
– localised functions difficult to represent
Why plane-wave?
It is based on density-functional theory, plane waves, and pseudopotentials.
Platforms: (really! also cell phones and playstations)
2. download & install
- Ubuntu users:
sudo apt install quantum-espresso
(mpirun version!) Not the latest version - Quantum Mobile (virtualbox image) No pwgui
- kooplex-edu Slow, only for educational use
- src package from Have you ever compiled a linux kernel?
www.quantum-espresso.org/download
and compile it!
3. benchmark
we skip this for now, but it is important
parallelization of the code vs parallelization against some of the parameters
FFT is important, gnu-compiler vs intel + MKL
Parallelization of QE
Parallelization on k-points:
- guarantees (almost) linear scaling if the number of k-points is a multiple of the number of pools;
- requires little communications (suitable for ethernet communications);
- reduces the required memory per processor by distributing wavefunctions (but not other quantities like the charge density), unless you set disk_io='high'.
Parallelization on PWs:
- yields good to very good scaling, especially if the number of processors in a pool is a divisor of N3 and Nr3 (the dimensions along the z-axis of the FFT grids, nr3 and nr3s, which coincide for NCPPs);
- requires heavy communications (suitable for Gigabit ethernet up to 4, 8 CPUs at most, specialized communication hardware needed for 8 or more processors );
- yields almost linear reduction of memory per processor with the number of processors in the pool.
kooplex-edu
2db XeonE5645@2.40GHz
Cores | Time (s) |
---|---|
1 |
238 |
2 |
139 |
3 | 94 |
4 | 72 |
6 | 56 |
8 | 50 |
12 | 38 |
Cores | Time (s) |
---|---|
1 | 208 |
2 | 147 |
3 | 108 |
4 | 87 |
6 | 52 |
8 | 48 |
12 | 40 |
16 | 41 |
4. setup run ...
- examples and tests
for every package, e.g. qe_dir/PW/examples
- graphical interfaces: pwgui, avogadro, etc
- text editor & scripting
main control block
&control
prefix='silicon',
! this is a comment: you can comment out variables
! set pseudo_dir and outdir to suitable directories
pseudo_dir = '../pseudo/',
outdir='../tmp/'
/
System block
&system
ibrav= 2, celldm(1) =10.2, nat= 2, ntyp= 1,
ecutwfc = 18.0,
/
MIND the commas and slashes!
Add newline after last block!!!
Atoms & kpoints
ATOMIC_SPECIES
Si 28.086 Si.pz-vbc.UPF
ATOMIC_POSITIONS alat
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
#K_POINTS tpiba
# this is also a comment: next line, number of k-points
# 2
# 0.25 0.25 0.25 1.0
# 0.25 0.25 0.75 3.0
K_POINTS automatic
2 2 2 1 1 1
Atoms & kpoints
ATOMIC_SPECIES
Si 28.086 Si.pz-vbc.UPF
ATOMIC_POSITIONS alat
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
#K_POINTS tpiba
# this is also a comment: next line, number of k-points
# 2
# 0.25 0.25 0.25 1.0
# 0.25 0.25 0.75 3.0
K_POINTS automatic
2 2 2 1 1 1
Atoms & kpoints
ATOMIC_SPECIES
Si 28.086 Si.pz-vbc.UPF
ATOMIC_POSITIONS alat
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
#K_POINTS tpiba
# 2
# 0.25 0.25 0.25 1.0
# 0.25 0.25 0.75 3.0
K_POINTS automatic
2 2 2 1 1 1
4. ... run calculation
run erhm what?
ls pwscfdir/bin: alpha2f.x dos.x fd_ifc.x generate_rVV10_kernel_table.x iotk_print_kinds.x molecularpdos.x plan_avg.x projwfc.x pwi2xsf.x sumpdos.x
average.x dynmat.x fd.x generate_vdW_kernel_table.x iotk.x neb.x plotband.x pw2bgw.x pw.x wannier_ham.x
bands.x epa.x fermi_proj.x ibrav2cell.x kpoints.x open_grid.x plotproj.x pw2gw.x q2qstar.x wannier_plot.x
bgw2pw.x epsilon.x fermi_velocity.x importexport_binary.x lambda.x path_interpolation.x plotrho.x pw2wannier90.x q2r.x wfck2r.x
cell2ibrav.x ev.x fqha.x initial_state.x manypw.x phcg.x pmw.x pwcond.x q2trans_fd.x
dist.x fd_ef.x fs.x iotk matdyn.x ph.x pp.x pw_export.x q2trans.x
PWSCF executables
- pw.x : Plane-Wave Self-Consistent Field
- ph.x : phonons with Density-Functional Perturbation Theory
- cp.x : Car-Parrinello Molecular Dynamics
- neb.x : energy barriers and reaction pathways through the Nudged Elastic Band method
- pwcond.x : ballistic conductance
-
dos.x bands.x pp.x ... : various utilities for data postprocessing
- pwgui : a Graphical User Interface, producing input data files for PWscf
- ld1.x : (atomic) a program for atomic calculations and generation of pseudopotentials
Bulk silicon
diamond-like:
C 3.567
Si 5.431
Ge 5.658
select your favourite ...
zinc-blende-like:
AlAs 5.6605
AlP 5.4510,
AlSb 6.1355
GaAs 5.653
GaP 5.4505
GaSb 6.0959
InAs 6.0583
InP 5.869
InSb 6.479
Example 1
Convergency tests
- download pseudo (LDA+PAW for Si)
PART 1
- change ecutwfc (10, 20, ... Ry) & run
- find total energies
- plot results & find the converged ecutwfc
PART2
- set ecutwfc to converged value
- increase kpoint set 2x2x2 ... 9x9x9 & run
- plot results & find the converged k-set
wget <link>
pw.x < infile >outfile
grep '!' outfile
go to my_example1 folder
Example2
Geometry optimization by hand
- set ecutwfc, k-set (from my_example1)
- change unit cell parameter
A=5.3 -- 5.5 in 0.02 steps (Ångström) & run
- find total energies
- plot & fit parabola
pw.x < infile >outfile
grep '!' outfile
go to my_example2 folder
experimental cell parameter A=5.341Å
Example3
Geometry optimization by built-in method
- add calculation='vc-relax' to control block
- add &cell + &ion blocks (even if they are empty)
- find final coordinates (in units of original lattice constant ...)
- compare result with "handy method"
go to my_example3 folder
Example4
Band structure
- optimized structure, scf run with k-set
- add calculation='bands'
nbnd= number_of_bands
k-path in BZ
- run pw.x again
- bands.x to create gnuplot-compatible output (with .gnu extension)
- plotband.x (writes plot scripts)
pw.x < scf.in >scf.out
pw.x <bands.in > bands.out
bands.x < band2.in >band2.out
go to my_example4 folder
Band structure of bulk Si
Example5
Density of states
- setup scf calculation
- setup dos calculation & run
- plot DOS
- DOS is ugly
- increase kpoints & change degauss value, 0.001, 0.01, 0.1 ... etc.
- add occupations='tetrahedra' to scf & remove degauss from dos input
- DOS is pretty
go to my_example5 folder
DOS of bulk silicon
Example6
Bulk modulus
- add tstress=.true. tag to &control block
- change the volume size by ±0.5%, ±1.0%, ...
- find the stress tensor in output, differentiate numerically & get the units right ...
go to my_example6 folder
Alternatively, set target stress to some value, perform geometry optimization, work out the bulk modulus...
Al-As 5.63262
Al-P 5.43095
Al-Sb 6.11182
Ga-As 5.6119
Ga-P 5.39437
Ga-Sb 6.05185
In-As 6.02329
In-P 5.82555
In-Sb 6.42447
C 3.53338
Si 5.39923
Ge 5.62113
LDA/PAW results summary
Al-As 75.8 76.0
Al-P 90.6 91.7
Al-Sb 56.0 56.8
Ga-As 74.0 73.7
Ga-P 92.0 91.5
Ga-Sb 187.8 80.6
In-As 61.5 61.4
In-P 72.4 72.2
In-Sb 48.5 49.0
C 469.9 469.3
Si 96.9 97.1
Ge 75.6 75.7
qe-intro
By János Koltai
qe-intro
Lecture 4 of the DFT course at Eötvös Loránd University
- 1,281