SelfEnergies
File containing the band map class.
- class xarpes.selfenergies.SelfEnergy(ekin_range, hnuminPhi, energy_resolution, temperature, label, properties, parameters)[source]
Self-energy
- property energy_resolution
Energy resolution associated with the self-energy.
- property temperature
Temperature associated with the self-energy [K].
- property parameters
Dictionary with user-supplied parameters (read-only view).
- property side
Optional side selector: ‘left’ or ‘right’.
- property fermi_wavevector
Optional k_F; can be set later.
- property fermi_velocity
Optional v_F; can be set later.
- property bare_mass
Optional bare mass; used by SpectralQuadratic formulas.
- property center_wavevector
Read-only center wavevector (SpectralQuadratic, if present).
- property peak_positions
k_parallel = peak * dtor * sqrt(ekin_range / PREF) (lazy).
- property peak_positions_sigma
Std. dev. of k_parallel (lazy).
- property imag
-Σ’’ (lazy).
- property imag_sigma
Std. dev. of -Σ’’ (lazy).
- property real
Σ’ (lazy).
- property real_sigma
Std. dev. of Σ’ (lazy).
- property a2f_spectrum
Cached α²F(ω) spectrum from last extraction (or None).
- property a2f_model
Cached MEM model spectrum from last extraction (or None).
- property a2f_omega_range
Cached ω grid for the last extraction (or None).
- property a2f_aval_select
Cached selected a-value from last extraction (or None).
- property a2f_cost
Cached cost from last bayesian_loop (or None).
- property reconstructed_real_ph
Phonon-only reconstructed real part from latest MEM run (or None).
- property reconstructed_imag_ph
Phonon-only reconstructed imaginary part from latest MEM run (or None).
- property reconstructed_real
Reconstructed real part with e-e contribution added back.
- property reconstructed_imag
Reconstructed imaginary part with e-e and impurity terms added back.
- property reconstructed_real_el
Electron-electron contribution to reconstructed real part.
- property reconstructed_imag_el
Electron-electron contribution to reconstructed imaginary part.
- property reconstructed_imag_imp
Impurity contribution vector for reconstructed imaginary part.
- property ecut_left
Cached left energy cutoff (meV) from the latest MEM run.
- property ecut_right
Cached right energy cutoff (meV) from the latest MEM run.
None means the algorithms used self.energy_resolution as right cutoff.
- property mdc_maxima
MDC maxima (lazy).
- SpectralLinear:
identical to peak_positions
- SpectralQuadratic:
peak_positions + center_wavevector
- plot_real(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot the real part Σ’ of the self-energy as a function of E-μ.
- Parameters:
- axMatplotlib-Axes or None
Axis to plot on. Created if not provided by the user.
- scale{“eV”, “meV”}
Units for both axes. If “meV”, x and y (and yerr) are multiplied by KILO.
- resolution_range{“absent”, “applied”}
If “applied”, applies the same energy mask used by
extract_a2f/bayesian_loopbased on cachedecut_left/ecut_rightvalues.- **kwargs
Additional keyword arguments passed to
ax.errorbar.
- Returns:
- figMatplotlib-Figure
Figure containing the Σ’(E) plot.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_imag(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot the imaginary part -Σ’’ of the self-energy vs. E-μ.
- Parameters:
- axMatplotlib-Axes or None
Axis to plot on. Created if not provided by the user.
- scale{“eV”, “meV”}
Units for both axes. If “meV”, x and y (and yerr) are multiplied by KILO.
- resolution_range{“absent”, “applied”}
If “applied”, applies the same energy mask used by
extract_a2f/bayesian_loopbased on cachedecut_left/ecut_rightvalues.- **kwargs
Additional keyword arguments passed to
ax.errorbar.
- Returns:
- figMatplotlib-Figure
Figure containing the -Σ’’(E) plot.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_both(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot Σ’(E) and -Σ’’(E) vs. E-μ on the same axis.
- Parameters:
- axMatplotlib-Axes or None
Axis to plot on. Created if not provided by the user.
- scale{“eV”, “meV”}
Units for both axes. If “meV”, x, y, and yerr are multiplied by KILO.
- resolution_range{“absent”, “applied”}
If “applied”, applies the same energy mask used by
extract_a2f/bayesian_loopbased on cachedecut_left/ecut_rightvalues.- **kwargs
Additional keyword arguments passed to
ax.errorbar.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_real(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed Σ’(E) vs. E-μ from the latest MEM workflow.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_imag(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed -Σ’’(E) vs. E-μ from the latest MEM workflow.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_both(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed Σ’(E) and -Σ’’(E) vs. E-μ on the same axis.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_real_ph(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed phonon contribution Σ_ph(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_imag_ph(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed phonon contribution -Σ’’_ph(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_both_ph(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed phonon Σ’(E) and -Σ’’(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_real_el(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed electron contribution Σ_el(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_imag_el(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed electron contribution -Σ’’_el(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_both_el(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed electron Σ’(E) and -Σ’’(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_real_imp(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed impurity real contribution Σ_imp(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_imag_imp(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed impurity imaginary contribution -Σ’’_imp(E).
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_reconstructed_both_imp(ax=None, scale='eV', resolution_range='absent', **kwargs)[source]
Plot reconstructed impurity Σ’(E) and -Σ’’(E) vs. E-μ.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_a2f(ax=None, abscissa='forward', **kwargs)[source]
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_model(ax=None, abscissa='forward', **kwargs)[source]
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- plot_spectra(ax=None, abscissa='forward', **kwargs)[source]
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- extract_a2f(*, omega_min, omega_max, omega_num, omega_I, omega_M, ax=None, method=None, parts=None, iter_max=None, aval_min=None, aval_max=None, aval_num=None, ecut_left=None, ecut_right=None, f_chi_squared=None, W=None, power=None, mu=None, omega_S=None, sigma_svd=None, t_criterion=None, g_guess=None, b_guess=None, c_guess=None, d_guess=None, h_n=None, h_n_min=None, impurity_magnitude=None, lambda_el=None)[source]
Extract Eliashberg function α²F(ω) from the self-energy. While working with band maps and MDCs is more intuitive in eV, the self-energy extraction is performed in eV.
- Parameters:
- axMatplotlib-Axes or None
Axis to plot on. Created if not provided by the user. (Not used yet; reserved for future plotting.)
- method{“chi2kink”}
MEM selection method.
- parts{“both”, “real”, “imag”}
Which part of the self-energy to fit.
- iter_maxint
Maximum number of MEM iterations.
- aval_min, aval_maxfloat
Minimum and maximum a values scanned in the chi2kink procedure.
- aval_numint
Number of a values scanned.
- ecut_leftfloat
Left energy cutoff in meV, measured upward from the lowest energy.
- ecut_rightfloat or None
Right energy cutoff in meV below the chemical potential. If None,
self.energy_resolutionis used.- f_chi_squaredfloat or None
Target chi-squared threshold factor. If None, defaults to 2.5 for
parts='both'and 2.0 otherwise.- Wfloat or None
Electron-electron interaction scale in meV, required when
lambda_elis nonzero for linearised bands.- powerint
Power used in the electron-electron self-energy model.
- mufloat
MEM regularisation parameter.
- omega_Sfloat
Switch-on scale for the model function.
- sigma_svdfloat
Singular-value cutoff used in the SVD.
- t_criterionfloat
Convergence criterion for chi2kink.
- g_guess, b_guess, c_guess, d_guessfloat
Initial guesses for the chi2kink logistic fit.
- h_nfloat or None
Model normalisation parameter. Must be provided.
- impurity_magnitudefloat
Constant impurity contribution subtracted from -Σ’’.
- lambda_elfloat
Strength of the electron-electron self-energy contribution.
- Returns:
- figMatplotlib-Figure
Figure showing the chi2kink selection curve.
- spectrumndarray
Extracted α²F(ω).
- modelndarray
MEM model spectrum.
- omega_rangendarray
ω grid used for the extraction.
- aval_selectfloat
Selected a-value returned by the chi2kink procedure.
Notes
Keyword arguments controlling the display of the figure:
kwargs
Meaning
title
Title of the plot (Default: None).
show
True to show the figure (default: True).
savefig
“abc.png” or “abc.eps” to save the figure to a file.
size_kwargs
Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)
tight_layout
True to call fig.tight_layout (default: False)
ax_grid
True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.
ax_annotate
Add labels to subplots e.g. (a), (b). Default: False
fig_close
Close figure. Default: True.
- bayesian_loop(*, omega_min, omega_max, omega_num, omega_I, omega_M, fermi_velocity=None, fermi_wavevector=None, bare_mass=None, vary=(), opt_method='Nelder-Mead', opt_options=None, method=None, parts=None, iter_max=None, aval_min=None, aval_max=None, aval_num=None, ecut_left=None, ecut_right=None, f_chi_squared=None, W=None, power=None, mu=None, omega_S=None, sigma_svd=None, t_criterion=None, g_guess=None, b_guess=None, c_guess=None, d_guess=None, h_n=None, h_n_min=None, impurity_magnitude=None, lambda_el=None, converge_iters=None, tole=None, scale_vF=None, scale_mb=None, scale_imp=None, scale_kF=None, scale_lambda_el=None, scale_hn=None, opt_iter_max=None, rollback_steps=None, max_retries=None, relative_best=None, min_steps_for_regression=None)[source]
Bayesian outer loop calling _cost_function().
If vary is non-empty, runs a SciPy optimization over the selected parameters in vary.
Supported entries in vary depend on self._class:
Common: “fermi_wavevector”, “impurity_magnitude”, “lambda_el”, “h_n”
SpectralLinear: additionally “fermi_velocity”
SpectralQuadratic: additionally “bare_mass”
- Parameters:
- opt_optionsdict, optional
Options passed directly to scipy.optimize.minimize. These are only used for convergence if the custom criterion is disabled (see Notes).
Notes
Convergence behaviour
By default, convergence is controlled by a custom patience criterion: the optimization terminates when the absolute difference between the current cost and the best cost seen so far is smaller than tole for converge_iters consecutive iterations.
To instead rely on SciPy’s native convergence criteria (e.g. Nelder–Mead xatol / fatol), disable the custom criterion by setting converge_iters=0 or tole=None. In that case, SciPy termination options supplied via opt_options are used.
- class xarpes.selfenergies.CreateSelfEnergies(self_energies)[source]
Thin container for self-energies with leaf-aware utilities. All items are assumed to be leaf self-energy objects with a .label attribute for identification.