These classes in the library O2scl_part calculate the thermodynamic properties of interacting and non-interacting quantum and classical particles.

Particle data classes

The class o2scl::part is the basic structure for a particle:

The data members o2scl::part::ms and o2scl::part::nu allow one to specify modifications to the mass and the chemical potential due to interactions. This allows one to calculate the properties of particle due to interactions so long as the basic form of the free-particle dispersion relation is unchanged, i.e.

\[ \sqrt{k^2+m^2} - \mu \rightarrow \sqrt{k^2+m^{* 2}} - \nu \]

If the particle is non-interacting, then o2scl::part::nu and o2scl::part::ms are sometimes used by O2scl_part functions for temporary storage.

If o2scl::part::inc_rest_mass is true (as is the default in all of the classes except o2scl::nucleus), then all functions include the rest mass (stored in o2scl::part::m) energy density in the energy density, the "mu" functions expect that the rest mass is included in o2scl::part::mu or o2scl::part::nu as input and the "density" functions output o2scl::part::mu or o2scl::part::nu including the rest mass. Note that it is assumed that o2scl::part::m contains the rest mass even if the particle is interacting and an effective mass is stored in o2scl::part::ms .

When o2scl::part::inc_rest_mass is true, antiparticles are implemented by choosing the antiparticle chemical potential to be $ - \mu $, and when inc_rest_mass is false, antiparticles are implemented by choosing the chemical potential of the antiparticles to be $ - \mu - 2 m $.

The thermodynamic identity used to compute the pressure for interacting particles is

\[ P = -\varepsilon + s T + \nu n \]

where o2scl::part::nu is used. This way, the particle class doesn't need to know about the structure of the interactions to ensure that the thermodynamic identity is satisfied. Note that in the O2scl_eos library, where in the equations of state the normal thermodynamic identity is used

\[ P = -\varepsilon + s T + \mu n \]

Frequently, the interactions which create an effective chemical potential which is different than o2scl::part::mu thus create extra terms in the pressure and the energy density for the given equation of state.

The o2scl::fermion class is a child of o2scl::part which contains data members for the Fermi momentum and energy gap. The o2scl::boson class contains an extra data member for the condensate. The o2scl::quark class is a descendant of the o2scl::fermion class which contains extra data members for the quark condensate and the contribution to the bag constant. Nuclei are represented by the o2scl::nucleus class and documented in Nuclei and nuclear masses.


Factors of $ \hbar, c $ and $ k_B $ have been removed everywhere, so that mass, energy, and temperature all have the same units. Number and entropy densities have units of mass cubed (or energy cubed). The particle classes can be used with any system of units which is based on powers of one unit, i.e. $ [n] = [T]^3 = [m]^3 = [P]^{3/4} = [\varepsilon]^{3/4}$, etc.

Classes for particle thermodynamics

At zero temperature, the thermodynamic properties of fermions can be computed using o2scl::fermion_zerot. The class o2scl::classical computes the properties of particles in the classical limit.

At finite temperature, there are different classes corresponding to different approaches to computing the integrals over the distribution functions. The approximation scheme from Johns96 is used in o2scl::boson_eff and o2scl::fermion_eff. An exact method employing direct integration of the distribution functions is used in o2scl::boson_rel and o2scl::fermion_rel, but these are necessarily quite a bit slower. All of these classes use expansions to give ensure comparably accurate results in the degenerate and non-degenerate limits.

The class o2scl::fermion_eff usually works to within about 1 part in $ 10^4 $, but can be as bad as 1 part in $ 10^2 $ in some more extreme cases. The default settings for o2scl::fermion_rel give an accuracy of at least 1 part in $ 10^6 $ (and frequently better than this). For o2scl::fermion_rel, the accuracy can be improved to 1 part in $ 10^{10} $ by decreasing the integration tolerances.

The class o2scl::fermion_nonrel assumes a non-relativistic dispersion relation for fermions. It uses an exact method for both zero and finite temperatures. The non-relativistic integrands are much simpler and o2scl::fermion_nonrel uses the appropriate GSL functions (which are nearly exact) to compute them.

Thermodynamics with derivatives

Sometimes it is useful to know derivatives like $ ds/dT $ in addition to the energy and pressure. The new data classes are children of o2scl::part_deriv . The three classes which compute these derivatives for fermions and classical particles. The class o2scl::classical_deriv handles the nondegenerate limit, o2scl::fermion_deriv_rel handles fermions and o2scl::fermion_deriv_nr handles nonrelativistic fermions. These classes compute the derivatives

\[ \left(\frac{d n}{d \mu}\right)_{T}, \quad \left(\frac{d n}{d T}\right)_{\mu}, \quad \mathrm{and} \quad \left(\frac{d s}{d T}\right)_{\mu} \quad . \]

All other first derivatives of the thermodynamic functions can be written in terms of these three. To see how to compute the specific heat, for example, see the discussion in the documentation of o2scl::part_deriv.

Particle example

/* Example: ex_part.cpp
#include <cmath>
#include <o2scl/test_mgr.h>
#include <o2scl/constants.h>
#include <o2scl/fermion_eff.h>
#include <o2scl/fermion_rel.h>
#include <o2scl/classical.h>
#include <o2scl/lib_settings.h>
using namespace std;
using namespace o2scl;
using namespace o2scl_const;
int main(void) {
// Compare the method from fermion_rel to the more approximate
// scheme used in fermion_eff. We work in units of inverse Fermis,
// so that energy density is fm^{-4}. We also use a classical
// particle, to compare to the nondegenerate approximation.
classical cla;
// Ensure that this example works without GNU units in case O2scl
// was installed on a system where GNU units is not installed.
fermion e2(e.m,2.0);
fermion e3(e.m,2.0);
// We provide an initial guess to the chemical potential;;;
// Compute the pressure at a density of 0.0001 fm^{-3} and a
// temperature of 10 MeV. At these temperatures, the electrons are
// non-degenerate, and Boltzmann statistics nearly applies.
cout << << " " << << " " << << " "
<< e.n*10.0/hc_mev_fm << endl;
// Test
t.test_rel(,,1.0e-2,"EFF vs. exact");
t.test_rel(,,4.0e-1,"classical vs. exact");
t.test_rel(e.n*10.0/hc_mev_fm,,1.0e-1,"classical vs. ideal gas law");
// Compute the pressure at a density of 0.1 fm^{-3} and a
// temperature of 1 MeV. At these temperatures, the electrons are
// strongly degenerate
cout << << " " << << endl;
// Test
t.test_rel(,,1.0e-2,"EFF vs. exact");
// Now add the contribution to the pressure from positrons using the
// implmentation of part::pair_density()
cout << << " " << << endl;
// Test
t.test_rel(,,1.0e-2,"EFF vs. exact");;
return 0;
// End of example

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