# The effect of early radiation in N-body simulations of cosmic structure formation

Julian Adamek, Jacob Brandbyge, Christian Fidler, Steen Hannestad, Cornelius Rampf, Thomas Tram

<figure><img src="image_1.png" /></figure>

## ► To cite this version:

Julian Adamek, Jacob Brandbyge, Christian Fidler, Steen Hannestad, Cornelius Rampf, et al. The effect of early radiation in N-body simulations of cosmic structure formation. Monthly Notices of the Royal Astronomical Society, 2017, 470 (1), pp.303-313. 10.1093/mnras/stx1157. hal-01582461

HAL Id: hal-01582461

https://hal.science/hal-01582461

Submitted on 18 Jan 2022

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

# The effect of early radiation in *N*-body simulations of cosmic structure formation

Julian Adamek,<fnref n="1" />★ Jacob Brandbyge,<fnref n="2" />,<fnref n="3" /> Christian Fidler,<fnref n="4" /> Steen Hannestad,<fnref n="2" /> Cornelius Rampf<fnref n="5" />,<fnref n="6" /> and Thomas Tram<fnref n="2" />

Accepted 2017 May 9. Received 2017 April 28; in original form 2017 March 30

## ABSTRACT

Newtonian *N*-body simulations have been employed successfully over the past decades for the simulation of the cosmological large-scale structure. Such simulations usually ignore radiation perturbations (photons and massless neutrinos) and the impact of general relativity (GR) beyond the background expansion. This approximation can be relaxed and we discuss three different approaches that are accurate to leading order in GR. For simulations that start at redshift less than about 100, we find that the presence of early radiation typically leads to per cent-level effects on the numerical power spectra at large scales. Our numerical results agree across the three methods, and we conclude that all of the three methods are suitable for simulations in a standard cosmology. Two of the methods modify the *N*-body evolution directly, while the third method can be applied as a post-processing prescription.

**Key words:** dark matter – large-scale structure of Universe – cosmology: theory.

## 1 INTRODUCTION

Radiation plays a major role in the dynamical evolution of the early Universe. At that time, radiation and matter are tightly coupled through electroweak interactions. As the Universe expands and cools, electroweak interactions freeze out and the neutrino species decouple. The baryons maintain their tight coupling to the photons through Thomson scattering until the baryon drag epoch. From this point on, gravity is the dominating force on a range of scales, leading eventually to the gravitational collapse of matter that forms clusters and filaments – the birth of the large-scale structure.

For the remaining cosmological evolution, matter behaves almost as a self-gravitating system due to the difference in the dynamical time-scale of matter perturbations compared to radiation perturbations (Voruz, Lesgourgues & Tram 2014). This entails that the non-linear clustering of matter can be simulated by simply ignoring radiation perturbations, and this is what is done in Newtonian cosmological *N*-body simulations (Teyssier 2002; Springel 2005; Hahn & Angulo 2016). On the other hand, solving the coupled

Einstein-Boltzmann equations in full non-linearity on cosmologically relevant time-scales is currently not feasible.

However, as will be discussed in greater detail below, several recent developments make it possible to include radiation with very little computational overhead. One example is the numerical code COSIRA (Brandbyge et al. 2017), which is a hybrid *N*-body code based on a modification of the Newtonian *N*-body code GADGET-2 and the linear Einstein-Boltzmann code CLASS (Blas, Lesgourgues & Tram 2011). Here, the relativistic corrections effectively appear as linear sources for the (otherwise fully non-linear) Newtonian gravity solver.

Since the effects discussed here have nearly vanishing impact on non-linear scales, instead of explicitly including these terms in a simulation, it is also possible to account for them through post-processing of the simulation output. Such a framework has recently been developed by Fidler et al. (2016), introducing the notion of Newtonian motion (Nm) gauges. In this framework, a modified version of CLASS determines the evolving space-time on which unmodified Newtonian simulations can be interpreted self-consistently within linear general relativity (GR). We apply this method here for the first time on actual *N*-body simulation data.

Other numerical techniques have been recently developed to carry out cosmological simulations in the context of GR.

<footnote n="1">¹Laboratoire Univers et Théories, Observatoire de Paris, PSL Research University, 5 place Jules Janssen, F-92195 Meudon, France</footnote>

<footnote n="2">²Department of Physics and Astronomy, University of Aarhus, Ny Munkegade 120, DK-8000 Aarhus C, Denmark</footnote>

<footnote n="3">³Centre for Star and Planet Formation, Niels Bohr Institute & Natural History Museum of Denmark, University of Copenhagen, Øster Volgade 5-7, DK-1350 Copenhagen, Denmark</footnote>

<footnote n="4">⁴Catholic University of Louvain - Center for Cosmology, Particle Physics and Phenomenology (CP³), Chemin du Cyclotron 2, B-1348 Louvain-la-Neuve, Belgium</footnote>

<footnote n="5">⁵Institute for Theoretical Physics (ITP), Philosophenweg 16, University of Heidelberg, D-69120 Heidelberg, Germany</footnote>

<footnote n="6">⁶Department of Physics, Israel Institute of Technology - Technion, Haifa 32000, Israel</footnote>

<footnote>* E-mail: julian.adamek@obspm.fr</footnote>
Examples include the simulations of Bentivegna & Bruni (2016), Giblin, Mertens & Starkman (2016) and Mertens, Giblin & Starkman (2016) that solve the full GR evolution in a fluid approximation and focus on aspects of cosmological backreaction (Buchert & Räsänen 2012; Buchert, Nayet & Wiegand 2013), a topic we shall not investigate here. To our knowledge, these codes also do not incorporate radiation and are thus not suitable for the present study.

N-body methods have many advantages if one wants to model the evolution of large-scale structure especially in the non-linear regime, in particular since they can handle aspects such as mergers and virialization to sufficient accuracy. Based on a weak-field expansion of GR, Adamek et al. (2016a,b) have developed the cosmological N-body code *gevolution*. Although effects of early radiation have not been incorporated in the first release, we present here novel results of the most recent version 1.1 that features a linear radiation module based on the same general principle as the one employed in COSIRA.

It goes without saying that all three approaches have their benefits and drawbacks. We will discuss and compare in detail these three approaches that go beyond the Newtonian approximation commonly employed in a Universe that is nowadays dominated by cold dark matter (CDM) and a cosmological constant $Λ$, i.e. the $Λ$CDM Universe. The paper is organized as follows. In Section 2, we will discuss the three different gauges that are at the basis of each method. In Section 3, we describe the numerical implementation of each method, and in Section 4 we give the results. We conclude in Section 5.

## 2 A TALE OF THREE GAUGES

In the ADM formalism (after Arnowitt, Deser & Misner 2008, also known as 3+1 decomposition) a general metric is written as

$$ds^2 = -N^2 d\tilde{\tau}^2 + N_i N^i d\tilde{\tau}^2 - 2N_i d\tilde{x}^i d\tilde{\tau} + \gamma_{ij} d\tilde{x}^i d\tilde{x}^j, \quad (1)$$

where N is the lapse function, $N_i$ the shift vector, $\gamma_{ij}$ the metric on the three-dimensional space-like hypersurface and $\tilde{\tau}, \tilde{x}^i$ are some arbitrary coordinates that label the foliation in the time-like direction and the points on the hypersurfaces, respectively. We will work in the weak-field regime of GR where coordinates can be chosen such that the shift vector is perturbatively small, and we will therefore drop the second term on the right-hand side of equation (1) from now on.

We split the shift vector into a curl-free and a divergence-free component,

$$N_i = a^2 [\nabla_i B + B_i], \quad \nabla^i B_i = 0, \quad (2)$$

where we introduce the conformal factor $a(\tilde{\tau})$, which, in a Friedmann–Robertson–Walker cosmology, parametrizes the background expansion.

The three-metric $\gamma_{ij}$ can be decomposed in a similar fashion,

$$\gamma_{ij} = a^2 [e^{2H_L} \delta_{ij} - 2D_{ij}H_T + 2\nabla_i E_j + h_{ij}], \quad (3)$$

where $D_{ij} = (\nabla_i \nabla_j - \delta_{ij} \nabla^2 / 3)$, and

$$\nabla^i E_i = 0, \quad h_i^i = 0, \quad \nabla^i h_{ij} = 0. \quad (4)$$

The traceless part of $\gamma_{ij}$ is therefore split into a spin-0 perturbation $H_T$, a pure spin-1 perturbation $E_i$, and a pure spin-2 perturbation $h_{ij}$.

Since we are working in the weak-field regime, we linearize all equations in the perturbation variables $B, B_i, H_T, E_i, h_{ij}$. We write $\exp(2H_L)$ instead of its linearized version $(1 + 2H_L)$ only in order to

facilitate the discussion of next-to-leading order weak-field effects later on. Similarly, we introduce a lapse perturbation A by writing

$$N = a e^A. \quad (5)$$

In GR, the freedom to choose a coordinate system implies that not all the perturbation variables introduced so far are physical. We can make a coordinate transformation $\tau = \tilde{\tau} + T$, $x^i = \tilde{x}^i + \nabla^i L + L^i$, where $L^i$ is the divergence-free part of the spatial coordinate shift, i.e. $\nabla_i L^i = 0$. This freedom shows that two of the scalar and one of the vector perturbations (with two polarizations) defined for the metric are in fact redundant. One way to deal with this issue is to construct a set of gauge-invariant perturbation variables, as was pioneered by Bardeen (1980). Another option is to specifically choose the coordinate system in such a way that the equations take some desired form, making them easier to solve or to interpret. Three such choices, all relevant for cosmology and each having their own advantages and drawbacks, will be discussed in the next subsections.

## 2.1 Poisson gauge

The Poisson gauge (which in the scalar sector reduces to the so-called Newtonian or longitudinal gauge) is defined by the coordinate system where T and L are chosen such that $B = H_T = 0$, and $L^i$ is chosen such that $E_i = 0$. In this case, the two remaining scalar metric perturbations A and $H_L$ coincide with the two first-order gauge-invariant potentials found by Bardeen (1980). We follow the notation<fnref n="1" /> of Ma & Bertschinger (1995) and write $A = \psi$ and $H_L = -\phi$. The metric therefore takes the form

$$ds^2 = a^2 [-e^{2\psi} d\tau^2 - 2B_i dx^i d\tau + (\delta_{ij} e^{-2\phi} + h_{ij}) dx^i dx^j]. \quad (6)$$

Adamek et al. (2016b) introduce a canonical momentum $q_i$ to write a geodesic equation that is valid for any value of $q_i$, including the ultrarelativistic case $q^2 \gg m^2 a^2$. In the non-relativistic limit, this becomes

$$\partial_{\tau} v_{i}^{P} + \mathcal{H} v_{i}^{P} = -\nabla_{i} \psi = -\nabla_{i} \phi + \nabla_{i} \chi, \quad (7)$$

where $v_i^P = q_i / (ma)$ is the peculiar velocity<fnref n="2" /> in the Poisson gauge, and we have also introduced the conformal Hubble rate $\mathcal{H} = \partial_{\tau} \ln a$. The lapse perturbation $\psi$ is replaced by

$$\psi = \phi - \chi, \quad (8)$$

and one can then proceed by solving the two constraints that determine $\phi$ and $\chi$. The former is given by the Hamiltonian constraint that is to leading order

$$\nabla^2 \phi - 3 \mathcal{H} \partial_{\tau} \phi - 3 \mathcal{H}^2 (\phi - \chi) = 4 \pi G a^2 \sum_{\alpha} \bar{\rho}_{\alpha} \delta_{\alpha}^{P}. \quad (9)$$

Here, $\delta_{\alpha}^{P} \equiv (\rho_{\alpha}^{P} - \bar{\rho}_{\alpha}) / \bar{\rho}_{\alpha}$ are the density perturbations in the Poisson gauge superposed on the background density $\bar{\rho}_{\alpha}$, where $\alpha$ labels the various species, i.e. baryons, dark matter, neutrinos and

<footnote n="1">¹ In previous work concerning the N-body gauge (e.g. Fidler et al. 2015, 2016; Brandbyge et al. 2017), the notation of Kodama & Sasaki (1984) was used, in particular a variable $\Phi = -\phi$. The notation of Adamek et al. (2016b) also features variables called $\Phi$ and $\Psi$ (stylized in capitals) but they choose a parametrization of the metric that is due to Green & Wald (2012). As will be explained later, that parametrization differs from the one employed in this work by some coefficients of next-to-leading order terms.</footnote>

<footnote n="2">² Note that the coordinate three-velocity is in fact $dx^i/d\tau = \delta^{ij}(v_j^P + B_j)$ at leading order.</footnote>
photons. As opposed to the N-body gauge, discussed below, one has to keep in mind that the spatial volume is perturbed by the presence of $H_L = -\phi$ in this gauge, which has an effect on how the physical density should be interpreted in numerical simulations. As a related note, mass conservation for non-relativistic species reads

$$ \partial_{\tau} \delta^{\mathrm{P}} + \nabla^{i} v_{i}^{\mathrm{P}} = 3 \partial_{\tau} \phi \quad (10) $$

at leading order, including a source term due to the local volume deformation.

The second constraint is, to the leading order, given by

$$ \nabla^2 \nabla^2 \chi = 12\pi G a^2 D^{ij} \sum_{\alpha} \delta_{jk} [T_i^k]_{\alpha}, \quad (11) $$

where the right-hand side is the longitudinal projection of the (traceless) stress-energy commonly known as the scalar anisotropic stress. This quantity is gauge-invariant at first order. We use the notation $[T_i^k]_\alpha$ to denote the contribution of species $\alpha$ to a tensorial quantity.

In standard cosmology, the scalar anisotropic stress appears at first order only for relativistic species (photons and neutrinos) and decays rapidly inside the horizon. On small scales, and in particular after the end of radiation domination, second-order effects from non-relativistic species and geometry can become larger than this first-order contribution. Adamek et al. (2016b) therefore compute the right-hand side of equation (11) non-perturbatively from the N-body ensemble, and they take into account second-order geometric corrections as well, i.e. terms that arise from the Einstein tensor beyond leading order.

The form of the second-order geometric terms depends on how one parametrizes the metric at second order. While Adamek et al. (2016b) follow the parametrization of Green & Wald (2012) in writing, for instance, the lapse as $N^2 = a^2(1 + 2\Psi)$ even at second order, we choose to employ the more common parametrization $N^2 = a^2\exp(2\psi) = a^2(1 + 2\psi + 2\psi^2 + \dots)$. It should be clear that the two parameters $\psi$ and $\Psi$ can always be directly related in a weakly perturbed geometry. Including the second-order geometric corrections, equation (11) becomes

$$ \nabla^2 \nabla^2 \chi = 3 D^{ij} \left( \nabla_i \phi \nabla_j \phi + 4\pi G a^2 \sum_{\alpha} \delta_{jk} [T_i^k]_{\alpha} \right), \quad (12) $$

up to quadratic terms involving $\chi$, $B_i$ or $h_{ij}$. The reason why we choose to neglect those terms is the fact that at leading order $\phi$ and $\psi$ are typically much larger than the other metric perturbations in Poisson gauge, and $\chi$ is very small inside the horizon. We therefore expect the first term on the right-hand side in equation (12) to give the dominant geometric contribution. A perturbative calculation of the second-order contributions to $\chi$ is presented in Appendix.

By augmenting also the other equations, we can establish accuracy at next-to-leading weak-field order on small scales for the entire scheme. The Hamiltonian constraint becomes

$$ (1 + 2\phi) \nabla^2 \phi - 3\mathcal{H} \partial_{\tau} \phi - 3\mathcal{H}^2 (\phi - \chi) - \frac{1}{2} \nabla_i \phi \nabla^i \phi \\ = 4\pi G a^2 \sum_{\alpha} \bar{\rho}_{\alpha} \delta_{\alpha}^{\mathrm{P}}, \quad (13) $$

and the geodesic equation acquires the frame-dragging term,

$$ \partial_{\tau} v_{i}^{\mathrm{P}} + \mathcal{H} v_{i}^{\mathrm{P}} = - \nabla_{i} \phi + \nabla_{i} \chi - v_{j}^{\mathrm{P}} \delta^{jk} \nabla_{i} B_{k}. \quad (14) $$

The latter is still written in a low-velocity expansion in order to highlight the terms relevant for non-relativistic particles.

The frame-dragging potential $B_i$ can be obtained by extracting the divergence-free part of the momentum constraint,

$$ \frac{1}{4} \nabla^2 \nabla^2 B_i = 4\pi G a^2 \delta_{ij} (\nabla^i \nabla^j - \delta^{jk} \nabla^2) \sum_{\alpha} [T_i^\alpha]_\alpha. \quad (15) $$

In linear perturbation theory, the right-hand side is decaying and usually assumed to be negligible at the end of radiation domination. At second order, the formation of cosmic large-scale structure induces a growing frame-dragging potential (e.g. Lu et al. 2009). In an N-body scheme, the right-hand side of the momentum constraint can be computed non-perturbatively, a method employed for the first time by Bruni, Thomas & Wands (2014). In the standard model however, the effect of frame dragging on the trajectories of non-relativistic particles remains minuscule: Adamek et al. (2016a) found the change in velocity accumulated due to this effect over the lifetime of the Universe to be typically around $10 \text{ m s}^{-1}$ at megaparsec scales, five orders of magnitude<fnref n="3" /> smaller than the typical velocities of 1000 km s$^{-1}$.

The spin-2 perturbation $h_{ij}$ obeys a damped wave equation with a source that is given by the spin-2 part of the anisotropic stress (e.g. Adamek et al. 2016b). However, the scattering of non-relativistic particles with gravitational waves is so weak that we can certainly neglect it in N-body simulations.

## 2.2 N-body gauge

Seeking a coordinate system where the equations of motion for non-relativistic matter in linearized GR are closely related to their Newtonian counterparts, Fidler et al. (2015) discovered the N-body (Nb) gauge. So far, it has only been discussed in the scalar sector and to first order, with coordinates chosen such that $H_L = 0$, thereby eliminating the spatial volume perturbation. In order to cast the equations into the desired form, one furthermore has to set $B = v$, where $v$ is the total velocity potential of the combined fluid ($v^i = \nabla^i v$). In the scalar sector, the line element reads

$$ ds^2 = a^2 \left[ -e^{2\xi} d\tau^2 - 2\nabla_i B \, dx^i d\tau + (\delta_{ij} - 2D_{ij} H_{\mathrm{T}}^{\mathrm{Nb}}) \, dx^i dx^j \right]. \quad (16) $$

Here, $A = \xi$ is a linear perturbation sourced by radiation pressure and anisotropic stress; $\xi$ thus grows in the radiation-dominated era, whereas it decays in the matter and $\Lambda$-dominated eras. Furthermore, $\xi$ is in any comoving-orthogonal gauge given by

$$ (\rho + p)\xi = -(12\pi G a^2)^{-1} \nabla^2 \chi - \delta p, \quad (17) $$

where $\rho$, $p$ and $\delta p$ are, respectively, the density, the pressure and the pressure perturbations from all fluids.

We could naturally extend this gauge to the vector sector by setting again $E_i = 0$. The remaining vector perturbation $B_i$ is then determined by the divergence-free part of the momentum constraint just as in Poisson gauge, but it does not play any role in the dynamics when one works in the Newtonian limit. Neither does the tensor perturbation $h_{ij}$.

<footnote n="3">³ It is interesting to note that the frame-dragging potential $B_i$ itself is only about two orders of magnitude smaller than the gravitational potentials $\psi$ and $\phi$. The additional three orders of magnitude suppression is due to the velocity component that contracts one of the indices in the frame-dragging term of equation (14). The suppression is therefore much less severe for relativistic particles.</footnote>
At leading order in the Nb gauge, mass conservation of the non-relativistic species is identical to the one in Newtonian gravity, i.e.

$$ \partial_{\tau} \delta^{\text{Nb}} + \nabla^{i} v_{i}^{\text{Nb}} = 0, \qquad (18) $$

and the geodesic equation reads

$$ \partial_{\tau} v_{i}^{\text{Nb}} + \mathcal{H} v_{i}^{\text{Nb}} = -\nabla_{i} \phi + \nabla_{i} \gamma^{\text{Nb}}, \qquad (19) $$

where $\phi$ is the same gauge-invariant potential as introduced above. It satisfies the Poisson equation

$$ \nabla^2 \phi = 4\pi G a^2 \sum_{\alpha} \bar{\rho}_{\alpha} \delta_{\alpha}^{\text{Nb}}, \qquad (20) $$

where $\delta_{\alpha}^{\text{Nb}}$ are density perturbations in the Nb gauge. One important aspect of this gauge is the fact that the volume perturbation $H_L$ is absent, and therefore, the $\delta^{\text{Nb}}$ for non-relativistic particles is simply the counting density, i.e. the density computed in a Newtonian N-body simulation. Furthermore, instead of the somewhat cumbersome equation (9), the potential $\phi$ is solved from the much simpler equation (20) that directly resembles its Newtonian counterpart.

The relativistic correction $\gamma^{\text{Nb}}$ to the geodesic equation is given by

$$ \gamma^{\text{Nb}} = \partial_{\tau}^{2} H_{T}^{\text{Nb}} + \mathcal{H} \partial_{\tau} H_{T}^{\text{Nb}} + \chi, \qquad (21) $$

where $\chi$ is the first-order gauge-invariant quantity computed in equation (11).

In the late Universe, radiation becomes less and less important. The contribution of radiation to the Poisson equation (20) becomes eventually negligible, and it can be shown that, to the leading weak-field order, $\gamma^{\text{Nb}}$ tends to zero in that limit. Under these conditions the dynamical equations take the Newtonian form, justifying the definition and the naming of the Nb gauge. However, at early times when simulations are usually initialized ($z \ge 50$), radiation remnants contaminate the evolution equations of non-relativistic particles, through the $\gamma^{\text{Nb}}$ term in the geodesic equation (19) and the non-matter source terms in the Poisson equation (20). By keeping track of these terms, one can thus compute the relativistic correction to the Newtonian trajectories in order to recover the relativistic evolution.

## 2.3 Nm gauges

While the Poisson and Nb gauges employ a simple gauge fixing – by either directly relating the metric potentials or setting them to zero – the Nm gauge employs a more complex gauge definition that is equivalent to a differential equation for the metric potential $H_T$. However, this allows us to define a gauge in which the relativistic trajectories of cold matter coincide directly with the Newtonian trajectories. Using such a gauge makes it possible to incorporate relativistic corrections without modifying the Newtonian simulation (Fidler et al. 2016).

In fact, the Nm gauges describe an entire class of gauges, and in this paper we choose the specific Nm gauge that employs the Nb gauge time coordinate, i.e. it is comoving-orthogonal with $B = v$ and $A = \xi$. The resulting line element for scalar perturbations is

$$ ds^2 = a^2 \left[ -e^{2\xi} d\tau^2 - 2\nabla_i B \, dx^i d\tau + (e^{2H_L^{\text{Nm}}} \delta_{ij} - 2D_{ij} H_T^{\text{Nm}}) \, dx^i dx^j \right]. \qquad (22) $$

Mass conservation is given by

$$ \partial_{\tau} \delta^{\text{Nm}} + \nabla^{i} v_{i}^{\text{Nm}} = -3 \partial_{\tau} H_{L}^{\text{Nm}}, \qquad (23) $$

whereas the force term in the geodesic equation is by definition identical to the Newtonian one,

$$ \partial_{\tau} v_{i}^{\text{Nm}} + \mathcal{H} v_{i}^{\text{Nm}} = -\nabla_{i} \Phi^{\text{N}}, \qquad (24) $$

where we have made use of the spatial gauge condition of the Nm gauge

$$ -\Phi^{\text{N}} = -\phi + \gamma^{\text{Nm}}, \qquad (25) $$

with $\gamma^{\text{Nm}} = \partial_{\tau}^{2} H_{T}^{\text{Nm}} + \mathcal{H} \partial_{\tau} H_{T}^{\text{Nm}} + \chi$ and the Newtonian potential based on the counting density $\delta^{\text{N}}$

$$ \nabla^2 \Phi^{\text{N}} = 4\pi G a^2 \bar{\rho} \delta^{\text{N}}. \qquad (26) $$

Explicitly, these equations are valid for a multifluid universe, although the Newtonian potential is sourced only by the non-relativistic species. Since the Nm gauge has a non-vanishing volume deformation, the relativistic density is constructed from the counting density and the volume deformation

$$ \delta^{\text{N}} = \delta^{\text{Nm}} + 3 H_{L}^{\text{Nm}}. \qquad (27) $$

Inserting this relation into equation (23), we find that the variables $\Phi^{\text{N}}$, $v^{\text{Nm}}$ and $\delta^{\text{N}}$ follow entirely Newtonian equations of motion and can be identified with the perturbations evolved in a Newtonian simulation. This implies that an unmodified Newtonian N-body simulation is in fact computing the relativistic evolution of the particles in the Nm gauge. We are thus able to obtain a relativistic interpretation of such an unmodified simulation by embedding its output in the non-trivial space-time of the Nm gauge. Note that the relativistic density $\delta^{\text{Nm}}$ is not evolved by Newtonian equations and is affected by the non-trivial local volume deformation. After solving for the metric perturbations, however, we recover the relativistic solution for the density $\delta^{\text{Nm}}$ from the simulation density $\delta^{\text{N}}$ by employing equation (27).

The spatial gauge condition of the Nm gauge, equation (25), is in fact a second-order time-differential equation, i.e.

$$ \partial_{\tau}^{2} H_{T}^{\text{Nm}} + \mathcal{H} \partial_{\tau} H_{T}^{\text{Nm}} = \phi - \chi - \Phi^{\text{N}}. \qquad (28) $$

To solve the differential equation, one requires boundary conditions. In this work, we choose the method explained in Fidler et al. (2016) for fixing these boundary conditions, corresponding to a metric associated with a Newtonian simulation initialized in the Nb gauge.

The metric perturbations in the Nm gauge (cf. equation 22), can be solved by modifying conventional Einstein-Boltzmann solvers such as `CLASS` or `CAMB` (Lewis, Challinor & Lasenby 2000). Details on the explicit numerical implementation are given in the following section.

## 3 NUMERICAL IMPLEMENTATION

In the following, we discuss two numerical codes, `COSIRA` in Section 3.1 and `gevolution` in Section 3.2, that aim, amongst other things, to incorporate the gravitational coupling of radiation perturbations to non-relativistic matter. Then in Section 3.3, we summarize the steps needed to apply the Nm gauge framework to a Newtonian N-body simulation.

### 3.1 COSIRA (N-BODY GAUGE)

The code `COSIRA` (COsmological Simulations with RAdiation) has been recently introduced as the first hybrid code incorporating relativistic corrections to matter trajectories in cosmological simulations (Brandbyge et al. 2017). `COSIRA` is essentially a modified
version of the Newtonian N-body code GADGET-2, a code that is originally designed to only evolve matter particles. In COSIRA, the N-body code is interfaced with a modified version of the Einstein-Boltzmann solver CLASS. In this way, the gravitational effect of evolving radiation perturbations on the matter N-body particles can be taken into account.

Computations are performed in the Nb gauge, and in that gauge the impact of GR can be combined into an effective GR density perturbation $\delta_{GR}$ defined in the next paragraph. This GR density is added to the CDM density and passed to the Poisson solver of GADGET-2. This modifies the long-range particle-mesh part of the force whereas the short-range tree part of the force is left unchanged.

In detail, we can write for the combined force potential in the geodesic equation (19) that

$$-\phi + \gamma = -\phi_{\text{sim}} - \phi_{\text{GR}}, \quad (29a)$$

with

$$\nabla^2 \phi_{\text{sim}} = 4\pi G a^2 \bar{\rho}_{\text{cdm}} \delta_{\text{sim}}, \quad (29b)$$

$$\nabla^2 \phi_{\text{GR}} = 4\pi G a^2 \bar{\rho}_{\text{cdm}} \delta_{\text{GR}}, \quad (29c)$$

where $\bar{\rho}_{\text{cdm}}\delta_{\text{GR}} = \sum_{\alpha \neq \text{cdm}} \bar{\rho}_{\alpha}\delta_{\alpha} - (4\pi G a^2)^{-1}\nabla^2\gamma$, and $\delta_{\text{sim}}$ is the non-linear CDM density contrast obtained from the N-body simulation. We note that in this way COSIRA includes the linear effect from GR and radiation that is passed from the Einstein-Boltzmann code to the N-body code, but there is no feedback in the opposite direction. Such a feedback would occur as a non-linear correction that goes beyond the linear scheme employed in the Einstein-Boltzmann code.

Once $\delta_{\text{GR}}$ has been incorporated in GADGET-2, the code evolves matter in full non-linearity while being in accordance with leading order GR. This also implies that the N-body output of COSIRA should be interpreted on the Nb gauge space-time.

As mentioned above, the Nb gauge is so far only defined to the leading order in GR. As a consequence, COSIRA neglects some second-order GR corrections that gevolution does take into account. This applies, for instance, to the second-order anisotropic stress that contributes to $\chi$ in the non-linear regime as we shall discuss in Section 4.5.

## 3.2 Gevolution

Adamek et al. (2016a,b) introduced gevolution, the first cosmological N-body code that is based entirely on a weak-field expansion of GR. The two main differences to the traditional Newtonian method, which in some sense is also a weak-field limit of GR, are the following.

(i) In Poisson gauge, the code explicitly computes all six metric perturbations, i.e. the two potentials $\phi$ and $\psi$, the two spin-1 modes of $B_1$, and the two spin-2 modes of $h_{ij}$. No assumption about the stress-energy is made except for the requirement that the gravitational fields have to remain small on the scales resolved by the simulation. This provides great flexibility as one can consistently include many types of relativistic sources for which a Newtonian treatment would be inappropriate. The example relevant for this work is, of course, radiation.

(ii) The geodesic equation is solved using a relativistic canonical momentum such that arbitrary momenta are allowed (in particular the ultrarelativistic limit $q^2 \gg m^2a^2$).

One limitation of the code is the fact that it works at fixed spatial resolution, mainly because the metric perturbations are solved using spectral analysis. However, a fixed lattice has advantages for parallelization, and gevolution is therefore typically an order of magnitude faster than an adaptive code for the same problem size. Furthermore, it is straightforward to add a linear source term for which a transfer function can be computed using an Einstein-Boltzmann solver.

The most recent version 1.1 of gevolution, presented here for the first time, can be linked directly with the Einstein-Boltzmann code CLASS such that the relevant transfer functions can be computed on the fly. At each time step, a realization of the linear density field of radiation (or any other linear source such as e.g. light neutrinos) is prepared and added to the N-body (matter) source to obtain the right-hand side of equation (13). The same is done for the anisotropic stress that sources equation (12). Linear vector modes are not generated in standard cosmology and therefore frame dragging is only caused by non-linear matter according to equation (15).

It is also possible to run a Newtonian simulation with gevolution. In this mode, the evolution is performed in Nb gauge. Similar to how it is done in the Poisson-gauge case, but in contrast to COSIRA, the plain linear radiation source (in Nb gauge) is used in the Poisson equation (20) such that the potential $\phi$ is computed explicitly. A realization of $\gamma$ is then prepared separately for solving the geodesic equation (19). We remind the reader that COSIRA instead solves directly for the combination $\gamma - \phi$ using a modified Poisson equation.

## 3.3 Nm gauge and Newtonian simulations

Instead of employing a relativistic N-body simulation, the idea of the Nm gauge framework is to make use of a relativistic coordinate system that is compatible with ordinary Newtonian N-body simulations. In this picture, a Newtonian code is in fact computing the relativistic evolution of the particles in the corresponding Nm gauge, and we are able to obtain a relativistic interpretation of this simulation by embedding its output in the non-trivial space-time of the Nm gauge.

The method is compatible with any Newtonian simulation and does not require modifications of the corresponding code. In order to obtain results that can be compared with the direct implementation in the Nb gauge (or Poisson gauge) presented in the previous sections, however, we need to perform a gauge transformation to the respective reference gauge. This means, at the level of the final N-body output, that we displace the positions of the simulated particles to obtain the relativistic output in the Nb gauge (or Poisson gauge).

Since the Nm and Nb gauge employ the same time foliation, the required gauge transformation is purely spatial,

$$\tau_{\text{Nb}} = \tau_{\text{Nm}}, \quad (30a)$$

$$x_{\text{Nb}}^i = x_{\text{Nm}}^i + \nabla^i L_{\text{Nm} \to \text{Nb}}, \quad (30b)$$

where $L_{\text{Nm} \to \text{Nb}} = 3H_L^{\text{Nm}}$. Recall that we have chosen to initialize our simulations in Nm coordinates that agree initially with the Nb coordinates. The Nb gauge enforces $H_L^{\text{Nb}} = 0$, but the presence of radiation during the simulation run generates non-zero values of $H_L$ in the Nm gauge. Thus, the spatial gauge transformation (30b) to the Nb gauge resets $H_L^{\text{Nm}} \neq 0$ to $H_L^{\text{Nb}} = 0$, which can be verified by the standard methods of cosmological perturbation theory (see e.g. Villa & Rampf 2016). Further details on this gauge transformation and its computation in CLASS can be found in Fidler et al. (2016).
We compute the potential of the displacement field $L_{Nm} \to Nb$ corresponding to this gauge transformation in our modified version of CLASS. Since *gevolution* can be run in Newtonian mode, we employ the output of *gevolution* in this mode and pass the information of the gauge transformation from *CLASS* to *gevolution*. The gauge transformation is then implemented on the final output providing the particle positions in the Nb gauge.

The advantage of this method is that the step-size in the *N*-body simulation is unaffected by the small time-scale of the radiation perturbations that is taken into account consistently in the Einstein-Boltzmann solver. The disadvantage is that the non-linear growth of fluctuations induced from the radiation perturbations themselves are also included at the level of the space-time that is computed only to linear order. However, as discussed in previous works (Fidler et al. 2016; Brandbyge et al. 2017) and shown by the results presented in this paper, these corrections are negligible at least in a standard model cosmology.

# 4 RESULTS

Brandbyge et al. (2017) carried out a set of *N*-body simulations with COSIRA. These use a comoving box of size 16 384 Mpc $h^{-1}$ that contains $1024^3$ particles. The cosmology is chosen as follows: $\Omega_m = 0.3133$, $\Omega_b = 0.0490$, $h = 0.6731$, $n_s = 0.9655$ ($k_{\text{pivot}} = 0.05$ Mpc$^{-1}$), $A_s = 2.215 \times 10^{-9}$, $T_{\text{CMB}} = 2.7255$ K, $N_{\text{eff}} = 3.046$ (three massless neutrinos). To compare with these existing runs, we perform a new set of *N*-body simulations with *gevolution* using the same cosmological parameters and the same initial redshift $z_{\text{ini}} = 99$. Here, we choose a regular lattice of $2048^3$ grid points and the same number of particles in order to compensate for the lack of adaptive force resolution – *gevolution* employs a particle-mesh scheme on a fixed regular mesh while COSIRA inherits the TREEMPM algorithm from GADGET-2 that resolves the (Newtonian) force at subgrid scales. We have also run simulations with $512^3$, $1024^3$, and even $4096^3$ grid points and particles, to investigate thoroughly the convergence of our results.

## 4.1 Overview of simulations

We explore various choices of handling early radiation effects, summarized in Table 1, which are as follows.

(I) Using the 'Newtonian' mode of *gevolution*, we include the effect of radiation perturbations in the same manner as it is done in COSIRA. This yields a relativistic simulation output in the Nb gauge.

(II) Using the 'relativistic' mode of *gevolution*, which employs Poisson gauge, we include the effects of radiation perturbations in an analogous manner, but adapted to Poisson gauge as explained in Section 2.1. However, in order to compare the final result with the other runs, we have to convert it from Poisson gauge to Nb gauge. This is done by actively displacing the particles at final time

<table><caption>**Table 1.** Summary of simulations performed in order to study different possibilities of handling early radiation.</caption><thead><tr><td>Simulation</td><td>Gauge</td><td>Radiation treatment</td></tr></thead><tbody><tr><td>I</td><td><i>N</i>-body</td><td>Direct simulation</td></tr><tr><td>II</td><td>Poisson</td><td>Direct simulation</td></tr><tr><td>III</td><td>Newtonian motion</td><td>Post-processing</td></tr><tr><td>IV</td><td>Poisson</td><td>None</td></tr><tr><td>V</td><td><i>N</i>-body</td><td>None</td></tr><tr><td>VI</td><td><i>N</i>-body</td><td>None/backscaling</td></tr></tbody></table>

according to a linear displacement field $L_{P \to Nb}$, the spatial gauge generator that connects the two gauges.

(III) We run *gevolution* in 'Newtonian' mode, but instead of adding radiation perturbations in the simulation, we retroactively include radiation when interpreting the output in the Nb gauge. In order to compare the final result, we convert it from Nb gauge to the Nb gauge by a gauge transformation, connected by the displacement field $L_{Nb \to Nb}$.

(IV) We run *gevolution* in a 'relativistic' mode employing the Poisson gauge, but we completely neglect the presence of radiation perturbations. The final result is brought back to Nb gauge in the same way as for case (II). Note that this run does include other relativistic contributions in the Poisson gauge according to the weak-field expansion employed in *gevolution*.

(V) We run *gevolution* in 'Newtonian' mode neglecting the presence of radiation perturbations. As the Nb gauge equations in this limit are entirely Newtonian, this corresponds to a relativistic simulation in the Nb gauge when neglecting radiation perturbations.

(VI) We finally run another simulation in 'Newtonian' mode with *gevolution* where radiation perturbations are ignored in the evolution; however, starting on initial data that was designed to obtain the correct power spectrum at redshift $z=0$. For that purpose, the linear transfer functions are scaled back from $z=0$ to the initial redshift using the linear (growing-mode) solution of matter that would be obtained if radiation was only present in the background. In practice, this is one of the most common ways to deal with the effect of early radiation, and in the following we call this method 'backscaling'. See Fidler et al. (2017) for a thorough theoretical discussion on this method in terms of the Nb and Nb gauges.

The three cases (I)–(III) correspond exactly to the three different approaches discussed in the previous section that are designed to correctly include linear radiation effects, and each of them is related to a respective gauge discussed in Section 2. The other three cases (IV)–(VI) all ignore the effect of early radiation, but they differ in the choice of gauge or initial conditions. Hence, the induced errors in the evolution will be different for these three cases.

## 4.2 Radiation effect on matter power spectra

We present our main results in Fig. 1, where we compare the scenarios without radiation, cases (IV)–(VI), to the corresponding simulations that include radiation at four different redshifts. This illustrates the error introduced by neglecting radiation perturbations in the various schemes. All realizations use the same random numbers to set the perturbation amplitudes and phases, such that the ratio of numerical spectra is not affected by cosmic variance.

In case (IV), the evolution is solved in Poisson gauge, but the contribution of radiation to equations (9) and (11) is neglected. We compare this run (red, double dash dotted curve) against case (II), which is a simulation where radiation is included. The initial data are prepared using the linear transfer functions that include radiation perturbations. The error is therefore zero at initial time, builds up to a certain amplitude at high redshift, and then essentially stops evolving when radiation becomes more and more diluted.

Ignoring a physical effect is not a gauge-invariant operation and it can therefore make a difference in which coordinate system one chooses to neglect radiation perturbations. To illustrate this, we repeat the same exercise using Nb gauge for the evolution, where case (V) neglects the effects of radiation and case (I) includes them (light blue, dashed curve). We find that the error has a different shape and grows to about 4 per cent on the largest considered scales. For
<figure><img src="image_4.png" /><figcaption>**Figure 1.** This figure shows the relative change in the Nb-gauge matter power spectrum at different redshifts for our simulations that did not include radiation effects, compared to those that did include them. For the red (double dash dotted) curve, the simulations were carried out in Poisson gauge, cases (II) and (IV) in the text, but we still show the ratio of the Nb-gauge power spectra. The light blue (dashed) curve shows the analogous result if the simulations are performed directly in Nb gauge, cases (I) and (V). A comparison with the dark blue (dot-dashed) curve shows that nearly identical results are obtained with COSIRA, and serves as a validation of the two independent numerical implementations. The orange (solid) curve finally shows a simulation in Nb gauge where, instead of including radiation in the dynamics, the initial data were manipulated in such a way that the error on the linear power spectrum is cancelled at redshift $z = 0$, a method called 'backscaling' or case (VI).</figcaption></figure>

comparison, we also plot the results that Brandbyge et al. (2017) obtained with COSIRA (dark blue, dot-dashed curve). Apart from the first data point that they already had noticed to be somewhat off we find a very good agreement between the two codes.

In our final example, we discuss the common procedure to handle early radiation effects. As noted above, for cases (IV) and (V), we have zero error on the power spectrum at the initial time, and consequently the improper handling of radiation causes the power spectrum to be offset from the true solution at later times. Given that most of the observations of large-scale structure are taken at low redshift, it actually seems more natural to impose a vanishing error at late time, e.g. at redshift $z = 0$. Since early radia-

tion affects only linear scales, this can be achieved by the following procedure. First, compute the linear matter power spectrum at $z = 0$ using a Boltzmann code, fully taking into account radiation. Next, solve the linear mode equations for matter perturbations for the given cosmological background, however, assuming that radiation has no perturbations at all. Finally, use the linear growing-mode solution for matter to scale the transfer functions from $z = 0$ back to the initialization redshift of the simulation. This is the backscaling procedure that is commonly applied in the literature.

With this procedure, the initial transfer functions will no longer agree with the relativistic ones, but they are designed in such a way
that the error introduced in the evolution by neglecting radiation is cancelled out at low redshift. A more detailed discussion of this method is presented in Fidler et al. (2017), where it is shown that this method works best using the present-day Nb gauge power spectrum. For this reason, we compare the results obtained in scenario (VI) with the relativistic simulation (I) in the Nb gauge. Our plot confirms that the error at the present time is vanishing, while at high redshifts a mismatch of several percent is found on large scales.

## 4.3 Linear post-processing

A separate issue we want to discuss briefly is the numerical error that can be introduced by acting a gauge transformation on the final particle configuration. By its nature, a linear gauge transformation is only applicable in the linear regime. However, in the particular scenario studied in this paper, the relativistic effects only appear on very large scales that remain linear to a high degree even down to redshift $z=0$. If we were to consider a situation where smaller scales would be affected, as could be the case in some inhomogeneous dark energy models or models of modified gravity for example, the linear relation between Poisson and Nb gauge would be lost. In such a situation, the Poisson gauge provides a framework where relativistic effects can be studied even at non-linear scales. The Nb or Nm gauge framework are so far only defined to first order and it remains to be seen whether they provide a useful concept in such an analysis.

Fig. 2 compares scenarios (I) and (II) that both include radiation but are evolved in different gauges. The ratio of power spectra is taken after the gauge transformation to Nb gauge, and we expect a ratio of unity if physical results do not depend on the coordinate system used for the calculation. Indeed, for the reasons noted above, we find very good agreement between the simulations in the two gauges. A small disagreement of less than a percent is visible at the smallest scales, but this is probably due to discretization effects, as we see the effect decreasing if we increase the resolution. One might wonder if the next-to-leading order weak-field effects, in particular frame dragging or the anisotropic stress of dark matter, could also play a role on those scales. After all, these effects are taken into

<figure><img src="image_5.png" /><figcaption>**Figure 2.** Comparison of two simulations that both include radiation, cases (I) and (II). The first simulation is performed directly in Nb gauge, whereas the second is performed in the Poisson gauge and subsequently converted to the Nb gauge by acting a gauge transformation on the final particle positions. Since both simulations contain the same linear physics and the scales plotted are all in the linear regime, the ratio is unity up to errors introduced by the gauge transformation and the discretization.</figcaption></figure>

account in case (II) but are neglected in case (I). However, these relativistic effects have a much smaller impact on the matter power spectrum, and are well below the permille level.

A somewhat larger disagreement between cases (I) and (II) appears at the largest scales and is of completely different origin. Here, we are confronted with the situation that the matter perturbations have very little power in Nb gauge, while the perturbations in Poisson gauge approach a nearly scale-invariant spectrum outside the horizon. This relatively large perturbation has to be taken off by the gauge transformation that takes the Poisson gauge to Nb gauge, and achieving this to high precision can be difficult numerically. The numerical error is exacerbated by the fact that we are showing the relative power in Nb gauge where the power itself is small. Taking all this into account, we think that the agreement between cases (I) and (II) is very convincing.

As will become evident in the next subsection, the gauge transformation required in our scenario (III) that connects Nm gauge and Nb gauge is much less problematic, mainly due to the fact that the two gauges are much more closely related.

## 4.4 Application of the Nm gauge

Scenario (III), which employs the Nm gauge, does not fit into the above comparisons as it is non-sensical to neglect radiation in an Nm gauge. In Fig. 3, we compare the output of case (III) before and after the gauge transformation to case (I) in the Nb gauge. Before the gauge transformation, case (III) is effectively identical to a Newtonian simulation and thus does not reproduce the results of the relativistic simulation (I). It does however match the comparison of the Newtonian power spectrum with the Nb gauge power spectrum at linear order performed in *CLASS* to great accuracy. After displacing the particles according to the gauge transformation to the Nb gauge, we find a remarkable agreement with the results of simulation (I) with errors significantly below the per cent level on all examined scales. On small (very non-linear) scales, radiation effects are

<figure><img src="image_6.png" /><figcaption>**Figure 3.** The cyan (dashed) line shows the matter power spectrum at redshift $z=0$ of a Newtonian simulation that ignored radiation perturbations, relative to a simulation that included those perturbations in Nb gauge. As shown, this discrepancy is well described by a linear prediction computed in *CLASS* (blue, dot-dashed line). It can be accounted for by interpreting the result in terms of the Nm gauge. To demonstrate this, the red (solid) line shows the matter power spectrum after the particles have been displaced according to the gauge transformation that brings them from Nm gauge back to Nb gauge. The *N*-body simulations for this plot were performed with *gevolution*, and the linear transfer function for the gauge generator was provided through a modified version of *CLASS*.</figcaption></figure>
<figure><img src="image_7.png" /><figcaption>**Figure 4.** Shown is the dimensionless power spectrum of $\chi$ at different redshifts. The solid red line is the linear contribution coming from radiation (photons and massless neutrinos). The dashed red line shows the second-order contribution from CDM and geometry, as computed in Appendix. The solid blue line is the one found in a numerical simulation with *gevolution*. The dotted violet line shows the dimensionless power spectrum of $\gamma$ for comparison.</figcaption></figure>

generally negligible, while on the larger scales the linear approximation of the Nm gauge metric potentials is a good approximation.

Note that an alternative version of the Nm gauges defined in Fidler et al. (2017) exists, which eliminates the error of the commonly employed backscaling method (VI) compared to the full Nb gauge simulation (I) by a similar gauge transformation.

## 4.5 Anisotropic stress

A hallmark feature of relativistic physics is the presence of two distinct gravitational potentials. Free-streaming photons and neutrinos (which are taken massless in our study) generate anisotropic stress even at first order, sourcing $\chi$ according to equation (11). This first-order contribution is gauge-invariant and appears in Nb gauge as a contribution to $\gamma$; see equation (21). The anisotropic stress of matter vanishes at first order, but it appears at higher order. While its second-order contribution to $\chi$ can be computed perturbatively (see Appendix), *gevolution* can construct it non-perturbatively from the N-body ensemble. At this order, a new geometric contribution from the weak-field expansion has to be taken into account as well; see equation (12). Since the Nb gauge framework is only developed up to leading order, we can do this computation so far only in Poisson gauge.

Fig. 4 shows the dimensionless power spectrum of $\chi$, defined in equation (A5), at four different redshifts. We show separately the first-order contribution from radiation and the second-order contribution computed in Appendix, as well as the total (first-order radiation plus second-order weak-field plus non-perturbative N-body contributions) found in the N-body simulation. On the scales covered by the simulation, we find excellent agreement with the perturbative results. Non-perturbative effects would only show up on even smaller scales than what is resolved in these simulations. For comparison, we also show the power spectrum of $\gamma$, computed only

to first order since we have no second-order expression at hand. It turns out that $\gamma$ is typically about one order of magnitude larger than $\chi$ on intermediate scales. Nevertheless, its (first-order) amplitude eventually drops below the second-order result for $\chi$, indicating that a first-order calculation may no longer be meaningful beyond those scales. However, for both, $\chi$ and $\gamma$, the overall amplitude decreases dramatically on small scales, and their effect can eventually be neglected.

## 5 SUMMARY AND CONCLUSIONS

We have presented a detailed study that investigates the effect of early radiation perturbations on the matter power spectrum at various times. We have tested three methods that incorporate radiation, i.e. by the use of (1) the hybrid N-body code COSIRA, (2) the relativistic N-body code *gevolution* and (3) the framework of Nm gauges. The last method does not require a modification of the Newtonian N-body approach itself and includes, as a limit, the commonly applied method to use modified initial data obtained through ‘backscaling’.

In more detail, the hybrid code COSIRA modifies the N-body TREEPM-code GADGET-2 and couples it to the linear Einstein-Boltzmann code CLASS. Radiation perturbations and GR effects are incorporated to the leading order, and the N-body output is given in Nb gauge. The second method is the relativistic N-body particle-mesh code *gevolution*, which includes GR corrections up to second order in the weak-field expansion in Poisson gauge. The linear effects of radiation are also obtained by interfacing the code with CLASS. Method (3) is the Nm gauge framework that retroactively applies linear radiation and GR effects to unmodified Newtonian N-body simulations. Here, the output of the simulation is to be interpreted within the Nm gauge, and the respective linear (metric) perturbations are determined with a modified version of CLASS. This includes the method of backscaling where Newtonian simulations are initialized by using an appropriately rescaled present-day matter power spectrum.

To compare the various methods – which make use of different gauges – we transformed the simulation outputs to Nb gauge (if required). For this, we have applied an active linear gauge transformation on the final particle positions that displaces the particles to the correct final positions in the Nb gauge. We have determined the required gauge generators by using a modified version of CLASS.

Our main results are summarized in Figs 1–3, where we take ratios of power spectra of the various methods that neglect/incorporate radiation. From Fig. 1, it is evident that the two relativistic codes COSIRA and *gevolution* agree very well, which gives us confidence that the two independent numerical implementations produce valid results. Only on very large scales, there is a slight discrepancy between the codes that results from insufficient number of particles in the simulation carried out with COSIRA. Furthermore, it is interesting to note that the results obtained in Poisson gauge (here by *gevolution*) are only very mildly affected by the presence of radiation perturbations, at most an effect of about 1 per cent. In the Nb gauge, by contrast, the impact of radiation is up to 4 per cent (for an initial redshift of $z_{\text{ini}} = 99$) on large scales. For a standard ΛCDM universe, the backscaling method works very accurately at the present time when interpreting the output in the Nb gauge; however, this simple interpretation is lost at the earlier times. A correct interpretation can still be achieved by employing the appropriate Nm gauge metric. In Fig. 3, we show our results obtained from the Nm gauge framework, where the impact of radiation is added to a
Newtonian simulation as a post-processing. The results we obtain agree at better than per cent-level accuracy on all studied scales.

In conclusion, we have established a comprehensive picture of the effects of early radiation in relativistic N-body simulations. These effects appear on very large scales that can be treated linearly even at the present time. Using a relativistic framework, it is therefore straightforward to take them into account, and we have shown three different implementations that lead to similar results. We have also verified that the backscaling approach accurately describes the matter power spectrum in the Nb gauge, with corrections from the full Nm metric relevant only on very large scales and smaller than a few per cent, provided that the initialization redshift of the simulation is below z ≃ 99. Furthermore, we have verified that the backscaling method accurately simulates the evolution of the baryonic acoustic oscillation (BAO) feature. For this, we have investigated the two-point matter correlation function for the various methods and found no significant discrepancy.

Perhaps, it is relevant here to have a closer look at whether ignoring GR and radiation perturbations could potentially be an observable effect in upcoming surveys. Since the effect grows with increasing length-scale, it mainly affects surveys with large volumes, i.e. photometric surveys, rather than spectroscopic surveys that typically have smaller effective volumes but allow for very accurate reconstruction of the BAO feature. The largest such survey currently planned is the photometric redshift survey component of the Euclid satellite mission (Laureijs et al. 2011). As a very crude estimate of the precision with which the matter power spectrum can be probed at a given wavenumber k, we can use the approximate relation ΔP(k)/P(k) ∼ [Veffk$^3$/(2π)$^3$]$^{1/2}$ with an effective survey volume Veff of approximately 1000 Gpc$^3$, which yields ΔP(k)/P(k) ∼ 0.015 (k/0.01 h Mpc$^{-1}$)$^{-3/2}$. At k ∼ 0.01 h Mpc$^{-1}$, we thus find ΔP(k)/P(k) ∼ 0.015 and at 0.001 we get ΔP(k)/P(k) ∼ 0.5. Clearly, the effect of early radiation is at most marginally observable with Euclid data. However, future 21-cm surveys potentially have significantly larger effective volumes and in this case the effect is potentially both important and directly observable.

Finally, we note that the methods presented in this paper could be used to study other types of (linear) relativistic effects that could occur, e.g. in models with inhomogeneous dark energy or other exotic sources of perturbations.

*Code availability.* A new release of *gevolution* that includes the treatment of radiation effects is available on a public *GIT* repository.<fnref n="4" /> The radiation module requires *CLASS* to be linked as a library. We recommend to use the most recent public release. The modified version of *CLASS* computing the Nm gauge potentials and gauge transformations is available upon request.

## ACKNOWLEDGEMENTS

We thank Vincent Desjacques for useful discussions. This work was supported by a grant from the Swiss National Supercomputing Centre (CSCS) under project ID s710. CF is supported by the Wallonia-Brussels Federation grant ARC11/15-040 and the Belgian Federal Office for Science, Technical & Cultural Affairs through the Interuniversity Attraction Pole P7/37. CR is supported by the DFG through the SFB-Transregio TRR33 ‘The Dark Universe’. JB, TT and SH acknowledge support from the Villum Foundation.

## REFERENCES

* Adamek J., Durrer R., Kunz M., 2014, Class. Quantam Grav., 31, 234006

* Adamek J., Daverio D., Durrer R., Kunz M., 2016a, Nature Phys., 12, 346

* Adamek J., Daverio D., Durrer R., Kunz M., 2016b, J. Cosmol. Astropart. Phys., 1607, 053

* Arnowitt R. L., Deser S., Misner C. W., 2008, Gen. Relativ. Gravit., 40, 1997

* Ballesteros G., Hollenstein L., Jain R. K., Kunz M., 2012, J. Cosmol. Astropart. Phys., 1205, 38

* Bardeen J. M., 1980, Phys. Rev. D, 22, 1882

* Bentivegna E., Bruni M., 2016, Phys. Rev. Lett., 116, 251302

* Bernardeau F., Colombi S., Gaztañaga E., Scoccimarro R., 2002, Phys. Rep., 367, 1

* Blas D., Lesgourgues J., Tram T., 2011, J. Cosmol. Astropart. Phys., 1107, 034

* Brandbyge J., Rampf C., Tram T., Leclercq F., Fidler C., Hannestad S., 2017, MNRAS, 466, L68

* Bruni M., Thomas D. B., Wands D., 2014, Phys. Rev. D, 89, 044010

* Buchert T., Räsänen S., 2012, Ann. Rev. Nucl. Part. Sci., 62, 57

* Buchert T., Nayet C., Wiegand A., 2013, Phys. Rev. D, 87, 123503

* Fidler C., Rampf C., Tram T., Crittenden R., Koyama K., Wands D., 2015, Phys. Rev. D, 92, 123517

* Fidler C., Tram T., Rampf C., Crittenden R., Koyama K., Wands D., 2016, J. Cosmol. Astropart. Phys., 1609, 031

* Fidler C., Tram T., Rampf C., Crittenden R., Koyama K., Wands D., 2017, J. Cosmol. Astropart. Phys., preprint (arXiv:1702.03221)

* Giblin J. T., Mertens J. B., Starkman G. D., 2016, Phys. Rev. Lett., 116, 251301

* Green S. R., Wald R. M., 2012, Phys. Rev. D, 85, 063512

* Hahn O., Angulo R. E., 2016, MNRAS, 455, 1115

* Kodama H., Sasaki M., 1984, Prog. Theor. Phys. Suppl., 78, 1

* Laureijs R. et al., 2011, ESA report number: ESA-SRE(2011)12

* Lewis A., Challinor A., Lasenby A., 2000, ApJ, 538, 473

* Lu T. H.-C., Ananda K., Clarkson C., Maartens R., 2009, J. Cosmol. Astropart. Phys., 0902, 023

* Ma C.-P., Bertschinger E., 1995, ApJ, 455, 7

* Mertens J. B., Giblin J. T., Starkman G. D., 2016, Phys. Rev. D, 93, 124059

* Springel V., 2005, MNRAS, 364, 1105

* Teysnier R., 2002, A&A, 385, 337

* Villa E., Rampf C., 2016, J. Cosmol. Astropart. Phys., 1601, 030

* Voruz L., Lesgourgues J., Tram T., 2014, J. Cosmol. Astropart. Phys., 1403, 004

## APPENDIX: SECOND-ORDER CONTRIBUTIONS TO $\chi$

Deep inside the horizon and after the end of radiation domination the linear source terms for $\chi$ decay and the non-linear contributions start to dominate. Here, we present a perturbative calculation of these contributions that is accurate to second order and hence valid for mildly non-linear scales (see also Ballesteros et al. 2012). To this end, we estimate the right-hand side of equation (12) by inserting the linear solutions that can be computed with a Boltzmann code. In particular, for non-relativistic matter, the stress is approximately given by

$$ \delta_{jk} T_i^k = \bar{\rho} \nabla_i v \nabla_j v, \qquad (A1) $$

where $v$ is the linear velocity potential. Pressureless matter, even if it behaves like a perfect fluid, produces some anisotropic stress when you look at it in a frame other than its rest frame. Defining a time-dependent density parameter

$$ \Omega = \frac{8\pi G a^2 \bar{\rho}}{3H^2}, \qquad (A2) $$

<footnote n="4">⁴ https://github.com/gevolution-code/gevolution-1.1.git</footnote>
and moving to Fourier space, equation (12) becomes

$$ \chi_k = \frac{1}{k^4(2\pi)^{3/2}} \int d^3\mathbf{q} \left[ \phi_q \phi_{k-q} + \frac{3}{2} \mathcal{H}^2 \Omega v_q v_{k-q} \right] \\ \times \left[ 3(\mathbf{q} \cdot \mathbf{k})^2 - 2k^2(\mathbf{q} \cdot \mathbf{k}) - k^2 q^2 \right]. \qquad (A3) $$

Note that we use the unitary Fourier convention. The linear perturbation variables $\phi_k$ and $v_k$ are related to the initial amplitude of the gauge-invariant curvature perturbation $\zeta_k^{\text{in}}$ through linear transfer functions,

$$ \phi_k(\tau) = \zeta_k^{\text{in}} T_k^{\phi}(\tau), \quad v_k(\tau) = \zeta_k^{\text{in}} T_k^{\nu}(\tau). \qquad (A4) $$

Let us also define the dimensionless power spectrum $\Delta^\zeta(k)$ as

$$ 4\pi k^3 \langle \zeta_k \zeta_{k'} \rangle_c = (2\pi)^3 \delta_D^{(3)}(\mathbf{k} + \mathbf{k}') \Delta^\zeta(k), \qquad (A5) $$

and similarly for other scalar quantities. With this definition and our Fourier convention, the normalization of $\Delta(k)$ agrees with the one chosen by Bernardeau et al. (2002). A straightforward calculation gives the following expression for the power spectrum of $\chi$,

$$ \Delta^{\chi}(k) = \frac{1}{2\pi k^5} \int d^3\mathbf{q} \left[ T_q^{\phi} T_{|k-q|}^{\phi} + \frac{3}{2} \mathcal{H}^2 \Omega T_q^{\nu} T_{|k-q|}^{\nu} \right]^2 \\ \times \frac{\Delta^{\zeta, \text{in}}(q)}{q^3} \frac{\Delta^{\zeta, \text{in}}(|\mathbf{k} - \mathbf{q}|)}{|\mathbf{k} - \mathbf{q}|^3} \left[ 3(\mathbf{q} \cdot \mathbf{k})^2 - 2k^2(\mathbf{q} \cdot \mathbf{k}) - k^2 q^2 \right]^2. \qquad (A6) $$

At this point, we would like to add a remark concerning the choice of metric parametrization. It was noted by Adamek, Durrer & Kunz (2014) that a similar calculation for a slightly different definition of $\chi$, related to the metric parametrization of Green & Wald (2012, see also our footnote 1) that was followed also in *gevolution* prior to the latest version 1.1, gives an integral expression that is divergent in the infrared. This implies that the two-point correlation for $\chi$ (in that parametrization) does not have a good fall-off behaviour at infinity. The divergence can be traced back to the appearance of a term like $\delta_{ij}\phi\nabla^2\phi$ in the equation that determines $\chi$. Such a term is absent in our corresponding equation (12), and the integral above therefore has no infrared problem. This is an additional motivation for choosing the exponential metric parametrization.

To clarify this point more explicitly, let us formally expand the potentials as

$$ \phi = \phi^{(1)} + \phi^{(2)} + \dots, \qquad (A7a) $$

$$ \psi = \psi^{(1)} + \psi^{(2)} + \dots, \qquad (A7b) $$

and let us do the same for the potentials $\Phi$ and $\Psi$ used by Adamek et al. (2014). Comparing the line elements, equation (1) in their

work and our equation (6), we establish

$$ \Phi^{(1)} = \phi^{(1)}, \qquad (A8a) $$

$$ \Psi^{(1)} = \psi^{(1)}, \qquad (A8b) $$

$$ \Phi^{(2)} = \phi^{(2)} - (\phi^{(1)})^2, \qquad (A8c) $$

$$ \Psi^{(2)} = \psi^{(2)} + (\psi^{(1)})^2. \qquad (A8d) $$

Therefore, $(\Phi - \Psi)$ and $(\phi - \psi)$ are the same at first order and correspond to the gauge-invariant quantity of equation (11), whereas they clearly differ at second order due to the reparametrization. Furthermore, the second-order contribution does not correspond to a gauge-invariant quantity – we simply compute it in a specific gauge. In this appendix, we estimate $\chi^{(2)} = \phi^{(2)} - \psi^{(2)}$, which differs from $(\Phi^{(2)} - \Psi^{(2)})$ by a term quadratic in the first-order potentials. It is the latter that causes an infrared problem.

In order to evaluate the convolution integral of equation (A6) numerically, it is convenient to employ a variable transformation $w = q/k$, $u = \sqrt{1 - 2w\mu + w^2}$, where $\mu$ is the cosine of the angle between $\mathbf{k}$ and $\mathbf{q}$ (e.g. Lu et al. 2009, appendix C). The azimuth angle can be integrated out directly, leaving us with

$$ \Delta^{\chi}(k) = \int_{0}^{\infty} \frac{dw}{w^2} \int_{|w-1|}^{w+1} \frac{du}{u^2} \left[ T_{kw}^{\phi} T_{ku}^{\phi} + \frac{3}{2} \mathcal{H}^2 \Omega T_{kw}^{\nu} T_{ku}^{\nu} \right]^2 \Delta^{\zeta, \text{in}}(kw) \\ \times \Delta^{\zeta, \text{in}}(ku) \left( \frac{1}{4} + \frac{1}{2}w^2 + \frac{1}{2}u^2 + \frac{3}{2}w^2u^2 - \frac{3}{4}w^4 - \frac{3}{4}u^4 \right)^2. \qquad (A9) $$

As noted at the beginning of this section, this result is valid if the first-order contributions to $\chi$ are subdominant. Of course, there exists a regime where first- and second-order contributions are of similar amplitude. In this case, one can simply add the two contributions, noting that their cross-correlation has to vanish in perturbation theory if one assumes Gaussian initial conditions for $\zeta$.

This paper has been typeset from a TeX/Latex file prepared by the author.