background

class background.BackgroundModel(decoupled=False, use_FD=True, collision_me=True, LO=True, NLO=True, throw=True, max_steps=512)[source]

Bases: Module

Background model.

decoupled

Whether neutrinos are always decoupled. Default is False.

Type:

bool, optional

use_FD

Whether to use Fermi-Dirac statistics for neutrinos, or a Maxwell-Boltzmann distribution. Default is True.

Type:

bool, optional

collision_me

Finite electron mass correction in energy transfer collision terms. Default is True.

Type:

bool, optional

LO

Whether to use leading order QED correction. Default is True.

Type:

bool, optional

NLO

Whether to use next-to-leading order QED correction. Default is True.

Type:

bool, optional

throw

Whether to raise exceptions on solver failure. Default is True. Set to False for parameter scans where some combinations may fail.

Type:

bool, optional

__call__(Delt_Neff_init, T_start=8.617333263296244, T_end=0.005170399957977747, me=0.51099895, rtol=1e-08, atol=1e-10, solver=Tsit5(scan_kind=None))[source]

Calculate thermodynamics given an initial \(\Delta N_\mathrm{eff}\).

Parameters:
  • Delt_Neff_init (float) – Initial \(\Delta N_\mathrm{eff}\). Can be positive or negative.

  • T_EM_init (float, optional) – Initial EM (and neutrino) temperature. Default is const.T_start.

  • T_EM_end (float, optional) – Final EM temperature to terminate integration at. Default is const.T_end.

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

  • rtol (float, optional) – Relative tolerance of the abundance solver. Default is 1e-8.

  • atol (float, optional) – Absolute tolerance of the abundance solver. Default is 1e-10.

  • max_steps (int, optional) – Maximum number of steps taken by the solver. Default is 4096. Increasing this slows down the code, while decreasing this could mean that the solver cannot complete the solution.

  • solver (Diffrax ODE solver) – The Diffrax ODE solver to use. A stiff solver is recommended. Default is the Tsitouras’ 5/4 solver.

Returns:

  • t_vec (array_like) – Times in s at which thermodynamics are saved.

  • a_vec (array_like) – Scale factor at each point in time.

  • rho_g_vec (array_like) – Energy density of photons in MeV^4 at each point in time.

  • rho_nu_vec (array_like) – Energy density of one species of neutrinos in MeV^4 at each point in time.

  • rho_extra_vec (array_like) – Energy density in MeV^4 of extra species at each point in time.

dY(t, Y, args)[source]

Differential equation for background quantities.

Parameters:
  • t (float) – Time in s.

  • Y (tuple of floats) – The values of \(\log a\), \(T_\gamma\) and \(T_\nu\).

  • args (tuple of floats) – The initial value of \(\log a\), and the initial energy density in MeV^4 of the extra inert relativistic species.

Return type:

The time derivative of the quantities specified in Y.