Hii all
I did Dos calculation using VASP. I want to calculate band gap. Is there any way to calculate band gap from DOSCAR or vasprun.xml file?
There are a few ways, however the easiest is with pymatgen’s Vasprun
object:
from pymatgen.io.vasp import Vasprun
vasprun = Vasprun("vasprun.xml") # or the path to your vasprun.xml
gap = vasprun.get_band_structure(efermi="smart").get_band_gap()
I tried the above script, but it did not give band gap. For reference I did not perform band structure calculation. I did Density of states calculation and from that vasprun.xml I try this.
It gave {Direct: False, Energy : 1.543, transition : ()}
The bandgap corresponds to the Energy
keyword in the dict. The Direct
keyword tells you if the gap is direct (True) or indirect (False)
So in your case, the bandgap is 1.543 eV and indirect
Thank you @Aaron_Kaplan
Hey @Aaron_Kaplan , Is there any way to calculate the bandgap of spin up and spin down dos separately using pymatgen? Also I want to calculate the value of DOS energy at fermi level.
Any suggestion will be highly thankful.