Public Member Functions | List of all members
o2scl::fermion_thermo_tl< fp_t > Class Template Referenceabstract

Fermion with finite-temperature thermodynamics [abstract base]. More...

#include <fermion.h>

Inheritance diagram for o2scl::fermion_thermo_tl< fp_t >:
o2scl::fermion_zerot_tl< double >

Detailed Description

template<class fp_t = double>
class o2scl::fermion_thermo_tl< fp_t >

This is an abstract base for the computation of finite-temperature fermionic statistics. Different children (e.g. fermion_eff and fermion_rel_tl) use different techniques to computing the momentum integrations.

Because massless fermions at finite temperature are much simpler, there are separate member functions included in this class to handle them. The functions massless_calc_density() and massless_calc_mu() compute the thermodynamics of massless fermions at finite temperature given the density or the chemical potentials. The functions massless_pair_density() and massless_pair_mu() perform the same task, but automatically include antiparticles.

The function massless_calc_density() uses a root object to solve for the chemical potential as a function of the density. The default is an object of type root_cern. The function massless_pair_density() does not need to use the root object because of the simplification afforded by the inclusion of antiparticles.

Idea for Future:
Create a Chebyshev approximation for inverting the the Fermi functions for massless_calc_density() functions?

Definition at line 309 of file fermion.h.

Public Member Functions

template<class fermion_t >
bool calc_mu_ndeg_tlate (fermion_t &f, fp_t temper, fp_t prec, bool inc_antip)
 Calculate thermodynamic properties from the chemical potential using a nondegenerate expansion.
 
template<class fermion_t >
bool calc_mu_deg_tlate (fermion_t &f, fp_t temper, fp_t prec)
 Calculate thermodynamic properties from the chemical potential using a degenerate expansion.
 
virtual bool calc_mu_ndeg (fermion &f, fp_t temper, fp_t prec=1.0e-18, bool inc_antip=false)
 Non-degenerate expansion for fermions. More...
 
virtual bool calc_mu_deg (fermion &f, fp_t temper, fp_t prec=1.0e-18)
 Degenerate expansion for fermions. More...
 
virtual void calc_mu (fermion &f, fp_t temper)=0
 Calculate properties as function of chemical potential.
 
virtual int calc_density (fermion &f, fp_t temper)=0
 Calculate properties as function of density. More...
 
virtual void pair_mu (fermion &f, fp_t temper)=0
 Calculate properties with antiparticles as function of chemical potential.
 
virtual int pair_density (fermion &f, fp_t temper)=0
 Calculate properties with antiparticles as function of density. More...
 
- Public Member Functions inherited from o2scl::fermion_zerot_tl< double >
void kf_from_density (fermion_tl< double > &f)
 Calculate the Fermi momentum from the density. More...
 
void energy_density_zerot (fermion_tl< double > &f)
 Energy density at T=0 from o2scl::fermion_tl::kf and o2scl::part_tl::ms. More...
 
void pressure_zerot (fermion_tl< double > &f)
 Pressure at T=0 from o2scl::fermion_tl::kf and o2scl::part_tl::ms. More...
 
virtual void calc_mu_zerot (fermion_tl< double > &f)
 Zero temperature fermions from o2scl::part_tl::mu or o2scl::part_tl::nu and o2scl::part_tl::ms.
 
virtual void calc_density_zerot (fermion_tl< double > &f)
 Zero temperature fermions from o2scl::part_tl::n and o2scl::part_tl::ms. More...
 

Massless fermions

root_cern def_massless_root
 The default solver for massless_calc_density() More...
 
rootmassless_root
 A pointer to the solver for massless fermions.
 
virtual void massless_calc_mu (fermion &f, fp_t temper)
 Finite temperature massless fermions.
 
virtual void massless_calc_density (fermion &f, fp_t temper)
 Finite temperature massless fermions.
 
virtual void massless_pair_mu (fermion &f, fp_t temper)
 Finite temperature massless fermions and antifermions.
 
virtual void massless_pair_density (fermion &f, fp_t temper)
 Finite temperature massless fermions and antifermions. More...
 
void set_massless_root (root<> &rp)
 Set the solver for use in massless_calc_density()
 
virtual const char * type ()
 Return string denoting type ("fermion_thermo")
 
void ndeg_terms (size_t j, fp_t tt, fp_t xx, fp_t m, bool inc_rest_mass, bool inc_antip, fp_t &pterm, fp_t &nterm, fp_t &enterm)
 Compute a term in the nondegenerate expansion.
 
fp_t massless_solve_fun (fp_t x, fermion &f, fp_t temper)
 Solve for the chemical potential for massless fermions.
 

Additional Inherited Members

- Protected Attributes inherited from o2scl::fermion_zerot_tl< double >
double pi
 Desc.
 
double pi2
 Desc.
 

Member Function Documentation

◆ calc_density()

template<class fp_t = double>
virtual int o2scl::fermion_thermo_tl< fp_t >::calc_density ( fermion f,
fp_t  temper 
)
pure virtual
Note
This function returns an integer value, in contrast to calc_mu(), because of the potential for non-convergence.

Implemented in o2scl::fermion_rel_tl< double >, and o2scl::fermion_eff.

◆ calc_mu_deg()

template<class fp_t = double>
virtual bool o2scl::fermion_thermo_tl< fp_t >::calc_mu_deg ( fermion f,
fp_t  temper,
fp_t  prec = 1.0e-18 
)
inlinevirtual

Attempts to evaulate thermodynamics of a degenerate fermion. If the result is accurate to within the requested precision, this function returns true, and otherwise this function returns false and the values in stored in the pr, n, en, and ed field are meaningless.

The pressure, density, and energy density, should be accurate to the requested precision, but the first term in the series expansion for the entropy is zero, so the entropy is one order lower in accuracy.

Idea for Future:
Make a function like this for dndm, dsdT, etc. for fermion_deriv .

Definition at line 621 of file fermion.h.

◆ calc_mu_ndeg()

template<class fp_t = double>
virtual bool o2scl::fermion_thermo_tl< fp_t >::calc_mu_ndeg ( fermion f,
fp_t  temper,
fp_t  prec = 1.0e-18,
bool  inc_antip = false 
)
inlinevirtual

Attempts to evaluate thermodynamics of a non-degenerate fermion. If the result is accurate to within the requested precision, this function returns true, and otherwise this function returns false and the values in stored in the pr, n, en, and ed field are meaningless.

If $ \mu $ is negative and sufficiently far from zero, then the thermodynamic quantities are smaller than the smallest representable double-precision number. In this case, this function will return true and report all quantities as zero.

Defining $ \psi \equiv (\mu-m)/T $, $ t \equiv T/m $, and $ d \equiv g~m^4/(2 \pi^2) $ the pressure in the non-degenerate limit ( $ \psi \rightarrow - \infty $) is (Johns96)

\[ P = d \sum_{n=1}^{\infty} P_n \]

where

\[ P_n \equiv \left(-1\right)^{n+1} \left(\frac{t^2}{n^2}\right) e^{n \left(\psi+1/t\right)} K_2 \left( \frac{n}{t} \right) \]

The density is then

\[ n = d \sum_{n=1}^{\infty} \frac{n P_n}{T} \]

and the entropy density is

\[ s = \frac{d}{m} \sum_{n=1}^{\infty} \left\{ \frac{2 P_n}{t} -\frac{n P_n}{t^2}+ \frac{\left(-1\right)^{n+1}}{2 n} e^{n \left(\psi+1/t\right)} \left[ K_1 \left( \frac{n}{t} \right)+K_3 \left( \frac{n}{t} \right) \right] \right\} \]

This function is accurate over a wide range of conditions when $ \psi < -4 $.

The ratio of the nth term to the first term in the pressure series is

\[ R_n \equiv \frac{P_{n}}{P_{1}} = \frac{(-1)^{n+1} e^{(n-1)(\psi+1/t)} K_2(n/t) }{n^2 K_2(1/t)} \]

This function currently uses 20 terms in the series and immediately returns false if $ |R_{20}| $ is greater than prec

In the nondegenerate and nonrelativistic ( $ t \rightarrow 0 $) limit, the argument to the Bessel functions and the exponential becomes too large. In this case, it's better to use the expansions, e.g. for $ x \equiv n/t \rightarrow \infty $,

\[ \sqrt{\frac{2 x}{\pi}} e^{x} K_2(x) \approx 1 + \frac{3}{8 x} - \frac{15}{128 x^2} + ... \]

The current code currently goes up to $ x^{-12} $ in the expansion, which is enough for the default precision of $ 10^{-18} $ since $ (20/700)^{12} \sim 10^{-19} $.

Definition at line 599 of file fermion.h.

◆ massless_pair_density()

template<class fp_t = double>
virtual void o2scl::fermion_thermo_tl< fp_t >::massless_pair_density ( fermion f,
fp_t  temper 
)
inlinevirtual

In the cases $ n^3 \gg T $ and $ T \gg n^3 $ , expansions are used instead of the exact formulas to avoid loss of precision.

In particular, using the parameter

\[ \alpha = \frac{g^2 \pi^2 T^6}{243 n^2} \]

and defining the expression

\[ \mathrm{cbt} = \alpha^{-1/6} \left( -1 + \sqrt{1+\alpha}\right)^{1/3} \]

we can write the chemical potential as

\[ \mu = \frac{\pi T}{\sqrt{3}} \left(\frac{1}{\mathrm{cbt}} - \mathrm{cbt} \right) \]

These expressions, however, do not work well when $ \alpha $ is very large or very small, so series expansions are used whenever $ \alpha > 10^{4} $ or $ \alpha < 3 \times 10^{-4} $. For small $ \alpha $,

\[ \left(\frac{1}{\mathrm{cbt}} - \mathrm{cbt} \right) \approx \frac{2^{1/3}}{\alpha^{1/6}} - \frac{\alpha^{1/6}}{2^{1/3}} + \frac{\alpha^{5/6}}{6{\cdot}2^{2/3}} + \frac{\alpha^{7/6}}{12{\cdot}2^{1/3}} - \frac{\alpha^{11/6}}{18{\cdot}2^{2/3}} - \frac{5 \alpha^{13/6}}{144{\cdot}2^{1/3}} + \frac{77 \alpha^{17/6}}{2592{\cdot}2^{2/3}} \]

and for large $ \alpha $,

\[ \left(\frac{1}{\mathrm{cbt}} - \mathrm{cbt} \right) \approx \frac{2}{3} \sqrt{\frac{1}{\alpha}} - \frac{8}{81} \left(\frac{1}{\alpha}\right)^{3/2} + \frac{32}{729} \left(\frac{1}{\alpha}\right)^{5/2} \]

This approach works to within about 1 part in $ 10^{12} $, and is tested in fermion_ts.cpp.

Idea for Future:
This could be improved by including more terms in the expansions.

Definition at line 772 of file fermion.h.

◆ pair_density()

template<class fp_t = double>
virtual int o2scl::fermion_thermo_tl< fp_t >::pair_density ( fermion f,
fp_t  temper 
)
pure virtual
Note
This function returns an integer value, in contrast to pair_mu(), because of the potential for non-convergence.

Implemented in o2scl::fermion_rel_tl< double >, and o2scl::fermion_eff.

Member Data Documentation

◆ def_massless_root

template<class fp_t = double>
root_cern o2scl::fermion_thermo_tl< fp_t >::def_massless_root

We default to a solver of type root_cern here since we don't have a bracket or a derivative.

Definition at line 831 of file fermion.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).