Skip to content

Contribution to Matter and Radiation Energy Density

Kay Lehnert edited this page Apr 1, 2026 · 3 revisions

Depending on the equation of state (EoS), a dynamic scalar field can act as radiation or as matter. The EoS is not constant and can evolve over the course of cosmic history. CLASS's default behaviour is to add a scalar field to the matter and radiation density.

  • For $0 \leq \omega_\phi \leq 1/3$, the scalar field contributes to radiation density with $3p_\phi$, and to matter with $\rho_\phi-3p_\phi$.
  • For $\omega_\phi >1/3$, the scalar field is not some sort of super-radiation that can cause negative matter density. It is an ultra-relativistic, stiff fluid that contributes to radiation, yet does not negatively contribute to matter.
  • For $\omega_\phi <0$, the scalar field is not some sort of super-matter that is eating away radiation. It is DE and does no longer contribute to matter or radiation.

The contribution is implemented in background.c in the background_functions() function:

    if (pvecback[pba->index_bg_p_scf] >= 0.)
    {
      if (3. * pvecback[pba->index_bg_p_scf] <= pvecback[pba->index_bg_rho_scf])
      {
        /* 0 <= w <= 1/3: smooth radiation-matter mixture */
        rho_r += 3. * pvecback[pba->index_bg_p_scf];
        rho_m += pvecback[pba->index_bg_rho_scf] - 3. * pvecback[pba->index_bg_p_scf];
      }
      else
      {
        /* w > 1/3: ultra-relativistic (stiff fluid), count as radiation */
        rho_r += pvecback[pba->index_bg_rho_scf];
      }
    }

The boundary regions $\omega=0$ and $\omega=1/3$ are smooth, there is no jump.

Clone this wiki locally