perturbopy.postproc.calc_modes.phdisp.Phdisp

class perturbopy.postproc.calc_modes.phdisp.Phdisp(pert_dict)

Bases: CalcMode

Class representation of a Perturbo phonon dispersion (phdisp) calculation.

qpt

Database for the q-points used in the phdisp calculation, containing M points.

Type:

RecipPtDB

phdisp

Database for the phonon energies computed by the phdisp calculation. The keys are the phonon mode, and the values are an array (of length M) containing the energies at each q-point with units phdisp.units

Type:

UnitsDict

Methods

from_yaml

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

plot_phdisp

Method to plot the phonon dispersion.

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_phdisp(ax, show_qpoint_labels=True, **kwargs)

Method to plot the phonon dispersion.

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

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

  • c (str, list) – Color(s) for phonon modes; see corresponding entry in plot_tools.plot_dispersion function

  • ls (str, list) – Linestyle(s) for phonon modes; see corresponding entry in plot_tools.plot_dispersion function

  • energy_window (tuple of float, optional) – The range of phonon energies to be shown on the y-axis.

Returns:

ax – Axis with the plotted phonons.

Return type:

matplotlib.axes.Axes