electron_phonon.self_energy

py4vasp.calculation.electron_phonon.self_energy

(

  • data_context,
  • **kwargs

)

Access and analyze electron-phonon self-energy data.

This class provides methods to access, select, and analyze the electron-phonon self-energy. It allows you to retrieve various quantities such as eigenvalues, Debye-Waller and Fan self-energies, and scattering approximations for different selections of bands, k-points, and spin channel.

Main features:
  • Retrieve self-energy data for specific bands, k-points and spin channels.

  • Convert self-energy data to dictionaries for further analysis.

  • Iterate over all available self-energy instances.

Examples

>>> elph_selfen = ElectronPhononSelfEnergy(raw_data)
>>> print(elph_selfen)
electron phonon self energy
>>> instance = elph_selfen[0]
>>> data = instance.to_dict()

chemical_potential_mu_tag

() → tuple

Return the chemical potential tag and values.

Returns

tuple
A tuple containing (tag_name, values_array) where tag_name is a string describing the chemical potential parameter and values_array contains the numerical values.

count

(value) → integer -- return number of occurrences of value

eigenvalues

() → np.ndarray

Return the eigenvalues from the raw data.

Returns

np.ndarray
Array containing eigenvalues for all k-points, bands, and spin channels.

index

(value) → integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

path

Returns the path from which the output is obtained.

print

()
Print a string representation of this instance.

read

(*args, **kwargs)
Convenient wrapper around to_dict. Check that function for examples and optional arguments.

select

(selection: str) → list[SelfEnergyInstance]

Return a list of SelfEnergyInstance objects matching the selection.

Parameters

selection: str
String representing the selection criteria (e.g., “nbands_sum”, “selfen_approx”, “selfen_delta”) and the desired values for those properties

Returns

list[SelfEnergyInstance]
Instances that match the selection criteria.

selections

() → dict

Return a dictionary describing what options are available to read the electron self-energies.

Returns

dict
Dictionary containing available selection options with their possible values. Keys include selection criteria like “nbands_sum”, “selfen_approx”, “selfen_delta”.

to_dict

() → dict

Return a dictionary that lists how many accumulators are available

Returns

dict
Dictionary containing information about the available accumulators.

py4vasp.electron_phonon.self_energy.SelfEnergyInstance

(

  • parent,
  • index

)

Represents a single instance of electron-phonon self-energy calculations. This class provides access to the electron-phonon self-energy data for a specific self-energy accumulator. It allows retrieval of various components of the self-energy, such as Debye-Waller and Fan terms.

Examples

>>> instance = ElectronPhononSelfEnergyInstance(parent, index=0)
>>> print(instance)
electron phonon self energy 0
>>> data = instance.to_dict()
>>> fan_value = instance.get_fan((iband, ikpt, isp))

debye_waller

() → SparseTensor

Return the Debye-Waller contribution to the electron-phonon self-energy as a sparse tensor.

Returns

SparseTensor
Sparse tensor containing Debye-Waller self-energy contributions for specific band, k-point, and spin combinations.

energies

() → SparseTensor

Return the energies at which the self energy was evaluated as a sparse tensor.

Returns

SparseTensor
Sparse tensor containing energy values for specific band, k-point, and spin combinations.

fan

() → SparseTensor

Return the Fan contribution to the electron-phonon self-energy as a sparse tensor.

Returns

SparseTensor
Sparse tensor containing Fan self-energy contributions for specific band, k-point, and spin combinations.

print

()
Print a string representation of this instance.

read

()
Convenient wrapper around to_dict. Check that function for examples and optional arguments.

read_metadata

() → Dict[str, Any]

Read metadata for this instance.

The metadata contains information about the settings used for this instance, such as the number of bands included in the summation, the delta value used for the self-energy calculation, and the scattering approximation employed.

Returns

Dict[str, Any]
A dictionary containing the metadata for this instance. The keys correspond to settings in the INCAR file, and the values are the respective settings used.

self_energy

() → SparseTensor

Return the total electron-phonon self-energy as a sparse tensor.

Returns

SparseTensor
Sparse tensor containing the sum of Fan and Debye-Waller contributions for specific band, k-point, and spin combinations.

to_dict

() → dict

Convert the electron-phonon self-energy instance to a dictionary.

Returns

dict
Dictionary containing metadata, eigenvalues, fan terms, debye_waller terms, and energies for this self-energy instance.

py4vasp.electron_phonon.self_energy.SparseTensor

(

  • band_kpoint_spin_index,
  • band_start,
  • tensor

)

A sparse tensor implementation for electron-phonon data.

This class provides efficient storage and access to tensor data that is only defined for specific combinations of band, k-point, and spin indices.

Parameters

band_kpoint_spin_index: array_like
Index mapping for (band, kpoint, spin) combinations.
band_start: int
Starting band index for valid data.
tensor: array_like
The actual tensor data values in compressed form.

valid_bands

: range

Return the range of valid band indices.

Returns

range
Range object representing the valid band indices.