Skip to content

Instantly share code, notes, and snippets.

@t-nissie
Last active October 7, 2018 23:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t-nissie/ad99810ddf1bceb602f6 to your computer and use it in GitHub Desktop.
Save t-nissie/ad99810ddf1bceb602f6 to your computer and use it in GitHub Desktop.
Quantum EspressoでTiO2アナターゼの電子のバンド構造とDOSを描く

Plot band structure and DOS of TiO2 anatase

Original files are in https://gist.github.com/t-nissie/ad99810ddf1bceb602f6 .

Preparation

  • Clone files in the gist as git clone https://gist.github.com/ad99810ddf1bceb602f6.git anatase08-k6x6x4-band-dos-gist.
  • cd anatase08-k6x6x4-band-dos-gist.
  • Get O.pw-mt_fhi.UPF and Ti.pw-mt_fhi.UPF form http://www.quantum-espresso.org/pseudopotentials/ .
  • Make symlinks to bands.x, dos.x, plotband.x and pw.x in the current directory, i.e. ln -s /SOMEWHERE/espresso-5.1.2/bin/bands.x.

relaxation of cell and atomic positions

Using an input file of anatase.vc-relax.in, we perform optimization of cell parameters and atomic positions.

$ mpirun -np 12 ./pw.x -in anatase.vc-relax.in | tee anatase.vc-relax.out
$ grep -B13 'End final coordinates' anatase.vc-relax.out

CELL_PARAMETERS (alat=  7.14000000)
   0.496771433  -0.496771433   1.216801080
   0.496771433   0.496771433   1.216801080
  -0.496771433  -0.496771433   1.216801080

ATOMIC_POSITIONS (crystal)
Ti      -0.000000000   0.000000000   0.000000000
Ti       0.500000000   0.750000000   0.250000000
O        0.500000000   0.539268418   0.039268418
O        0.000000000   0.789268418   0.789268418
O        0.000000000   0.210731582   0.210731582
O        0.500000000   0.960731582   0.460731582
End final coordinates

SCF calculation

Although the last calculation with anatase.vc-relax.in gives SCF results in its end, we perform an SCF calculation with anatase.scf.in. Optimized cell parameters and atom positions were copied from anatase.vc-relax.out into anatase.scf.in.

$ mpirun -np 12 ./pw.x -in anatase.scf.in | tee anatase.scf.out

Confirm that stress and forces are small enough.

Plot band structure

In anatase.bands.in, crystal_b is used. How to write input files of anatase.bands.in and bands.in is described around

Anyway, we do non-SCF calculations at each k-point along Z-Gamma-X-P with pw.x, and then we execute bands.x with bands.sh as

$ ./bands.sh
$ gv anatase.bands.ps &

If you do not have gv(1), you can use evince(1) instead for preview of generated anatase.bands.ps.

Plot DOS

$ ./dos.sh
$ gnuplot
plot [0:12] [-6:10] 'anatase.dos' u 2:($1-5.0) w l

band-dos.png

Plotted electronic dispersion and DOS of anatase TiO2. Spikes in the band plot may be due to a bug in pw.x.

ToDo

  • 6 6 4 1 1 1 or 6 6 4 0 0 0 for K_POINTS AUTOMATIC
  • To check convergence w.r.t. k-points
  • To check convergence w.r.t. kinetic energy cutoff
  • Two 5.0 in bands.sh should be adjusted to the valence band maximum (VBM) according to the calculated KS-levels in anatase.scf.out.

Refereces

  • Adisak Boonchun, Naoto Umezawa, Takahisa Ohno, Shuxin Ouyanga and Jinhua Ye: J. Mater. Chem. A 1, 6664-6669 (2013).
&control
calculation = 'bands'
prefix = 'anatase'
pseudo_dir = './'
outdir = './'
/
&system
ibrav = 7
celldm(1) = 7.093904
celldm(3) = 2.4494134129942915
space_group = 141
nat = 2
ntyp = 2
ecutwfc = 100.0
ecutrho = 1000.0
nbnd=40
/
&electrons
/
ATOMIC_SPECIES
Ti 47.867 Ti.pw-mt_fhi.UPF
O 16.00 O.pw-mt_fhi.UPF
ATOMIC_POSITIONS (crystal_sg)
Ti 0.0 0.0 0.00
O 0.0 0.0 0.21073169670146766
K_POINTS (crystal_b)
4
0.5000 0.5000 0.5000 50
0.0000 0.0000 0.0000 50
0.0000 0.5000 -0.5000 50
0.2500 0.7500 -0.2500 50
&control
calculation = 'nscf'
prefix = 'anatase'
pseudo_dir = './'
outdir = './'
wf_collect=.false.
forc_conv_thr = 1d-4
!disk_io = 'none'
/
&system
ibrav = 7
celldm(1) = 7.093904
celldm(3) = 2.4494134129942915
space_group = 141
nat = 2
ntyp = 2
ecutwfc = 100.0
ecutrho = 1000.0
nbnd=40
/
&electrons
conv_thr = 1.0d-8
/
&IONS
/
&cell
cell_factor = 3.0d0
/
ATOMIC_SPECIES
Ti 47.867 Ti.pw-mt_fhi.UPF
O 16.00 O.pw-mt_fhi.UPF
K_POINTS AUTOMATIC
10 10 6 1 1 1
ATOMIC_POSITIONS (crystal_sg)
Ti 0.0 0.0 0.00
O 0.0 0.0 0.21073169670146766
&control
calculation = 'scf'
restart_mode = 'from_scratch'
prefix = 'anatase'
tstress = .true.
tprnfor = .true.
pseudo_dir = './'
outdir = './'
wf_collect=.true.
forc_conv_thr = 1d-4
!disk_io = 'none'
/
&system
ibrav = 7
celldm(1) = 7.093904
celldm(3) = 2.4494134129942915
space_group = 141
nat = 2
ntyp = 2
!occupations = 'fixed'
ecutwfc = 100.0
ecutrho = 1000.0
!input_dft = 'vdW-DF-C09'
!nosym = .TRUE.
/
&electrons
conv_thr = 1.0d-8
/
&IONS
/
&cell
cell_factor = 3.0d0
/
ATOMIC_SPECIES
Ti 47.867 Ti.pw-mt_fhi.UPF
O 16.00 O.pw-mt_fhi.UPF
K_POINTS AUTOMATIC
6 6 4 1 1 1
ATOMIC_POSITIONS (crystal_sg)
Ti 0.0 0.0 0.00
O 0.0 0.0 0.21073169670146766
&control
calculation = 'vc-relax'
restart_mode = 'from_scratch'
prefix = 'anatase.vc-relax'
tstress = .true.
tprnfor = .true.
pseudo_dir = './'
outdir = './'
wf_collect=.true.
forc_conv_thr = 1d-4
disk_io = 'none'
/
&system
ibrav = 7
celldm(1) = 7.14
celldm(3) = 2.5
space_group = 141
nat = 2
ntyp = 2
ecutwfc = 100.0
ecutrho = 1000.0
/
&electrons
conv_thr = 1.0d-8
/
&IONS
/
&cell
cell_factor = 3.0d0
/
ATOMIC_SPECIES
Ti 47.867 Ti.pw-mt_fhi.UPF
O 16.00 O.pw-mt_fhi.UPF
K_POINTS AUTOMATIC
6 6 4 1 1 1
ATOMIC_POSITIONS (crystal_sg)
Ti 0.0 0.0 0.00
O 0.0 0.0 0.21
&bands
prefix = 'anatase'
outdir='./'
filband = 'bands.dat'
/
#!/bin/sh
##
mpirun -np 12 ./pw.x -in anatase.bands.in | tee anatase.bands.out
mpirun -np 12 ./bands.x < bands.in | tee bands.out
./plotband.x <<EOF
bands.dat
-1, 15
anatase.bands.xmgr
anatase.bands.ps
5.0
2.0, 5.0
EOF
rm -f anatase.wfc*
&dos
outdir = './',
prefix='anatase',
fildos='anatase.dos',
DeltaE=0.1
ngauss=0,
degauss=0.01
/
#!/bin/sh
##
mpiexec -np 12 ./pw.x -in anatase.dos.in | tee anatase.dos.out
mpiexec -np 12 ./dos.x < dos.in | tee dos.out
#!/bin/sh
# -*- ruby -*- We do not need this k-points generator ZGXP.rb anymore, because we can use crystal_b in anatase.bands.in.
exec ruby -x "$0" "$@"
#!ruby
i=0
N_Z=50
N_X=50
N_P=50
N_Z.step(0, -1).each do |j|
x = j / (2.0 * N_Z)
printf("%8.4f%8.4f%8.4f%4d\n", x, x, x, i+=1)
end
(1..N_X).each do |j|
x = j / (2.0 * N_X)
printf("%8.4f%8.4f%8.4f%4d\n", 0, x, -x, i+=1)
end
(1..N_P).each do |j|
x = j / (4.0 * N_P)
printf("%8.4f%8.4f%8.4f%4d\n", x, 0.5+x, -0.5+x, i+=1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment