Previous topic

mmf.math.special

Next topic

mmf.math.special.lerch

This Page

mmf.math.special.fermi

fermi_functions Compute various properties of free fermions.
fermi_integral(mu, m, T[, pmax, singlet, ...]) Return density of a single species of free fermions of mass m

The core of this module is to evaluate the generalized Fermi-Dirac integrals:

\begin{aligned}
  F_{k}(\eta, \theta) &= \int_{0}^{\infty} \d{t}\;
                         \frac{t^{k}\sqrt{1+ \theta t/2}}
                              {1+e^{t-\eta}},\\
  F^{(a)}_{k}(\beta\mu, \beta m) &= 
    F_{k}(\eta, \theta) - F_{k}(\eta - \beta\mu, \theta),\\
  &= \int_{0}^{\infty} \d{t}\;
   \frac{t^{k}\sqrt{1+ \theta t/2}\sinh(\beta\mu)}
        {\cosh(t + \beta m) + \cosh(\beta\mu)}
\end{aligned}

This allows us to compute, for example, the density and energy-density of a relativistic Fermi gas (see [Miralles:1996rt] for some explicit formulae for the thermodynamic quantities).

\begin{aligned}
   x &= \beta(E-m), &
   \eta &= \beta(\mu-m), &
   \theta &= \frac{1}{\beta m},
\end{aligned}

System Message: WARNING/2 (\begin{aligned} n_{\beta}(\mu, m) &= \int \dbar^{3}{k}\; \frac{1}{1+e^{\beta(\sqrt{k^2 + m^2} - \mu)}} = \frac{m^3\theta^{3/2}}{\sqrt{2}\pi^2} \left[F_{\frac{1}{2}}(\eta, \theta) + \theta F_{\frac{3}{2}}(\eta, \theta)\right],\\ n^{(s)}_{\beta}(\mu, m) &= \int \dbar^{3}{k}\; \frac{m}{E}\frac{1}{1+e^{\beta(\sqrt{k^2 + m^2} - \mu)}} = \frac{m^3\theta^{3/2}}{\sqrt{2}\pi^2} F_{\frac{1}{2}}(\eta, \theta) \end{aligned} )

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2011/06/27> Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge rman-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabi c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji, lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nyn orsk, polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbia nc, slovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorb ian, welsh, loaded. (/usr/local/texlive/2011/texmf-dist/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/local/texlive/2011/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2011/texmf-dist/tex/latex/base/inputenc.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/ucs/utf8x.def)) (/usr/local/texlive/2011/texmf-dist/tex/latex/ucs/ucs.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/ucs/data/uni-global.def)) (/usr/local/texlive/2011/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?’ option. (/usr/local/texlive/2011/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2011/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2011/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2011/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/local/texlive/2011/texmf-dist/tex/latex/tools/bm.sty) (/Users/mforbes/Library/texmf/tex/latex/mmf/mmfmath.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/mh/mathtools.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2011/texmf-dist/tex/latex/tools/calc.sty) (/usr/local/texlive/2011/texmf-dist/tex/latex/mh/mhsetup.sty)) (/usr/local/texlive/2011/texmf-dist/tex/latex/base/ifthen.sty) (/usr/local/texlive/2011/texmf-dist/tex/latex/doublestroke/dsfont.sty) (/usr/local/texlive/2011/texmf-dist/tex/generic/mathdots/mathdots.sty)) (/usr/local/texlive/2011/texmf-dist/tex/latex/preview/preview.sty) No file math.aux. (/usr/local/texlive/2011/texmf-dist/tex/latex/ucs/ucsencs.def) (/usr/local/texlive/2011/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2011/texmf-dist/tex/latex/latexconfig/graphics.cfg) (/usr/local/texlive/2011/texmf-dist/tex/latex/graphics/dvips.def))) Preview: Fontsize 12pt (/usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/umsb.fd) ! LaTeX Error: Command \dj unavailable in encoding OT1. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.30 \end{gather} ! LaTeX Error: Command \dj unavailable in encoding OT1. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.30 \end{gather} ! LaTeX Error: Command \dj unavailable in encoding OT1. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.30 \end{gather} ! LaTeX Error: Command \dj unavailable in encoding OT1. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.30 \end{gather} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 1488 bytes). Transcript written on math.log.

Using F^{(a)} includes the anti-particle contributions.

For more details, see the notes in section Fermi-Dirac Integrals.

[Miralles:1996rt]J. A. Miralles and K. A. van Riper, “Accurate Evaluation of Fermi-Dirac Integrals and Their Derivatives for Arbitrary Degeneracy and Relativity”, ApJ Supp. 105, 407-418 (1996) [arXiv:astro-ph/9509124]

Following the suggestion by [Natarajan:1993rz]

class mmf.math.special.fermi.fermi_functions

Bases: object

Compute various properties of free fermions.

Examples

>>> fermi_functions.P(1, 1, 1)               
array(0.23482812162868...)
>>> fermi_functions.N(1, 1, 1)               
array(0.160318814464720...)
>>> fermi_functions.N_s(1, 1, 1)              
array(0.075970412559876...)
>>> fermi_functions.dN_dmu(1, 1, 1)          
array(0.193444769294...)
>>> fermi_functions.dN_dm(1, 1, 1)           
array(-0.0425632327406...)
__init__()

x.__init__(...) initializes x; see help(type(x)) for signature

classmethod N(mu, m, T)

Return the density.

classmethod N_s(mu, m, T)

Return the scalar density.

classmethod P(mu, m, T)

Return the pressure.

classmethod dN_dm(mu, m, T)

Return the derivative of the density wrt. m.

classmethod dN_dmu(mu, m, T)

Return the derivative of the density wrt. mu.

classmethod get_imt()

Return the class IMT instance. This is expensive to compute and so is “memoized”.

mmf.math.special.fermi.fermi_integral(mu, m, T, pmax=None, singlet=False, abs_tol=None, rel_tol=None)

Return density of a single species of free fermions of mass m at temperature T and chemical potential mu in natural units (\hbar = c = 1). Does not include any degeneracy factors:

\int_{0}^{p_{\text{max}}}\d{p}\;
     \frac{p^{2}}{1+e^{(\sqrt{p^2 + m^2} - \mu)/T}}
     -
     \frac{p^{2}}{1+e^{(\sqrt{p^2 + m^2} + \mu)/T}}

Parameters :

mu : float

Chemical potential

m : float

Mass

T : float

Temperature

pmax : float

Upper limit on integration.

singlet : bool

If True, then the singlet density will be computed:

\int_{0}^{p_{\text{max}}}\d{p}\;
     \frac{m}{\sqrt{p^2 + m^2}}
     \left(
       \frac{p^{2}}{1+e^{(\sqrt{p^2 + m^2} - \mu)/T}}
       -
       \frac{p^{2}}{1+e^{(\sqrt{p^2 + m^2} + \mu)/T}}
     \right)

Examples

>>> import math, numpy as np
>>> mu = 3.0
>>> m = 2.0
>>> T = 0.0
>>> pF = math.sqrt(mu*mu-m*m)
>>> N = fermi_integral(mu, m, T)
>>> np.allclose(N, pF**3/6/pi**2)
True
>>> import math, numpy as np
>>> mu = 30.0
>>> m = 22.0
>>> T = 0.00001
>>> pF = math.sqrt(mu*mu-m*m)
>>> N = fermi_integral(mu, m, T)
>>> np.allclose(N, pF**3/6/pi**2)
True