erlab.analysis.fit.functions.general

Some general functions and utilities used in fitting.

Many functions are numba-compiled for speed.

Module Attributes

TINY

From lmfit.lineshapes, equal to numpy.finfo(numpy.float64).resolution

Functions

bcs_gap(x[, a, b, tc])

Interpolation formula for a temperature dependent BCS-like gap.

do_convolve(x, func, resolution[, pad])

Convolves func with gaussian of FWHM resolution in x.

do_convolve_2d(x, y, func, resolution[, pad])

dynes(x[, n0, gamma, delta])

Dynes formula for superconducting density of states.

fermi_dirac(x, center, temp)

Fermi-dirac edge in terms of temperature.

fermi_dirac_linbkg(x, center, temp, back0, ...)

Fermi-dirac edge with linear backgrounds above and below the fermi level.

fermi_dirac_linbkg_broad(x, center, temp, ...)

Resolution-broadened Fermi edge with linear backgrounds above and below EF.

gaussian(x, center, sigma, amplitude)

gaussian_wh(x, center, width, height)

Gaussian parametrized with FWHM and peak height.

lorentzian(x, center, sigma, amplitude)

lorentzian_wh(x, center, width, height)

Lorentzian parametrized with FWHM and peak height.

step_broad(x[, center, sigma, amplitude])

Step function convolved with a Gaussian.

step_linbkg_broad(x, center, sigma, back0, ...)

Resolution broadened step function with linear backgrounds.

erlab.analysis.fit.functions.general.bcs_gap(x, a=1.76, b=1.74, tc=100.0)[source]

Interpolation formula for a temperature dependent BCS-like gap.

\[\Delta(T) \simeq a \cdot k_B T_c \cdot \tanh\left(b \sqrt{\frac{T_c}{T} - 1}\right)\]
Parameters:
  • x (array-like) – The temperature values in kelvins at which to calculate the BCS gap.

  • a (float) – Proportionality constant. Default is 1.76.

  • b (float) – Proportionality constant. Default is 1.74.

  • tc (float) – The critical temperature in Kelvins. Default is 100.0.

erlab.analysis.fit.functions.general.do_convolve(x, func, resolution, pad=5, **kwargs)[source]

Convolves func with gaussian of FWHM resolution in x.

Parameters:
  • x (ndarray[Any, dtype[float64]]) – A evenly spaced array specifing where to evaluate the convolution.

  • func (Callable) – Function to convolve.

  • resolution (float) – FWHM of the gaussian kernel.

  • pad (int) – Multiples of the standard deviation \(\sigma\) to pad with.

  • **kwargs – Additional keyword arguments to func.

erlab.analysis.fit.functions.general.do_convolve_2d(x, y, func, resolution, pad=5, **kwargs)[source]
erlab.analysis.fit.functions.general.dynes(x, n0=1.0, gamma=0.003, delta=0.01)[source]

Dynes formula for superconducting density of states.

The formula is given by [4]:

\[f(x) = N_0 \text{Re}\left[\frac{|x| + i \Gamma}{\sqrt{(|x| + i \Gamma)^2 - \Delta^2}}\right]\]

where \(x\) is the binding energy, \(N_0\) is the normal-state density of states at the Fermi level, \(\Gamma\) is the broadening term, and \(\Delta\) is the superconducting energy gap.

Parameters:
  • x (array-like) – The input array of energy in eV.

  • n0\(N_0\), by default 1.0.

  • gamma\(\Gamma\), by default 0.003.

  • delta – The superconducting energy gap \(\Delta\), by default 0.01.

erlab.analysis.fit.functions.general.fermi_dirac(x, center, temp)[source]

Fermi-dirac edge in terms of temperature.

erlab.analysis.fit.functions.general.fermi_dirac_linbkg(x, center, temp, back0, back1, dos0, dos1)[source]

Fermi-dirac edge with linear backgrounds above and below the fermi level.

Note

back0 and back1 corresponds to the linear background above and below EF (due to non-homogeneous detector efficiency or residual intensity on the phosphor screen during sweep mode), while dos0 and dos1 corresponds to the linear density of states below EF including the linear background.

erlab.analysis.fit.functions.general.fermi_dirac_linbkg_broad(x, center, temp, resolution, back0, back1, dos0, dos1)[source]

Resolution-broadened Fermi edge with linear backgrounds above and below EF.

erlab.analysis.fit.functions.general.gaussian(x, center, sigma, amplitude)[source]
erlab.analysis.fit.functions.general.gaussian_wh(x, center, width, height)[source]

Gaussian parametrized with FWHM and peak height.

Note

\(\sigma=\frac{w}{2\sqrt{2\log{2}}}\)

erlab.analysis.fit.functions.general.lorentzian(x, center, sigma, amplitude)[source]
erlab.analysis.fit.functions.general.lorentzian_wh(x, center, width, height)[source]

Lorentzian parametrized with FWHM and peak height.

Note

\(\sigma=w/2\)

erlab.analysis.fit.functions.general.step_broad(x, center=0.0, sigma=1.0, amplitude=1.0)[source]

Step function convolved with a Gaussian.

erlab.analysis.fit.functions.general.step_linbkg_broad(x, center, sigma, back0, back1, dos0, dos1)[source]

Resolution broadened step function with linear backgrounds.

erlab.analysis.fit.functions.general.TINY: float = 1e-15

From lmfit.lineshapes, equal to numpy.finfo(numpy.float64).resolution