Spectral properties¶
This submodule provides functions that plot spectral properties (mostly the spectral function) as a function of frequency and/or wavevector.
List of functions¶
- pyqcm.spectral.DoS(w, eta=0.1, label=0, sum=False, progress=True, labels=None, colors=None, file=None, data_file='dos.tsv', plt_ax=None, **kwargs)¶
Plots the density of states (DoS) as a function of frequency
- Parameters
w (float) – the frequency range is from -w to w if w is a float. If w is a tuple then the range is (wmax[0], wmax[1]). w can also be an explicit list of real frequencies, or of complex frequencies (in which case eta is ignored)
eta (float) – Lorentzian broadening, if w is real
label (int) – label of the model instance
sum (boolean) – if True, the sum of the DoS of all lattice orbitals is plotted in addition to each orbital individually
progress (boolean) – if True, prints computation progress
labels ([str]) – labels of the different curves
colors ([str]) – colors of the different curves
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.Fermi_surface(nk=64, label=0, orb=None, quadrant=False, plane='xy', k_perp=0.0, file=None, plt_ax=None, **kwargs)¶
Plots the Fermi surface of the non-interacting model (2D)
- Parameters
nk (int) – number of wavevectors on each side of the grid
label (int) – label of the model instance
orb (int) – if None, plots all the orbitals. Otherwise just plots the FS for that orbital (starts at 1)
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’
k_perp (float) – momentum component in the third direction (in multiple of \(\pi\))
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.G_dispersion(nk=64, label=0, orb=None, period='G', contour=False, inv=False, quadrant=False, datafile=None, max=None, k_perp=0.0, plane='xy', file=None, plt_ax=None, **kwargs)¶
Plots the eigenvalues of the inverse Green function at zero frequency
- Parameters
nk (int) – number of wavevectors on each side of the grid
label (int) – label of the model instance
orb (int) – if 0, plots all the orbitals. Otherwise just shows the plot for that orbital (starts at 1)
period (str) – periodization scheme (‘G’, ‘M’)
contour (boolean) – True for a contour plot; otherwise a 3D plot.
inv (boolean) – True if the inverse eigenvalues (inverse energies) are plotted instead
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
datafile (str) – if different from None, just writes the data in a file and does not plot
max (float) – energy range (from -max to max)
k_perp (float) – momentum component in the third direction (in multiple of \(pi\))
plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.Luttinger_surface(nk=200, label=0, orb=1, quadrant=False, k_perp=0, plane='xy', file=None, plt_ax=None, **kwargs)¶
Plots the Luttinger surface (zeros of the Green function) in the Brillouin zone (2D)
- Parameters
nk (int) – number of wavevectors on each side of the grid
label (int) – label of the model instance
orb (int) – orbital number (starts at 1)
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
k_perp (float) – for 3D models, value of the component of k perpendicular to the plane
plane (str) – for 3D models, plane of the plot (‘z’=’xy’, ‘y’=’xz’, ‘x=’yz’)
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.cluster_spectral_function(wmax=6, eta=0.05, imaginary=False, clus=0, label=0, offset=2, full=False, opt=None, spin_down=False, blocks=False, file=None, plt_ax=None, realpart=False, color='b', **kwargs)¶
Plots the spectral function of the cluster in the site basis
- Parameters
wmax (float) – the frequency range is from -wmax to wmax if w is a float. If wmax is a tuple then the range is (wmax[0], wmax[1]). wmax can also be an explicit list of real frequencies
eta (float) – Lorentzian broadening
imaginary (boolean) – If True, the frequency range is along the imaginary frequency axis
clus (int) – label of the cluster within the super unit cell (starts at 0)
label (int) – label of the model instance
offset (float) – vertical offset in the plot between the curves associated to successive wavevectors
full (boolean) – if True, plots off-diagonal components as well
self (boolean) – if True, plots the self-energy instead of the spectral function
opt (str) – if None, G is computed. Other options are ‘self’ (self-energy) and ‘hyb’ (hybridization function)
spin_down (boolean) – if True, plots the spin down part, if different
blocks (boolean) – if True, gives the GF in the symmetry basis (block diagonal)
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
color – matplotlib color of the curves
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
the array of frequencies, the spectral weight
- pyqcm.spectral.gap(k, orb=1, threshold=0.001)¶
Computes the spectral gap for a series of wavevectors
:param k : set of wavevectors :param int orb : orbital number (starts at 1) :param float threshold : weight below which a Lehmann contribution is deemed zero returns: an array of gap values
- pyqcm.spectral.hybridization_function(wmax=6, eta=0.01, imaginary=False, clus=0, realpart=False, label=0, file=None, plt_ax=None, **kwargs)¶
This function plots the imaginary part of the hybridization function Gamma as a function of frequency. Only the diagonal elements are plotted, but for all clusters if there is more than one. The arguments have the same meaning as in plot_spectrum, except ‘realpart’ which, if True, plots the real part instead of the imaginary part.
- Parameters
wmax (float) – the frequency range is from -wmax to wmax if w is a float. If wmax is a tuple then the range is (wmax[0], wmax[1]). wmax can also be an explicit list of real frequencies
eta (float) – Lorentzian broadening
imaginary (boolean) – If True, the frequency range is along the imaginary frequency axis
clus (int) – cluster index (starts at 0)
realpart (boolean) – if True, the real part of the Green function is shown, not the imaginary part
label (int) – label of the model instance
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.mdc(nk=200, eta=0.1, label=0, orb=None, spin_down=False, quadrant=False, opt='GF', k_perp=0, freq=0.0, max=None, plane='xy', size=1.0, band_basis=False, sym=None, file=None, plt_ax=None, **kwargs)¶
Plots the spectral weight at zero frequency in the Brillouin zone (2D)
- Parameters
nk (int) – number of wavevectors on each side of the grid
eta (float) – Lorentzian broadening
label (int) – label of the model instance
orb (int) – if None, sums all the orbitals. Otherwise just shows the weight for that orbital (starts at 1)
spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
opt (str) – The quantity to plot. ‘GF’ = Green function, ‘self’ = self-energy, ‘Z’ = quasi-particle weight
k_perp (float) – momentum component in the third direction (in multiple of pi)
freq (float) – frequency at which the spectral function is computed (0 by default)
max (float) – maximum value of the plotting range (if None, maximum of the data)
plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’
band_basis (boolean) – uses the band basis instead of the orbital basis (for multiband models)
sym (str) – symmetrization option for the mdc
size (float) – size of the plot, in multiple of the default (2 pi on the side)
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
the contour plot object
- pyqcm.spectral.mdc_anomalous(nk=200, w=0.1j, label=0, orbitals=(1, 1), self=False, im_part=False, quadrant=False, k_perp=0.0, plane='xy', file=None, plt_ax=None, **kwargs)¶
Plots the anomalous Green function or self-energy (2D)
- Parameters
nk (int) – number of wavevectors on each side of the grid
w (complex) – complex frequency at which the Green function is computed
label (int) – label of the model instance
orbitals (int) – shows the weight for orbitals (b1,b2) (starts at 1), or numpy array of spin-Nambu projection
self (boolean) – if True, plots the anomalous self-energy instead of the spectral function
im_part (boolean) – if True, plots the imaginary part instead of the real part
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
k_perp (float) – for 3D models, value of the component of k perpendicular to the plane
plane (str) – for 3D models, plane of the plot (‘z’=’xy’, ‘y’=’xz’, ‘x=’yz’)
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.momentum_profile(op, nk=50, label=0, quadrant=False, k_perp=0.0, plane='xy', file=None, plt_ax=None, **kwargs)¶
Plots the momentum-resolved average of operator op in the Brillouin zone (2D)
- Parameters
op (str) – name of the lattice operator
nk (int) – number of wavevectors on each side of the grid
label (int) – label of the model instance
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
k_perp (float) – momentum component in the third direction (in multiple of pi)
plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.plot_dispersion(nk=64, label=0, spin_down=False, orb=None, contour=False, datafile=None, quadrant=False, k_perp=0, plane='xy', file=None, plt_ax=None, view_angle=None, **kwargs)¶
Plots the dispersion relation in the Brillouin zone (2D)
- Parameters
nk (int) – number of wavevectors on each side of the grid
label (int) – label of the model instance
spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)
orb (int) – if None, sums all the orbitals. Otherwise just shows the weight for that orbital (starts at 1)
contour (boolean) – True if a contour plot is produced instead of a 3D plot.
datafile (str) – if given, name of the data file (no extension please) in which the data is printed, for plotting with an external program. Does not plot. Will produce one file per orbital, with the .tsv extension.
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
k_perp (float) – momentum component in the third direction (in multiple of pi)
plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
view_angle (tuple) – optional projection angle to pass to view_init() in the format of (elevation, azimuth) in degrees
kwargs – keyword arguments passed to the matplotlib ‘plot_surface’ function
- Returns
None
- pyqcm.spectral.segment_dispersion(path='triangle', nk=64, label=0, file=None, plt_ax=None, **kwargs)¶
Plots the dispersion relation in the Brillouin zone along a wavevector path
- Parameters
path (str) – wavevector path, as used by the function wavevector_path()
nk (int) – number of wavevectors on each side of the grid
label (int) – label of the model instance
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.spectral_function(wmax=6.0, eta=0.05, path='triangle', nk=32, label=0, orb=None, offset=2, opt='A', Nambu_redress=True, inverse_path=False, title=None, file=None, plt_ax=None, **kwargs)¶
Plots the spectral function \(A(\mathbf{k},\omega)\) along a wavevector path in the Brillouin zone. This version plots the spin-down part with the correct sign of the frequency in the Nambu formalism.
- Parameters
wmax (float) – the frequency range is from -wmax to wmax if w is a float. If wmax is a tuple then the range is (wmax[0], wmax[1]). wmax can also be an explicit list of real frequencies
eta (float) – Lorentzian broadening
path (str) – a keyword that is passed to pyqcm.wavevector_path() to produce a set of wavevectors along a path, or a tuple
nk (int) – the number of wavevectors along each segment of the path (passed to pyqcm.wavevector_grid())
label (int) – label of the instance of the model
orb (int) – if not None, only plots the spectral function associated with this orbital number (starts at 1). If None, sums over all orbitals.
offset (float) – vertical offset in the plot between the curves associated to successive wavevectors
opt (str) – ‘A’ : spectral function, ‘self’ : self-energy, ‘Sx’ : spin (x component), ‘Sy’ : spin (y component)
Nambu_redress (boolean) – if True, evaluates the Nambu component at the opposite frequency
inverse_path (boolean) – if True, inverts the path (k –> -k)
title (str) – optional title for the plot. If None, a string with the model parameters will be used.
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.spectral_function_Lehmann(path='triangle', nk=32, label=0, orb=1, offset=0.1, lims=None, file=None, plt_ax=None, **kwargs)¶
Plots a Lehmann representation of the spectral function along a wavevector path in the Brillouin zone. Singularities are plotted as impulses with heights proportionnal to the residue.
- Parameters
path – if a string, keyword passed to pyqcm.wavevector_path() to produce a set of wavevectors; else, explicit list of wavevectors (N x 3 numpy array).
nk (int) – the number of wavevectors along each segment of the path (passed to pyqcm.wavevector_path())
label (int) – label of the instance of the model
orb (int) – only plots the spectral function associated with this orbital number (starts at 1)
offset (float) – vertical offset in the plot between the curves associated to successive wavevectors
lims ((float,float)) – limits of the plot in frequency (2-tuple)
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
None
- pyqcm.spectral.spin_mdc(nk=200, eta=0.1, label=0, orb=None, quadrant=False, opt='spin', freq=0.0, max=None, k_perp=0, plane='xy', band_basis=False, file=None, plt_ax=None, **kwargs)¶
Plots the spin spectral weight at zero frequency in the Brillouin zone (2D)
- Parameters
nk (int) – number of wavevectors on each side of the grid
eta (float) – Lorentzian broadening
label (int) – label of the model instance
orb (int) – if None, sums all the orbitals. Otherwise just shows the weight for that orbital (starts at 1)
quadrant (boolean) – if True, plots the first quadrant of a square Brillouin zone only
opt (str) – The quantity to plot. ‘spin’ = spin texture, ‘spins’ = spin texture (saturated), ‘sz’ = z-component, ‘spinp’ = modulus of xy-component
freq (float) – frequency at which the spectral function is computed (0 by default)
max (float) – maximum value of the plotting range (if None, maximum of the data)
k_perp (float) – momentum component in the third direction (in multiple of pi)
plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’
band_basis – uses the band basis instead of the orbital basis (for multiband models)
file (str) – if not None, saves the plot in a file with that name
plt_ax – optional matplotlib axis set, to be passed when one wants to collect a subplot of a larger set
kwargs – keyword arguments passed to the matplotlib ‘plot’ function
- Returns
The contour plot object