Measurements of the redshift drift  the real time variation of the redshift of distance sources  are expected in the next couple of decades using next generation facilities such as the ANDES spectrograph at the ELT and the SKAO survey. The unprecedented precision of such observations will demand precise theoretical and numerical modeling of the effect in the standard LambdaCDM cosmology. In this work we use the Gadget4 Nbody code to simulate the redshift drift and its fluctuations in LambdaCDM cosmologies deriving the corresponding power spectra from a simulation with 10243 particles in a 1textrmGpch1 box. Our results provide an estimate for the distribution and amplitude of the fluctuations and the spectra which match previous work in the literature using EinsteinBoltzmann solvers to within an order of magnitude. Our work provides a methodology for performing statistical analysis of the redshift drift effect and deriving its fluctuation power spectra from future large scale surveys.
['Astrophysics - Cosmology and Nongalactic Astrophysics']
Redshift Drift fluctuations from Nbody simulations
{'Redshift Drift fluctuations from N -body simulations': 'Pedro Bessa 1 Valerio Marra 2 , 3 , 4 Tiago Castro 3 , 4 , 5  \n1 PPGCosmo, Universidade Federal do Espírito Santo, 29075-910, Vitória, ES, Brazil  \n2 Dep. de Física, Universidade Federal do Espírito Santo, 29075-910, Vitória, ES, Brazil  \n3 INAF - Osservatorio Astronomico di Trieste, 34131 Trieste, Italy  \n4 IFPU - Institute for Fundamental Physics of the Universe, 34151, Trieste, Italy  \n5 INFN - Sezione di Trieste, I-34100 Trieste, Italy  \nE-mail: pedvbessa@gmail.com  \nAbstract. Measurements of the redshift drift - the real time variation of the redshift of distance sources - are expected in the next couple of decades using next generation facilities such as the ANDES spectrograph at the ELT and the SKAO survey. The unprecedented precision of such observations will demand precise theoretical and numerical modeling of the effect in the standard ΛCDM cosmology. In this work, we use the Gadget4 N -body code to simulate the redshift drift and its fluctuations in ΛCDM cosmologies, deriving the corresponding power spectra from a simulation with 1024 3 particles in a 1Gpc h -1 box. Our results provide an estimate for the distribution and amplitude of the fluctuations and the spectra, which match previous work in the literature using Einstein-Boltzmann solvers to within an order of magnitude. Our work provides a methodology for performing statistical analysis of the redshift drift effect and deriving its fluctuation power spectra from future large scale surveys.  \nKeywords: redshift drift, numerical simulations  \nArXiv ePrint:  \n1234.56789', '1 Introduction': "As cosmology develops further into its precision era, the theoretical and computational modeling of astrophysical and cosmological phenomena becomes ever more important in order to make proper sense of observations, break degeneracies and probe new regimes. The capabilities of next and current generation surveys allow observational cosmology to probe astrophysical and cosmological phenomena previously thought unreachable, and use these new probes to further test the standard cosmological model. Among these new probes and facilities, with the advent of new, state-of-art spectrographs such as ESPRESSO at the ELT [1, 2], and radio surveys such as SKAO [3, 4], we expect to obtain a first measurement of the time variation of the redshift of far away sources, namely the redshift drift, in the next couple of decades. This first measurement would impose constraints on the cosmological parameters of the ΛCDM and its extensions in a model-independent way in the local Universe from real-time cosmology, an important complementary measurement to distance based and cosmographic measurements.  \nThe redshift drift provides a new, powerful probe of cosmological dynamics, since it is a model independent test of the Universe's rate of expansion change, relying purely on metric and kinematic quantities. Its theoretical prediction was first derived by Sandage and McVittie [5, 6] as a general consequence of non-static cosmological models. Its detection and measurement through the observation of the Lymanα forest of distant quasars, was proposed by Loeb [7], in what is now known as the Sandage-Loeb test, although measurements from photometric surveys and strong gravitational lenses have also been investigated [8, 9].  \nWith the possibility of measuring this effect in the near-future, and its use as a test of the cosmological model, research has focused on understanding the evolution and redshift dependency of the redshift drift in general cosmological space-times, in particular perturbed Robertson-Walker metrics [10, 11]; its use as a test of dark energy and alternative cosmological scenarios [12]; and as a probe of cosmic homogeneity [13]. Important work has been done on forecasting the measurement of the effect through observations of the Ly α forest by facilities like the ELT [14-16] and the SKAO [17-19].  \nFrom the theoretical point of view, by extending the redshift drift definition to arbitrary spacetimes, the works [10, 12] have allowed the calculation of perturbative and contaminating effects from cosmological inhomogeneities and local structures on the drift. In particular, the authors in [11] derived the gauge-invariant expression for the redshift drift in a perturbed Robertson-Walker spacetime and its power spectrum, which allows one to interpret future observations and its perturbative effects to first order, in full concordance with the standard cosmological model and its independent late and early time tests.  \nIn scenarios where direct observational data is limited, simulations and numerical implementations provide a controlled framework to test hypotheses and explore the effects of various cosmological parameters on a given effect or observable. Modeling of the redshift drift and observational errors through N -body simulations was performed first in [20], and its power spectra was first numerically obtained through the use of Einstein-Boltzmann solvers in [11], and using relativistic numerical codes in [21]. There has been, however, a lack of direct modeling of the effect and its power spectra through N -body simulations in the ΛCDM setting, including peculiar velocity and acceleration effects.  \nThis work aims to fill this gap in the literature by using Newtonian N -body simulations and its mapping to relativistic cosmology as a model for a Universe with structure, and deriving the scale and redshift dependency of the drift through its power spectra obtained directly from simulations, providing a first estimate of the effect in the ΛCDM model from N -body simulations, as well as consistency check for future survey observations and data of this effect.  \nThe paper layout is as following: In Section 2, we review the mathematical background needed to derive the redshift drift fluctuations in a Robertson-Walker cosmology. In Sections 3 and 4, we review the derivation of the redshift drift fluctuations power spectrum in ΛCDM and its approximations, as well as the map between Newtonian perturbations obtained from the N -body simulations and the theoretical relativistic quantities. In Section 5, we detail our simulation parameters and set-up and the numerical derivation of the power spectra. We also detail our error estimation and modeling. In Section 6, we write our conclusions and discuss the results.", '2 Redshift drift and fluctuations': "We model the redshift drift fluctuations using linear cosmological perturbation theory on a homogeneous and isotropic background, given by Robertson-Walker metric. Since we are interested in the concordance ΛCDM model, we focus on the flat, K = 0 case. First, we obtain its expression in flat RW and then generalize it to arbitrary spacetimes, such that the fluctuations become a particular case where the metric is given by the perturbed RW metric. In a flat Robertson-Walker spacetime, with line element given by  \nds 2 = -a 2 ( t )[ dt 2 + δ ij dx i dx j ] , (2.1)  \nwhere we denote cosmic time by τ and conformal time by t . Using the subscripts o and s to denote measurements at the observer and source, respectively. The expression for the redshift drift can be easily derived through the cosmic time derivative of the redshift [7]  \ndz dτ o = d dτ o ( a o a s ) = 1 dτ o [ a o (1 + H o dτ o ) a s (1 + H s ( a s /a o ) dτ o ) -a o a s ] = H o (1 + z ) -H s . (2.2)  \nThe expression for the drift above shows that observing the redshift of a source at different observer times τ gives us a measure of its evolution at current time τ O . From (2.2) it is clear that the redshift drift has a positive value when the Hubble parameter increases monotonically, indicating an accelerating phase of the scale factor. At the background level, this is true for any given observer since we have spacetime homogeneity and isotropy, but once perturbations are introduced, the existence of cosmic structures changes the path of light rays through their gravitational potential and peculiar velocities, such that equation (2.2) has to be modified.  \nIn [10], the author derived a generalization of expression (2.2) for the redshift drift in an arbitrary spacetime, relying only on the assumption of a 3 + 1 slicing of the spacetime. For an observer o with 4-velocity u µ and a light ray emitted from source S with tangent 4-vector k µ , the redshift drift is measured by the observer is  \ndz dτ o = (1 + z ) [ h -∇ e E E ] o -[ h -∇ e E E ] s , with h := 1 3 θ + σ µν e µ e ν -a µ e µ , (2.3)  \nwhere we have the usual kinematic quantities - the expansion, acceleration, and traceless expansion tensor - along the observer's congruence, defined respectively by  \nθ = ∇ u u, a µ = ∇ µ θ, σ µν = ∇ ( µ u ν ) -1 3 θh µν , (2.4)  \nwhere h µν = g µν + u µ u ν . Expression (2.3), in the case of the metric (2.1) simplifies to (2.2). We will use it to derive the expression for the drift in a Universe with perturbations.", '2.1 Redshift drift in perturbed Robertson-Walker': "We now focus on the case of a Universe with inhomogeneities of the matter and metric fields described by small fluctuations relative to the background metric, modeled by a perturbed Robertson-Walker metric. In the longitudinal gauge, the line element for this metric is given by [22]  \nds 2 = -a 2 ( t ) 2 (1 + 2Ψ) dt 2 + a 2 ( t )(1 -2Φ) δ ij dx i dx j , (2.5)  \nwhere the potentials Φ and Ψ are the gauge-invariant Bardeen potentials. We also write the observer's 4-velocity in this spacetime as  \nu µ = 1 a (1 -Ψ , v i ) , v i ≡ ∂ i v, (2.6)  \nwith v the velocity potential, and u µ a global defined congruence of comoving observers.  \nFollowing fully gauge-invariant cosmological perturbation theory, in [11], the authors obtained the gauge-invariant expression for the redshift drift (2.3) in the perturbed RobertsonWalker metric, which here we express in terms of the longitudinal gauge used in (2.5)  \ndz dτ o = (1 + z ) [ -H + ˙ Ψ+¯ n i ∂ i ( ˙ v + H v ) + ˙ H H (Φ -¯ n i ∂ i v ) + ( ˙ H-H 2 H + ¯ n i ∂ i ) ∫ o s dλ ( ˙ Φ+ ˙ Ψ ) ] , (2.7)  \nwhere ¯ n i is the space-like vector of the source direction or spatial propagation. In deriving this expression, we neglected observer-dependent monopole and dipole terms, namely the observer's peculiar velocity and gravitational potential, as we are focused in survey and simulation data averaged over sources in the sky. This observer dependent drift and its impact on measurements of the redshift drift has been studied in [23].  \nThe potential terms in expression (2.7) have been shown to be orders of magnitude smaller than the spatial dependent and velocity terms, particularly in the redshift range z ∈ [0 , 1 . 5] we expect to measure the drift effect [11], and thus we assume that they are subdominant to the other perturbative quantities and do not contribute to the overall fluctuations of the drift. Focusing on terms containing the velocity and its time derivatives, and by defining d ¯ z d ¯ τ o as the background value of the redshift drift given by (2.2), we obtain the expression for the perturbations of the redshift drift  \nδ ˙ z := dz dτ o -d ¯ z d ¯ τ o d ¯ z d ¯ τ o ≈ -1 H [ ¯ n i ˙ v i -( ˙ H-H 2 H ) ¯ n i v i ] , (2.8)  \nwhere we note again that all observer and potential terms were neglected. In the following sections, we will derive the power spectrum of the signal (2.8) as a function of redshift measured by the observer.", '3 Redshift drift power spectrum': "The redshift drift fluctuations power spectrum can be obtained directly from the primordial metric fluctuations power spectrum through the potential and velocity transfer functions and Einstein's equations, and this has been implemented and checked numerically in [11] through Einstein-Boltzmann solvers. Here we briefly describe how one can obtain the redshift-drift power spectra from the primordial perturbations.  \nThe primordial spectrum of curvature perturbations P Ψ generated by primordial fluctuations formed through a standard inflationary mechanism in the early Universe can be written as [22]  \nk 3 P Ψ ≡ 2 π 2 ( 3 5 ) 2 P R = (2 π ) 3 δ ( k -k ' ) A ( k k ∗ ) n S -1 , (3.1)  \nwhere k ∗ is a pivot scale that characterizes the perturbation scale, A is the primordial amplitude of the Bardeen Potential Ψ fluctuations, and n S is the spectral index defining the scale dependency of the perturbations. P R is the scale-invariant primordial spectrum, which is  \nrelated to the Fourier transform of the 2-point correlation function of the primordial fluctuations by 2 π 2 ( 3 5 ) 2 P R = k 3 〈 Ψ in ( k )Ψ ∗ in ( k ' ) 〉 . The measured primordial amplitude, obtained via observation of the CMB is the primordial curvature fluctuation amplitude A S , related to A via [22]  \nA = 2 π 2 ( 3 5 ) 2 A S . (3.2)  \nThe cosmological parameters A S , n S have been measured and constrained through observations of the CMB by the Planck satellite, and an up-to-date review of their values can be found in [24]. The values for these parameters used throughout this paper can be found in table 1.  \nThe value of the Bardeen potential at a given redshift Ψ( z ) is related to the primordial fluctuations Ψ in ( k ) through the Transfer Function T Ψ ( k, z ) and the growth factor D + ( z ), measures of the cosmological structure formation up to redshift z , via [25]  \nΨ( k, z ) = T Ψ ( k, z )Ψ ini ( k ) (3.3) = 9 10 D + ( a ) a T ( k )Ψ ini ( k ) .  \nThe Transfer Function T ( k ) is characteristized by the evolution of the cosmological model and its parameters and can be obtained either analytically through an ansatz [26], or numerically using Einstein-Boltzmann solvers. Einstein's Equations allows one to use the Transfer Function T ( k ) to obtain the fields v , Φ and Ψ at a given redshift from the primordial power spectrum P R using the relations [27]  \nV ( k, z ) = T V ( k, z )Ψ ini ( k ) , (3.4a)  \nΦ( k, z ) = T Φ ( k, z )Ψ ini ( k ) , (3.4b)  \nT Φ = T Ψ , (3.4c)  \nT V = 2 a 3Ω m k H 2 0 ( H T Ψ + ˙ T Ψ ) , (3.4d)  \nkT Ψ = ˙ T V + H T V . (3.4e)  \nApplying these relations to (2.7) and decomposing observed fields in spherical harmonics Y /lscriptm ( n ) over the celestial sphere with unit vector n , the observed angular power spectrum of the redshift drift fluctuations at redshift z S is given by  \nC δ ˙ z /lscript ( z s ) = 2 A π ∫ dk k ( k k ∗ ) n S -1 | F /lscript ( k, z s ) | 2 , (3.5)  \nwhere the Kernel F /lscript ( k, z S ) is given by  \nF /lscript ( k, z s ) ≈ -1 H [ j /lscript ( kr s ) ( ˙ T ψ + ˙ H H T Ψ ) + j ' /lscript ( kr s ) ( ˙ T V -˙ H-H 2 H T V )] ,  \nwhere j /lscript are the spherical Bessel functions of order /lscript , and r S is the comoving radial distance from the observer to the source. Here, we neglect the time-varying integral terms, which are small, while keeping the potential terms.", '4 Power spectrum from N -body simulations': "To test the theoretical predictions for the redshift drift power spectra C δ ˙ z /lscript ( z s ) obtained in the previous section, we use the Gadget4 1 N -body cosmological code [28] to perform a Newtonian N -body simulation and a modified version of the class Einstein-Boltzmann solver [29, 30] to validate our results, first used in [11] to obtain numerical results for the power spectra.  \nIn the longitudinal gauge the metric potentials in (2.5) and the velocities in (2.6) map directly to the Newtonian gravitational potential ψ and the particles' peculiar velocity vector v i [31], allowing us to treat them as the particle fields in a Newtonian N -body simulation. The theoretical prediction for the perturbed redshift drift field (2.7), obtained using firstorder cosmological perturbation theory, can then be directly mapped to the fields from the simulation with no loss in accuracy, as first shown in [31]. To obtain the power spectra at different redshifts from the Gadget4 simulations then, we follow this correspondence, formalized in the dictionary between relativistic and Newtonian cosmologies first defined in [31].  \nThe angular power spectrum at redshift z of an arbitrary 3D field X is related to its power spectrum through the expressions [25]:  \nC X /lscript ( z ) = 2 π ∫ ∞ 0 dkk 2 P X obs ( k, z ) W 2 r,/lscript ( k ) = 4 π ∫ ∞ 0 dk k ∆ 2 ( k, z ) W 2 r,/lscript ( k ) , (4.1)  \nW r,/lscript ( k ) = ∫ r 0 d ¯ rW (¯ r ) j ( i ) /lscript ( k ¯ r ) , (4.2)  \nwhere W (¯ r ) is an arbitrary window function used to filter a certain range of redshifts or scales, and j ( i ) /lscript is the i -th derivative of the spherical Bessel function j /lscript , which appears in the Fourier transform of direction-dependent fields X ( n ). The dimensional power spectrum is related to the dimensionless one by P X obs ( k, z ) = 2 π 2 k 3 ∆ 2 ( k, z ).  \nBy taking the field X to be the redshift drift fluctuation, the observed angular power spectrum of the redshift drift derived from an N -body simulation is given by  \nC δ ˙ z /lscript ( z ) = 4 π ∫ ∞ 0 dk k ∆ 2 ( k, z ) W 2 r,/lscript ( k ) (4.3)  \n∆( k, z ) = F { -1 H [ -˙ ψ + n · ˙ v + ˙ H H ψ -( ˙ H-H 2 H ) n · v ]} , (4.4)  \nwhere we used the mapping between the relativistic Bardeen potential Ψ and the Newtonian potential ψ , and between the relativistic 4-velocity v µ of the observed and the peculiar velocity of particles v = ( v x , v y , v z ). F denotes the 3D Fourier transform of the redshift drift field, and n is the unit vector on the sphere.  \nWe further simplify expression (4.3) by neglecting the potential terms, which are at least an order of magnitude smaller than the velocity terms, to arrive at the final expression  \nfor the angular redshift drift power spectrum, given by  \nC δ ˙ z /lscript ( x ) = 4 π ∫ ∞ 0 dk k ∆ 2 ( k, z ) W 2 r,/lscript ( k ) , (4.5)  \nW r,/lscript ( k ) = ∫ r 0 d ¯ r W (¯ r ) j ' /lscript ( k ¯ r ) , (4.6)  \n∆( k, z ) = F { -1 H [ n · ˙ v -( ˙ H-H 2 H ) n · v ]} . (4.7)  \nFor scales /lscript /greatermuch 1, it is usual to adopt the Limber approximation, which we detail in appendix A. Using this approximation, (4.1) can be further simplified to  \nC X /lscript ( x ) = 2 π ∫ ∞ 0 dk k ∆ 2 ( k, z ) W 2 r,/lscript ( k ) ≈ 1 ( /lscript +1 / 2) 3 ∫ d ¯ r ¯ r ∆ 2 ( /lscript +1 / 2 ¯ r , z ) W 2 (¯ r ) . (4.8)  \nFor distance modes satisfying /lscript ≳ /lscript c = ¯ r/ ∆¯ r the Limber approximation has been shown to be accurate to smaller than 1% accuracy levels in comparison to the fully integrated power spectra [22, 25]. We shall make use of this approximation as a consistency check when validating the simulations.  \nFurthermore, we use a top-hat window function, which filters modes outside a comoving size ∆¯ r . Modes k such that /lscript ≳ k ∆¯ r 2 π ¯ r are integrated out of the angular power spectra. The explicit form of this window function is given by  \nW r (¯ r ) = { 1 / ∆ r for r 1 < ¯ r < r 2 , ∆ r = r 2 -r 1 0 otherwise . (4.9)  \nOne can also interpret the window function above as selecting fluctuations inside the redshift slice ∆ z ≈ H ( z )∆ r/c centered on the redshift z .  \nThis window function, when inserted in equation (4.8), allows one to simplify further the observed angular power spectrum expression in the Limber approximation. By selecting a small distance slice ∆¯ r of the observed cosmic region, we have  \nC X /lscript ( z ) ≈ 1 ( /lscript +1 / 2) 3 ∫ d ¯ r ¯ r ∆ 2 ( /lscript +1 / 2 ¯ r , z ) W 2 (¯ r ) ∆¯ r/ ¯ r /lessmuch 1 -----→ /lscript c ( /lscript +1 / 2) 3 ∆ 2 ( /lscript +1 / 2 ¯ r , z ) . (4.10)  \nEquation (4.10) allows simple implementation of the the theoretical power spectrum (4.1), and although we use the FFTlog-and-beyond 2 [32] routine to calculate the integrals [33], at smaller scales the Limber approximation provides consistency check for the numerical power spectra.  \nWe note that approximations (4.8) and (4.10) are valid for integrals containing no derivatives of the Bessel functions, such as for the potential terms in (3.5). In the final expression (4.5) the Limber approximation is not a good approximation due to the different oscillating behavior of the spherical Bessel function derivatives.", '5 Simulation setup and derived power spectrum': 'To model the observed power spectra of the redshift drift fluctuations (4.5) we perform a Newtonian N -body simulation using the Gadget4 code. Our simulation was run on a  \nTable 1 : Parameters used to generate the N -body simulation with Gadget4 and numerical spectra through Einstein-Boltzmann solvers.  \n1 Gpc h -1 Box with 1024 3 particles, and initial conditions were generated via the built-in NGEN-ic code at redshift z = 49. Cosmological parameters, particle mass, and gravitational softening /epsilon1 soft can be found in Table 1. We produced three snapshots at the redshifts z = 0 . 5 , 1 , 2. For the window function, we use a redshift slice of ∆ z = 0 . 1 and a top-hat window function, which corresponds to a comoving size of 0 . 1 c/H ( z ) Mpc for the projected field in equation (4.1).', '5.1 Validation': 'We compute the matter power spectra at redshifts z = 0 . 5 , 1 , 2 with the Pylians3 library 3 [34], and test them against the linear and nonlinear ( halofit ) matter power spectra derived from class . The simulation snapshots are read in HDF5 format, and we employ a triangularshaped cloud mass assignment scheme in Pylians3 to generate the density fields. We plot the results in figure 1. The curves obtained from the simulations match the expected behavior. We subtracted the shot-noise contribution P N = V/N from the power spectrum measured from the simulation ˆ P , that is, we show P = ˆ P -V/N .  \nTo validate the routines used to compute the angular power spectra in equation (4.5), we compare the results obtained from the simulation with the FFTlog-and-beyond libraryagainst those from the class code (the classgal module). Additionally, we include the Limber approximation as a consistency check for the angular power spectra derived from the simulations. The results of this comparison are presented in figure 2. The agreement is not perfect because classgal computes the angular power spectrum on the lightcone, while we are using the power spectrum of a given snapshot. We checked the importance of non-linearities by feeding the linear power spectrum from class to the FFTlog-and-beyond routine: we found the expected suppression of power at smaller scales and lower redshifts. We estimate the cosmic variance on the angular power spectrum via Var [ C /lscript ] = 2 C 2 /lscript 2 /lscript +1 .  \nFigure 1 : Matter power spectra for redshifts z = 0 . 5 , 1 , 2. In the figures we compare two routines against the power spectra obtained from the Gadget4 simulations: the halofit routine and the linear matter power spectrum from CLASS . The vertical red lines mark 2 k fund and k Nyq / 2.  \n<!-- image -->  \nTo avoid effects due to finite box size and resolution, we restrict our spectra to modes k ∈ [2 k fund , k Nyq / 2] and angular correlations to modes /lscript ∈ [ 2 /lscript fund = 2 k fund r ( z ) (1+ z ) , /lscript Nyq / 2 = k Nyq r/ 2 (1+ z ) ] , above the fundamental frequency k fun = 2 π/ Box Size and below the Nyquist frequency k Nyq = N grid × k fun .', '5.2 Redshift drift': "To generate the 3D array of the redshift drift field, we discard potential terms and follow equation (4.7) to derive the drift expression from the acceleration and velocity fields. Via Pylians3 we obtain the 1024 3 array with the total drift per voxel. We then divide the total redshift drift field by the particle number field, in order to obtain the average redshift drift field. It can happen that there are empty voxels; in this case we set the average redshift drift to zero. The amount of empty voxels is less than 100 in a total of 2 30 voxels. We then subtract the average redshift drift in the snapshot from the redshift drift field and divide by the same average to obtain the redshift drift fluctuations of (2.8). We plot the redshift drift fluctuation distribution histogram in figure 3 for the three redshifts analyzed, which provide a glimpse at the gaussianity and amplitude of the fluctuations.  \nFigure 2 : Angular power spectrum of matter for redshifts z = 0 . 5 , 1 , 2. The power spectra are calculated in three different ways: using the CLASSgal code, using the FFTlog routine to obtain the angular spectra from the matter power spectrum of the simulation, and using the Limber approximation for the angular spectra from the simulation. The vertical red lines mark 2 /lscript fund and /lscript Nyq / 2.  \n<!-- image -->  \nIn obtaining the power spectrum, we make use of the flat-sky approximation, where one assumes the direction vector n on the sphere is approximated by a vector α , where α is a 2D coordinate vector in the plane perpendicular to the observer's reference direction. This is equivalent to choosing the reference axis z in the simulation box as being the observer direction, as well as assuming that the box size corresponds to a sizeable fraction of the celestial sphere. We further detail this approximation in appendix B, while noticing that for big enough box sizes, it provides an accurate estimate of the angular power spectrum [35]. The power spectrum is then calculated using the Pk\\_library from pylians (same routine that we used to compute the matter power spectrum of figure 1).  \nThe shot noise for the drift field can be computed following the formalism of [36] such that  \nP δ ˙ z N /similarequal V N 〈 δ ˙ z 2 〉 , (5.1)  \nthat is, it is the matter power spectrum shot noise multiplied by the variance of the drift  \nFigure 3 : Histogram for the redshift drift fluctuations in the simulation box for redshifts z = 0 . 5 , 1 , 2. The distribution is nearly gaussian with standard deviation σ ≈ 2 · 10 -2 for all redshifts.  \n<!-- image -->", 'field. We then have': 'P δ ˙ z = ̂ P δ ˙ z -P δ ˙ z N , (5.2)  \nwhere we subtracted the shot-noise contribution from the power spectrum measured from the simulation ˆ P . We plot the dimensionless power spectra ∆ 2 ( k, z ) of the redshift drift in figure 4 with and without subtraction of the shot noise. We can see that the shot-noise subtraction correctly removes the excess power at small scales, k ∼ 2 h /Mpc. √  \nWe see that the amplitude of the redshift drift fluctuations is | δ | ∼ ∆ 2 ≈ O (10 -3 ), and that the power spectrum is stronger at higher redshifts, where the cosmic velocity and acceleration fields in (2.8) are known to be larger, since velocity perturbations decay as a function of cosmic time in ΛCDM [22]. This result is in agreement with the results found in [11] and around two orders of magnitude higher than the results found in [20], which also used a Newtonian simulation to obtain an estimate of the fluctuation amplitude. We note that the results in [20] are based on an Einstein-de Sitter background cosmology, such that some of the discrepancies can be attributed to the effect of both the background cosmology and structure formation in ΛCDM, which is known to be slower due to the late time acceleration.  \nFigure 4 : Dimensionless redshift drift power spectra at redshifts z = 0 . 5 , 1 , 2 with and without shot noise. The vertical red lines mark 2 k fund and k Nyq / 2.  \n<!-- image -->  \nTable 2 : Shot noise for the redshift drift power spectra and the expected noise for the redshift drift experiment with SKA1 and SKA2, taken from [18]. The value for z = 2 is extrapolated from the expected noise at z = 1 . 5.  \nFor N particles = 1024 3 and the cosmic parameters given in table 1, the values of the shot noise P δ ˙ z N at the analyzed redshifts can be found in table 2. The expected shot noise in the SKA survey experiment aimed at measuring the redshift drift has been estimated in [18], and by assuming that the survey will be able to precisely measure the fluctuations to constrain the background value of the redshift drift, we can compare the results of table 2 to the error due to shot noise predicted for the SKA1 and SKA2 experiments as found in [11, 18], which is expected to observe N ∼ 10 7 galaxies per redshift bin and the noise term proportional to 1 / √ N . Table 2 shows that the shot noise obtained from our work is small compared to the noise predicted from the survey capabilities, such that one does need to take into account  \nFigure 5 : Redshift drift angular power spectra for redshifts z = 0 . 5 , 1 , 2 . The green line is the prediction for the angular power spectrum using the implementation in the class cosmology code. The vertical red lines mark 2 /lscript fund and /lscript Nyq / 2.  \n<!-- image -->  \nthe shot noise from the drift fluctuations when estimating the power spectrum.', '5.3 Comparison with class and discussion': 'The modified class code used to generate the angular power spectrum C δ ˙ z /lscript operates strictly within linear perturbation theory, meaning that nonlinear effects are not included in the redshift drift power spectra. However, since our simulations probe the nonlinear regime, deviations from linearity appear at smaller scales, leading to modifications in the slope of the angular spectrum compared to the linear spectra produced by class . We normalize the spectra derived from simulations, based on (4.5), to match the convention used in [37], enabling a proper comparison between the amplitude of the N -body angular spectra and the predictions from class . This normalization convention is detailed in Appendix C for reference.  \nIn figure 5, we plot both the spectra obtained from the simulations and the spectra generated using the class implementation of the redshift drift fluctuations spectra. We find an agreement within an order of magnitude between both spectra at all scales. The discrepancies are attributed to the flat-sky approximation used in computing the redshift drift component at large scales, the non-linearities at small scales, and to the calculation of  \nclustering based on the simulation snapshot drift power spectrum rather than on the lightcone, as also highlighted in figure 2. Previous works on the amplitude and angular power spectrum of the redshift drift fluctuations, using both Newtonian N -body simulations [20] and fully relativistic simulations [21], found a difference of more than two orders of magnitude for the amplitude of the fluctuations in relation to the class implementation found in [11].  \nIn the ΛCDM case, our work points to an effect of at most order 10 -3 in relation to the background redshift drift for angular correlations, in agreement with both [11] and [13]. With respect to the order of magnitude and size of the effects, our work converges with the literature, where a precision of ∆ ˙ z/ ˙ z ∼ 10 -3 is needed in order to measure such fluctuations. Nevertheless, even in our idealized simulation setting, we were able to constrain the amplitude and scaling of the power spectrum of the drift fluctuations through observations of the cosmic velocity and acceleration fields, which together with the galaxy number count spectra, as discussed in [11], could help in detecting a statistically significant signal of the drift by constraining contaminating effects due to the peculiar motion of sources.', '6 Conclusions': 'In this paper, we derive the redshift drift power spectrum at different redshifts from an N -body simulation using the Gadget4 code. To obtain the power spectrum from the simulation, we model it using the theoretical prediction found in [11] and numerically calculate it using the velocity and acceleration fields from the Gadget4 snapshots and power spectrum and FFT routines found in the pylians and FFTlog-and-beyond python libraries. We validate our code and simulation using the Einstein-Boltzmann solver class , and once validated, compare our results to the numerical predictions obtained using the same code in [11]. Our work provides a methodology for modeling the redshift drift using N -body simulations and derive one and two point statistics from simulation data.  \nOur findings show an agreement with the numerical implementation of the redshift drift spectra using the class code to within an order of magnitude, with a signal that approximately increases from large to intermediary scales for all redshifts and peaks at scales ∼ O (10 2 ), and strictly decreases afterwards, up to scales /lscript ∼ 10 3 . Our results also show a peak of the signal at the same scales as the class implementation and an overall agreement with the scale behavior of previous work on ΛCDM settings such as [11]. The discrepancies are attributed to the flat-sky approximation used in computing the redshift drift component at large scales, the non-linearities at small scales, and to the calculation of clustering based on the simulation snapshot drift power spectrum rather than on the light-cone. Previous works using N -body simulations to model a measurement of the redshift drift and its fluctuations find a disagreement of more than 2 orders of magnitude in relation to our results and the results of [11], although the authors assumed a different cosmological background and energy content. Further work assuming the same background cosmologies, possibly on the past lightcone, is needed in order to properly compare the results from different numerical simulations of the effect.  \nOur work agrees with previous literature in that measuring the fluctuations on the drift significantly impacts the observation of the background effect, in particular in measuring the velocity and acceleration fields distribution over the sky. Although of order 10 -3 on the background drift, which is already small, it is within the capabilities of surveys such as SKA [11, 21].  \nAt last, our simulation assumes an idealized dark matter plus Λ only Universe, with structure formation and peculiar motion of sources with no baryonic effects or feedback, and a simulation box size of 1Gpc. The SKA radio telescope will have a sky coverage of 75% and probe redshifts z ∈ [0 , 5] in the radio, HI and 21cm regions, observing baryonic feedback in regimes previously unseen. Larger simulations, including baryonic and hydrodynamic effects in structure formation and the momentum fields, are to be done to prepare for the upcoming observational challenge in measuring the drift with next-generation surveys. Such a task is beyond the current computational capabilities of the current work, and we leave it for future research.', 'Acknowledgements': 'It is a pleasure to acknowledge Enea Di Dio, Cullan Howlett, and Ruth Durrer for their valuable discussions. PB acknowledges financial support from Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) and Fundação de Apoio à Pesquisa do Espírito Santo (FAPES) for his PhD and visiting PhD fellowship. VM thanks CNPq (Brazil) and FAPES (Brazil) for partial financial support. TC is supported by the Agenzia Spaziale Italiana (ASI) under - Euclid-FASE D Attivita\' scientifica per la missione - Accordo attuativo ASI-INAF n. 2018-23-HH.0, by the PRIN 2022 PNRR project "Space-based cosmology with Euclid: the role of High-Performance Computing" (code no. P202259YAF), by the INFN INDARK PD51 grant, and by the FARE MIUR grant \'ClustersXEuclid\' R165SBKTMA. We acknowledge the computing centre of Cineca and the use of the Santos Dumont supercomputer of the National Laboratory of Scientific Computing (LNCC, Brazil). We would also like to acknowledge the use of the computational resources provided by the Sci-Com Lab of the Department of Physics at UFES, which was funded by FAPES and CNPq.', 'A Limber approximation': "The Limber approximation makes use of the fact that the spherical Bessel functions j /lscript ( x ) peak around x = [ /lscript ( /lscript +1)] 1 / 2 ≈ /lscript +1 / 2 [38]. For large /lscript , this peak is even more pronounced, such that one may take j /lscript ( x ) /lscript /greatermuch 1 --→ √ π ( /lscript +1 / 2) δ ( x -/lscript -1 / 2), such that, for a function f ( k ) = ∫ dx ' f ( x ' ) j /lscript ( kx ' ), we have  \n∫ ∞ 0 dkf ( k ) = ∫ ∞ 0 ∫ dkdx ' f ( x ' ) j /lscript ( kx ' ) ≈ ∫ ∞ 0 dkf ( /lscript + 1 2 ) . (A.1)  \nThis approximation has been used extensively on scales /lscript ≳ O (10) for cosmological angular correlations, including in class [37].", 'B Flat sky approximation': 'In the flat-sky approximation we assume that we are observing a small enough area of the sky such that the curvature of the celestial sphere can be neglected. More precisely, we substitute the spherical coordinates over the whole celestial sphere by  \nn = r ( z )( θ, φ ) -→ e z = r ( z )( x, y ) , (B.1)  \nwhere e z is the unitary vector in a given coordinate in the simulation box, assumed to be the observer or survey reference direction, and ( x, y ) are 2D coordinates in the plane  \nperpendicular to e z . For small scales, this approximation is very accurate, as smaller areas of the sky are less affected by curvature effects. In this approximation, the modes /lscript are conjugate to the coordinates α = ( x, y ), such that they are related by a 2D Fourier transform. See [35] for a comprehensive discussion of the flat-sky approximation.', 'C Units': 'As the Gadget4 code works with internal code units, one needs to convert from internal units to physical units and then map these fields to the physical fields found in equation (4.5) through the conversion factors. We list the conversion factors and units used throughout the paper in the following table, and refer the reader to the Gadget4 documentation at wwwmpa.mpa-garching.mpg.de/gadget4 for a comprehensive list of the conversion factors.  \nTable 3 : Fields given in simulation units and physical units, and conversion factor from simulation to physical units.  \nFurthermore, the class code outputs the angular power spectra of fields X using the convention  \n/lscript ( /lscript +1) 2 π C XX /lscript = ( /lscript ( /lscript +1) 2 π ) 4 π ∫ dk k ∆ 2 /lscript ( k, z ) , (C.1)  \nwhere ∆ 2 ( k, z ) is given by the | F /lscript | 2 in expression (3.5).', 'References': "- [1] C.J.A.P. Martins et al., Fundamental physics with ESPRESSO: Constraints on Bekenstein and dark energy models from astrophysical and local probes* , Phys. Rev. D 105 (2022) 123507 [ 2205.13848 ].\n- [2] S. Cristiani et al., Spectrographs and Spectroscopists for the Sandage Test , 2, 2023 [ 2302.04365 ].\n- [3] F. Combes, Science with SKA , in Semaine de l'astrophysique française 2021 , 7, 2021 [ 2107.03915 ].\n- [4] R. Braun, T. Bourke, J.A. Green, E. Keane and J. Wagg, Advancing Astrophysics with the Square Kilometre Array , PoS AASKA14 (2015) 174.\n- [5] A. Sandage, The change of redshift and apparent luminosity of galaxies due to the deceleration of selected expanding universes , Astrophys. J. 136 (1962) .\n- [6] G. McVittie, Appendix to the change of redshift and apparent luminosity of galaxies due to the deceleration of selected expanding universes , Astrophys. J. 136 (1962) .\n- [7] A. Loeb, Direct Measurement of Cosmological Parameters from the Cosmic Deceleration of Extragalactic Objects , Astrophys. J. Lett. 499 (1998) L111 [ astro-ph/9802122 ].\n- [8] A.G. Kim, E.V. Linder, J. Edelstein and D. Erskine, Giving Cosmic Redshift Drift a Whirl , Astropart. Phys. 62 (2015) 195 [ 1402.6614 ].\n- [9] O.F. Piattella and L. Giani, Redshift drift of gravitational lensing , Phys. Rev. D 95 (2017) 101301 [ 1703.05142 ].  \n- [10] A. Heinesen, Multipole decomposition of redshift drift - model independent mapping of the expansion history of the Universe , Phys. Rev. D 103 (2021) 023537 [ 2011.10048 ].\n- [11] P. Bessa, R. Durrer and D. Stock, Perturbations of cosmological redshift drift , JCAP 11 (2023) 093 [ 2306.13911 ].\n- [12] A. Heinesen, Redshift drift as a model independent probe of dark energy , Phys. Rev. D 103 (2021) L081302 [ 2102.03774 ].\n- [13] S.M. Koksbang and A. Heinesen, Redshift drift in a universe with structure: Lemaître-Tolman-Bondi structures with arbitrary angle of entry of light , Phys. Rev. D 106 (2022) 043501 [ 2205.11907 ].\n- [14] J. Liske et al., Cosmic dynamics in the era of Extremely Large Telescopes , Mon. Not. Roy. Astron. Soc. 386 (2008) 1192 [ 0802.1532 ].\n- [15] R. Cooke, The ACCELERATION programme: I. Cosmology with the redshift drift , Mon. Not. Roy. Astron. Soc. 492 (2020) 2044 [ 1912.04983 ].\n- [16] ANDES collaboration, Cosmology and fundamental physics with the ELT-ANDES spectrograph , Exper. Astron. 57 (2024) 5 [ 2311.16274 ].\n- [17] C.M.J. Marques, C.J.A.P. Martins and C.S. Alves, Fundamental cosmology from ANDES precision spectroscopy , Mon. Not. Roy. Astron. Soc. 522 (2023) 5973 [ 2305.01446 ].\n- [18] H.-R. Klöckner, D. Obreschkow, C. Martins, A. Raccanelli, D. Champion, A.L. Roy et al., Real time cosmology - A direct measure of the expansion rate of the Universe with the SKA , PoS AASKA14 (2015) 027 [ 1501.03822 ].\n- [19] K. Bolejko, C. Wang and G.F. Lewis, Direct detection of the cosmic expansion: the redshift drift and the flux drift , 1907.04495 .\n- [20] S.M. Koksbang, Redshift drift in a universe with structure. II. Light rays propagated through a Newtonian N-body simulation , Phys. Rev. D 107 (2023) 063544 [ 2303.06900 ].\n- [21] S.M. Koksbang, A. Heinesen and H.J. Macpherson, Redshift drift in a universe with structure. III. Numerical relativity , Phys. Rev. D 110 (2024) 063519 [ 2404.06242 ].\n- [22] R. Durrer, The Cosmic Microwave Background , Cambridge University Press, 2 ed. (2020), 10.1017/9781316471524.\n- [23] T. Inoue, E. Komatsu, W. Aoki, T. Chiba, T. Misawa and T. Usuda, The effect of our local motion on the Sandage-Loeb test of the cosmic expansion , Publ. Astron. Soc. Jap. 72 (2020) 131 [ 1911.01467 ].\n- [24] Planck collaboration, Planck 2018 results. VI. Cosmological parameters , Astron. Astrophys. 641 (2020) A6 [ 1807.06209 ].\n- [25] S. Dodelson and F. Schmidt, Modern Cosmology , Elsevier (2021).\n- [26] D.J. Eisenstein and W. Hu, Power spectra for cold dark matter and its variants , Astrophys. J. 511 (1997) 5 [ astro-ph/9710252 ].\n- [27] C. Bonvin and R. Durrer, What galaxy surveys really measure , Phys. Rev. D 84 (2011) 063505 [ 1105.5280 ].\n- [28] V. Springel, R. Pakmor, O. Zier and M. Reinecke, Simulating cosmic structure formation with the gadget-4 code , Mon. Not. Roy. Astron. Soc. 506 (2021) 2871 [ 2010.03567 ].\n- [29] E. Di Dio, F. Montanari, J. Lesgourgues and R. Durrer, The CLASSgal code for Relativistic Cosmological Large Scale Structure , JCAP 11 (2013) 044 [ 1307.1459 ].\n- [30] D. Blas, J. Lesgourgues and T. Tram, The Cosmic Linear Anisotropy Solving System (CLASS). Part II: Approximation schemes , JCAP 2011 (2011) 034 [ 1104.2933 ].  \n- [31] S.R. Green and R.M. Wald, Newtonian and Relativistic Cosmologies , Phys. Rev. D 85 (2012) 063512 [ 1111.2997 ].\n- [32] X. Fang, E. Krause, T. Eifler and N. MacCrann, Beyond Limber: Efficient computation of angular power spectra for galaxy clustering and weak lensing , JCAP 05 (2020) 010 [ 1911.11947 ].\n- [33] X. Fang, E. Krause, T. Eifler and N. MacCrann, Beyond limber: efficient computation of angular power spectra for galaxy clustering and weak lensing , Journal of Cosmology and Astroparticle Physics 2020 (2020) 010-010.\n- [34] F. Villaescusa-Navarro, Pylians: Python libraries for the analysis of numerical simulations , Astrophysics Source Code Library 1811.008 (2018) .\n- [35] W.L. Matthewson and R. Durrer, The Flat Sky Approximation to Galaxy Number Counts , JCAP 02 (2021) 027 [ 2006.13525 ].\n- [36] C. Howlett, The redshift-space momentum power spectrum - I. Optimal estimation from peculiar velocity surveys , Mon. Not. Roy. Astron. Soc. 487 (2019) 5209 [ 1906.02875 ].\n- [37] E. Di Dio, F. Montanari, J. Lesgourgues and R. Durrer, The CLASSgal code for Relativistic Cosmological Large Scale Structure , J. Cosmol. Astropart. Phys. 2013 (2013) 044.\n- [38] M. LoVerde and N. Afshordi, Extended Limber Approximation , Phys. Rev. D 78 (2008) 123506 [ 0809.5112 ]."}