Particles

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 $. When o2scl::part::inc_rest_mass is false, there is an ambiguity in the relative definitions of the rest mass contribution for the antiparticles and the combination of both particles and antiparticles. Define energy density for particles including the rest mass contribution as $ \varepsilon_+ $, and the energy density without the rest mass contribution as $ \tilde{\varepsilon}_{+} = \varepsilon_{+} - n_{+} m $ . Similarly, for antiparticles, we have $ \tilde{\varepsilon}_- = \varepsilon_- - n_- m $. The total energy density including the rest mass contribution is then $ \varepsilon = \varepsilon_{+} + \varepsilon_- $ and without the rest mass contribution $ \tilde{\varepsilon} \equiv \varepsilon - (n_{+}-n_-) m $. Then,

\begin{eqnarray} \tilde{\varepsilon} & = & \varepsilon_+ - n_{+} m + \varepsilon_- + n_- m \nonumber \\ & = & \varepsilon_+ - n_{+} m + \varepsilon_- - n_- m + 2 n_- m \nonumber \\ & = & \tilde{\varepsilon}_+ + \tilde{\varepsilon}_- + 2 n_- m \nonumber \end{eqnarray}

Similarly, for the chemical potentials, we have

\[ \tilde{\mu}_+ \equiv \frac{\partial \tilde{\varepsilon}_+}{n_+} = \mu_+ - m \quad \mathrm{and} \quad \tilde{\mu}_- \equiv \frac{\partial \tilde{\varepsilon}_-}{n_-} = \mu_- - m \]

thus $ \tilde{\mu}_- = - \tilde{\mu}_+ - 2 m $ . This bookkeeping is handled by o2scl::part::anti(), the o2scl::fermion_eval_thermo::pair_mu(), and the o2scl::fermion_eval_thermo::pair_density(), functions.

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.

Units:

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{\partial n}{\partial \mu}\right)_{T}, \quad \left(\frac{\partial n}{\partial T}\right)_{\mu}, \quad \mathrm{and} \quad \left(\frac{\partial s}{\partial T}\right)_{\mu} \quad . \]

All other first derivatives of the thermodynamic functions can be written in terms of these three.


Other derivatives with respect to chemical potential and temperature:

There is a Maxwell relation

\[ \left(\frac{\partial s}{\partial \mu}\right)_{T,V} = \left(\frac{\partial^2 P}{\partial \mu \partial T}\right)_{V} = \left(\frac{\partial^2 P}{\partial T \partial \mu}\right)_{T,V} = \left(\frac{\partial n}{\partial T}\right)_{\mu,V} \]

The pressure derivatives are trivial

\[ \left(\frac{\partial P}{\partial \mu}\right)_{T,V}=n, \quad \left(\frac{\partial P}{\partial T}\right)_{\mu,V}=s \]

The energy density derivatives are related through the thermodynamic identity:

\[ \left(\frac{\partial \varepsilon}{\partial \mu}\right)_{T,V}= \mu \left(\frac{\partial n}{\partial \mu}\right)_{T,V}+ T \left(\frac{\partial s}{\partial \mu}\right)_{T,V} \]

\[ \left(\frac{\partial \varepsilon}{\partial T}\right)_{\mu,V}= \mu \left(\frac{\partial n}{\partial T}\right)_{\mu,V}+ T \left(\frac{\partial s}{\partial T}\right)_{\mu,V} \]


Other derivatives:

Todo:
These expressions need work.

Most of the other common derivatives which are used are those which can be obtained by second derivatives of the Gibbs free energy, $ G = F + P V $.

\begin{eqnarray} \left(\frac{\partial^2 G}{\partial T^2}\right)_{P,\{N_i\}} &=& -\left( \frac{\partial S}{\partial T} \right)_{P,\{N_i\}} = - \frac{N c_P}{T} \nonumber \\ \left(\frac{\partial^2 G}{\partial T \partial P}\right)_{\{N_i\}} &=& \left( \frac{\partial V}{\partial T} \right)_{P,\{N_i\}} = V \alpha \nonumber \\ \left(\frac{\partial^2 G}{\partial P^2}\right)_{T,\{N_i\}} &=& \left( \frac{\partial V}{\partial P} \right)_{T,\{N_i\}} = - V \kappa_T \nonumber \end{eqnarray}

Other common derivatives are the heat capacity per particle at constant volume, $ c_V $, and the speed of sound, $ ( d P / d \varepsilon)_{\{N_i\},S} $.

It is useful to write these derivatives in terms of the three derivatives determined above. The heat capacity per particle at constant volume is defined by

\[ c_V = \frac{T}{N} \left( \frac{\partial S}{\partial T} \right)_{V,N} = \frac{T}{n} \left( \frac{\partial s}{\partial T} \right)_{V,n} \]

This quantity is sometimes defined as

\[ c_V=\frac{T}{N} \left( \frac{\partial E}{\partial T} \right)_{V,N} \]

but these definitions are identical as can be seen by taking the derivative of $ E = F + T S $ . As noted in Particles in the User's Guide for O2scl_part , we work in units so that $ \hbar = c = k_B = 1 $, so $ c_V $ is unitless. To compute $ c_V $ in terms of the derivatives above, note that the descendants of o2scl::part_deriv provide all of the three thermodynamic derivatives in terms of $ \mu, V $ and $ T $, so we have

\[ s=s(\mu,T,V) \quad \mathrm{and} \quad n=n(\mu,T,V) \, . \]

We can then construct a function

\[ s=s[\mu(n,T,V),T,V] \]

and then write the required derivative directly

\[ \left(\frac{\partial s}{\partial T}\right)_{n,V} = \left(\frac{\partial s}{\partial \mu}\right)_{T,V} \left(\frac{\partial \mu}{\partial T}\right)_{n,V} + \left(\frac{\partial s}{\partial T}\right)_{\mu,V} \, . \]

Now we use the identity

\[ \left(\frac{\partial \mu}{\partial T}\right)_{n,V} = - \left(\frac{\partial n}{\partial T}\right)_{\mu,V} \left(\frac{\partial n}{\partial \mu}\right)_{T,V}^{-1} \, , \]

and the Maxwell relation above to give

\[ c_V = \frac{T}{n} \left[ \left(\frac{\partial s}{\partial T}\right)_{\mu,V} -\left(\frac{\partial n}{\partial T}\right)_{\mu,V}^2 \left(\frac{\partial n}{\partial \mu}\right)_{T,V}^{-1} \right] \]

which expresses the heat capacity in terms of the three derivatives which are given.

The isothermal compressibility is

\[ \kappa_T \equiv -\frac{1}{V} \left( \frac{\partial V}{\partial P}\right)_{T,\{N_i\}} \]

In a single-component system, this can also be written as

\[ \kappa_T = -\frac{1}{V} \left( \frac{\partial V}{\partial P}\right)_{T,N} = -n \left[ \frac{\partial (1/n)}{\partial P}\right]_{T,N} = \frac{1}{n} \left( \frac{\partial n}{\partial P}\right)_{T,N} \]

This quantity can be computed from $ F = - P V + \sum_i \mu_i N_i $ :

\[ \left( \frac{\partial F}{\partial V}\right)_{T,\{N_i\}} = - P + V \left( \frac{\partial P}{\partial V}\right)_{T,\{N_i\}} = \sum_j N_j \left( \frac{\partial \mu_j}{\partial V}\right)_{T,\{N_i\}} \]

The chemical potential derivative can be computed from a Maxwell relation

\[ \left( \frac{\partial \mu_j}{\partial V} \right)_{T,\{N_i\}} = \left(\frac{d^2 F}{\partial V \partial N_j}\right)_{T,\{N_{i\neq j}\}} = \left(\frac{d^2 F}{\partial N_j \partial V}\right)_{T,\{N_{i\neq j}\}} = -\left( \frac{\partial P}{\partial N_j} \right)_{T,\{N_{i\neq j}\},V} \, . \]

Using

\[ \left( \frac{\partial P}{\partial N_j} \right)_{T,\{N_{i\neq j}\},V} = n_j \left( \frac{\partial N} {\partial \mu_j} \right)_{T,\{N_{i\neq j}\},V}^{-1} \, . \]

we obtain the result

\[ \kappa_T = \sum_j n_j^2 \left( \frac{\partial n_j} {\partial \mu_j} \right)_{T,\{N_{i\neq j}\},V}^{-1} \]

The coefficient of thermal expansion is

\[ \alpha \equiv \frac{1}{V} \left( \frac{\partial V}{\partial T} \right)_{N,P} \, . \]

We can rewrite the derivative

\[ \left( \frac{\partial V}{\partial T} \right)_{N,P} = -\left( \frac{\partial P}{\partial T} \right)_{N,V} \left( \frac{\partial P}{\partial V} \right)_{N,T}^{-1} \, . \]

The second derivative was already computed above, and the first derivative can be computed from the Maxwell relation

\[ \left( \frac{\partial P}{\partial T} \right)_{N,V} = \left( \frac{\partial S}{\partial V} \right)_{N,T} \, , \]

In turn, the entropy derivative can be computed using

\[ S=S[\mu(N,T,V),T,V] \]

to get

\[ \left( \frac{\partial S}{\partial T} \right)_{N,V} = \left( \frac{\partial S}{\partial \mu} \right)_{T,V} \left( \frac{\partial \mu}{\partial T} \right)_{N,V} + \left( \frac{\partial S}{\partial T} \right)_{\mu,V} \, , \]

and

\[ \left( \frac{\partial S}{\partial V} \right)_{N,T} = \left( \frac{\partial S}{\partial \mu} \right)_{T,V} \left( \frac{\partial \mu}{\partial V} \right)_{N,T} + \left( \frac{\partial S}{\partial V} \right)_{\mu,T} \, . \]

The result is

\[ \alpha = -\frac{1}{V}\left[n \left( \frac{\partial n} {\partial T} \right)_{\mu,V} \left( \frac{\partial n} {\partial \mu} \right)_{T,V}^{-1} + s \right] \left[n ^2 \left( \frac{\partial n} {\partial \mu} \right)_{T,V}^{-1}\right] \]

The heat capacity per particle at constant pressure, $ c_P $, is defined as

\[ c_P \equiv \frac{T}{N} \left( \frac{\partial S}{\partial T} \right)_{N,P} = \frac{T}{N} \left( \frac{\partial H}{\partial T} \right)_{N,P} \]

The equivalence of these two derivatives can be obtained either from $ dH = V dP + T dS + \mu d N $ or by taking the derivative of the function $ H = H[ N,P,S(N,P,T) ] $. In O2scl , the quantity $ c_P $ is unitless. (which is also unitless) we can write functions

\[ S=S(N,T,V) \qquad \mathrm{and} \qquad V=V(N,P,T) \]

which imply

\[ \left( \frac{\partial S}{\partial T} \right)_{N,P} = \left( \frac{\partial S}{\partial T} \right)_{N,V} + \left( \frac{\partial S}{\partial V} \right)_{N,T} \left( \frac{\partial V}{\partial T} \right)_{N,P} \, . \]

Thus we require the derivatives

\[ \left( \frac{\partial S}{\partial T} \right)_{N,V} , \left( \frac{\partial S}{\partial V} \right)_{N,T} , \qquad\mathrm{and}\qquad \left( \frac{\partial V}{\partial T} \right)_{N,P} \, . \]

To compute the new entropy derivatives, we can write

\[ S=S[\mu(N,T,V),T,V] \]

to get

\[ \left( \frac{\partial S}{\partial T} \right)_{N,V} = \left( \frac{\partial S}{\partial \mu} \right)_{T,V} \left( \frac{\partial \mu}{\partial T} \right)_{N,V} + \left( \frac{\partial S}{\partial T} \right)_{\mu,V} \, , \]

and

\[ \left( \frac{\partial S}{\partial V} \right)_{N,T} = \left( \frac{\partial S}{\partial \mu} \right)_{T,V} \left( \frac{\partial \mu}{\partial V} \right)_{N,T} + \left( \frac{\partial S}{\partial V} \right)_{\mu,T} \, . \]

These require the chemical potential derivatives which have associated Maxwell relations

\[ \left( \frac{\partial \mu}{\partial T} \right)_{N,V} = -\left( \frac{\partial S}{\partial N} \right)_{T,V} \qquad\mathrm{and}\qquad \left( \frac{\partial \mu}{\partial V} \right)_{N,T} = -\left( \frac{\partial P}{\partial N} \right)_{T,V} \, . \]

Finally, we can rewrite the derivatives on the right hand sides in terms of derivatives of functions of $ \mu, V $ and $ T $,

\[ \left( \frac{\partial S}{\partial N} \right)_{T,V} = \left( \frac{\partial S}{\partial \mu} \right)_{T,V} \left( \frac{\partial N}{\partial \mu} \right)_{T,V}^{-1} \, , \]

and

\[ \left( \frac{\partial P}{\partial N} \right)_{T,V} = \left( \frac{\partial P}{\partial \mu} \right)_{T,V} \left( \frac{\partial N}{\partial \mu} \right)_{T,V}^{-1} \, . \]

The volume derivative,

\[ \left( \frac{\partial V}{\partial T} \right)_{N,P} \, , \]

is related to the coefficient of thermal expansion, sometimes called $ \alpha $,

\[ \alpha \equiv \frac{1}{V} \left( \frac{\partial V}{\partial T} \right)_{N,P} \, . \]

We can rewrite the derivative

\[ \left( \frac{\partial V}{\partial T} \right)_{N,P} = -\left( \frac{\partial P}{\partial T} \right)_{N,V} \left( \frac{\partial P}{\partial V} \right)_{N,T}^{-1} \, . \]

The first term can be computed from the Maxwell relation

\[ \left( \frac{\partial P}{\partial T} \right)_{N,V} = \left( \frac{\partial S}{\partial V} \right)_{N,T} \, , \]

where the entropy derivative was computed above. The second term (related to the inverse of the isothermal compressibility, $ \kappa_T \equiv (-1/V) (\partial V/\partial P)_{T,N} $ can be computed from the function $ P = P[\mu(N,V,T),V,T] $

\[ \left( \frac{\partial P}{\partial V} \right)_{N,T} = \left( \frac{\partial P}{\partial \mu} \right)_{T,V} \left( \frac{\partial \mu}{\partial V} \right)_{N,T} + \left( \frac{\partial P}{\partial V} \right)_{\mu,T} \]

where the chemical potential derivative was computed above.

The results above can be collected to give

\[ \left( \frac{\partial S}{\partial T} \right)_{N,P} = \left( \frac{\partial S}{\partial T} \right)_{\mu,V} + \frac{S^2}{N^2} \left( \frac{\partial N}{\partial \mu} \right)_{T,V} - \frac{2 S}{N} \left( \frac{\partial N}{\partial T} \right)_{\mu,V} \, , \]

which implies

\[ c_P = \frac{T}{n} \left( \frac{\partial s}{\partial T} \right)_{\mu,V} + \frac{s^2 T}{n^3} \left( \frac{\partial n}{\partial \mu} \right)_{T,V} - \frac{2 s T}{n^2} \left( \frac{\partial n}{\partial T} \right)_{\mu,V} \, , \]

This derivation also gives the well-known relationship between the heat capacities at constant volume and constant pressure,

\[ c_P = c_V + \frac{T \alpha^2}{n \kappa_T} \, . \]

Todo:
I think the expression below only works for fermions

In the case where the particle is interacting, the derivative of the density with respect to the effective mass is

\[ \left(\frac{dn}{dm^{*}}\right)_{\mu,T} = \left(\frac{3 n}{m^{*}}\right) - \frac{T}{m^{*}} \left(\frac{dn}{dT}\right)_{m^{*},\mu} - \frac{\nu}{m^{*}} \left(\frac{dn}{d\mu}\right)_{m^{*},T} \]

This relation holds whether or not the mass is included in the chemical potential $ \nu $, as the rest mass is held constant even though the effective mass is varying. This relation also holds in the case where the particle is non-interacting, so long as one does not allow the rest mass in the chemical potential to vary. This derivative is useful, for example, in models of quark matter where the quark mass is dynamically generated.


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.
("kg","1/fm",o2scl_mks::mass_electron),2.0);
fermion e2(e.m,2.0);
fermion e3(e.m,2.0);
// We provide an initial guess to the chemical potential
e.mu=e.m;
e2.mu=e2.m;
e3.mu=e3.m;
// 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.
e.n=0.0001;
eff.calc_density(e,10.0/hc_mev_fm);
e2.n=0.0001;
relf.calc_density(e2,10.0/hc_mev_fm);
e3.n=0.0001;
cla.calc_density(e3,10.0/hc_mev_fm);
cout << e.pr << " " << e2.pr << " " << e3.pr << " "
<< e.n*10.0/hc_mev_fm << endl;
// Test
t.test_rel(e.pr,e2.pr,1.0e-2,"EFF vs. exact");
t.test_rel(e2.pr,e3.pr,4.0e-1,"classical vs. exact");
t.test_rel(e.n*10.0/hc_mev_fm,e3.pr,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
e.n=0.0001;
eff.calc_density(e,10.0/hc_mev_fm);
e2.n=0.0001;
relf.calc_density(e2,10.0/hc_mev_fm);
cout << e.pr << " " << e2.pr << endl;
// Test
t.test_rel(e.pr,e2.pr,1.0e-2,"EFF vs. exact");
// Now add the contribution to the pressure from positrons using the
// implmentation of part::pair_density()
e.n=0.0001;
eff.pair_density(e,10.0/hc_mev_fm);
e2.n=0.0001;
relf.pair_density(e2,10.0/hc_mev_fm);
cout << e.pr << " " << e2.pr << endl;
// Test
t.test_rel(e.pr,e2.pr,1.0e-2,"EFF vs. exact");
t.report();
return 0;
}
// End of example

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