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:
SpeciesCold dark matter. Synchronous gauge leaves the choice of the initial hypersurface open. The equations of
discoeb.components.gravitytake 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:
SpeciesBaryon continuity and Euler equations, without the Thomson drag.
ThomsonScatteringadds the drag.
- class discoeb.components.species.Photons(**settings)[source]#
Bases:
SpeciesPhoton temperature multipoles
F(F_0 .. F_LMAX_G) and E-modesE.F_0 = delta_g,F_1 = 4 theta_g / (3 k)andF_2 = 2 sigma_g.E[l - 2]isE_lforl = 2 .. LMAX_POL. This is the collisionless part of the hierarchy.ThomsonScatteringdamps the multipoles and sources the polarization. The E-mode hierarchy couples upwards with(l+3)(l-1)/(l+1)in place ofl+1and closes withk 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:
SpeciesMassless neutrinos
N(N_0 .. N_LMAX_NR) which stream freely without collisions.
- class discoeb.components.species.MassiveNeutrinos(**settings)[source]#
Bases:
SpeciesMassive neutrinos on
NQMAXmomentum bins:psi[i, l](Ma & Bertschinger).Bin
ihas nodeq_i, weightw_ianddlnf0/dlnq, and streams freely (stream()) withkv = k v_i,v_i = q / sqrt(q^2 + a^2 amnu^2). The momentsSum w psi0 / v,Sum w psi1andSum w v psi2enter the Einstein sources. The background density ratiorhonuand pressure ratiopnuintegrate the Fermi-Dirac distribution onNQ_NU_BACKGROUNDnodes. 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 throughself. Each bin addsLMAX_NU + 1states. 3 bins give LCDM_MNUnvar = 98. 5 bins compile about 4x slower and gain noP(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 indelta_canddelta_b. Their own monopoles are then less accurate than the other states: a launch that reads them weightspsi_i_lin itserror_weights.
- class discoeb.components.species.CosmologicalConstant(**overrides)[source]#
Bases:
_DarkEnergyDensityA cosmological constant: density only, no perturbations.
- class discoeb.components.species.DarkEnergy(**overrides)[source]#
Bases:
_DarkEnergyDensityA CPL fluid
w = w_0 + w_a (1 - a)with rest-frame sound speedcs2_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 != -1at every scale factor: a history that reachesw = -1between the start and today is rejected (check), since a single fluid cannot cross it. UseCosmologicalConstantforw = -1. The fluid starts in the adiabatic mode,delta_de = (1 + w_0) delta_cat rest.
- class discoeb.components.species.Fluid(**settings)[source]#
Bases:
SpeciesA perfect fluid with a constant equation of state
wand rest-frame sound speedcs2.The fluid equations of
DarkEnergyat constantw, where the adiabatic sound speed iswitself,\[\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 asa^(-3(1+w)). It starts in the adiabatic mode,delta = (1 + w) delta_cat rest.w = cs2 = 0is a second cold dark matter andw = cs2 = 1/3a dark radiation without shear. The growing mode’s series does not count it: a subclass that is matter or radiation contributes itsdensitytorho_matterorrho_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:
ComponentThe 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
kabout a particular solution driven by the metric, and the oscillation decays as1/(k tau). Wherersais 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) andkappa' tau < RSA_KAPPA_TAU(tau_c / tau > 5). Like CLASS, which switches at a fixedtau_free_streaming, it only turns on: pasta = RSA_A_LATCHit stays on through reionization. CLASS’s Thomson corrections for reionization are missing.RSA = 0(DISCO_RSA=0) turns it off.It provides the switch
rsaand the streaming solutionrsa_deltaandrsa_theta, and names no species. Each species that follows it reads those and adds its own density to the sumdelta_rho_streaming. The solution is general relativity’s (NoRadiationStreamingfor another theory).
- class discoeb.components.species.NoRadiationStreaming(**overrides)[source]#
Bases:
ComponentThe full hierarchies at all times: what
RadiationStreamingprovides, 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.