pyband
and pydos
are two python scripts that analyse the VASP calculation
results (e.g. OUTCAR and PROCAR) and convert the results to images. It offers a
fast and effective way to preview the calcuated results. The image plotting
utilizes matplotlib
package.
When no argument is given, pyband
reads in OUTCAR
(optionally KPOINTS
)
and find the band information within. It then plots the resulting band structure
and save it as band.png
.
$ pyband
The default output image name can be changed by adding -o YourImageName.suffix
to the above command line. Note that the image format is
automatically recognized by the script, which can be any format that is
supported by matplotlib
. The size of the image can also be speified by -s width height
command line arguments.
The labels of the high-symmetry K-points, which are not shown in the figure, can
be designate by -k
flag.
$ pyband -k mgkm
In some cases, if you are interested in finding out the characters of each KS
states, e.g. the contribution of some atom to each KS state, the flag --occ atoms
comes to help.
$ pyband --occ '1 3 4'
where 1 3 4
are the atom index starting from 1 to #atoms in the above image.
The size of red dots in the figure indicates the weight of the specified atoms
to the KS states. This can also be represented using a colormap:
$ pyband --occ '1 3 4' --occL
The spd-projected weight can also be specefied:
$ pyband --occ '1 3 4' --spd '4 5 6 7 8'
where in the arguments of --spd
:
s orbital: 0
py, pz, px orbital: 1 2 3
dxy, dyz, dz2, dxz, dx2 orbital: 4 5 6 7 8
More command line arguments can be found by pyband -h
.
This script is used to plot partial density of states (pDOS) from VASP PROCAR
files.
pydos -p '1 3 4' -p '2 7 8' -p '5 6 9' -z 0.65 -x -1 2 -y 0 6
where -p
specifies the atom indexes, -x
and -y
determines the x and y
limits of the plot, -z
is followed by the energy reference of the plot.
This script can plot PDOS from multiple VASP PROCARs
in multiple axes, example usages:
#!/bin/bash
npdos -nr 2 -f 4.8 4.0 \
-o g1.png \
-nxminor 4 \
-i pbe/scf/PROCAR -a 0 -p 0 -pv n -tlab 'PBE-PBE' -tlw 0.5 -tlc r \
-i scf-pbe_opt-hse/PROCAR -a 0 -p 0 -pv n -tlab 'HSE-PBE' -tlw 0.5 -tlc b \
-i scf-hse_opt-pbe/PROCAR -a 1 -p 0 -pv n -tlab 'PBE-HSE' -tlw 0.5 -tlc r \
-i hse/scf/PROCAR -a 1 -p 0 -pv n -tlab 'HSE-HSE' -tlw 0.5 -tlc b \
-x -4 6 -x -6 6 \
-z 3.3129 -z 3.3726 -z 3.5583 -z 3.6332 \
-panelloc 0.01 0.95 \
-q
The resulting figure: