perturbopy.postproc.calc_modes.spins.Spins

class perturbopy.postproc.calc_modes.spins.Spins(pert_dict)

Bases: CalcMode

Class representation of a Perturbo spins calculation.

Parameters:
  • pert_dict (dict)

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

kpt

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

Type:

RecipPtDB

bands

Database for the band energies computed by the spins calculation.

Type:

UnitsDict

spins

Database for the spin and band energies computed by the spins calculation.

Type:

UnitsDict

Methods

from_yaml

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

plot_spins

Method to plot the <n|sigma_z|n> values over the band structure.

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

plot_spins(ax, kpoint_idx=0, show_kpoint_labels=True, log=True, **kwargs)

Method to plot the <n|sigma_z|n> values over the band structure.

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

  • kpoint_idx (int, optional) – Index of the k-point to plot the <n|sigma_z|n> values for. <n|sigma_z|n> elements will be plotted along k-points, at this k-point By default, it will be the first k-point.

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

  • log (bool, optional) – If true, the plot will normalize values on a log scale. If false, the plot will normalize values linearly. By default, it will be true.

Returns:

ax – Axis with the plotted bands.

Return type:

matplotlib.axes.Axes