Occupations

Step and delta smearing functions.

elphmod.occupations.bose_einstein(x)[source]

Calculate Bose-Einstein function.

elphmod.occupations.double_fermi_dirac(x, d)[source]

Calculate double Fermi function.

elphmod.occupations.double_fermi_dirac_delta(x, d)[source]

Calculate negative derivative of double Fermi function.

elphmod.occupations.double_fermi_dirac_delta_prime(x, d)[source]

Calculate negative 2nd derivative of double Fermi function.

elphmod.occupations.double_fermi_dirac_entropy(x, d)[source]

Calculate double-Fermi-Dirac generalized electronic entropy.

elphmod.occupations.fermi_dirac(x)[source]

Calculate Fermi function.

elphmod.occupations.fermi_dirac_delta(x)[source]

Calculate negative derivative of Fermi function.

elphmod.occupations.fermi_dirac_delta_prime(x)[source]

Calculate negative 2nd derivative of Fermi function.

elphmod.occupations.fermi_dirac_entropy(x)[source]

Calculate electronic entropy.

elphmod.occupations.fermi_dirac_matsubara(x, nmats=1000)[source]

Calculate Fermi function as Matsubara sum.

elphmod.occupations.fermi_dirac_matsubara_delta(x, nmats=1000)[source]

Calculate negative derivative of Fermi function as Matsubara sum.

elphmod.occupations.fermi_dirac_matsubara_delta_prime(x, nmats=1000)[source]

Calculate negative 2nd derivative of Fermi function as Matsubara sum.

elphmod.occupations.find_Fermi_level(n, e, kT=0.025, f='fd', mu=None, tol=1e-05, eps=1e-10)[source]

Determine chemical potential via fixed-point iteration.

See Eqs. 4.21 and 4.22 of https://janberges.de/theses/Master_Jan_Berges.pdf.

Parameters:
nfloat

Number of electrons (with spin) per unit cell.

endarray

Electronic energies for representative k points.

kTfloat

Smearing temperature.

ffunction

Electron distribution as a function of energy divided by kT.

mufloat

Initial guess for chemical potential. By default, an estimate based on the assumption of a constant density of states is used.

tolfloat

Tolerance for the number of electrons.

epsfloat

Smallest allowed absolute value of divisor.

Returns:
float

Chemical potential.

elphmod.occupations.find_Fermi_level_simple(n, e, kT=0.025, f='fd', mu=None, tol=1e-05, damp=0.01)[source]

Determine chemical potential via simple fixed-point iteration.

Parameters:
nfloat

Number of electrons (with spin) per unit cell.

endarray

Electronic energies for representative k points.

kTfloat

Smearing temperature.

ffunction

Electron distribution as a function of energy divided by kT.

mufloat

Initial guess for chemical potential. By default, an estimate based on the assumption of a constant density of states is used.

tolfloat

Tolerance for the number of electrons.

dampfloat

Damping factor in the fixed-point equation. Large values may prevent convergence; small values will slow down convergence.

Returns:
float

Chemical potential.

elphmod.occupations.gauss(x)[source]

Calculate Gaussian step function.

elphmod.occupations.gauss_delta(x)[source]

Calculate negative derivative of Gaussian step function.

elphmod.occupations.gauss_delta_prime(x)[source]

Calculate negative 2nd derivative of Gaussian step function.

elphmod.occupations.gauss_entropy(x)[source]

Calculate Gaussian generalized electronic entropy.

elphmod.occupations.heaviside(x)[source]

Calculate (reflected) Heaviside function.

elphmod.occupations.heaviside_delta(x)[source]

Calculate negative derivative of (reflected) Heaviside function.

elphmod.occupations.heaviside_delta_prime(x)[source]

Calculate negative 2nd derivative of (reflected) Heaviside function.

elphmod.occupations.heaviside_entropy(x)[source]

Calculate negative Heaviside generalized electronic entropy.

elphmod.occupations.hermite_polynomials(x, N=100)[source]

Generate Hermite polynomials.

\[\begin{split}H_0(x) &= 1 \\ H_1(x) &= 2 x \\ H_{n + 1}(x) &= 2 x H_n(x) - 2 n H_{n - 1}(x)\end{split}\]
elphmod.occupations.lorentz(x)[source]

Calculate Lorentz step function.

Used to simulate the influence of a wide box-shaped hybridization function at low temperatures. Formula derived by Tim O. Wehling and Erik G.C.P. van Loon. Here, we have \(x = \epsilon / h\) with the height \(h\) of the hybridization, instead of \(x = \epsilon / k T\) with the temperature \(T\).

elphmod.occupations.lorentz_delta(x)[source]

Calculate negative derivative of Lorentz step function.

elphmod.occupations.lorentz_delta_prime(x)[source]

Calculate negative 2nd derivative of Lorentz step function.

elphmod.occupations.marzari_vanderbilt(x)[source]

Calculate Marzari-Vanderbilt (cold smearing) step function.

elphmod.occupations.marzari_vanderbilt_delta(x)[source]

Calculate negative derivative of Marzari-Vanderbilt step function.

elphmod.occupations.marzari_vanderbilt_delta_prime(x)[source]

Calculate negative 2nd derivative of Marzari-Vanderbilt step function.

elphmod.occupations.marzari_vanderbilt_entropy(x)[source]

Calculate Marzari-Vanderbilt generalized electronic entropy.

elphmod.occupations.methfessel_paxton(x, N=1)[source]

Calculate Methfessel-Paxton step function.

elphmod.occupations.methfessel_paxton_delta(x, N=1)[source]

Calculate negative derivative of Methfessel-Paxton step function.

elphmod.occupations.methfessel_paxton_delta_prime(x, N=1)[source]

Calculate negative 2nd derivative of Methfessel-Paxton step function.

elphmod.occupations.methfessel_paxton_entropy(x, N=1)[source]

Calculate Methfessel-Paxton generalized electronic entropy.

elphmod.occupations.methfessel_paxton_term(x, order=1, diff=0)[source]

Calculate Methfessel-Paxton term (without zeroth order).

From Phys. Rev. B 40, 3616 (1989):

\[\begin{split}S_0(x) &= \frac {1 - erf(x)} 2 \\ S_N(x) &= S_0(x) + \sum_{n = 1}^N A_n H_{2 n - 1}(x) \exp(-x^2) \\ D_N(x) &= -S'(N, x) = \sum{n = 0}^N A_n H_{2 n}(x) \exp(-x^2) \\ A_n &= \frac{(-1)^n}{\sqrt \pi n! 4^n}\end{split}\]

This routine has been adapted from Quantum ESPRESSO:

  • Step function: Modules/wgauss.f90

  • Delta function: Modules/w0gauss.f90

elphmod.occupations.smearing(smearing='gaussian', **ignore)[source]

Select smearing function via name used in Quantum ESPRESSO.

Parameters:
smearingstr, default ‘gaussian’

Any available option for PWscf input parameter smearing, as well as lorentzian, lorentz, and heaviside. If no string is passed, it is returned as is.

**ignore

Ignored keyword arguments, e.g., parameters from ‘func’read_pwi.

Returns:
function

Smearing function.