perturbopy.postproc.calc_modes.bands.Bands

class perturbopy.postproc.calc_modes.bands.Bands(pert_dict)

Bases: CalcMode

Class representation of a Perturbo bands calculation.

Parameters:
  • pert_dict (dict)

  • calculation. (Dictionary containing the inputs and outputs from the bands)

kpt

Database for the k-points used in the bands calculation.

Type:

RecipPtDB

bands

Database for the band energies computed by the bands calculation.

Type:

UnitsDict

Methods

direct_bandgap

Method to compute the direct bandgap between two bands.

effective_mass

Method to compute the effective mass at a k-point, approximated with a parabolic fit.

from_yaml

Class method to create a CalcMode object from the YAML file generated by a Perturbo calculation.

indirect_bandgap

Method to compute the indirect bandgap between two bands.

plot_bands

Method to plot the band structure.

direct_bandgap(n_lower, n_upper)

Method to compute the direct bandgap between two bands.

Parameters:
  • n_lower (int) – Band number of the lower and upper bands.

  • n_upper (int) – Band number of the lower and upper bands.

Returns:

  • gap (float) – The direct bandgap, computed as the minimum energy difference between two bands at the same k-point.

  • kpoint (array) – The k-point corresponding to the direct bandgap.

Raises:

ValueError – If the upper and lower band numbers provided are not valid band indices from the bands database, or if n_lower is greater than n_upper.

effective_mass(n, kpoint, max_distance, direction=None, ax=None, c='r')

Method to compute the effective mass at a k-point, approximated with a parabolic fit.

Parameters:
  • n (int) – Index of the band for which to calculate the effective mass.

  • kpoint (list) – The k-point on which to center the calculation.

  • max_distance (float) – Maximum distance between the center k-point and k-points to include in the parabolic approximation.

  • direction (array_like, optional) – The k-point specifying the direction of the effective mass. Defaults to the same value as kpoint, i.e. the longitudinal effective mass.

  • ax (matplotlib.axes.Axes) – Axis on which to plot the bands and approximated parabolic curve

  • c (str) – Color for plotting the approximated parabolic curve

Returns:

effective_mass – The longitudinal effective mass at band n and the inputted kpoint, computed by a parabolic fit.

Return type:

float

classmethod from_yaml(yaml_path='pert_output.yml')

Class method to create a CalcMode object from the YAML file generated by a Perturbo calculation.

Parameters:

yaml_path (str, optional) – Path to the YAML file generated by a Perturbo calculation

Returns:

calc_mode – The CalcMode object generated from the YAML file

Return type:

CalcMode

indirect_bandgap(n_lower, n_upper)

Method to compute the indirect bandgap between two bands.

Parameters:
  • n_lower (int) – Band number of the lower and upper bands.

  • n_upper (int) – Band number of the lower and upper bands.

Returns:

  • gap (float) – The indirect bandgap, computed as the energy difference between the minimum of the upper band and the maximum of the lower band.

  • lower_kpoint, upper_kpoint (array) – k-points corresponding to the minimum of the upper band and the maximum of the lower band.

Raises:

ValueError – If the upper and lower band numbers provided are not valid band indices from the bands database, or if n_lower is greater than n_upper.

plot_bands(ax, show_kpoint_labels=True, **kwargs)

Method to plot the band structure.

Parameters:
  • ax (matplotlib.axes.Axes) – Axis on which to plot the bands.

  • show_kpoint_labels (bool, optional) – If true, the k-point labels stored in the labels attribute will be shown on the plot. Default true.

Returns:

ax – Axis with the plotted bands.

Return type:

matplotlib.axes.Axes