perturbopy.postproc.calc_modes.spectral_cumulant.SpectralCumulant

class perturbopy.postproc.calc_modes.spectral_cumulant.SpectralCumulant(spectral_file, pert_dict)

Bases: CalcMode

Class representation of a Perturbo cumulant calculation

Parameters:

prefix (str) – Prefix for the HDF5 file containing spectral function data.

temp_array

Array of temperatures corresponding to the spectral data.

Type:

numpy.ndarray

freq_array

Array of energy value in electron volts (eV).

Type:

numpy.ndarray

freq_step

Energy step size for the energy grid in eV.

Type:

float

Akw

Spectral function data, indexed by k-point, band, temperature, and ω.

Type:

numpy.ndarray

Methods

from_hdf5_yaml

Class method to create a SpectralCumulantCalcMode object from the HDF5 file and YAML file generated by a Perturbo calculation

from_yaml

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

plot_Aw

Plots the spectral function A(ω) for a given k-point, temperature, and band.

classmethod from_hdf5_yaml(spectral_path, yaml_path='pert_output.yml')

Class method to create a SpectralCumulantCalcMode object from the HDF5 file and YAML file generated by a Perturbo calculation

Parameters:
  • spectral_path (str) – Path to the HDF5 file generated by a spectral-cum calculation

  • yaml_path (str, optional) – Path to the YAML file generated by a spectral-cum calculation

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_Aw(ax, ik=0, it=0, ib=0)

Plots the spectral function A(ω) for a given k-point, temperature, and band.

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

  • ik (int, optional) – Index of the k-point in the grid. Default is 0.

  • it (int, optional) – Index of the temperature in the temperature array. Default is 0.

  • ib (int, optional) – Index of the band. Default is 0.

Returns:

The axis object with the plotted spectral function.

Return type:

matplotlib.axes.Axes

Notes

The spectral function is normalized before plotting. The plot includes labels, legends, and adjusted aesthetics for better visualization.