easyunfold.effective_mass
#
Module for obtaining effective mass
Module Contents#
Classes#
Calculate effective mass from unfolding data 
Functions#
Fit the effective masses using either a parabolic or nonparabolic fit. 

Return fitted effective mass curve 

Return the indices and values of points in an array close to the value with a tolerance 

Locate the labels and indices of the kpoints defining a segment 
Data#
API#
 easyunfold.effective_mass.eV_to_hartree#
None
 easyunfold.effective_mass.bohr_to_m#
None
 easyunfold.effective_mass.angstrom_to_bohr#
None
 easyunfold.effective_mass.TMP_DATA#
None
 easyunfold.effective_mass.fit_effective_mass(distances, energies, parabolic=True)#
Fit the effective masses using either a parabolic or nonparabolic fit.
Adapted from
sumo
.Args: distances (:obj:
numpy.ndarray
): The xdistances between kpoints in reciprocal Angstroms, normalised to the band extrema. energies (:obj:numpy.ndarray
): The band eigenvalues normalised to the eigenvalue of the band extrema. parabolic (:obj:bool
, optional): Use a parabolic fit of the band edges. IfFalse
then nonparabolic fitting will be attempted. Defaults toTrue
.Returns: float: The effective mass in units of electron rest mass, :math:
m_0
.
 easyunfold.effective_mass.fitted_band(x: numpy.ndarray, eff_mass: float) numpy.ndarray #
Return fitted effective mass curve
 easyunfold.effective_mass.points_with_tol(array, value, tol=0.0001, sign=1)#
Return the indices and values of points in an array close to the value with a tolerance
 class easyunfold.effective_mass.EffectiveMass(unfold: easyunfold.unfold.UnfoldKSet, intensity_tol: float = 0.1, extrema_tol: float = 0.001, parabolic: bool = True, npoints: float = 3)#
Calculate effective mass from unfolding data
Initialization
Instantiate the object
 Parameters:
unfold – The
UnfoldKSet
object that holds unfolding data.intensity_tol – Intensity threshold for detecting band edges.
extrema_tol – Distance tolerance for detecting band edges.
parabolic – Perform parabolic fit or not. The default is None.
npoints – The number of points used for fitting.
 set_nocc(nocc)#
 property kpoints#
The primitive cell kpoints used for unfolding.
 property kpoints_labels#
The primitive cell kpoints labels set for unfolding.
 get_band_extrema(mode: str = 'cbm', extrema_tol: float = None, ispin=0)#
Obtain the kpoint idx of band extrema, sub indices in the set, and the band indices.
The search takes two steps. First, the kpoints at the band extrema are located by comparing the band energies with that recorded in the supplied cbm and vbm, based on the
extrema_tol
. Afterwards, the band indices are selected at these kpoints using thetol
set. Parameters:
mode – The mode to search for band extrema. Can be either ‘cbm’ (conduction band minimum) or ‘vbm’ (valence band maximum).
extrema_tol – The tolerance for determining the proximity of band energies to the cbm/vbm. If not provided, the default tolerance from
self.extrema_detect_tol
is used.ispin – The spin index. Default is 0.
 Returns:
A tuple of extrema locations including a list of kpoint indices, subindices within the set, and the band indices at each kpoint that is within the
extrema_tol
from the cbm/vbm. Raises:
ValueError – If an unknown mode is provided.
 _get_kpoint_distances()#
Distances between the kpoints along the path in the reciprocal space. This does not take account of the breaking of the path NOTE: the reciprocal lattice vectors includes the 2pi factor, e.g. np.linalg.inv(L).T * 2 * np.pi
 _get_fitting_data(kidx: int, iband: int, direction=1, ispin=0, npoints=None)#
Get fitting data for a specific combination of kpoint and band index
 Parameters:
kidx – The index of the kpoint
iband – The index of the band
direction – The direction of the data collection, defaults to 1
ispin – The index of the spin, defaults to 0
npoints – Override for the number of data points to collect
 Returns:
The normalized kpoint distances, normalized effective energies, and the original kpoint distances and effective energies
 get_effective_masses(npoints: Union[float, None] = None, ispin=0, iks=None, iband=None, mode=None)#
Obtain the effective masses based on the unfolded band structure
 Parameters:
npoints – Number of points to use for fitting. If None, a default value is used.
ispin – The index of the spin channel. Default is 0.
iks – Kpoint indices used for manual override.
iband – Band indices used for manual override.
mode – Calculation mode. If None, effective masses at both conduction band minimum (cbm) and valence band maximum (vbm) will be calculated.
 Returns:
A dictionary containing the effective masses for electrons and holes.
 _get_effective_masses(mode: str = 'cbm', ispin: int = 0, npoints: Union[None, int] = None, iks=None, iband=None)#
Work out the effective masses based on the unfolded band structure for CBM or VBM
 Parameters:
mode – The mode to calculate effective masses, either ‘cbm’ for conduction band minimum or ‘vbm’ for valence band maximum. Default is ‘cbm’.
ispin – The spin index. Default is 0.
npoints – The number of points to use for fitting. If None, the default number of points will be used.
iks – The indices of the kpoints to calculate effective masses. If None, the indices will be obtained from get_band_extrema method.
iband – The indices of the bands to calculate effective masses. If None, the indices will be obtained from get_band_extrema method.
 Returns:
A list of dictionaries containing the calculated effective masses and related information.
 easyunfold.effective_mass.locate_kpoint_segment(idxk: int, label_idx: list, label_names: list, direction: int)#
Locate the labels and indices of the kpoints defining a segment
 Parameters:
idxk – The index of the kpoint
label_idx – A list of indices corresponding to the labels
label_names – A list of label names
direction – The direction of the segment (1 for forward, 1 for backward)
 Returns:
A tuple containing the index of the label, the label name of the starting point, and the label name of the ending point