Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
o2scl::fermion_eval_thermo Class Referenceabstract

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

#include <fermion.h>

Inheritance diagram for o2scl::fermion_eval_thermo:
o2scl::fermion_zerot o2scl::fermion_eff o2scl::fermion_nonrel o2scl::fermion_rel

Public Member Functions

virtual bool calc_mu_ndeg (fermion &f, double temper, double prec=1.0e-18, bool inc_antip=false)
 Non-degenerate expansion for fermions. More...
 
virtual bool calc_mu_deg (fermion &f, double temper, double prec=1.0e-18)
 Degenerate expansion for fermions. More...
 
virtual void calc_mu (fermion &f, double temper)=0
 Calculate properties as function of chemical potential.
 
virtual int calc_density (fermion &f, double temper)=0
 Calculate properties as function of density. More...
 
virtual void pair_mu (fermion &f, double temper)=0
 Calculate properties with antiparticles as function of chemical potential.
 
virtual int pair_density (fermion &f, double temper)=0
 Calculate properties with antiparticles as function of density. 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_eval_thermo")
 
virtual double calibrate (fermion &f, int verbose=0, std::string fname="")
 Test the thermodynamics of calc_density() and calc_mu() More...
 
Massless fermions
virtual void massless_calc_mu (fermion &f, double temper)
 Finite temperature massless fermions.
 
virtual void massless_calc_density (fermion &f, double temper)
 Finite temperature massless fermions.
 
virtual void massless_pair_mu (fermion &f, double temper)
 Finite temperature massless fermions and antifermions.
 
virtual void massless_pair_density (fermion &f, double temper)
 Finite temperature massless fermions and antifermions. More...
 
- Public Member Functions inherited from o2scl::fermion_zerot
void kf_from_density (fermion &f)
 Calculate the Fermi momentum from the density. More...
 
void energy_density_zerot (fermion &f)
 Energy density at T=0 from fermion::kf and part::ms. More...
 
void pressure_zerot (fermion &f)
 Pressure at T=0 from fermion::kf and part::ms. More...
 
virtual void calc_mu_zerot (fermion &f)
 Zero temperature fermions from part::mu or part::nu and part::ms.
 
virtual void calc_density_zerot (fermion &f)
 Zero temperature fermions from part::n and part::ms.
 

Public Attributes

root_cern def_massless_root
 The default solver for massless_calc_density() More...
 

Protected Member Functions

double massless_solve_fun (double x, fermion &f, double temper)
 Solve for the chemical potential for massless fermions.
 

Protected Attributes

rootmassless_root
 A pointer to the solver for massless fermions.
 

Detailed Description

This is an abstract base for the computation of finite-temperature fermionic statistics. Different children (e.g. fermion_eff and fermion_rel) 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 199 of file fermion.h.

Member Function Documentation

◆ calc_density()

virtual int o2scl::fermion_eval_thermo::calc_density ( fermion f,
double  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, o2scl::fermion_eff, and o2scl::fermion_nonrel.

◆ calc_mu_deg()

virtual bool o2scl::fermion_eval_thermo::calc_mu_deg ( fermion f,
double  temper,
double  prec = 1.0e-18 
)
virtual

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 .

◆ calc_mu_ndeg()

virtual bool o2scl::fermion_eval_thermo::calc_mu_ndeg ( fermion f,
double  temper,
double  prec = 1.0e-18,
bool  inc_antip = false 
)
virtual

Attempts to evaulate 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} $.

◆ calibrate()

virtual double o2scl::fermion_eval_thermo::calibrate ( fermion f,
int  verbose = 0,
std::string  fname = "" 
)
virtual

This compares the approximation to the exact results over a grid with $ T = \left\{10^{-2},1,10^{2}\right\} $, $ \log_{10} (m/T) = \left\{ -3,-2,-1,0,1,2,3\right\} $, and $ \log_{10} \psi = \left\{ -3,-2,-1,0,1\right\} $, where $ \psi \equiv \left(\mu-m\right)/T $ using calc_density() and calc_mu(), with both inc_rest_mass taking both values true and false.

The verbose parameter controls the amount of output, and fname is the filename for the file fermion_cal.o2.

Idea for Future:

Also calibrate massless fermions?

Convert into separate class?

◆ massless_pair_density()

virtual void o2scl::fermion_eval_thermo::massless_pair_density ( fermion f,
double  temper 
)
virtual

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.

◆ pair_density()

virtual int o2scl::fermion_eval_thermo::pair_density ( fermion f,
double  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, o2scl::fermion_eff, and o2scl::fermion_nonrel.

Member Data Documentation

◆ def_massless_root

root_cern o2scl::fermion_eval_thermo::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 398 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).