Dark Energy models

class camb.dark_energy.DarkEnergyModel(*args, **kwargs)[source]

Abstract base class for dark energy model implementations.

class camb.dark_energy.DarkEnergyEqnOfState(*args, **kwargs)[source]

Bases: DarkEnergyModel

Abstract base class for models using w and wa parameterization with use w(a) = w + (1-a)*wa parameterization, or call set_w_a_table to set another tabulated w(a). If tabulated w(a) is used, w and wa are set to approximate values at z=0.

See model.CAMBparams.set_initial_power_function() for a convenience constructor function to set a general interpolated P(k) model from a python function.

Variables:
  • w – (float64) w(0)

  • wa – (float64) -dw/da(0)

  • cs2 – (float64) fluid rest-frame sound speed squared

  • use_tabulated_w – (boolean) using an interpolated tabulated w(a) rather than w, wa above

set_params(w=-1.0, wa=0, cs2=1.0)[source]

Set the parameters so that P(a)/rho(a) = w(a) = w + (1-a)*wa

Parameters:
  • w – w(0)

  • wa – -dw/da(0)

  • cs2 – fluid rest-frame sound speed squared

set_w_a_table(a, w)[source]

Set w(a) from numerical values (used as cublic spline). Note this is quite slow.

Parameters:
  • a – array of scale factors

  • w – array of w(a)

Returns:

self

class camb.dark_energy.DarkEnergyFluid(*args, **kwargs)[source]

Bases: DarkEnergyEqnOfState

Class implementing the w, wa or splined w(a) parameterization using the constant sound-speed single fluid model (as for single-field quintessense).

set_w_a_table(a, w)[source]

Set w(a) from numerical values (used as cublic spline). Note this is quite slow.

Parameters:
  • a – array of scale factors

  • w – array of w(a)

Returns:

self

class camb.dark_energy.DarkEnergyPPF(*args, **kwargs)[source]

Bases: DarkEnergyEqnOfState

Class implementating the w, wa or splined w(a) parameterization in the PPF perturbation approximation (arXiv:0808.3125) Use inherited methods to set parameters or interpolation table.

class camb.dark_energy.Quintessence(*args, **kwargs)[source]

Bases: DarkEnergyModel

Abstract base class for single scalar field quintessence models.

For each model the field value and derivative are stored and splined at sampled scale factor values.

To implement a new model, need to define a new derived class in Fortran, defining Vofphi and setting up initial conditions and interpolation tables (see TEarlyQuintessence as example).

Variables:
  • DebugLevel – (integer)

  • astart – (float64)

  • integrate_tol – (float64)

  • sampled_a – (float64 array)

  • phi_a – (float64 array)

  • phidot_a – (float64 array)

class camb.dark_energy.EarlyQuintessence(*args, **kwargs)[source]

Bases: Quintessence

Example early quintessence (axion-like, as arXiv:1908.06995) with potential

V(phi) = m^2f^2 (1 - cos(phi/f))^n + Lambda_{cosmological constant}

Variables:
  • n – (float64) power index for potential

  • f – (float64) f/Mpl (sqrt(8piG)f); only used for initial search value when use_zc is True

  • m – (float64) mass parameter in reduced Planck mass units; only used for initial search value when use_zc is True

  • theta_i – (float64) phi/f initial field value

  • frac_lambda0 – (float64) fraction of dark energy in cosmological constant today (approximated as 1)

  • use_zc – (boolean) solve for f, m to get specific critical reshift zc and fde_zc

  • zc – (float64) reshift of peak fractional early dark energy density

  • fde_zc – (float64) fraction of early dark energy density to total at peak

  • npoints – (integer) number of points for background integration spacing

  • min_steps_per_osc – (integer) minimumum number of steps per background oscillation scale

  • fde – (float64 array) after initialized, the calculated background early dark energy fractions at sampled_a

class camb.dark_energy.AxionEffectiveFluid(*args, **kwargs)[source]

Bases: DarkEnergyModel

Example implementation of a specifc (early) dark energy fluid model (arXiv:1806.10608). Not well tested, but should serve to demonstrate how to make your own custom classes.

Variables:
  • w_n – (float64) effective equation of state parameter

  • fde_zc – (float64) energy density fraction at z=zc

  • zc – (float64) decay transition redshift (not same as peak of energy density fraction)

  • theta_i – (float64) initial condition field value