effmass.inputs

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. “)
__init__(bs, atoms)[source]

Initialises an instance of the DataASE class and infers which bands are occupied and unoccupied from the fermi level.

Parameters:bs (ase.spectrum.band_structure.BandStructure) – An instance of the ase.spectrum.band_structure.BandStructure object.
Returns:None.
class effmass.inputs.DataAims(directory_path, output_name='calculation.out')[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, output_name='calculation.out')[source]

Initialises an instance of the DataAims class and checks data using check_data().

Parameters:
  • directory_path (str) – The path to the directory containing output, geometry.in, control.in and bandstructure files
  • output_name (str) – Name of the output file - contrary to the rest of the files, this is chosen by the user during an Aims run. Defaults to ‘aims.out’.
Returns:

None.

fermi_energy = None

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 = None

Finding number of kpoints and determining number of BZ paths

reciprocal_lattice = None

Finding spin channels

spin_channels = None

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.DataOctopus(bandstructure_path, info_path, results_path)[source]

Class for parsing and storing data from a octopus calculation. Extends the Data class”

Note: DataOctopus.fermi_energy is automatically set to the mean of DataOctopus.CBM and DataOctopus.VBM.

__init__(bandstructure_path, info_path, results_path)[source]

Initialises an instance of the Data class and checks data using check_data().

Parameters:
  • bandStructure_path (str) – The path to the bandstructure file.
  • info_path (str) – The path to the info file.
  • results_path (str) – The path to the results.out file.
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 using check_data().

Parameters:
  • outcar_path (str) – The path to the OUTCAR file
  • procar_path (str or list) – 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.DataVasprun(path)[source]

Class for parsing and storing data from a VASP calculation using vasprun.xml. Works for parsing calculations with split k-point paths

Note: occupancies are set to 0 below fermi level and 1 above it

__init__(path)[source]

Initialises an instance of the Data class and checks data using check_data().

Parameters:
  • path (str) – Path to vasprun.xml. If the calculation was split along
  • k-path, the path should be to the folder which contains the (the) –
  • i.e. for mapi/split-01/vasprun.xml, mapi/split-02/vasprun.xml (splits.) –
  • would specify path=mapi (you) –
Returns:

None.

class effmass.inputs.Settings(energy_range=0.25, extrema_search_depth=0.025, conduction_band=True, valence_band=True, direction=None, frontier_bands_only=False, bandfit=6, degeneracy_condition=1e-05)[source]

Class for setting analysis parameters.

energy_range

energy in kT over which the segment extends.

Type:float
extrema_search_depth

energy in kT from bandedge over which to search for extrema.

Type:float
conduction_band

calculate conduction band (electron) effective masses. Defaults to True.

Type:bool
valence_band

calculate valence band (hole) effective masses. Defaults to True.

Type:bool
direction

calculate effective masses for this direction only. If None then effective masses for all directions are calculated. Defaults to False.

Type:list(float)
frontier_bands_only

calculate effective masses for the lowest energy conduction band and/or highest energy valence band only. When True this overrides extrema_search_depth. Defaults to False.

degree_bandfit

the degree of the polynomial which is used to fit to dispersion data when calculating the transport mass.

Type:int
degeneracy_condition

the energy difference below which bands are considered to be degenerate. Defaults to 1E-5.

Type:float
__init__(energy_range=0.25, extrema_search_depth=0.025, conduction_band=True, valence_band=True, direction=None, frontier_bands_only=False, bandfit=6, degeneracy_condition=1e-05)[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.
  • conduction_band (bool) – calculate conduction band (electron) effective masses. Defaults to True.
  • valence_band (bool) – calculate valence band (hole) effective masses. Defaults to True.
  • direction (list(float or int)) – calculate effective masses for this direction only. If None then effective masses for all directions are calculated. Defaults to False.
  • frontier_bands_only – calculate effective masses for the lowest energy conduction band and/or highest energy valence band only. When True this overrides extrema_search_depth. Defaults to False.
  • bandfit (int) – the degree of the polynomial which is used to fit to dispersion data when calculating the transport mass.
  • degeneracy_condition (float) – the energy difference below which bands are considered to be degenerate. Defaults to 1E-5.
Returns:

None.

check_settings()[source]

Check that Settings class attributes are sane.

Parameters:None.
Returns:None.