Band Structure
rsgrad band
can plot the band structure from PROCAR and OUTCAR.
Help Message
$ rsgrad band -h
rsgrad-band
Plot bandstructure and projected bandstructure
USAGE:
rsgrad band [OPTIONS]
OPTIONS:
-c, --config <CONFIG>
Band structure plot configuration file path
--colormap <COLORMAP>
[default: jet]
--efermi <EFERMI>
Set the E-fermi given from SCF's OUTCAR and it will be the reference energy level
--gen-template
Generate band structure plot configuration template
-h, --help
Print help information
--htmlout <HTMLOUT>
Save the band structure plot as HTML [default: band.html]
-k, --kpoint-labels <KPOINT_LABELS>
Symbols for high symmetry points on the kpoint path
--ncl-spinor <NCL_SPINOR>
[possible values: X, Y, Z]
--outcar <OUTCAR>
OUTCAR path [default: ./OUTCAR]
--procar <PROCAR>
PROCAR path [default: ./PROCAR]
--show
Open the browser and show the plot immediately
--to-inline-html
Render the plot and print the rendered code to stdout
--txtout-prefix <TXTOUT_PREFIX>
Save the raw data of band structure [default: band_raw]
--ylim <YLIM> <YLIM>
Set the y-range of the plot [default: "-1 6"]
Configuration Template
# rsgrad Band plot configuration in toml format.
# multiple tokens inside string are seperated by whitespace, if you
# kpoint-labels = ["G", "K", "M", "G"] # should be consistant with the boundaries in KPOINTS
procar = "PROCAR"
outcar = "OUTCAR"
txtout-prefix = "band_raw"
htmlout = "band.html"
# segment-ranges = [[1, 40], [41, 80], [81, 120]] # if commented, rsgrad will find the boundaries by judging if k[i] == k[i+1]
# ncl-spinor = "Z" # for vasp_ncl calculation
# colormap = "jet" # the colormap specified to plot ncl-band
# efermi = 0.0 # if commented, rsgrad will read the efermi from OUTCAR, but if may be slightly different from scf's
# ylim = [-1, 6]
# [pband.plot1]
# spins = "up down" # "u d" are also ok, for ncl system, "tot x y z" are available
# atoms = "1 3..7 -1" # which atoms to project on, if commented, all atoms are selected
# orbits = "s px dxy" # which orbits to project on, if commented, all orbits are selected
# color = "red" # the color of marker
Example (without configuration file)
Simply run rsgrad band
can plot the band structure.
$ rsgrad band
[2022-07-14T18:40:18Z INFO rsgrad::commands::band] Reading fermi level and lattice data from "./OUTCAR"
[2022-07-14T18:40:18Z INFO rsgrad::commands::band] Reading band data from "./PROCAR"
[2022-07-14T18:40:18Z INFO rsgrad::commands::band] Found Fermi level: 12.7626, shifting eigenvalues ...
[2022-07-14T18:40:18Z WARN rsgrad::commands::band] No k-point labels found, use empty labels instead
[2022-07-14T18:40:18Z INFO rsgrad::commands::band] Plotting raw bands ...
[2022-07-14T18:40:18Z INFO rsgrad::commands::band] Writing Bandstructure to "band.html"
[2022-07-14T18:40:18Z INFO rsgrad::commands::band] Writing raw band data to "band_raw.txt"
[2022-07-14T18:40:18Z INFO rsgrad] Time used: 79.644034ms
There may be a warning reminds you provide the labels of each high-symmetry point.
rsgrad
identifies high-symmetry points by calculate the difference of consecutive k-points.
If the difference equals zero, these two points are labelled as one high-symmetry point.
For example:
...
k-point 38 : 0.0000 0.0256 0.0000
k-point 39 : 0.0000 0.0128 0.0000
k-point 40 : 0.0000 0.0000 0.0000
k-point 41 : 0.0000 0.0000 0.0000
k-point 42 : -0.0085 0.0171 0.0000
k-point 43 : -0.0171 0.0342 0.0000
...
k-point 40 and k-point 41 are same, thus be identified as one high-symmetry point. Each of the high-symmetry
points need a label. You may either left the --kpoint-labels
empty or provide the correct labels seperated
by white spaces. Sometimes it may produce wrong band structure due to the special k-point path like
kpoints for bandstructure L-G-X-U K-G
10
line
reciprocal
0.50000 0.50000 0.50000 1
0.00000 0.00000 0.00000 1
0.00000 0.00000 0.00000 1
0.00000 0.50000 0.50000 1
0.00000 0.50000 0.50000 1
0.25000 0.62500 0.62500 1
0.37500 0.7500 0.37500 1
0.00000 0.00000 0.00000 1
The end of third segment (0.25000, 0.62500, 0.62500) and the beginning of fourth segment (0.37500, 0.7500, 0.37500) are not consistent, which produces wrong k-path, leading to wrong band structure:
To solve this issue, you need to try the configuration file.
Example (with configuration file)
With the configuration in the following
kpoint-labels = ["L", "Γ", "X", "U|K", "Γ"]
procar = "PROCAR"
outcar = "OUTCAR"
txtout-prefix = "pband_raw"
htmlout = "pband.html"
segment-ranges = [[1, 10], [11, 20], [21, 30], [31, 40]]
[pband.Si-p-orbit]
orbits = "px py pz"
color = "red"
and run rsgrad -c pband.toml
$ rsgrad band -c pband.toml
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Reading porjected band configuration fomr Some("pband.toml")
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Reading fermi level and lattice data from "OUTCAR"
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Reading band data from "PROCAR"
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Found Fermi level: 12.7626, shifting eigenvalues ...
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Plotting raw bands ...
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Plotting projected bands ...
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Writting projected band Si-p-orbit to "pband_raw_Si-p-orbit.txt" ...
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Projected band plot time usage: 1.220401ms
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Writing Bandstructure to "band.html"
[2022-07-14T18:41:02Z INFO rsgrad::commands::band] Writing raw band data to "pband_raw.txt"
[2022-07-14T18:41:02Z INFO rsgrad] Time used: 77.804627ms
then it produces
Example (for non-collinear system)
For the results produced by vasp_ncl
, rsgrad
supports plotting the \(z\) (\(x\) and \(y\) are also OK) projection to
analyze the spin angular moments.
kpoint-labels = ["M", "Γ", "K", "M"]
procar = "PROCAR"
outcar = "OUTCAR"
txtout-prefix = "band_ncl_raw"
htmlout = "band_ncl.html"
segment-ranges = [[81, 120], [1, 40], [41, 80]]
ncl-spinor = "Z"
colormap = "jet"
then it produces