PAOFLOW.graphics.plot_functions#

Functions#

plot_dos(es, dos, title, x_lim, y_lim, vertical, col)

plot_pdos(es, dos, title, x_lim, y_lim, vertical, ...)

normalize_weights(w)

plot_weighted_bands(outputdir, bands, sym_points, ...)

plot_bands(bands, sym_points, title, label, y_lim, col)

Plot one or more band structures for comparison.

plot_dos_beside_bands(es, dos, bands, sym_points, ...)

plot_berry_under_bands(berry, bands, sym_points, ...)

plot_tensor(enes, tensors, eles, title, x_lim, y_lim, ...)

plot_shc_tensor(enes, shc, title, x_lim, y_lim, x_lab, ...)

plot_optical(curves, title, x_lim, y_lim, x_label, y_label)

Overlay an arbitrary selection of optical spectra on a single axis.

plot_color_swatch(rgb01[, hexstr, title, label])

Display a solid swatch of the perceived visible color of a material.

plot_phonons(distances, frequencies[, ticks, dos, ...])

Plot a phonon dispersion, optionally with a side density-of-states panel.

plot_gruneisen_band(distances, gruneisen[, ticks, ...])

Plot the mode Grueneisen parameters along a q-path (dispersion style).

plot_phonon_thermal(temperatures, free_energy, ...[, ...])

Plot the harmonic thermal properties as a function of temperature.

plot_qha(temperatures[, volume, thermal_expansion, ...])

Plot the quasi-harmonic quantities as a function of temperature.

plot_ir_spectrum(frequencies, intensities[, modes, ...])

Plot a broadened infrared spectrum, optionally with the mode sticks.

plot_raman_spectrum(frequencies, intensities[, modes, ...])

Plot a broadened Raman spectrum, optionally with the mode sticks.

plot_migdal_eliashberg(data[, temps, title, filename, ...])

Plot the isotropic Migdal-Eliashberg results versus temperature.

plot_migdal_eliashberg_aniso(data[, temps, iso_data, ...])

Plot the anisotropic Migdal-Eliashberg results versus temperature.

plot_phonon_assisted_absorption(data[, eta_ev, ...])

Plot the phonon-assisted and direct absorption versus photon energy.

plot_thermal_emissivity(data[, temps, title, filename])

Plot the spectral and total hemispherical emissivity versus temperature.

plot_metal_transport(eliashberg, resistivity[, ...])

Plot the transport Eliashberg function and the resistivity of a metal.

plot_carrier_mobility(mobility[, scattering, ...])

Plot phonon-limited carrier mobilities and the scattering rates of a semiconductor.

Module Contents#

PAOFLOW.graphics.plot_functions.plot_dos(es, dos, title, x_lim, y_lim, vertical, col, x_label=None, y_label=None)[source]#
PAOFLOW.graphics.plot_functions.plot_pdos(es, dos, title, x_lim, y_lim, vertical, cols, labels, legend)[source]#
PAOFLOW.graphics.plot_functions.normalize_weights(w)[source]#
PAOFLOW.graphics.plot_functions.plot_weighted_bands(outputdir, bands, sym_points, title, cbar_label, label, filename, y_lim, col)[source]#
PAOFLOW.graphics.plot_functions.plot_bands(bands, sym_points, title, label, y_lim, col, labels=None, legend=True)[source]#

Plot one or more band structures for comparison.

Arguments:

bands: ndarray (nbands, nkpts) or list of such arrays. col: single color or list of colors, one per dataset. labels: optional list of legend labels, one per dataset. legend: show legend when labels are provided (default True).

PAOFLOW.graphics.plot_functions.plot_dos_beside_bands(es, dos, bands, sym_points, title, band_label, x_lim, y_lim, col, dos_ticks)[source]#
PAOFLOW.graphics.plot_functions.plot_berry_under_bands(berry, bands, sym_points, title, band_label, berry_label, x_lim, y_lim, col, dos_ticks)[source]#
PAOFLOW.graphics.plot_functions.plot_tensor(enes, tensors, eles, title, x_lim, y_lim, x_lab, y_lab, col, legend, min_zero=False)[source]#
PAOFLOW.graphics.plot_functions.plot_shc_tensor(enes, shc, title, x_lim, y_lim, x_lab, y_lab, cols, labels, legend, legend_outside=False)[source]#
PAOFLOW.graphics.plot_functions.plot_optical(curves, title, x_lim, y_lim, x_label, y_label, cols=None, legend=True)[source]#

Overlay an arbitrary selection of optical spectra on a single axis.

This is the generic renderer behind the user-facing optical-property selection (dielectric function, refractive index, absorption, reflectivity, optical conductivity and emissivity). Each curve may carry its own abscissa, so spectra sampled on the photon-energy grid and the total-emissivity-versus-temperature curve can both be drawn through the same entry point.

Arguments:
curves (list): Sequence of (x, y, label) tuples, one per spectrum.

x and y are 1D arrays of equal length; label is the legend text (may be None).

title (str): Figure title (defaults to 'Optical properties'). x_lim (tuple): (x_min, x_max) axis limits, or None. y_lim (tuple): (y_min, y_max) axis limits, or None. x_label (str): X-axis label (defaults to 'Energy (eV)'). y_label (str): Y-axis label (defaults to 'Optical response'). cols (str/tuple or list): A single color applied to every curve, or a

list of colors (one per curve). None lets matplotlib cycle.

legend (bool): Show the legend when any curve carries a label.

PAOFLOW.graphics.plot_functions.plot_color_swatch(rgb01, hexstr=None, title=None, label=None)[source]#

Display a solid swatch of the perceived visible color of a material.

Arguments:

rgb01 (sequence): sRGB color components in [0, 1]. hexstr (str): Optional hex string annotated on the swatch (e.g. ‘#rrggbb’). title (str): Figure title (defaults to ‘Perceived color’). label (str): Optional text drawn above the hex value (e.g. the material).

PAOFLOW.graphics.plot_functions.plot_phonons(distances, frequencies, ticks=None, dos=None, title=None, y_lim=None, col='black', units='THz', filename=None)[source]#

Plot a phonon dispersion, optionally with a side density-of-states panel.

Arguments:

distances (ndarray): 1D array of cumulative path distances. frequencies (ndarray): 2D array (nq, nbranch) of phonon frequencies. ticks (tuple): Optional (positions, labels) for high-symmetry points. dos (tuple): Optional (frequency, dos) arrays for a side DOS panel. title (str): Plot title. y_lim (tuple): Frequency axis limits (y_min, y_max). col (str or tuple): Line colour. units (str): Frequency unit string for the axis label. filename (str): If given, save the figure to this path.

PAOFLOW.graphics.plot_functions.plot_gruneisen_band(distances, gruneisen, ticks=None, title=None, y_lim=None, col='black', filename=None)[source]#

Plot the mode Grueneisen parameters along a q-path (dispersion style).

Arguments:

distances (ndarray): 1D array of cumulative path distances. gruneisen (ndarray): 2D array (nq, nbranch) of mode Grueneisen parameters. ticks (tuple): Optional (positions, labels) for high-symmetry points. title (str): Plot title. y_lim (tuple): Grueneisen-axis limits (y_min, y_max). col (str or tuple): Line colour. filename (str): If given, save the figure to this path.

PAOFLOW.graphics.plot_functions.plot_phonon_thermal(temperatures, free_energy, entropy, heat_capacity, title=None, filename=None)[source]#

Plot the harmonic thermal properties as a function of temperature.

Arguments:

temperatures (ndarray): 1D array of temperatures (K). free_energy (ndarray): Helmholtz free energy (kJ/mol). entropy (ndarray): Entropy (J/K/mol). heat_capacity (ndarray): Constant-volume heat capacity (J/K/mol). title (str): Plot title. filename (str): If given, save the figure to this path.

PAOFLOW.graphics.plot_functions.plot_qha(temperatures, volume=None, thermal_expansion=None, bulk_modulus=None, heat_capacity=None, gruneisen=None, ev=None, title=None, filename=None)[source]#

Plot the quasi-harmonic quantities as a function of temperature.

Each supplied quantity is drawn in its own panel; None panels are skipped. Pass ev=(volumes, energies) to include the static E-V curve.

Arguments:

temperatures (ndarray): 1D array of temperatures (K). volume (ndarray): Equilibrium volume V(T) (Angstrom^3). thermal_expansion (ndarray): Volumetric thermal expansion alpha(T) (1/K). bulk_modulus (ndarray): Isothermal bulk modulus B(T) (GPa). heat_capacity (ndarray): Constant-pressure heat capacity Cp(T) (J/K/mol). gruneisen (ndarray): Thermodynamic Gruneisen parameter gamma(T). ev (tuple): Optional (volumes, energies) static E-V data (Angstrom^3, eV). title (str): Overall figure title. filename (str): If given, save the figure to this path.

PAOFLOW.graphics.plot_functions.plot_ir_spectrum(frequencies, intensities, modes=None, title=None, x_lim=None, col='black', units='cm-1', filename=None)[source]#

Plot a broadened infrared spectrum, optionally with the mode sticks.

Arguments:

frequencies (ndarray): 1D array of frequencies for the broadened curve. intensities (ndarray): 1D array of broadened intensities. modes (tuple): Optional (mode_freq, mode_intensity) arrays drawn as

vertical sticks at the discrete mode positions.

title (str): Plot title. x_lim (tuple): Frequency axis limits (x_min, x_max). col (str or tuple): Line colour. units (str): Frequency unit string for the axis label. filename (str): If given, save the figure to this path.

PAOFLOW.graphics.plot_functions.plot_raman_spectrum(frequencies, intensities, modes=None, title=None, x_lim=None, col='black', units='cm-1', filename=None)[source]#

Plot a broadened Raman spectrum, optionally with the mode sticks.

Arguments:

frequencies (ndarray): 1D array of frequencies for the broadened curve. intensities (ndarray): 1D array of broadened intensities. modes (tuple): Optional (mode_freq, mode_intensity) arrays drawn as

vertical sticks at the discrete mode positions.

title (str): Plot title. x_lim (tuple): Frequency axis limits (x_min, x_max). col (str or tuple): Line colour. units (str): Frequency unit string for the axis label. filename (str): If given, save the figure to this path.

PAOFLOW.graphics.plot_functions.plot_migdal_eliashberg(data, temps=None, title=None, filename=None, real_axis_max_mev=60.0)[source]#

Plot the isotropic Migdal-Eliashberg results versus temperature.

Parameters:
  • data (mapping) – Contents of migdal_eliashberg.npz written by PAOFLOW.elphon.migdal_eliashberg.write_me_outputs().

  • temps (sequence of float, optional) – Temperatures (K) drawn in the frequency-resolved panels; defaults to up to four temperatures with a non-zero gap.

  • title (str, optional) – Overall figure title.

  • filename (str, optional) – If given, the figure is also saved to this path.

  • real_axis_max_mev (float, optional) – Upper frequency (meV) of the real-axis Delta(w) panels (default 60), capped at the end of the real-axis grid (wscut).

Returns:

Shows the figure (and writes filename).

Return type:

None

Notes

Panels: Delta(i w_n) and Z(i w_n); Re / Im Delta(w) on the real axis (analytic continuation solid, Pade dashed); the quasiparticle DOS; Delta(T) from the lowest Matsubara frequency and the two real-axis gap edges; and the largest eigenvalue of the linearised kernel with Tc. Temperatures use one blue ramp (light to dark with increasing T); the three gap estimates use distinct colours and markers.

PAOFLOW.graphics.plot_functions.plot_migdal_eliashberg_aniso(data, temps=None, iso_data=None, title=None, filename=None, distribution_scale=0.003)[source]#

Plot the anisotropic Migdal-Eliashberg results versus temperature.

Parameters:
  • data (mapping) – Contents of migdal_eliashberg_aniso.npz written by PAOFLOW.elphon.anisotropic_eliashberg.write_me_aniso_outputs().

  • temps (sequence of float, optional) – Temperatures (K) drawn in the distribution and quasiparticle-DOS panels; defaults to up to four temperatures with a non-zero gap.

  • iso_data (mapping, optional) – Contents of the isotropic migdal_eliashberg.npz (PAOFLOW.elphon.migdal_eliashberg.write_me_outputs()); its Delta(i w_0) is drawn for comparison.

  • title (str, optional) – Overall figure title.

  • filename (str, optional) – If given, the figure is also saved to this path.

  • distribution_scale (float, optional) – Horizontal scale (K per 1/eV^2) of the gap distributions in the Delta(T) panel; the default 3e-3 is that of EPW tutorial 04.

Returns:

Shows the figure (and writes filename).

Return type:

None

Notes

Panels: the distribution of Delta_nk(i w_0) at every temperature, drawn as in EPW tutorial 04 (plot_gap0.gnu): EPW’s gap_distribution_FS (epw_gap_distribution()), filled from T to T + distribution_scale * rho(Delta), with the isotropic gap when given; the gap distributions and the quasiparticle DOS at the chosen temperatures; the distribution of lambda_nk; Delta_nk versus lambda_nk at the lowest temperature; and the largest eigenvalue of the linearised kernel.

PAOFLOW.graphics.plot_functions.plot_phonon_assisted_absorption(data, eta_ev=0.05, temperature=None, epw_indabs_file=None, title=None, filename=None)[source]#

Plot the phonon-assisted and direct absorption versus photon energy.

Parameters:
  • data (mapping) – Contents of absorption.npz written by PAOFLOW.elphon.phonon_assisted_absorption.write_absorption_outputs().

  • eta_ev (float, optional) – Intermediate-state broadening (eV) to show; the closest computed one is used (default 0.05).

  • temperature (float, optional) – Temperature (K) of the left panel; defaults to the first one.

  • epw_indabs_file (str, optional) – EPW epsilon2_indabs_<T>K.dat overlaid (dashed) on the phonon-assisted curve of the left panel, at the same broadening column.

  • title (str, optional) – Overall figure title.

  • filename (str, optional) – If given, the figure is also saved to this path.

Returns:

Shows the figure (and writes filename).

Return type:

None

Notes

Left: polarisation-averaged Im eps (direct, phonon-assisted and total, Gaussian delta) on a log scale. Right: the absorption coefficient (cm^-1) for every temperature (one blue ramp, light to dark with increasing T). The indirect and direct gaps of the dense grid are marked.

PAOFLOW.graphics.plot_functions.plot_thermal_emissivity(data, temps=None, title=None, filename=None)[source]#

Plot the spectral and total hemispherical emissivity versus temperature.

Parameters:
Returns:

Shows the figure (and writes filename).

Return type:

None

Notes

Left: spectral hemispherical emissivity of the slab (solid) and of the opaque half-space (dashed) at each temperature (one blue ramp, light to dark with increasing T). Right: the Planck-weighted total emissivity of the slab and of the half-space versus T; the lowest Planck coverage of the photon-energy grid is noted.

PAOFLOW.graphics.plot_functions.plot_metal_transport(eliashberg, resistivity, channel_names=None, experiment=None, title=None, filename=None)[source]#

Plot the transport Eliashberg function and the resistivity of a metal.

Parameters:
  • eliashberg (mapping) – Contents of eliashberg.npz from a dense-q run with transport=True (omega in eV, a2F, a2F_tr, lambda, lambda_tr, omega_plasma_ev).

  • resistivity (ndarray, shape (ntemp, 2 + nchannel)) – Rows of resistivity.dat written by transport.elphon.py: temperature (K), total and per-channel resistivity (micro-ohm cm).

  • channel_names (sequence of str, optional) – Labels of the channel columns.

  • experiment (ndarray, shape (n, 2), optional) – Measured (temperature, resistivity in micro-ohm cm), drawn as markers.

  • title (str, optional) – Overall figure title.

  • filename (str, optional) – If given, the figure is also saved to this path.

Returns:

Shows the figure (and writes filename).

Return type:

None

Notes

Left: \(\alpha^2F(\omega)\) and the transport function \(\alpha^2F_{tr}(\omega)\) (the velocity-weighted coupling that relaxes the current), with \(\lambda\) and \(\lambda_{tr}\). Right: the resistivity \(\rho(T)\), total and, with several channels, the contribution of each (Matthiessen’s rule).

PAOFLOW.graphics.plot_functions.plot_carrier_mobility(mobility, scattering=None, temperature_k=300.0, experiment=None, title=None, filename=None)[source]#

Plot phonon-limited carrier mobilities and the scattering rates of a semiconductor.

Parameters:
  • mobility (ndarray, shape (ntemp, 11)) – Rows of mobility.dat (PAOFLOW.elphon.carrier_scattering.write_mobility_outputs()): T (K), chemical potential, n_e, n_h, SERTA and MRTA electron and hole mobilities (cm^2/(V s)), conductivities and Seebeck coefficient.

  • scattering (mapping, optional) – Contents of carrier_scattering.npz (energies_ev, in_window, carrier, rates_serta, rates_mrta, temps_k, vbm_ev, cbm_ev); adds the rates panel.

  • temperature_k (float, optional) – Temperature of the rates panel (the closest computed one).

  • experiment (ndarray, shape (n, 3), optional) – Measured (T, electron mobility, hole mobility), drawn as open markers; NaN skips a value.

  • title (str, optional) – Overall figure title.

  • filename (str, optional) – If given, the figure is also saved to this path.

Returns:

Shows the figure (and writes filename).

Return type:

None

Notes

Left: \(\mu_{e,h}(T)\) in the momentum-relaxation (MRTA, solid) and self-energy (SERTA, dashed) relaxation-time approximations, on log-log axes (phonon-limited mobilities fall roughly as \(T^{-1.5}\) to \(T^{-2.5}\)). Right: \(1/\tau_{n\mathbf k}\) (MRTA) of the window states against the carrier energy from the band edge.