thermo

thermo.Hubble(rho_tot)[source]

The Hubble parameter in s^-1.

Parameters:

rho_tot (float or array) – The total energy density in MeV^4.

Return type:

float or array

thermo.N_eff(rho_tot, rho_g)[source]

Neff parameter.

Parameters:
  • rho_tot (float or array) – Total energy density of all fluids.

  • rho_g (float or array) – Energy density of photons.

Return type:

float or array

thermo.T_g(rho_g)[source]

Photon temperature from photon energy density.

Parameters:

rho_g (float or array) – Energy density of photons.

Returns:

Same units as (rho_g)**0.25

Return type:

float or array

thermo.T_nu(rho_nu)[source]

Neutrino temperature given an energy density.

Parameters:

rho_nu (float or array) – Neutrino energy density in MeV^4.

Returns:

Units of MeV.

Return type:

float or array

thermo.collision_terms_std(T_g, T_nue, T_numt, me=0.51099895, mu_nue=0.0, mu_numt=0.0, decoupled=False, use_FD=True, collision_me=True)[source]

Energy and number density transfer rate between EM and neutrino sector relevant for incomplete neutrino decoupling.

Parameters:
  • T_g (array_like) – Photon temperature in MeV.

  • T_nue (array_like) – Electron neutrino temperature in MeV.

  • T_numt (array_like) – Mu, tau neutrino temperature in MeV.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me

  • mu_nue (float, optional) – Chemical potential of electron neutrinos in MeV. Defaults to 0.

  • mu_numt (float, optional) – Chemical potential of mu, tau neutrinos in MeV. Defaults to 0.

  • decoupled (bool, optional) – Neutrinos are assumed to be completely decoupled if True.

  • use_FD (bool, optional) – Fermi-Dirac distribution used for neutrinos if True.

  • collision_me (bool, optional) – Finite electron mass if true.

Returns:

(C_rho_nue, C_rho_numu, C_n_nue, C_n_numu) for the energy density transfer rate (in MeV^4/s) to nu_e and (nu_mu, nu_tau), followed by the number density transfer rate (in MeV^3/s) to nu_e and (nu_mu, nu_tau)

Return type:

tuple

thermo.dn_nue_dT_nue_std(T_nue, mu_nue=0.0)

Gradient of n_nue_std with respect to positional argument(s) 0. Takes the same arguments as n_nue_std but returns the gradient, which has the same shape as the arguments at positions 0.

thermo.dn_nue_dmu_nue_std(T_nue, mu_nue=0.0)

Gradient of n_nue_std with respect to positional argument(s) 1. Takes the same arguments as n_nue_std but returns the gradient, which has the same shape as the arguments at positions 1.

thermo.dn_numt_dT_numt_std(T_numt, mu_numt=0.0)

Gradient of n_numt_std with respect to positional argument(s) 0. Takes the same arguments as n_numt_std but returns the gradient, which has the same shape as the arguments at positions 0.

thermo.dn_numt_dmu_numt_std(T_numt, mu_numt=0.0)

Gradient of n_numt_std with respect to positional argument(s) 1. Takes the same arguments as n_numt_std but returns the gradient, which has the same shape as the arguments at positions 1.

thermo.drho_EM_dT_g_std(T_g, mu=0, me=0.51099895, LO=True, NLO=True)

Gradient of rho_EM_std with respect to positional argument(s) 0. Takes the same arguments as rho_EM_std but returns the gradient, which has the same shape as the arguments at positions 0.

thermo.drho_nue_dT_nue_std(T_nue, mu_nue=0.0)

Gradient of rho_nue_std with respect to positional argument(s) 0. Takes the same arguments as rho_nue_std but returns the gradient, which has the same shape as the arguments at positions 0.

thermo.drho_nue_dmu_nue_std(T_nue, mu_nue=0.0)

Gradient of rho_nue_std with respect to positional argument(s) 1. Takes the same arguments as rho_nue_std but returns the gradient, which has the same shape as the arguments at positions 1.

thermo.drho_numt_dT_numt_std(T_numt, mu_numt=0.0)

Gradient of rho_numt_std with respect to positional argument(s) 0. Takes the same arguments as rho_numt_std but returns the gradient, which has the same shape as the arguments at positions 0.

thermo.drho_numt_dmu_numt_std(T_numt, mu_numt=0.0)

Gradient of rho_numt_std with respect to positional argument(s) 1. Takes the same arguments as rho_numt_std but returns the gradient, which has the same shape as the arguments at positions 1.

thermo.nB(a, eta_fac=1.0)[source]

Number density of baryons in MeV^3.

Parameters:
  • a (float or array) – Scale factor of interest.

  • eta_fac (float, optional) – Factor to rescale the central value of the baryon-to-photon ratio by.

Return type:

float or array

thermo.n_massive_BE(T, mu, m, g)[source]

Series approximation for number density of a massive particle with Bose-Einstein statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species (1 for scalar, 3 for vector, etc.).

Returns:

Units of MeV^3.

Return type:

float

thermo.n_massive_FD(T, mu, m, g)[source]

Series approximation for number density of a massive particle with Fermi-Dirac statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species (2 for Majorana Fermion, 4 for Dirac Fermion, etc.).

Returns:

Units of MeV^3.

Return type:

float

thermo.n_massive_MB(T, mu, m, g)[source]

Series approximation for number density of a massive particle with Maxwell-Boltzmann statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species.

Returns:

Units of MeV^3.

Return type:

float

thermo.n_massless_BE(T, mu, g)[source]

Number density of a massless particle with Bose-Einstein statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species (1 for scalar, 2 for vector, etc.).

Returns:

Units of MeV^3.

Return type:

float

thermo.n_massless_FD(T, mu, g)[source]

Number density of a massless particle with Fermi-Dirac statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species (2 for Weyl fermion).

Returns:

Units of MeV^3.

Return type:

float

thermo.n_massless_MB(T, mu, g)[source]

Number density of a massless particle with Maxwell-Boltzmann statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species.

Returns:

Units of MeV^3.

Return type:

float

thermo.n_nue_std(T_nue, mu_nue=0.0)[source]

Total number density of electron neutrinos.

Parameters:
  • T_nue (float) – Electron neutrino temperature in MeV.

  • mu_nue (float, optional) – Chemical potential of electron neutrinos in MeV. Defaults to 0.

Returns:

Units of MeV^3.

Return type:

float

thermo.n_numt_std(T_numt, mu_numt=0.0)[source]

Total number density of mu, tau neutrinos.

Parameters:
  • T_numt (float) – Mu, tau neutrino temperature in MeV.

  • mu_numt (float, optional) – Chemical potential of mu,tau neutrinos in MeV. Defaults to 0.

Returns:

Units of MeV^3.

Return type:

float

thermo.p_EM_std(T_g, mu=0, me=0.51099895, LO=True, NLO=True)[source]

Total pressure of EM-coupled SM fluids.

Parameters:
  • T_g (float) – Temperature of massive particle species in MeV.

  • mu (float, optional) – Parameter added for syntax consistency–does not impact function behavior. Defaults to 0.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

  • LO (bool) – True includes leading order QED corrections to the pressure. Defaults to ‘True’.

  • NLO (bool) – True includes next-to-leading order QED corrections to the pressure. Defaults to ‘True’.

Returns:

Units of MeV^4.

Return type:

float

thermo.p_EM_std_v(T_g, mu=0, me=0.51099895, LO=True, NLO=True)

Vectorized version of p_EM_std. Takes similar arguments as p_EM_std but with additional array axes over which p_EM_std is mapped.

Original documentation:

Total pressure of EM-coupled SM fluids.

Parameters

T_gfloat

Temperature of massive particle species in MeV.

mufloat, optional

Parameter added for syntax consistency–does not impact function behavior. Defaults to 0.

mefloat, optional

Electron mass in MeV. Defaults to const.me.

LObool

True includes leading order QED corrections to the pressure. Defaults to ‘True’.

NLObool

True includes next-to-leading order QED corrections to the pressure. Defaults to ‘True’.

Returns

float

Units of MeV^4.

thermo.p_massive_BE(T, mu, m, g)[source]

Series approximation for pressure of a massive particle with Bose-Einstein statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species (1 for scalar, 3 for vector, etc.).

Returns:

Units of MeV^4.

Return type:

float

thermo.p_massive_FD(T, mu, m, g)[source]

Series approximation for pressure of a massive particle with Fermi-Dirac statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species (1 for Majorana Fermion, 2 for Dirac Fermion, etc.).

Returns:

Units of MeV^4.

Return type:

float

thermo.p_massive_MB(T, mu, m, g)[source]

Series approximation for pressure of a massive particle with Maxwell-Boltzmann statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in units of MeV.

  • mu (float) – Chemical potential of massive particle species.

  • m (float) – Mass of particle in units of MeV.

  • g (float) – Degrees of freedom of massive particle species.

Returns:

Units of MeV^4.

Return type:

float

thermo.p_massless_BE(T, mu, g)[source]

Pressure of a massless particle with Bose-Einstein statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species (1 for scalar, 2 for vector, etc.).

Returns:

Units of MeV^4.

Return type:

float

thermo.p_massless_FD(T, mu, g)[source]

Pressure of a massless particle with Fermi-Dirac statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species (2 for Weyl fermion).

Returns:

Units of MeV^4.

Return type:

float

thermo.p_massless_MB(T, mu, g)[source]

Pressure of a massless particle with Maxwell-Boltzmann statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species.

Returns:

Units of MeV^4.

Return type:

float

thermo.p_nue_std(T_nue, mu_nue=0.0)[source]

Total pressure of electron neutrinos.

Parameters:
  • T_nue (float) – Electron neutrino temperature in MeV.

  • mu_nue (float, optional) – Chemical potential of electron neutrinos in MeV. Defaults to 0.

Returns:

Units of MeV^4.

Return type:

float

thermo.p_numt_std(T_numt, mu_numt=0.0)[source]

Total pressure of mu, tau neutrinos.

Parameters:
  • T_numt (float) – Mu, tau neutrino temperature in MeV.

  • mu_numt (float, optional) – Chemical potential of mu,tau neutrinos in MeV. Defaults to 0.

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_EM_std(T_g, mu=0, me=0.51099895, LO=True, NLO=True)[source]

Total energy density of EM-coupled SM fluids.

Parameters:
  • T_g (float) – Photon temperature in MeV.

  • mu (float, optional) – Parameter added for syntax consistency–does not impact function behavior. Defaults to 0.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

  • LO (bool) – True includes leading order QED corrections to the energy density. Defaults to ‘True’.

  • NLO (bool) – True includes next-to-leading order QED corrections to the energy density. Defaults to ‘True’.

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_EM_std_v(T_g, mu=0, me=0.51099895, LO=True, NLO=True)

Vectorized version of rho_EM_std. Takes similar arguments as rho_EM_std but with additional array axes over which rho_EM_std is mapped.

Original documentation:

Total energy density of EM-coupled SM fluids.

Parameters

T_gfloat

Photon temperature in MeV.

mufloat, optional

Parameter added for syntax consistency–does not impact function behavior. Defaults to 0.

mefloat, optional

Electron mass in MeV. Defaults to const.me.

LObool

True includes leading order QED corrections to the energy density. Defaults to ‘True’.

NLObool

True includes next-to-leading order QED corrections to the energy density. Defaults to ‘True’.

Returns

float

Units of MeV^4.

thermo.rho_massive_BE(T, mu, m, g)[source]

Series approximation for energy density of a massive particle with Bose-Einstein statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species (1 for scalar, 3 for vector, etc.).

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_massive_FD(T, mu, m, g)[source]

Series approximation for energy density of a massive particle with Fermi-Dirac statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV.

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species (2 for Majorana Fermion, 4 for Dirac Fermion, etc.).

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_massive_MB(T, mu, m, g)[source]

Series approximation for energy density of a massive particle with Maxwell-Boltzmann statistcs.

Parameters:
  • T (float) – Temperature of massive particle species in MeV.

  • mu (float) – Chemical potential of massive particle species in MeV

  • m (float) – Mass of particle in MeV.

  • g (float) – Degrees of freedom of massive particle species.

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_massless_BE(T, mu, g)[source]

Energy density of a massless particle with Bose-Einstein statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species (1 for scalar, 2 for vector, etc.).

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_massless_FD(T, mu, g)[source]

Energy density of a massless particle with Fermi-Dirac statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species (2 for Weyl fermion).

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_massless_MB(T, mu, g)[source]

Energy density of a massless particle with Maxwell-Boltzmann statistcs.

Parameters:
  • T (float) – Temperature of massless particle species in units of MeV.

  • mu (float) – Chemical potential of massless particle species.

  • g (float) – Degrees of freedom of massless particle species.

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_nue_std(T_nue, mu_nue=0.0)[source]

Total energy density of electron neutrinos.

Parameters:
  • T_nue (float) – Electron neutrino temperature in MeV.

  • mu_nue (float, optional) – Chemical potential of electron neutrinos in MeV. Defaults to 0.

Returns:

Units of MeV^4

Return type:

float

thermo.rho_numt_std(T_numt, mu_numt=0.0)[source]

Total energy density of mu, tau neutrinos.

Parameters:
  • T_numt (float) – Mu, tau neutrino temperature in MeV.

  • mu_numt (float, optional) – Chemical potential of mu,tau neutrinos in MeV. Defaults to 0.

Returns:

Units of MeV^4.

Return type:

float

thermo.rho_plus_p_EM_std(T_g, mu=0, me=0.51099895, LO=True, NLO=True)[source]

Sum of energy densities and pressures of all EM-coupled SM fluids.

Parameters:
  • T_g (float) – Photon temperature in MeV.

  • mu (float, optional) – Parameter added for syntax consistency–does not impact function behavior. Defaults to 0.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

  • LO (bool) – True includes leading order QED corrections to the energy density and pressure. Defaults to ‘True’.

  • NLO (bool) – True includes next-to-leading order QED corrections to the energy density and pressure. Defaults to ‘True’.

Returns:

Units of MeV^4.

Return type:

float