effmass.inputs¶
A module for storing electronic structure data and user settings. Currently supported codes are VASP and FHI-Aims (with limited functionality).
The module contains a Data
class which parses OUTCAR and PROCAR files using the vasppy package.
A function for parsing DOSCAR files is also provided.
The module contains a DataAims
class which parses and stores the geometry.in/calculation.out files generated for/from a FHI-AIMS calculation.
A Settings
class stores analysis parameters set by the user.
-
class
effmass.inputs.
Data
[source]¶ Parent class for parsing and storing data from bandstructure calculations. Contains a
check_data()
method for basic checks on bandstructure data.-
spin_channels
¶ 1 (non-spin-polarised), 2 (spin-polarised), 4 (spin-orbit coupling).
- Type
int
-
number_of_kpoints
¶ the number of k-points per band.
- Type
int
-
number_of_bands
¶ the number of bands.
- Type
int
-
kpoints
¶ 2-dimensional array with shape (number_of_kpoints, 3). Each row contains the fractional coordinates of a kpoint [kx,ky,kz].
- Type
array(float)
-
energies
¶ 2-dimensional array with shape (number_of_bands,number_of_kpoints). Each row contains energies of eigenstates in eV for a particular band.
- Type
array(float)
-
occupancy
¶ 2-dimensional array with shape (number_of_bands,number_of_kpoints). Each row contains occupation number of the eigenstates for a particular band. Values range from 0-1 (spin-polarised) or 0-2 (non-spin-polarised).
- Type
array(float)
-
reciprocal_lattice
¶ the reciprocal lattice vectors in format [[x1,y1,z1],[x2,y2,z2],[x3,y3,z3]], units Angstrom \(^{-1}\).
- Type
list(float)
-
CBM
¶ the conduction band minimum energy in eV.
- Type
float
-
VBM
¶ the valence band maximum in eV.
- Type
float
-
fermi_energy
¶ the fermi energy in eV.
- Type
float
-
__init__
()[source]¶ Initialises an instance of the
Data
class. All attributes are None until set by the derived class.- Parameters
None. –
- Returns
None.
-
check_data
(spin_channels, number_of_kpoints, number_of_bands, CBM, VBM, fermi_energy, occupancy)[source]¶ Check that Data class attributes make basic sense.
- Parameters
None. –
- Returns
None.
Notes
There is a similar method that runs automatically when reading data in using the vasppy.procar module.
-
-
class
effmass.inputs.
DataASE
(bs, atoms)[source]¶ Class for interfacing with the ASE bandstructure object. Inherits attributes and methods from the
Data
class, and extends with a method for inferring the CBM/VBM from Fermi level.Note: DataASE.fermi_energy is taken from the seedname.out file.
- Note: The DataASE class does not parse eigenstate occupancy data. The Fermi energy will
be used to infer which bands are occupied (below the fermi energy) and which are unoccupied (above the fermi energy). You should independently confirm that the fermi energy is in the band gap of your material. Note that you can manually set the fermi_energy attribute and find the CBM and VBM using the method find_cbm_vbm. “)
-
class
effmass.inputs.
DataAims
(directory_path)[source]¶ Class for parsing and storing data from a FHI-AIMS calculation.
-
spin_channels
¶ 1 (non-spin-polarised), 2 (spin-polarised), 4 (spin-orbit coupling).
- Type
int
-
number_of_kpoints
¶ the number of k-points per band.
- Type
int
-
number_of_bands
¶ the number of bands.
- Type
int
-
kpoints
¶ 2-dimensional array with shape (number_of_kpoints, 3). Each row contains the fractional coordinates of a kpoint [kx,ky,kz].
- Type
array(float)
-
energies
¶ 2-dimensional array with shape (number_of_bands,number_of_kpoints). Each row contains energies of eigenstates in eV for a particular band.
- Type
array(float)
-
occupancy
¶ 2-dimensional array with shape (number_of_bands,number_of_kpoints). Each row contains occupation number of the eigenstates for a particular band. Values range from 0-1 (spin-polarised) or 0-2 (non-spin-polarised).
- Type
array(float)
-
reciprocal_lattice
¶ the reciprocal lattice vectors in format [[x1,y1,z1],[x2,y2,z2],[x3,y3,z3]], units Angstrom \(^{-1}\).
- Type
list(float)
-
CBM
¶ the conduction band minimum energy in eV.
- Type
float
-
VBM
¶ the valence band maximum in eV.
- Type
float
-
fermi_energy
¶ the fermi energy in eV. Automatically set to the mean of Data.CBM and Data.VBM.
- Type
float
-
__init__
(directory_path)[source]¶ Initialises an instance of the
DataAims
class and checks data usingcheck_data()
.- Parameters
directory_path (str) – The path to the directory containing output, geometry.in, control.in and bandstructure files
- Returns
None.
-
fermi_energy
¶ Cutting energy values in a range of 30 eV above and below the Fermi level. FHI AIMS is all electron, but not all states are needed for a meaningful effmass calculation
-
number_of_bands
¶ Finding number of kpoints and determining number of BZ paths
-
reciprocal_lattice
¶ Finding spin channels
-
spin_channels
¶ Finding number of bands
-
-
class
effmass.inputs.
DataCastep
(directory_path, seedname)[source]¶ Class for parsing and storing data from a Castep bandstructure calculation. Inherits attributes and methods from the
DataASE
class.-
__init__
(directory_path, seedname)[source]¶ Initialises an instance of the
DataCastep
class.- Parameters
directory_path (str) – The path to a directory containing seedname.cell, seedname.out and seedname.bands
seedname (str) – The name (without suffix) of the input and output files
- Returns
None.
-
-
class
effmass.inputs.
DataVasp
(outcar_path, procar_path, ignore=0, **kwargs)[source]¶ Class for parsing and storing data from a vasp calculation. Extends the
Data
class to include support for analysing DOSCAR data”- Additional attributes:
dos (array): 2-dimensional array. Each row contains density of states data (units “number of states / unit cell”) at a given energy: [energy(float),dos(float)]. integrated_dos: 2-dimensional array. Each row contains integrated density of states data at a given energy: [energy(float),integrated_dos(float)].
Note: DataVasp.fermi_energy is automatically set to the mean of DataVasp.CBM and DataVasp.VBM.
-
__init__
(outcar_path, procar_path, ignore=0, **kwargs)[source]¶ Initialises an instance of the
Data
class and checks data usingcheck_data()
.- Parameters
outcar_path (str) – The path to the OUTCAR file
procar_path (
str
orlist
) – The path(s) to one or more PROCAR files.ignore (int) – The number of kpoints to ignore at the beginning of the bandstructure slice through kspace (useful for hybrid calculations where zero weightings are appended to a previous self-consistent calculation).
**kwargs – Additional keyword arguments for reading the PROCAR file(s).
- Returns
None.
-
parse_DOSCAR
(filename='./DOSCAR')[source]¶ Parses the DOS and integrated DOS from a vasp DOSCAR file.
- Parameters
filename (str, optional) – The location and filename of the DOSCAR to read in. Defaults to ‘./DOSCAR’.
- Returns
None.
Notes
If the DOS has been sampled at more than 10000 points then this function will break at the expression for num_data_points. In this case, edit your DOSCAR file so that in the header there is a space preceding the number of points.
-
class
effmass.inputs.
Settings
(energy_range=0.25, extrema_search_depth=0.025, bandfit=6)[source]¶ Class for setting analysis parameters.
Attributes: energy_range (float): energy in kT over which the segment extends. extrema_search_depth (float): energy in kT from bandedge over which to search for extrema. degree_bandfit (int): the degree of the polynomial which is used to fit to dispersion data when calculating the transport mass.
-
__init__
(energy_range=0.25, extrema_search_depth=0.025, bandfit=6)[source]¶ Initialises an instance of the Settings class and checks input using
check_settings()
.- Parameters
energy_range (float) – energy in eV over which the segment extends. Defaults to 0.25 eV.
extrema_search_depth (float) – energy in eV from bandedge over which to search for extrema. Defaults to 0.025 eV.
degree_bandfit (int) – the degree of the polynomial which is used to fit to dispersion data when calculating the transport mass.
- Returns
None.
-