In [1]:
from pymatgen.electronic_structure.plotter import plot_fermi_surface
from monty.os import makedirs_p
from pymatgen.symmetry.bandstructure import HighSymmKpath
In [9]:
vrun = Vasprun('boltztrap2_data/vasprun-PbTe_uniform_bs.xml')
bs = vrun.get_band_structure()
nelect = vrun.parameters['NELECT']
In [10]:
# specify here the band index you need, in this example the vbm is taken
vbm = bs.get_vbm()['band_index'][Spin.up][-1]
In [11]:
# create the directory "fermi/vbm" before
makedirs_p('fermi/vbm/')
# run the interpolation, lpfac should be between 50 and 150
BoltztrapRunner(bs=bs,nelec=nelect,lpfac=10,run_type='FERMI',band_nb=vbm,cond_band=False).run(path_dir='fermi/vbm/')
# read the output
an=BoltztrapAnalyzer.from_files("fermi/vbm/boltztrap/")
In [12]:
# prepare high symmetry points labels
st = vrun.final_structure
kpoints_dict = HighSymmKpath(st).kpath['kpoints']
In [13]:
# edit or generete a dict like this one to pass the kpoint labels and frac coords you want to plot
kpoints_dict
Out[13]:
In [15]:
an.fermi_surface_data.max()
Out[15]:
In [23]:
# plot the surface in an external window
# vbm is set at 0 eV, so we set an energy level of 0.05 below the vbm
plot_fermi_surface(an.fermi_surface_data,bs.structure,cbm=False,energy_levels=[-0.05],
kpoints_dict=kpoints_dict, labels_scale_factor=0.1)
Out[23]:
In [16]:
# specify here another band index you need, in this example the cbm is taken
cbm = bs.get_cbm()['band_index'][Spin.up][0]
In [17]:
# create the directory "fermi/cbm" before
makedirs_p('fermi/cbm/')
# run the interpolation, lpfac should be between 50 and 150
BoltztrapRunner(bs=bs,nelec=nelect,lpfac=10,run_type='FERMI',band_nb=cbm,cond_band=True).run(path_dir='fermi/cbm/')
# read the output
an=BoltztrapAnalyzer.from_files("fermi/cbm/boltztrap/")
In [18]:
an.fermi_surface_data.max()
Out[18]:
In [20]:
# plot the surface in an external window
# cbm is at ~0.83 eV, so we set an energy level of 0.07 above the cbm
plot_fermi_surface(an.fermi_surface_data,bs.structure,cbm=True,energy_levels=[0.9],
kpoints_dict=kpoints_dict, labels_scale_factor=0.1)
Out[20]:
In [2]:
vrun = Vasprun('boltztrap2_data/vasprun_AlAs.xml.gz')
bs = vrun.get_band_structure()
nelect = vrun.parameters['NELECT']
In [3]:
cbm = bs.get_cbm()['band_index'][Spin.up][0]
vb1 = bs.get_vbm()['band_index'][Spin.up][-1]
vb2 = bs.get_vbm()['band_index'][Spin.up][-2]
vb3 = bs.get_vbm()['band_index'][Spin.up][-3]
In [4]:
cbm, vb1, vb2, vb3
Out[4]:
In [5]:
st = vrun.final_structure
kpoints_dict = HighSymmKpath(st).kpath['kpoints']
In [6]:
kpoints_dict
Out[6]:
In [7]:
makedirs_p('fermi/cbm/')
# run the interpolation, lpfac should be between 50 and 150
BoltztrapRunner(bs=bs,nelec=nelect,lpfac=5,run_type='FERMI',band_nb=cbm,cond_band=True).run(path_dir='fermi/cbm/')
# read the output
an=BoltztrapAnalyzer.from_files("fermi/cbm/boltztrap/")
# plot the fermi surface and get the figure object
fig, mlab = plot_fermi_surface(an.fermi_surface_data,bs.structure,cbm=True,energy_levels=[1.55],
kpoints_dict=kpoints_dict, labels_scale_factor=0.1,
interative=False,multiple_figure=False,color=(1,0,0))
In [8]:
for vb,tf in zip((vb1,vb2,vb3),(0.2,0.4,1)):
makedirs_p(f'fermi/vb_{vb}')
# run the interpolation, lpfac should be between 50 and 150
BoltztrapRunner(bs=bs,nelec=nelect,lpfac=50,run_type='FERMI',band_nb=vb,cond_band=False).run(path_dir=f'fermi/vb_{vb}/')
# read the output
an=BoltztrapAnalyzer.from_files(f"fermi/vb_{vb}/boltztrap/")
# plot the fermi surface in the previous figure object
fig, mlab = plot_fermi_surface(an.fermi_surface_data,bs.structure,cbm=False,energy_levels=[-0.07],
kpoints_dict=kpoints_dict, labels_scale_factor=0.1,
interative=False, mlab_figure=fig,multiple_figure=False,transparency_factor=[tf])
mlab.show()
In [27]:
from pymatgen.electronic_structure.boltztrap import read_cube_file
# decompress boltztrap_BZ.cube.gz before running the following
fs_data = read_cube_file('boltztrap2_data/boltztrap_BZ.cube')
st = Vasprun('boltztrap2_data/vasprun_mp-12103.xml.gz').final_structure
kpoints_dict = HighSymmKpath(st).kpath['kpoints']
In [23]:
plot_fermi_surface(fs_data,st,cbm=True,
kpoints_dict=kpoints_dict, labels_scale_factor=0.1,
color=(1,0,0))
Out[23]:
In [1]:
from pymatgen.electronic_structure.boltztrap2 import BztInterpolator, VasprunBSLoader
In [2]:
vrun = Vasprun('boltztrap2_data/vasprun-PbTe_uniform_bs.xml')
bs = vrun.get_band_structure()
nelect = vrun.parameters['NELECT']
In [3]:
data = VasprunBSLoader(vrun)
In [4]:
bztI = BztInterpolator(data,lpfac=10)
In [5]:
bztI.eband.shape
Out[5]:
In [6]:
from BoltzTraP2 import fermisurface
In [ ]:
# with 2:3 we get the index of the vb, mu is in Ha
fermisurface.plot_fermisurface(data,bztI.equivalences,bztI.eband[2:3,:],mu=-0.003)