Species#

Each species is a Component that owns its state.

The variables are those of Ma & Bertschinger (1995): a density contrast delta and a velocity divergence theta per fluid. The Boltzmann hierarchies are vector states: F holds the photons’ F_0 .. F_lmax, E holds E_2 .. E_lmax, N the neutrino multipoles and psi one row per massive-neutrino momentum bin. A density is a physical density parameter, omega_i(a) (discoeb.components.gravity). Their equations loop over multipoles and share the free-streaming tail in stream(). The truncations are component settings: LMAX_G and LMAX_POL on Photons, LMAX_NR on MasslessNeutrinos, LMAX_NU and NQMAX on MassiveNeutrinos.

class discoeb.components.species.ColdDarkMatter(**overrides)[source]#

Bases: Species

Cold dark matter. Synchronous gauge leaves the choice of the initial hypersurface open. The equations of discoeb.components.gravity take the one in which this species is at rest, so it has a density contrast but no velocity (fixes_gauge).

class discoeb.components.species.Baryons(**overrides)[source]#

Bases: Species

Baryon continuity and Euler equations, without the Thomson drag.

ThomsonScattering adds the drag.

class discoeb.components.species.Photons(**settings)[source]#

Bases: Species

Photon temperature multipoles F (F_0 .. F_LMAX_G) and E-modes E.

F_0 = delta_g, F_1 = 4 theta_g / (3 k) and F_2 = 2 sigma_g. E[l - 2] is E_l for l = 2 .. LMAX_POL. This is the collisionless part of the hierarchy. ThomsonScattering damps the multipoles and sources the polarization. The E-mode hierarchy couples upwards with (l+3)(l-1)/(l+1) in place of l+1 and closes with k L E_{L-1} / (2L+1) - (L+3) E_L / tau. Both hierarchies stream freely above their lowest three (F) or one (E) multipoles. The E-modes start at zero.

class discoeb.components.species.MasslessNeutrinos(**settings)[source]#

Bases: Species

Massless neutrinos N (N_0 .. N_LMAX_NR) which stream freely without collisions.

class discoeb.components.species.MassiveNeutrinos(**settings)[source]#

Bases: Species

Massive neutrinos on NQMAX momentum bins: psi[i, l] (Ma & Bertschinger).

Bin i has node q_i, weight w_i and dlnf0/dlnq, and streams freely (stream()) with kv = k v_i, v_i = q / sqrt(q^2 + a^2 amnu^2). The moments Sum w psi0 / v, Sum w psi1 and Sum w v psi2 enter the Einstein sources. The background density ratio rhonu and pressure ratio pnu integrate the Fermi-Dirac distribution on NQ_NU_BACKGROUND nodes. Deep in radiation domination the neutrinos are still relativistic, so each bin starts as the massless hierarchy, psi_l = -(1/4) N_l dlnf0/dlnq. The quadrature nodes and weights are instance constants the providers read through self. Each bin adds LMAX_NU + 1 states. 3 bins give LCDM_MNU nvar = 98. 5 bins compile about 4x slower and gain no P(k) accuracy against CLASS.

The bins are out of the solver’s step-size control (error_weight=0). They stream freely to today, and resolving their oscillation costs many steps for no change in delta_c and delta_b. Their own monopoles are then less accurate than the other states: a launch that reads them weights psi_i_l in its error_weights.

class discoeb.components.species.CosmologicalConstant(**overrides)[source]#

Bases: _DarkEnergyDensity

A cosmological constant: density only, no perturbations.

class discoeb.components.species.DarkEnergy(**overrides)[source]#

Bases: _DarkEnergyDensity

A CPL fluid w = w_0 + w_a (1 - a) with rest-frame sound speed cs2_DE.

Synchronous-gauge fluid equations after Ballesteros & Lesgourgues 2010, with the adiabatic sound speed c_a^2 = w - w' / (3 (1+w) aH), w' = -w_a aH a,

\[\begin{split}\delta' &= -(1+w)\left(\theta + \frac{h'}{2}\right) - 3 (c_s^2 - w)\, aH\, \delta - 9 (1+w)(c_s^2 - c_a^2) (aH)^2 \frac{\theta}{k^2}, \\ \theta' &= -(1 - 3 c_s^2)\, aH\, \theta + \frac{c_s^2 k^2}{1+w} \delta.\end{split}\]

Valid for w != -1 at every scale factor: a history that reaches w = -1 between the start and today is rejected (check), since a single fluid cannot cross it. Use CosmologicalConstant for w = -1. The fluid starts in the adiabatic mode, delta_de = (1 + w_0) delta_c at rest.

class discoeb.components.species.Fluid(**settings)[source]#

Bases: Species

A perfect fluid with a constant equation of state w and rest-frame sound speed cs2.

The fluid equations of DarkEnergy at constant w, where the adiabatic sound speed is w itself,

\[\begin{split}\delta' &= -(1+w)\left(\theta + \frac{h'}{2}\right) - 3 (c_s^2 - w)\, aH\, \delta - 9 (1+w)(c_s^2 - w) (aH)^2 \frac{\theta}{k^2}, \\ \theta' &= -(1 - 3 c_s^2)\, aH\, \theta + \frac{c_s^2 k^2}{1+w} \delta,\end{split}\]

with no anisotropic stress. Its physical density today is omega (Omega h^2) and scales as a^(-3(1+w)). It starts in the adiabatic mode, delta = (1 + w) delta_c at rest. w = cs2 = 0 is a second cold dark matter and w = cs2 = 1/3 a dark radiation without shear. The growing mode’s series does not count it: a subclass that is matter or radiation contributes its density to rho_matter or rho_radiation.

Its names (delta, theta, w, cs2) are generic, so a model lists it under a name:

LCDM.add(Fluid.named("dr"), name="LCDM+dr")   # dr_omega, dr_w, dr_delta ...
class discoeb.components.species.RadiationStreaming(**overrides)[source]#

Bases: Component

The radiation streaming approximation of CLASS (Blas, Lesgourgues & Tram 2011).

Well inside the horizon, once the photons decouple, the photon and massless-neutrino hierarchies oscillate at k about a particular solution driven by the metric, and the oscillation decays as 1/(k tau). Where rsa is 1 the model swaps the hierarchies for that solution,

delta = 4 (aH h’ - k^2 eta) / k^2, theta = -h’/2, no shear, no polarization,

(synchronous gauge), takes h' without the streaming species as CLASS does, and freezes their states. The switch is CLASS’s: k tau > RSA_K_TAU (45) and kappa' tau < RSA_KAPPA_TAU (tau_c / tau > 5). Like CLASS, which switches at a fixed tau_free_streaming, it only turns on: past a = RSA_A_LATCH it stays on through reionization. CLASS’s Thomson corrections for reionization are missing. RSA = 0 (DISCO_RSA=0) turns it off.

It provides the switch rsa and the streaming solution rsa_delta and rsa_theta, and names no species. Each species that follows it reads those and adds its own density to the sum delta_rho_streaming. The solution is general relativity’s (NoRadiationStreaming for another theory).

class discoeb.components.species.NoRadiationStreaming(**overrides)[source]#

Bases: Component

The full hierarchies at all times: what RadiationStreaming provides, switched off.

LCDM.swap(RadiationStreaming, NoRadiationStreaming, name=...) is a model without the approximation, for a theory of gravity whose constraints the streaming solution does not know. The constants fold away when the kernel compiles.