# Perturbed redshifts from N-body simulations

Julian Adamek

► To cite this version:

Julian Adamek. Perturbed redshifts from N-body simulations. Physical Review D, 2018, 97 (2), pp.021302. 10.1103/PhysRevD.97.021302. hal-01703827

HAL Id: hal-01703827

https://hal.science/hal-01703827

Submitted on 19 Jan 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished 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_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Perturbed redshifts from N-body simulations

Julian Adamek*

Laboratoire Univers et Théories, Observatoire de Paris—PSL Research
University—CNRS—Université Paris Diderot—Sorbonne Paris Cité,
5 place Jules Janssen, 92195 Meudon CEDEX, France

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

(Received 31 August 2017; published 19 January 2018)

In order to keep pace with the increasing data quality of astronomical surveys the observed source redshift has to be modeled beyond the well-known Doppler contribution. In this article I want to examine the gauge issue that is often glossed over when one assigns a perturbed redshift to simulated data generated with a Newtonian N-body code. A careful analysis reveals the presence of a correction term that has so far been neglected. It is roughly proportional to the observed length scale divided by the Hubble scale and therefore suppressed inside the horizon. However, on gigaparsec scales it can be comparable to the gravitational redshift and hence amounts to an important relativistic effect.

DOI: 10.1103/PhysRevD.97.021302

## I. INTRODUCTION

While the standard analysis of redshift space perturbations [1] only contains the leading Doppler term, recent and future galaxy surveys have or will have sufficient statistical power to detect subleading terms such as gravitational redshift, weak lensing, transverse Doppler shift, time delays, etc. These include general relativistic effects that are interesting targets for testing gravity at cosmological scales. For instance, a first detection of gravitational redshift in galaxy clusters has been claimed in [2]. Perturbation theory can be used to understand these effects analytically (e.g., [3]), and many results have been derived in longitudinal gauge. However, their application to N-body simulations requires due care with respect to how the data are mapped to the relativistic spacetime.

One possibility is to run relativistic simulations directly in longitudinal gauge [4], but the use of Newtonian N-body codes is by far the more common practice. Coming from the Newtonian world it is not immediately clear how their results should be interpreted in a relativistic context (e.g., [5–7]). In [8] it was finally realized that one can specify a gauge, the so-called “N-body gauge,”<fnref n="1" /> in which the relativistic equations are formally identical to the Newtonian ones, therefore providing a framework for a fully relativistic interpretation of Newtonian simulations. The same authors went on to analyze initial conditions in this framework, showing that the usual recipes are consistent with general relativity as well [9].

The issue has so far mostly been discussed in relation to the matter power spectrum, and the implications for the perturbed redshift and some other observables have therefore not yet been fully appreciated. In the recent literature the redshift formula of longitudinal gauge is often directly applied to N-body simulation data, thereby disregarding the fact that these are not provided in the appropriate coordinate system. For instance, [10,11] do not account for this aspect, but I show that the correction is fortunately very small on the scales they are interested in. While the gauge issue is noted in [12] where a correction term is applied to the density perturbation [see their Eq. (17)], the redshift of individual sources is still computed without such a correction [see their Eqs. (9) and (10)]. In the following I wish to clarify this issue by studying the coordinate transformations involved, and finally by deriving the correct formulas for the perturbed redshift in N-body gauge. I show that a small correction term due to the spatial coordinate transformation appears and should, in principle, be included in the analysis. However, this term only becomes relevant on extremely large scales.

## II. WEAK-FIELD METRIC

Astrophysical objects with high compactness exist on scales ≲0.01 parsec (the largest known supermassive black holes), while on extremely large scales ≳100 megaparsec the Universe can be described entirely in terms of linear equations. In between these two extremes there lies a vast range of scales where the distribution of matter can be very inhomogeneous but the gravitational fields are weak, and the geometry is therefore only weakly perturbed. This empirical fact is confirmed every time we point a telescope at the sky and observe that most rays seem to propagate along almost straight paths.

<footnote>* julian.adamek@obspm.fr</footnote>

<footnote n="1">¹In fact, [7] had already discovered “half of” the necessary coordinate transformation, leading to what they called “Newtonian matter gauge.” The spatial part of the transformation is however different from the N-body gauge, leading to a non-vanishing volume perturbation.</footnote>
It is therefore possible to describe the dynamics on those scales in terms of the nonlinear evolution of matter on a geometry with a linearly perturbed metric. Of course, as for any geometry, there also exist many coordinate systems in which the metric takes a wildly nonlinear form. A particularly well-known coordinate system in which the smallness of the geometric perturbation is carried into effect is the one of the longitudinal gauge. For the purpose of a more general discussion I adopt the notation introduced in [13] and write the generic line element for a metric with linear scalar perturbations on top of a Friedmann-Lemaître model as

$$ds^2 = a^2(\tau) \left[ -(1+2A)d\tau^2 + (1+2H_L)\delta_{ij}dx^i dx^j - 2\nabla_i B dx^i d\tau - 2\left(\nabla_i \nabla_j - \frac{1}{3}\delta_{ij}\Delta\right)H_T dx^i dx^j \right], \quad (1)$$

where $a(\tau)$ is the scale factor, $\tau$ and $x^i$ are conformal time and comoving coordinates on the spacelike hypersurface, respectively, and $A, B, H_L, H_T$ are scalar functions describing perturbations. Vector and tensor perturbations are not discussed here. A setting is said to be weak field if there exists a coordinate system for which all the above perturbation variables are small, i.e., $|A|, |H_L|, \sqrt{\nabla_i B \nabla^i B}$, $\sqrt{\nabla_i \nabla_j H_T \nabla^i \nabla^j H_T - (\Delta H_T)^2}/3 \ll 1$. One can then find other such coordinate systems by making a small change of coordinates, generated by two scalar fields $T$ and $L$, so that $\tau \to \tau + T$ and $x^i \to x^i + \nabla^i L$. This shows that the four scalar perturbations only contain two physical modes. The longitudinal gauge is obtained by choosing $T$ and $L$ such that $B = H_T = 0$, leaving only the lapse perturbation $A = \Psi$ and the volume perturbation $H_L = \Phi$, where the two potentials $\Psi$ and $\Phi$ denote precisely the two physical modes when written as first-order gauge-invariant expressions. The typical amplitude of these perturbations is $\sim 10^{-5}$ in our Universe, except for the vicinity of black holes or neutron stars where the weak-field description breaks down.

In longitudinal gauge the Hamiltonian constraint reads

$$-\Delta\Phi + 3\mathcal{H}\Phi' - 3\mathcal{H}^2\Psi = 4\pi G a^2 \delta\rho, \quad (2)$$

where $\mathcal{H}$ is the conformal Hubble rate, a prime denotes partial derivative with respect to $\tau$, and the equation is linearized in $\Phi$ and $\Psi$ but not in $\delta\rho$. In fact, the matter perturbation $\delta\rho$ can be very large, but it is computed and evolved on a linearly perturbed geometry. This equation is however not the one used in a Newtonian $N$-body code. First, such a code uses counting densities that are not corrected for perturbations of the volume element— Newtonian theory assumes Euclidean geometry. Second, the Poisson equation lacks some of the terms featured on the left-hand side.

From now on I restrict the discussion to the case where gravitational fields are sourced exclusively by nonrelativistic matter. In this case anisotropic stress can be neglected, implying $\Phi = -\Psi$.

### III. PERTURBED REDSHIFT IN LONGITUDINAL GAUGE

The effect of geometry (and perturbations thereof) on observables can be understood by studying the geodesics of photons that reach the observation event. Let me denote the tangent vector of such a geodesic as $k^\mu$. The condition $g_{\mu\nu}k^\mu k^\nu = 0$ implies that $k^i/k^0 = n^i(1+2\Psi)$, where $n^i$ is the unit vector ($\delta_{ij}n^i n^j = 1$) pointing in the direction the photon is traveling. The geodesic equation can then be expressed as an evolution equation for the energy,

$$\frac{d \ln k^0}{d\tau} = -2\mathcal{H} - 2n^i \nabla_i \Psi, \quad (3)$$

and an equation describing the deflection of the ray,

$$\frac{dn^i}{d\tau} = -2(\delta^{ij} - n^i n^j)\nabla_j \Psi. \quad (4)$$

A reference clock is specified through a unit timelike vector $u^\mu = a^{-1}(1-\Psi, v^i)$ where $v^i = dx^i/d\tau$ is the peculiar (coordinate) velocity of the clock's rest frame. In such a frame, the measured photon energy is $-g_{\mu\nu}u^\mu k^\nu$. A first integral of Eq. (3) yields the following expression for the observed redshift between source (src) and observer (obs):

$$1 + z = \frac{g_{\mu\nu} u^\mu k^\nu|_{\text{src}}}{g_{\mu\nu} u^\mu k^\nu|_{\text{obs}}} = \frac{a_{\text{obs}}}{a_{\text{src}}} \left( 1 + n_i v_{\text{obs}}^i - n_i v_{\text{src}}^i + \Psi_{\text{obs}} - \Psi_{\text{src}} - 2 \int_{\text{src}}^{\text{obs}} \Psi' d\chi \right). \quad (5)$$

Here $d\chi$ is a conformal distance element along the photon path. The redshift perturbations are easily identified as the Doppler shift due to peculiar motion, the gravitational redshift due to time dilation, and the Rees-Sciamma effect (also known as integrated Sachs-Wolfe effect in the context of linear theory).

The boundary terms in this expression have to be evaluated at the coordinate time at which the photon geodesic actually intersects the world lines of source and observer. The time of flight of the photon is affected by the Shapiro delay, which for a coordinate distance $\chi$ between source and observer is given by the following relation:

$$\begin{aligned} \chi &= \int_{\text{src}}^{\text{obs}} d\chi = \int_{\text{src}}^{\text{obs}} (1+2\Psi)d\tau \\ &= \tau_{\text{obs}} - \tau_{\text{src}} + 2 \int_{\text{src}}^{\text{obs}} \Psi d\chi. \end{aligned} \quad (6)$$
IV. FROM LONGITUDINAL TO N-BODY GAUGE

Given a linearly perturbed geometry specified in longi-
tudinal gauge I now make a small change of coordinates to
set $H_L = 0$. Considering the Lie derivative of the metric
tensor the required transformation is generated by $T$, $L$ that
satisfy

$$
\mathcal{H}T + \frac{1}{3} \Delta L = \Psi. \qquad (7)
$$

I furthermore choose $L' = 0$ such that velocities are not
transformed. In this new coordinate system one finds
$B = T$ and $H_T = -L$. It is important to verify that these
new perturbations do not violate the weak-field conditions.<fnref n="2" />
As explained below, $L$ is chosen such that $\Delta L$ is of order $\Psi$,
and hence the same is true for the perturbations generated
by $H_T$. One can then easily convince oneself that $\nabla_i T$ is
of the order of a peculiar velocity—in fact, it coincides
with the Zel'dovich approximation thereof—and therefore
$\sqrt{\nabla_i B \nabla^i B} \sim v \lesssim 10^{-3}$ at low redshift. The shift perturba-
tion in the new coordinate system is therefore substantially
larger than $\Psi$, but still comfortably within the weak-field
regime. The lapse perturbation becomes

$$
A = \Psi + \mathcal{H}T + T', \quad (8)
$$

and as explained shortly I arrange that it vanishes at
leading order.

The Hamiltonian constraint becomes

$$
\Delta \left( \mathcal{H}B - \frac{1}{3} \Delta H_T \right) + 3\mathcal{H}^2 A = 4\pi G a^2 \delta\rho, \quad (9)
$$

and as a consequence of $H_L = 0$ the density perturbation $\delta\rho$ can be obtained simply by counting the mass elements per coordinate volume, in accordance with the procedure relevant for Newtonian codes. For nonrelativistic particles the geodesic equation reduces to

$$
\frac{dv^i}{d\tau} + \mathcal{H}v^i = \nabla^i(\mathcal{H}B + B' - A). \quad (10)
$$

Since I assume that matter is nonrelativistic and hence the
pressure perturbation can be neglected, the spatial trace of
Einstein's equations yields

$$
\mathcal{H}A' - \left( \mathcal{H}^2 - 2 \frac{a''}{a} \right) A = 0 \Rightarrow A \propto \frac{1}{a \mathcal{H}^2}. \quad (11)
$$

This shows that an appropriate choice of boundary con-
ditions sets $A = 0$. Furthermore, with such a choice Eqs. (9)
and (10) are formally identical to the ones of Newtonian
gravity if Eqs. (7) and (8) are used,

$$
\Delta\Psi = 4\pi G a^2 \delta\rho, \quad \frac{dv^i}{d\tau} + \mathcal{H}v^i = -\nabla^i\Psi. \quad (12)
$$

Keeping in mind that the above equations remain valid
even if $\delta\rho/\rho$ becomes large I now set the boundary
conditions at early times when matter perturbations are
still linear. According to Eq. (8) the condition $A=0$ is
satisfied when

$$
T = -\frac{1}{a} \int^{a} \frac{\Psi}{\mathcal{H}} d\tilde{a}. \qquad (13)
$$

The linear solution of $\Psi$ is constant in matter domination,
and with Eq. (7) the corresponding choice of $L$ is given by
$\Delta L = 5\Psi_{\text{in}}$. Here I introduce $\Psi_{\text{in}}$ to denote the linear initial
condition for $\Psi$ in matter domination.

With this choice one can see that $\nabla^i B = v^i$ in the linear
regime, which (together with $H_L = 0$) is the original gauge
condition used in [8] for the N-body gauge. So even though
my gauge condition $H'_T = -L' = 0$ is different, the
resulting coordinate system is the same whenever only
nonrelativistic matter is present. The advantage of my
condition is that it does not explicitly refer to a matter
perturbation and can hence be easily extended into the
nonlinear regime of matter as long as gravitational fields
remain weak. In a slight abuse of terminology I therefore
always call this system of coordinates the one of N-body
gauge, as the state of a Newtonian N-body simulation is
given in precisely these coordinates.

I now discuss the repercussions of this change of
coordinates from longitudinal to N-body gauge. The null
condition is solved in N-body gauge by $k^i/k^0 = n^i +$
$\nabla^i B + n^j(\nabla_j \nabla^i - \delta_j^i \Delta/3)H_T$, and the photon geodesic
equation can be written as

$$
\frac{d \ln k^0}{d \tau} = -2 \mathcal{H} - n^i n^j \nabla_i \nabla_j B, \quad (14)
$$

and

$$
\frac{dn^i}{d\tau} = -(\delta^{ij} - n^i n^j) \nabla_j \left( n^k \nabla_k B - \frac{1}{3} \Delta H_T \right). \quad (15)
$$

Considering how the coordinate transformation acts on $u^\mu$
one sees that $u^\mu = a^{-1}(1, v^i)$ in the new coordinates. Thus,
a first integral of Eq. (14) gives the following new
expression for the observed redshift:

<footnote n="2">²For instance, had I made a change of coordinates that sets $A = B = 0$ instead, like in a synchronous gauge, I would have found $L' = T = -a^{-1} \int a^i (\Psi/\mathcal{H}) d\tilde{a}$ and that $H_L$ receives a contribution $\sim \Delta\Psi/\mathcal{H}^2 \sim \delta\rho/\rho$. The volume perturbation therefore does not remain small everywhere in such a coordinate system, rendering the weak-field treatment inconsistent.</footnote>
$$z + 1 = \frac{a_{\text{obs}}}{a_{\text{src}}} \left( 1 + n_i v_{\text{obs}}^i - n_i v_{\text{src}}^i + \Psi_{\text{obs}} - \Psi_{\text{src}} + \mathcal{H}B|_{\text{obs}} - \mathcal{H}B|_{\text{src}} - 2 \int_{\text{src}}^{\text{obs}} \Psi' d\chi \right). \quad (16)$$

In order to recover all the terms of Eq. (5) I used $(\mathcal{H}B)' = \Psi'$ and $\mathcal{H}B + B' = -\Psi$, but evidently a new boundary term $\mathcal{H}B$ appears. Noting that $B = T$ this boundary term can be understood as the result of the change of coordinates acting on the background term $a_{\text{obs}}/a_{\text{src}}$. In other words, the term has to appear because the equal-time hypersurfaces in $N$-body gauge do not coincide with the ones of longitudinal gauge. The coordinate time of a Newtonian $N$-body simulation is the one of $N$-body gauge, and hence this boundary term needs to be taken into account.

Let me now inspect the time of flight for the photon in $N$-body gauge,

$$\begin{aligned} \chi &= \int_{\text{src}}^{\text{obs}} \left( 1 + n^i \nabla_i B + n^i n^j \nabla_i \nabla_j H_T - \frac{1}{3} \Delta H_T \right) d\tau \\ &= \tau_{\text{obs}} - \tau_{\text{src}} + B_{\text{obs}} - B_{\text{src}} + n^i \nabla_i H_T|_{\text{obs}} - n^i \nabla_i H_T|_{\text{src}} \\ &\quad + 2 \int_{\text{src}}^{\text{obs}} \Psi d\chi, \end{aligned} \quad (17)$$

where I again use the gauge conditions to recover the terms known from longitudinal gauge. Compared to Eq. (6) there are two new boundary terms. These are expected from the gauge transformation, since the coordinate time transforms as $\tau \to \tau + T = \tau + B$, and the coordinate distance transforms as $\chi \to \chi + n^i \nabla_i L|_{\text{obs}} - n^i \nabla_i L|_{\text{src}} = \chi - n^i \nabla_i H_T|_{\text{obs}} + n^i \nabla_i H_T|_{\text{src}}$. For a photon trajectory with fixed end points, the coordinate time of emission and observation therefore transforms such that the boundary terms due to the shift perturbation in Eqs. (16) and (17) cancel exactly. The other boundary term in Eq. (17) gives precisely the change in the coordinate distance due to the spatial transformation between longitudinal and $N$-body gauge. Therefore, the perturbed redshift for the trajectory remains invariant.

## V. DISCUSSION

The precedent analysis clarifies that in order to use the longitudinal gauge for computing the perturbed redshifts with $N$-body simulation data one should transform the coordinates appropriately. In particular, the coordinate distance between observer and sources changes according to a spatial transformation that is independent of time. This has already been pointed out in [5], and I explicitly show

how to recover this result in the relativistic framework provided by the $N$-body gauge. Alternatively the computation of the perturbed redshift can also be carried out directly in $N$-body gauge. In this case the coordinates of sources are directly taken from the simulation, and the effect appears as a modification of the Shapiro delay.

In order to estimate the amplitude of the correction, let me compute the typical change $\delta\chi = n^i \nabla_i L|_{\text{obs}} - n^i \nabla_i L|_{\text{src}}$ of the coordinate distance. Using the relation $\Delta L = 5\Psi_{\text{in}}$ the variance of $\delta\chi$ is given by

$$\langle \delta\chi^2 \rangle = 50 \int_0^\infty \frac{dk}{k^3} \left[ \frac{1}{3} - \frac{1}{k\chi} j_1(k\chi) + j_2(k\chi) \right] \Delta_k^\Psi, \quad (18)$$

where $\Delta_k^\Psi$ is the dimensionless power spectrum of $\Psi_{\text{in}}$. Unfortunately the integral has an infrared divergence for nearly scale invariant spectra, but in practice this divergence is regulated by the finite size of a simulation. Imposing a cutoff close to the Hubble scale one finds that $\delta\chi/\chi \sim 10^{-4}$ almost independent of scale $\chi$ and precise value of the cutoff. Considering how a change in the coordinate distance affects the time of flight one sees that the typical correction to the redshift due to this coordinate effect is $\delta z/(1+z) \sim \mathcal{H}\delta\chi$. Therefore the effect becomes of the order of the gravitational redshift for trajectories at or above the gigaparsec. At these extreme scales the gauge correction is of the same order as all other relevant terms and should be taken into account.

As suggested in [2] the gravitational redshift may be measured statistically by looking for “excess redshift” of the brightest galaxies at the center of clusters when compared to the fainter galaxies in the outskirts. For simulating such a measurement the relevant correction is given by the difference in time of flight between the different sources, and therefore the effect is suppressed by the small ratio between the scale of the cluster and the Hubble scale. One expects that in this case the correction is typically less than 1% of the signal and can therefore safely be neglected.

## ACKNOWLEDGMENTS

I thank R. Durrer, C. Rampf, and Y. Rasera for comments on the manuscript as well as C. Fidler and T. Tram for many insightful discussions about the $N$-body gauge. I further enjoyed a valuable correspondence with D. Bertacca and C. Porciani about [12]. Prior to submission, C. Fidler et al. also kindly shared their manuscript [14] on a closely related topic.
[1] N. Kaiser, Clustering in real space and in redshift space, Mon. Not. R. Astron. Soc. **227**, 1 (1987).

[2] R. Wojtak, S. H. Hansen, and J. Hjorth, Gravitational redshift of galaxies in clusters as predicted by general relativity, Nature (London) **477**, 567 (2011).

[3] C. Bonvin, Isolating relativistic effects in large-scale structure, Classical Quantum Gravity **31**, 234002 (2014).

[4] J. Adamek, D. Daverio, R. Durrer, and M. Kunz, General relativity and cosmic structure formation, Nat. Phys. **12**, 346 (2016).

[5] N. E. Chisari and M. Zaldarriaga, Connection between Newtonian simulations and general relativity, Phys. Rev. D **83**, 123505 (2011); N. E. Chisari and M. Zaldarriaga, Erratum, Phys. Rev. D **84**, 089901 (2011).

[6] S. R. Green and R. M. Wald, Newtonian and relativistic cosmologies, Phys. Rev. D **85**, 063512 (2012).

[7] S. F. Flender and D. J. Schwarz, Newtonian versus relativistic cosmology, Phys. Rev. D **86**, 063527 (2012).

[8] C. Fidler, C. Rampf, T. Tram, R. Crittenden, K. Koyama, and D. Wands, General relativistic corrections to *N*-body

simulations and the Zel'dovich approximation, Phys. Rev. D **92**, 123517 (2015).

[9] C. Fidler, T. Tram, C. Rampf, R. Crittenden, K. Koyama, and D. Wands, Relativistic initial conditions for *N*-body simulations, J. Cosmol. Astropart. Phys. **06** (2017) 043.

[10] Y.-C. Cai, N. Kaiser, S. Cole, and C. Frenk, Gravitational redshift and asymmetric redshift-space distortions for stacked clusters, Mon. Not. R. Astron. Soc. **468**, 1981 (2017).

[11] H. Zhu, S. Alam, R. A. C. Croft, S. Ho, and E. Giusarma, *N*-body simulations of gravitational redshifts and other relativistic distortions of galaxy clustering, Mon. Not. R. Astron. Soc. **471**, 2345 (2017).

[12] M. Borzyszkowski, D. Bertacca, and C. Porciani, LIGER: Mock relativistic light cones from Newtonian simulations, Mon. Not. R. Astron. Soc. **471**, 3899 (2017).

[13] H. Kodama and M. Sasaki, Cosmological perturbation theory, Prog. Theor. Phys. Suppl. **78**, 1 (1984).

[14] C. Fidler, T. Tram, C. Rampf, R. Crittenden, K. Koyama, and D. Wands, General relativistic weak-field limit and Newtonian *N*-body simulations, J. Cosmol. Astropart. Phys. **12** (2017) 022.