effmass.analysis

A module for analysing the data contained in a Segment object.

Contains the Segment class and methods for calculating various definitions of the effective mass.

class effmass.analysis.Segment(Data, band, kpoint_indices)[source]

Class for segments of the bandstructure. A Segment contains data for a particular region of reciprocal space and particular band.

band

The band number of the segment (counting starts from 0).

Type:int
kpoint_indices

The indices of effmass.inputs.Data.kpoints from which this Segment is formed.

Type:list(int)
kpoints

2-dimensional array. Each row contains the fractional coordinates of a kpoint [kx,ky,kz]. A slice of effmass.inputs.Data.kpoints.

Type:array(float)
cartesian_kpoints

2-dimensional array. Each row contains the cartesian coordinates (angstrom \(^{-1}\)) of a kpoint.

Type:array(float)
dk_angs

1-dimensional array which contains the distance (angstrom \(^{-1}\)) between each kpoint and the extrema.

Type:array(float)
dk_bohr

1-dimensional array which contains the distance (bohr \(^{-1}\)) between each kpoint and the extrema.

Type:array(float)
energies

1-dimensional array which contains the energy (eV) of each eigenstate. A slice of effmass.inputs.Data.energies.

Type:array(float)
dE_eV

1-dimensional array which contains the difference in energy (hartree) between each kpoint and the extrema.

Type:array(float)
dE_hartree

1-dimensional array which contains the difference in energy (eV) between each kpoint and the extrema.

Type:array(float)
occupancy

2-dimensional array. Each row contains occupation number of the eigenstates for a particular band. A slice of effmass.inputs.Data.occupancy.

Type:array(float)
direction

1-dimensional array with length 3. The direction between kpoints in the segment.

Type:array(float)
band_type

The band type, determined by occupancy of the eigenstate. Argument choices are “conduction_band”, “valence_band” or “unknown”. If set to “unknown”, some class methods will raise a warning and return None.

Type:str
fermi_energy

the fermi energy in eV.

Type:float
__init__(Data, band, kpoint_indices)[source]

Initialise an instance of the Segment class.

Parameters:
  • Data (Data) – Data instance initialised from the bandstructure which contains the segment
  • band (int) – the band number of the segment
  • kpoint_indices (list(int)) – the kpoint indices of the segment
Returns:

None.

alpha(polyfit_order=6, truncate=True)[source]

The transport mass (\(\frac{k}{\delta E \delta k}\)) is calculated as a function of dk_bohr and fitted to a straight line. The gradient of this line determines the alpha parameter which is used in the kane dispersion.

See effmass.analysis.Segment.transport_effmass().

Parameters:
  • polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
  • truncate (bool, optional) – If True, data only up to effmass.analysis.Segment.explosion_index() is used. If False, alpha is calculated using data for the whole segment. Defaults to True.
Returns:

The alpha parameter (hartree \(^{-1}\)).

Return type:

float

explosion_index(polyfit_order=6)[source]

This will find the index at which there is a change in sign of the second derivative.

In the region of this point the first derivative will pass through zero and so the transport mass (\(\frac{1}{\delta E \delta k}\)) will explode.

Parameters:polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.

Notes

This marks the point at which the Kane dispersion is definitely not valid, although it may be that the Kane dispersion is a poor approximation prior to this.

fd(k, fermi_level, temp, alpha, mass_bandedge)[source]

Calculates the probability that an eigenstate of momentum k is occupied, using Fermi-Dirac statistics and assuming a Kane dispersion.

Parameters:
  • k – the momentum of the eigenstate (bohr:math:^{-1}).
  • fermi_level (float, optional) – Fermi level (eV) to be used in Fermi-dirac statistics. Defaults to fermi_energy.
  • temp (float, optional) – The temperature (K) to be used in Fermi-Dirac statistics. Defaults to 300.
  • alpha (float, optional) – The alpha parameter of the Kane dispersion (hartree$^{-1}$)
  • mass_bandedge – The mass at bandedge parameter of the Kane dispersion (units electron mass).
Returns:

The probability that the eigenstate is occupied.

Return type:

float

Note

The sign of the alpha parameter and mass_bandedge are important. If these are negative (as would be expected for the valence band), then they must be passed as negative values to the function.

finite_difference_effmass()[source]

The curvature at the band edge is calculated using a second order forward finite difference method. This is then inverted to give an effective mass.

Parameters:None
Returns:Bandedge effective mass from finite difference (in units of electron mass).
Return type:float
finite_difference_fit()[source]

Calculates the curvature at the band edge using a finite difference method and then evaluates the corresponding quadratic dispersion along dk_bohr.

See effmass.analysis.Segment.finite_difference_effmass().

Parameters:None
Returns:list containing energies (hartree). The energies are calculated at 100 points evenly distributed across dk_bohr using the quadratic approximation.
Return type:list(float)
five_point_leastsq_effmass()[source]

Fits a parabolic dispersion using the least-squares method to 5 points (3 DFT-calculated points + 2 from symmetry).

Parameters:None
Returns:Curvature effective mass (in units of electron mass).
Return type:float

Notes

no weighting is used.

five_point_leastsq_fit()[source]

Calculates the curvature effective mass using a parabolic least- squares fit and then evaluates the corresponding parabolic dispersion along dk_bohr.

Parameters:None
Returns:list containing energies (hartree). The energies are calculated at 100 points evenly distributed across dk_bohr.
Return type:list(float)
inertial_effmass(polyfit_order=6, dk=None, polyfit_weighting=False)[source]

Calculates the inertial (curvature) effective mass (\(\frac{1}{\frac{\delta^2E}{\delta k^2}}\)), evaluated at dk_bohr.

Parameters:
  • polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
  • dk (array, optional) – distance (bohr :math:^{-1}) from extrema in reciprocal space at which to evaluate second order derivatives. Defaults to 100 points evenly distributed across the whole segment.
  • polyfit_weighting (bool, optional) – If True, polyfit will be weighted according to occupation of eigenstates. If False, no weighting will be used.
Returns:

array(float). 1d array containing the conductivity effective mass (in units of electron rest mass) evaluated at the points specified in dk.

kane_fit(polyfit_order=6)[source]

Calculate the Kane quasi-linear dispersion parameters, then evaluates at 100 points evenly distributed across dk_bohr.

The Kane quasi-linear dispersion is described by
..math::
frac{hbar ^2 k^2}{2m_{tb}} = E(1+alpha E)
where the transport mass at bandedge (\(m_{tb}\)) and the alpha parameter are calculated by fitting a linear function to the transport mass \(m_t\) as a function of energy E.
..math::
m_t = m_{tb}(1+2alpha E)

The transport mass \(m_t\) is calculated by approximating the dispersion with a polynomial function and taking the first derivative, see transport_effmass().

Parameters:polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
Returns:1d array containing energies (hartree).
Return type:array
kane_mass_band_edge(polyfit_order=6, truncate=True)[source]

The transport mass (\(\frac{1}{\delta E \delta k}\)) is calculated as a function of dk_bohr and fitted to a straight line. The intercept of this line with the y-axis gives a transport mass at bandedge which is used as a parameter in the kane dispersion.

See effmass.analysis.Segment.transport_effmass().

Parameters:
  • polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
  • truncate (bool, optional) – If True, data only up to effmass.analysis.Segment.explosion_index() is used. If False, alpha is calculated using data for the whole segment. Defaults to True.
Returns:

transport mass at bandedge (in units of electron mass).

Return type:

float

mass_integration(fermi_level=None, temp=300, alpha=None, mass_bandedge=None, upper_limit=None)[source]

Integrates the product of the fermi-dirac distribution, density of states and second derivative of kane dispersion along the one- dimensional slice of k-space defined by Segment (up to explosion_index()).

Parameters:
  • fermi_level (float, optional) – Fermi level (eV) to be used in Fermi-dirac statistics. Defaults to fermi_energy.
  • temp (float, optional) – The temperature (K) to be used in Fermi-Dirac statistics. Defaults to 300.
  • alpha (float, optional) – The alpha parameter of the Kane dispersion (hartree$^{-1}$)
  • mass_bandedge – The mass at bandedge parameter of the Kane dispersion (units electron mass).
  • upper_limit (float, optional) – The integration upper limit (bohr$^{-1}$). Defaults to where the Kane quasi-linear dispersion is no longer valide, defined by explosion_index().
Returns:

The optical effective mass (units of electron mass), defined as the inverse of the second derivative of a kane dispersion, weighted according to occupancy of available eigenstates (the product of density of states and the fermi-dirac distribution).

Return type:

float

Note

The sign of the alpha parameter and mass_bandedge are important. If these are negative (as would be expected for the valence band), then they must be passed as negative values to the function.

optical_effmass_kane_dispersion(fermi_level=None, temp=300, alpha=None, mass_bandedge=None, upper_limit=None)[source]

Calculates the optical effective mass, with the dispersion approximated by a Kane quasi-linear function.

This optical effective mass is defined as:
..math::
frac{1}{m_o} = frac{int f(E_k(k),T) frac{delta^2 E_k(k)}{delta k^2} dk}{int f(E_k(k),T) dk}
where the integral is along the one-dimensional slice of k-space defined by Segment (up to explosion_index()) and \(f(E_k,T)\) is the Fermi-Dirac distribution. E_k(k) is the Kane dispersion:
..math::
frac{hbar ^2}{2m_{tb}} = E(1+alpha E)

where the transport mass at bandedge (\(m_{tb}\)) is calculated using effmass.analysis.Segment.kane_mass_band_edge() and the alpha parameter is calculated using effmass.analysis.Segment.alpha().

Parameters:
  • fermi_level (float, optional) – Fermi level (eV) to be used in Fermi-dirac statistics. Defaults to fermi_energy.
  • temp (float, optional) – The temperature (K) to be used in Fermi-Dirac statistics. Defaults to 300.
  • alpha (float, optional) – The alpha parameter of the Kane dispersion (hartree$^{-1}$)
  • mass_bandedge – The mass at bandedge parameter of the Kane dispersion (units electron mass).
  • upper_limit (float, optional) – The integration upper limit (bohr$^{-1}$). Defaults to where the Kane quasi-linear dispersion is no longer valide, defined by explosion_index().
Returns:

The optical effective mass (units of electron mass) of the Segment.

Return type:

float

Note

The sign of the alpha parameter and mass_bandedge are important. If these are negative (as would be expected for the valence band), then they must be passed as negative values to the function.

optical_poly_effmass(polyfit_order=6)[source]

Calculates the optical effective mass with a polynomial approximation to the dispersion

This optical effective mass is defined as:
..math::
frac{1}{m_o} = frac{sum_i f(E_i) g(k_i) frac{delta^2 E}{delta k^2}|_i}{sum f(E_i) g(k_i)}

where the sum is over eigenstates i contained withing the Segment. \(f_(E_i)\) is the probability of occupation (Fermi-Dirac statistics) and \(g(k_i)\) is the density of states at that k-point.

Parameters:polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
Returns:The optical effective mass (units of electron mass) of the Segment.
Return type:float
poly_derivatives(polyfit_order=6, polyfit_weighting=True, dk=None)[source]

Constructs a polynomial function using a least squares fit to Segment dispersion data, then evaluates first and second order derivatives.

Parameters:
  • polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
  • polyfit_weighting (bool, optional) – If True, polyfit will be weighted according to occupation of eigenstates. If False, no weighting will be used.
  • dk (array, optional) – distance (bohr :math:^{-1}) from extrema in reciprocal space at which to evaluate first and second order derivatives. Defaults to 100 points evenly distributed across the whole segment.
Returns:

A tuple containing a 1d array of first derivatives and 1d array of second derivatives, evaluated at dk: ([dedk],[d2edk2])

Return type:

tuple

poly_fit(polyfit_order=6, polyfit_weighting=True)[source]

Constructs a polynomial function using a least squares fit to Segment dispersion data, then evaluates at 100 points evenly distributed across dk_bohr.

Parameters:
  • polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
  • polyfit_weighting (bool, optional) – If True, polyfit will be weighted according to occupation of eigenstates. If False, no weighting will be used.
Returns:

1d array containing energies (hartree).

Return type:

array

transport_effmass(polyfit_order=6, dk=None, polyfit_weighting=False)[source]

Calculates the transport mass (\(\frac{k}{\delta E \delta k}\)), evaluated at dk_bohr .

Parameters:
  • polyfit_order (int, optional) – order of polynomial used to approximate the dispersion. Defaults to 6.
  • dk (array, optional) – distance (bohr :math:^{-1}) from extrema in reciprocal space at which to evaluate first order derivatives. Defaults to 100 points evenly distributed across the whole segment.
  • polyfit_weighting (bool, optional) – If True, polyfit will be weighted according to occupation of eigenstates. If False, no weighting will be used.
Returns:

array(float). 1d array containing the transport effective mass (in units of electron rest mass) evaluated at the points specified in dk.

weight_integration(fermi_level=None, temp=300, alpha=None, mass_bandedge=None, upper_limit=None)[source]

Integrates the product of the fermi-dirac distribution along the one-dimensional slice of k-space defined by Segment (up to explosion_index()).

Parameters:
  • fermi_level (float, optional) – Fermi level (eV) to be used in Fermi-dirac statistics. Defaults to fermi_energy.
  • temp (float, optional) – The temperature (K) to be used in Fermi-Dirac statistics. Defaults to 300.
  • upper_limit (float, optional) – The integration upper limit (bohr$^{-1}$). Defaults to where the Kane quasi-linear dispersion is no longer valide, defined by explosion_index().
Returns:

A normalisation factor for mass_integration().

Return type:

float

Note

The sign of the alpha parameter and mass_bandedge are important. If these are negative (as would be expected for the valence band), then they must be passed as negative values to the function.

weighted_leastsq_effmass()[source]

Fits a parabolic dispersion using the weighted least-squares method to all points in the segment, plus those from symmetry, E(k)=E(-k).

Parameters:None
Returns:Curvature effective mass (in units of electron mass)
Return type:float

Notes

weighting is given by the Fermi-Dirac distribution.

weighted_leastsq_fit()[source]

Calculates the curvature effective mass usinhag a weighted least- squares fit and then evaluates the corresponding parabolic dispersion along dk_bohr.

Parameters:None
Returns:list containing energies (hartree). The energies are calculated at 100 points evenly distributed across dk_bohr.
Return type:list(float)
weighting(fermi_level=None, temp=300)[source]

Calculates a weighting for each kpoint using the Fermi-Dirac statistics.

Parameters:
  • quasi_fermi_level (float, optional) – The fermi level to be used in Fermi-Dirac statistics. Defaults to effmass.inputs.Segment.fermi_energy.
  • temp (float, optional) – The temperature (K) to be used in Fermi-Dirac statistics. Defaults to 300.
Returns:

A 1-dimensional array which contains the weighting for each k-point.

Return type:

array(float)

Notes

The weighting is relative only: constants will cancel out when using to weight least square fits or means.

class effmass.analysis.SegmentVasp(DataVasp, band, kpoint_indices)[source]

Class for segments of a Vasp bandstructure. Inherits from Segment class, and extends to include DOS Segment 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)]. A slice of effmass.inputs.DataVasp.dos. integrated_dos (array): 2-dimensional array. Each row contains integrated density of states data at a given energy: [energy(float),integrated_dos(float)]. A slice of effmass.inputs.DataVasp.integrated_dos.
__init__(DataVasp, band, kpoint_indices)[source]

Initialise an instance of the Segment class.

Parameters:
  • Data (Data) – Data instance initialised from the bandstructure which contains the segment
  • band (int) – the band number of the segment
  • kpoint_indices (list(int)) – the kpoint indices of the segment
Returns:

None.