PAOFLOW.response.do_epsilon#

Attributes#

Functions#

do_dielectric_tensor(data_controller, ene)

Compute and write the frequency-dependent dielectric tensor.

do_jdos(data_controller, ene, jdos_smeartype)

Compute and write the joint density of states (JDOS).

do_epsilon(data_controller, ene, ispin, ipol, jpol)

Compute the dielectric-function components for one spin channel and polarization pair.

optical_conductivity(ene, epsi, epsr, ipol, jpol)

Optical (AC) conductivity from the complex dielectric function.

refractive_index(ene, epsi, epsr)

Complex refractive index and derived spectra from $varepsilon(omega)$.

directional_reflectivity(epsr, epsi, theta)

Fresnel directional reflectivity for an opaque (optically thick) medium.

spectral_hemispherical_emissivity(epsr, epsi, ntheta)

Spectral hemispherical emissivity from the directional reflectivity.

total_hemispherical_emissivity(ene, emis_w, temperature)

Total (Planck-weighted) hemispherical emissivity at a temperature.

write_emissivity(data_controller, ene, epsr, epsi, ...)

Compute and write all emissivity spectra for one diagonal component.

eps_loop(data_controller, ene, ispin, ipol, jpol)

Inner BZ loop: accumulate the interband dielectric-function integrands.

jdos_loop(data_controller, ene, ispin, jdos_smeartype)

Inner BZ loop: accumulate the joint-density-of-states integrand.

Module Contents#

PAOFLOW.response.do_epsilon.comm[source]#
PAOFLOW.response.do_epsilon.rank[source]#
PAOFLOW.response.do_epsilon.do_dielectric_tensor(data_controller, ene)[source]#

Compute and write the frequency-dependent dielectric tensor.

Iterates over every tensor component pair (i, j) listed in arrays['d_tensor'] and for each one calls do_epsilon() to obtain the imaginary part \u03b5\u2082 (epsi), real part \u03b5\u2081 (epsr), electron energy-loss spectrum \u03b5\u2082/(\u03b5\u2081\u00b2+\u03b5\u2082\u00b2) (eels), and the Kramersu2013Kronig-derived real part (ieps). Each quantity is written to a two-column .dat file.

For diagonal components the plasmon frequency is estimated from the f-sum rule:

\[\begin{split}\\omega_p = \\sqrt{\\frac{2}{\\pi} \\int_0^\\infty \\omega\\,\\varepsilon_2(\\omega)\,d\\omega}\end{split}\]

and printed to stdout.

Spin-polarised runs (nspin = 2) loop over both spin channels and append _0 / _1 suffixes to each output file.

Parameters:
  • data_controller (DataController) – Provides d_tensor, nspin, smearing, degauss, opath.

  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV. Must not start exactly at zero (shifted internally to 1e-5 eV by do_epsilon()).

  • opath) (Output files (written to)

  • ------------------------------------

  • epsi_XY.dat – Two-column (energy, value) files for each tensor component XY; spin-polarised runs also produce _0 and _1 variants. sigmar/sigmai are the real (absorptive) and imaginary (dispersive) parts of the optical conductivity in SI units (S/m).

  • epsr_XY.dat – Two-column (energy, value) files for each tensor component XY; spin-polarised runs also produce _0 and _1 variants. sigmar/sigmai are the real (absorptive) and imaginary (dispersive) parts of the optical conductivity in SI units (S/m).

  • eels_XY.dat – Two-column (energy, value) files for each tensor component XY; spin-polarised runs also produce _0 and _1 variants. sigmar/sigmai are the real (absorptive) and imaginary (dispersive) parts of the optical conductivity in SI units (S/m).

  • ieps_XY.dat – Two-column (energy, value) files for each tensor component XY; spin-polarised runs also produce _0 and _1 variants. sigmar/sigmai are the real (absorptive) and imaginary (dispersive) parts of the optical conductivity in SI units (S/m).

  • sigmar_XY.dat – Two-column (energy, value) files for each tensor component XY; spin-polarised runs also produce _0 and _1 variants. sigmar/sigmai are the real (absorptive) and imaginary (dispersive) parts of the optical conductivity in SI units (S/m).

  • sigmai_XY.dat – Two-column (energy, value) files for each tensor component XY; spin-polarised runs also produce _0 and _1 variants. sigmar/sigmai are the real (absorptive) and imaginary (dispersive) parts of the optical conductivity in SI units (S/m).

PAOFLOW.response.do_epsilon.do_jdos(data_controller, ene, jdos_smeartype)[source]#

Compute and write the joint density of states (JDOS).

The JDOS counts the number of interband transitions at each photon energy

\[\begin{split}J(\\omega) = \\sum_{nm\\mathbf{k}} f_{n\\mathbf{k}} (1 - f_{m\\mathbf{k}}) \\delta(E_{m\\mathbf{k}} - E_{n\\mathbf{k}} - \\omega)\end{split}\]

broadened with either a Gaussian or Lorentzian of width delta. Results from all MPI ranks are summed with MPI.Allreduce and written to jdos.dat (spin-unpolarised) or jdos_0.dat / jdos_1.dat (spin-polarised).

Parameters:
  • data_controller (DataController) – Provides my_eigsmat, kpnts_wght, nbnds, nspin, dftSO, smearing, degauss, delta, insulator, opath.

  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV.

  • jdos_smeartype (str) – Broadening kernel: 'gauss' (Gaussian) or 'lorentz' (Lorentzian).

  • opath) (Output files (written to)

  • ------------------------------------

  • jdos_1.dat (jdos.dat or jdos_0.dat /) – Two-column (energy, JDOS) file(s).

PAOFLOW.response.do_epsilon.do_epsilon(data_controller, ene, ispin, ipol, jpol)[source]#

Compute the dielectric-function components for one spin channel and polarization pair.

Calls eps_loop() to accumulate the imaginary and real parts of the interband dielectric function across all k-points (reducing partial sums via MPI.Allreduce), then applies the physical prefactor and constructs the remaining spectra:

  • epsi u2014 imaginary part \u03b5\u2082(\u03c9) (interband absorption)

  • epsr u2014 real part \u03b5\u2081(\u03c9) (Sellmeier dispersion)

  • eels u2014 electron energy-loss spectrum \u03b5\u2082 / (\u03b5\u2081\u00b2 + \u03b5\u2082\u00b2)

  • ieps u2014 Kramersu2013Kronig real part reconstructed by a discrete numerical integration

The SI prefactor is

\[\begin{split}A = \\frac{2\\,e\\,(10^{10}) a_0^{\\,2}}{\\varepsilon_0\,N_k\,\\Omega}\end{split}\]

with a_0 the Bohr radius, \u03b50 the vacuum permittivity, N_k the number of k-points, and \u03a9 the unit-cell volume in Bohru00b3.

Parameters:
  • data_controller (DataController) – Provides E_k, pksp, nkpnts, omega, bnd, nspin, dftSO, insulator, smearing, degauss, delta, intrasmear.

  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV. A value of exactly zero is shifted to 1e-5 eV to avoid division by zero.

  • ispin (int) – Spin channel index (0 or 1).

  • ipol (int) – Polarization index of the electric field (0u20132 = x, y, z).

  • jpol (int) – Second polarization index (0u20132 = x, y, z).

Returns:

  • epsi (ndarray, shape (ne,)) – Imaginary part of the dielectric function.

  • epsr (ndarray, shape (ne,)) – Real part of the dielectric function.

  • eels (ndarray, shape (ne,)) – Electron energy-loss spectrum.

  • ieps (ndarray, shape (ne,)) – Kramersu2013Kronig-derived real part.

PAOFLOW.response.do_epsilon.optical_conductivity(ene, epsi, epsr, ipol, jpol)[source]#

Optical (AC) conductivity from the complex dielectric function.

The optical conductivity is related to the complex relative permittivity \(\varepsilon(\omega) = \varepsilon_1 + i\varepsilon_2\) by

\[\sigma(\omega) = -i\,\varepsilon_0\,\omega\, \bigl(\varepsilon(\omega) - 1\bigr)\]

so that its real (absorptive) and imaginary (dispersive) parts are

\[\sigma_1(\omega) = \varepsilon_0\,\omega\,\varepsilon_2(\omega), \qquad \sigma_2(\omega) = -\varepsilon_0\,\omega\, \bigl(\varepsilon_1(\omega) - \delta_{ij}\bigr).\]

The -1 (\delta_{ij}) vacuum subtraction is applied only to diagonal tensor components, consistent with the +1 added to epsr in do_epsilon().

Parameters:
  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV. The angular frequency is \(\omega = E / \hbar\) with \hbar in eV s.

  • epsi (ndarray, shape (ne,)) – Imaginary part of the dielectric function \(\varepsilon_2\).

  • epsr (ndarray, shape (ne,)) – Real part of the dielectric function \(\varepsilon_1\) (already including the +1 for diagonal components).

  • ipol (int) – Tensor component indices (0-2 = x, y, z).

  • jpol (int) – Tensor component indices (0-2 = x, y, z).

Returns:

  • sigma_r (ndarray, shape (ne,)) – Real (absorptive) part of the optical conductivity in S/m.

  • sigma_i (ndarray, shape (ne,)) – Imaginary (dispersive) part of the optical conductivity in S/m.

PAOFLOW.response.do_epsilon.refractive_index(ene, epsi, epsr)[source]#

Complex refractive index and derived spectra from $varepsilon(omega)$.

For a diagonal component of the complex relative permittivity $varepsilon = varepsilon_1 + ivarepsilon_2$ the complex refractive index $tilde n = n + ikappa$ satisfies $tilde n^2 = varepsilon$, so

\[\begin{split}n &= \sqrt{(|\varepsilon| + \varepsilon_1)/2}, \\ \kappa &= \sqrt{(|\varepsilon| - \varepsilon_1)/2}.\end{split}\]

From these the absorption coefficient and normal-incidence reflectivity follow:

\[\begin{split}\alpha(\omega) &= 2\,\omega\,\kappa(\omega)/c, \\ R(\omega) &= \frac{(n-1)^2 + \kappa^2}{(n+1)^2 + \kappa^2}.\end{split}\]
Parameters:
  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV.

  • epsi (ndarray, shape (ne,)) – Imaginary and real parts of the (diagonal) dielectric function, with the +1 already included in epsr.

  • epsr (ndarray, shape (ne,)) – Imaginary and real parts of the (diagonal) dielectric function, with the +1 already included in epsr.

Returns:

  • n (ndarray, shape (ne,)) – Real part of the refractive index (unitless).

  • kappa (ndarray, shape (ne,)) – Extinction coefficient (unitless).

  • alpha (ndarray, shape (ne,)) – Absorption coefficient in 1/m.

  • refl (ndarray, shape (ne,)) – Normal-incidence reflectivity (unitless, in [0, 1]).

PAOFLOW.response.do_epsilon.directional_reflectivity(epsr, epsi, theta)[source]#

Fresnel directional reflectivity for an opaque (optically thick) medium.

Treats the diagonal complex relative permittivity \(\tilde\varepsilon = \varepsilon_1 + i\varepsilon_2\) as the squared complex refractive index \(\tilde n^2 = \tilde\varepsilon\). For an opaque bulk material light does not transmit, so the spectral directional reflectivity follows from the Fresnel equations. The complex refraction term is

\[q(\theta, \omega) = \sqrt{\tilde n^2 - \sin^2\theta},\]

and the polarization-resolved reflectivities for the transverse-electric (s) and transverse-magnetic (p) components are

\[\begin{split}R_s(\theta, \omega) &= \left\lvert \frac{\cos\theta - q}{\cos\theta + q}\right\rvert^2, \\ R_p(\theta, \omega) &= \left\lvert \frac{\tilde n^2\cos\theta - q}{\tilde n^2\cos\theta + q} \right\rvert^2.\end{split}\]

The unpolarized directional reflectivity is the average

\[R(\theta, \omega) = \tfrac{1}{2}\bigl(R_s + R_p\bigr).\]

At normal incidence (\(\theta = 0\)) this reduces to the standard expression \(R = [(n-1)^2 + \kappa^2]/[(n+1)^2 + \kappa^2]\) returned by refractive_index().

Parameters:
  • epsr (ndarray, shape (ne,)) – Real and imaginary parts of the (diagonal) dielectric function, with the +1 already included in epsr.

  • epsi (ndarray, shape (ne,)) – Real and imaginary parts of the (diagonal) dielectric function, with the +1 already included in epsr.

  • theta (float) – Incidence angle relative to the surface normal, in radians (0 <= theta < pi/2).

Returns:

refl – Unpolarized directional reflectivity (unitless, in [0, 1]).

Return type:

ndarray, shape (ne,)

PAOFLOW.response.do_epsilon.spectral_hemispherical_emissivity(epsr, epsi, ntheta)[source]#

Spectral hemispherical emissivity from the directional reflectivity.

By Kirchhoff’s law the directional spectral emissivity of an opaque material equals its directional spectral absorptivity, \(\varepsilon(\theta, \omega) = 1 - R(\theta, \omega)\). The hemispherical emissivity removes the directional dependence by averaging over all solid angles in the upper hemisphere, weighted by the projected area \(\cos\theta\):

\[\varepsilon(\omega) = 2 \int_0^{\pi/2} \varepsilon(\theta, \omega)\,\cos\theta\,\sin\theta\,d\theta.\]

The polar-angle integral is evaluated numerically on a uniform grid of ntheta points in \([0, \pi/2]\) via the trapezoidal rule, with directional_reflectivity() supplying \(R(\theta, \omega)\) at each angle.

Parameters:
  • epsr (ndarray, shape (ne,)) – Real and imaginary parts of the (diagonal) dielectric function.

  • epsi (ndarray, shape (ne,)) – Real and imaginary parts of the (diagonal) dielectric function.

  • ntheta (int) – Number of polar-angle samples in [0, pi/2].

Returns:

emis – Spectral hemispherical emissivity (unitless, in [0, 1]).

Return type:

ndarray, shape (ne,)

PAOFLOW.response.do_epsilon.total_hemispherical_emissivity(ene, emis_w, temperature)[source]#

Total (Planck-weighted) hemispherical emissivity at a temperature.

The total hemispherical emissivity weights the spectral hemispherical emissivity \(\varepsilon(\omega)\) against the Planck blackbody spectral intensity and integrates over frequency:

\[\varepsilon(T) = \frac{\int_0^\infty \varepsilon(\omega)\, I_{bb}(\omega, T)\,d\omega} {\int_0^\infty I_{bb}(\omega, T)\,d\omega}, \qquad I_{bb}(\omega, T) = \frac{\hbar\omega^3}{4\pi^3 c^2} \frac{1}{\exp(\hbar\omega / k_B T) - 1}.\]

Because the result is a ratio, the constant prefactor \(\hbar/(4\pi^3 c^2)\) cancels and the angular frequency may be replaced by the photon energy \(E = \hbar\omega\) (in eV), so the weight reduces to \(w(E) = E^3 / [\exp(E / k_B T) - 1]\) with \(k_B T\) expressed in eV.

Note

The integral is evaluated over the supplied energy grid ene only. At moderate temperatures the Planck weight peaks at low photon energy (\(\sim k_B T\) to \(\sim 10\,k_B T\)), so for a meaningful \(\varepsilon(T)\) the grid should start near zero and resolve the thermally relevant range; otherwise the truncated integral underestimates the contribution from unsampled frequencies.

Parameters:
  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV (assumed strictly positive).

  • emis_w (ndarray, shape (ne,)) – Spectral hemispherical emissivity \(\varepsilon(\omega)\).

  • temperature (float) – Absolute temperature in kelvin.

Returns:

emis_total – Total hemispherical emissivity (unitless, in [0, 1]).

Return type:

float

PAOFLOW.response.do_epsilon.write_emissivity(data_controller, ene, epsr, epsi, comp, spin_tag)[source]#

Compute and write all emissivity spectra for one diagonal component.

Driven by the configuration stored on data_controller by PAOFLOW.dielectric_tensor() when emissivity=True:

  • emis_angles u2014 incidence angles (degrees) at which the Fresnel directional reflectivity \(R(\theta, \omega)\) and emissivity \(\varepsilon(\theta, \omega) = 1 - R\) are tabulated.

  • emis_ntheta u2014 number of polar-angle samples used for the hemispherical integral.

  • emis_temperature u2014 temperature(s) (K) at which the Planck-weighted total hemispherical emissivity is evaluated.

Parameters:
  • data_controller (DataController) – Provides emis_angles, emis_ntheta, emis_temperature and the write_file_row_col output method.

  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV.

  • epsr (ndarray, shape (ne,)) – Real and imaginary parts of the diagonal dielectric function.

  • epsi (ndarray, shape (ne,)) – Real and imaginary parts of the diagonal dielectric function.

  • comp (str) – Two-letter tensor-component tag (e.g. 'xx') for output filenames.

  • spin_tag (str) – Spin suffix appended to filenames ('', '_0' or '_1').

  • opath) (Output files (written to)

  • ------------------------------------

  • refl_th{deg}_{comp}{spin}.dat – Directional reflectivity and emissivity at each selected angle.

  • emis_th{deg}_{comp}{spin}.dat – Directional reflectivity and emissivity at each selected angle.

  • emish_{comp}{spin}.dat – Spectral hemispherical emissivity \(\varepsilon(\omega)\).

  • emist_{comp}{spin}.dat – Two-column (temperature, total hemispherical emissivity) file.

PAOFLOW.response.do_epsilon.eps_loop(data_controller, ene, ispin, ipol, jpol)[source]#

Inner BZ loop: accumulate the interband dielectric-function integrands.

Evaluates the Kubou2013Greenwood sum

\[\begin{split}\\varepsilon_2(\\omega) \\propto \\sum_{nm\\mathbf{k}} \\frac{f_n - f_m}{E_{mn}} |\\langle m | p_i | n \\rangle|^2 \\frac{\\eta\\omega} {(E_{mn}^2 - \\omega^2)^2 + \\eta^2\\omega^2}\end{split}\]

and its real-part companion simultaneously, using the PAO momentum matrix pksp. A separate Drude-like intraband term is added for metals when attributes['insulator'] is False.

Occupations are computed from the integrated Fermi function (step, Gaussian, or Methfesselu2013Paxton) according to attributes['smearing']. Overflow errors from large exponentials in the Fermi function are silenced locally and restored on return.

This function operates on the local k-point slice held by the calling MPI rank; the caller is responsible for reducing partial sums across ranks.

Parameters:
  • data_controller (DataController) – Provides E_k, pksp, bnd, nspin, dftSO, insulator, smearing, degauss, delta, intrasmear.

  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV.

  • ispin (int) – Spin channel index.

  • ipol (int) – First polarization index (row of momentum matrix).

  • jpol (int) – Second polarization index (column of momentum matrix).

Returns:

  • epsi (ndarray, shape (ne,)) – Local partial sum for the imaginary part (unscaled).

  • epsr (ndarray, shape (ne,)) – Local partial sum for the real part (unscaled).

PAOFLOW.response.do_epsilon.jdos_loop(data_controller, ene, ispin, jdos_smeartype)[source]#

Inner BZ loop: accumulate the joint-density-of-states integrand.

Iterates over all k-points and interband pairs (n, m) with E_{mn} > 0 and computes

\[\begin{split}J(\\omega) = \\sum_{nm\\mathbf{k}} w_k\,f_{n\\mathbf{k}} (1 - f_{m\\mathbf{k}}) g(E_{mn}, \\omega, \\eta)\end{split}\]

where g is either a Gaussian ('gauss') or Lorentzian ('lorentz') of width delta, and w_k are the k-point weights. The result is normalized by the total oscillator-strength sum and the spin degeneracy factor.

Occupations are computed from the integrated Fermi function (step, Gaussian, or Methfesselu2013Paxton) selected by attributes['smearing'].

This function operates on the local k-point slice; the caller reduces partial sums with MPI.Allreduce.

Parameters:
  • data_controller (DataController) – Provides my_eigsmat, kpnts_wght, nbnds, nspin, dftSO, smearing, degauss, delta, insulator.

  • ene (ndarray, shape (ne,)) – Photon-energy grid in eV.

  • ispin (int) – Spin channel index.

  • jdos_smeartype (str) – Broadening kernel: 'gauss' or 'lorentz'.

Returns:

jdos – Local partial JDOS contribution from this MPI rank’s k-points (normalized but not yet globally reduced).

Return type:

ndarray, shape (ne,)

Raises:

ValueError – If jdos_smeartype is not 'gauss' or 'lorentz'.