Open Access
Issue
A&A
Volume 710, June 2026
Article Number A101
Number of page(s) 11
Section Cosmology (including clusters of galaxies)
DOI https://doi.org/10.1051/0004-6361/202659526
Published online 03 June 2026

© The Authors 2026

Licence Creative CommonsOpen Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

This article is published in open access under the Subscribe to Open model. This email address is being protected from spambots. You need JavaScript enabled to view it. to support open access publication.

1. Introduction

Cosmological N-body simulations are fundamental tools in modern cosmology, providing a numerical framework for studying the non-linear evolution of structure from the linear Gaussian early Universe to the highly non-linear cosmic web observed today. They allow us to test cosmological models, interpret large-scale surveys, and explore scenarios beyond the reach of analytic theory. The first attempts to model gravitational clustering in a cosmological context date back to the works of Peebles (1970) and Press & Schechter (1974), who studied the formation of galaxy clusters and introduced a statistical framework for halo formation. These early works laid the foundation for the development of numerical simulations that could capture the complexity of non-linear structure formation.

In the 1970s, the first cosmological N-body simulations were performed with relatively few particles and often employed free (open) boundary conditions in spherical regions, as in White (1976) and Aarseth et al. (1979). At that time, the focus was on modelling galaxy clusters, where edge effects were less critical. By the early 1980s, however, periodic boundary conditions became the standard choice. This shift was driven by the need to mimic an infinite, statistically homogeneous Universe and to avoid artificial edge effects, while also enabling efficient particle-mesh (PM) and hybrid TreePM algorithms that rely on Fourier methods (Klypin & Shandarin 1983; Xu 1995). The three-torus (T3 =S1 × S1 × S1) topological manifold is homeomorphic to the Cartesian product of three circles, and it is often described as a periodic box. Since the Lagrangian of a self-gravitating system in T3 is invariant to translation, the linear momentum is conserved in such a system. In the late 20th century, the notion that our Universe has this sort of topological manifold was considered a real possibility (Zeldovich & Starobinskij 1984; Broadhurst et al. 1990; Einasto et al. 1997), but modern large-volume galaxy surveys and cosmic microwave background (CMB) observations did not find any signs of periodicity (Hawkins et al. 2002; Planck Collaboration XVIII 2016) on the observed scales. Periodic boundary conditions are widely used in such codes as GADGET4 (Springel et al. 2022), AREPO (Weinberger et al. 2020), and PKDGRAV3 (Potter et al. 2017) and remain the dominant approach in large-scale cosmological simulations such as Millennium (Springel et al. 2005), Illustris (Genel et al. 2014), and Euclid flagship (Euclid Collaboration: Castander et al. 2025).

Despite their practicality, the three-torus topology is not an ideal representation of the Universe with trivial ℝ3 topological manifold. While the cubic T3 topology preserves statistical homogeneity, it breaks statistical isotropy, since the cube is invariant only under the octahedral group Oh, not the full continuous rotation group SO(3). According to Noether’s theorem, the angular momentum is generally not conserved in a periodic simulation box, since the Lagrangian of a particle system in this topology is not invariant under continuous rotation. This symmetry-breaking also introduces subtle anisotropies in the gravitational field and can bias clustering statistics, especially when the simulation box is not much larger than the scales of interest. In practice, these effects are mitigated by choosing sufficiently large volumes (Rácz et al. 2021).

To address these limitations of the most used T3 topology, alternative topological manifolds must be explored. Rácz et al. (2018) proposed the STEreographically Projected cosmological Simulations (StePS) algorithm, which uses a spherically symmetric ℝ3 topological manifold with spatial compactification. This approach preserves full rotational invariance and implements a radially varying resolution: high in the simulation centre and gradually decreasing towards the outskirts, reaching the scale of homogeneity to avoid boundary effects. In this space, the full angular momentum vector of a self-gravitating system is conserved. In this paper, we introduce a new hybrid simulation topology that combines the fully periodic and spherical StePS approaches: the cylindrical S1 × ℝ2 topological manifold. In this configuration, the simulation domain is periodic along one axis (the cylinder’s axis) and open in the radial direction. This design enables a zoom-in strategy similar to the spherical StePS approach, with high resolution near the central axis and decreasing resolution outward, while retaining periodicity in one dimension. The Lagrangian of a self-gravitating particle system in this space is invariant under translation along the cylinder’s axis and rotations in the ℝ2 plane, which are described by the SO(2) group. As a consequence of Noether’s theorem, the linear momentum along the cylinder’s axis and the angular momentum along the same axis are both conserved. Such a topology is particularly well-suited for studying naturally anisotropic environments such as filamentary structures or anisotropic cosmological models with the same symmetries.

This paper is organised as follows: in Sect. 2, we describe the base cosmological simulation algorithm. In Sect. 3, we present the initial condition generation method. Then, in Sect. 4, we introduce the first lambda cold dark matter (ΛCDM) simulations in cylindrical S1 × ℝ2 topological manifold. Finally, in Sect. 5, we summarise our results.

2. Algorithm

2.1. Equations of motion

The Newtonian equations of motion in comoving coordinates of a system composed of N particles can be written as

m i x i ¨ = j = 1 j i N m i m j F ( x i x j , h i + h j ) a ( t ) 3 2 m i H ( t ) x ˙ i , Mathematical equation: $$ \begin{aligned} m_i \ddot{\boldsymbol{x}_i} = \sum ^N_{\begin{matrix} j = 1 \\ j\ne i \end{matrix}} \frac{m_i m_j \boldsymbol{F}(\boldsymbol{x}_i - \boldsymbol{x}_j, h_i + h_j)}{a(t)^3} - 2 m_i H(t) \boldsymbol{\dot{x}}_i, \end{aligned} $$(1)

where xi, mi, and hi are the coordinate vector, mass, and softening length of the particle with i index, a(t) is the scale factor determined by the background cosmological model,

H ( t ) = a ˙ ( t ) a ( t ) Mathematical equation: $$ \begin{aligned} H(t) = \frac{\dot{a}(t)}{a(t)} \end{aligned} $$(2)

is the Hubble parameter, and F(xi − xj, hi + hj) is the smoothed gravitational force between particles i and j. This force depends on the ℱ(r, h) force softening and the background topology. In the StePS code, the softening,

F ( r , h ) = { 32 r 4 h 6 38.4 r 3 h 5 + 32 r 3 h 3 if r < h 2 , & 32 r 4 3 h 6 + 38.4 r 3 h 5 f r a c 48 r 2 h 4 + 64 r 3 h 3 1 15 r 2 if h 2 < r < h , & 1 r 2 if r > h , Mathematical equation: $$ \begin{aligned} \mathcal{F} (r, h) = \left\{ \begin{array}{l l} \frac{32{r}^{4}}{{h}^{6}}-\frac{38.4{r}^{3}}{{h}^{5}} +\frac{32r}{3{h}^{3}}&\;\text{ if}\quad r < \frac{h}{2},\\ \&\ \\ -\frac{32{r}^{4}}{3{h}^{6}}+\frac{38.4{r}^{3}}{{h}^{5}}-\\ frac{48{r}^{2}}{{h}^{4}}+\frac{64r}{3\,{h}^{3}}-\frac{1}{15{r}^{2}}&\;\text{ if} \quad \frac{h}{2} < r < h,\\ \&\ \\ \frac{1}{{r}^{2}}&\;\text{ if}\quad r>h, \end{array} \right. \end{aligned} $$(3)

is used (Rácz et al. 2019), which corresponds to the cubic spline kernel of Monaghan & Lattanzio (1985). The shape of the F(r, h) force function is determined by the background topology.

For a trivial, flat Euclidean ℝ3 space, the smoothed gravitational force law can be written as

F R 3 ( r , h ) = G F ( | r | , h ) r | r | , Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathbb{R} ^3}(\boldsymbol{r}, h) = -G\mathcal{F} (\left| \boldsymbol{r} \right|, h)\frac{\boldsymbol{r}}{\left| \boldsymbol{r} \right|}, \end{aligned} $$(4)

where G is the gravitational constant. This formula is equivalent to Newton’s law of universal gravitation if r > h. The standard flat ΛCDM cosmological model assumes this isotropic gravity, and it is possible to use this directly in the StePS simulation code. In the case of comoving simulations in this topology, the right hand side of Eq. (1) has to be extended with a simple radial term,

F r ( x i ) = + m i 4 π G 3 ρ 0 x i , Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_r(\boldsymbol{x}_i) = +m_i\frac{4\pi G}{3}\rho _0\boldsymbol{x}_i, \end{aligned} $$(5)

that prevents the system from collapsing, where ρ0 is the mean matter density in the simulation volume. For the detailed calculations, we refer to Rácz et al. (2018).

While the cosmological principle demands isotropic gravity, most cosmological simulations use non-trivial T3 topology for numerical convenience. In a periodic cubic box with a linear size, Lbox, multiple periodic images of the particles have to be taken into account with

F T 3 ( r , h ) = n G F ( | r n L box | , h ) r n L box | r n L box | , Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathrm{T} ^3}(\boldsymbol{r}, h) = \sum \limits _{\boldsymbol{n}}-G\mathcal{F} (|\boldsymbol{r} - \boldsymbol{n}L_{\rm box}|, h)\frac{\boldsymbol{r}-\boldsymbol{n}L_{\rm box}}{|\boldsymbol{r}-\boldsymbol{n}L_{\rm box}|} , \end{aligned} $$(6)

summation formula, where n = {n1, n2, n3}∈ℤ3, |r − Lbox ⋅ n|< Ncut ⋅ Lbox, and Ncut is the cut-off distance of the summation in linear box size units. In practice, this formula converges notoriously slowly and the number of periodic images scales with the third power of Ncut. To overcome this limitation, the Ewald (1921) summation method is used, in which the force is split into rapidly convergent real-space and reciprocal-space parts. While a straightforward implementation of Ewald summation provides sufficient accuracy, evaluating these sums requires hundreds or even thousands of floating-point operations for every interaction. This can be dramatically reduced by pre-computing the difference between the direct (nearest periodic image) forces and the fully periodic Ewald forces on a cubic grid (Hernquist et al. 1991). By constructing a lookup table from these values, one can use interpolation to efficiently add the Ewald correction term to the quasi-periodic force as

F T 3 ( r , h ) = F R 3 ( r , h ) + D Ewald ( r ) , Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathrm{T} ^3} (\boldsymbol{r}, h) = \boldsymbol{F}_{\mathbb{R} ^3}(\boldsymbol{r}, h) + \boldsymbol{D}_{\mathrm{Ewald} }(\boldsymbol{r}), \end{aligned} $$(7)

where r is the separation vector between the nearest image in the T3 manifold and DEwald(r) is the Ewald correction term. In practice, the long-range forces can be calculated with Fast Fourier Transform (FFT) (Cooley & Tukey 1965; Hockney & Eastwood 1988), which corresponds to Ncut → ∞, but this method is not implemented in StePS, since this topology is not the main focus of our code. In the T3 topological manifold, the linear momentum is conserved due to translational invariance. However, angular momentum is not conserved because the system’s Lagrangian lacks symmetry under continuous rotation. This is reflected in the force law: the force vector between two particles depends not only on their relative positions, but also on their orientation relative to the axes of the periodic box. For the detailed description of T3 periodic effects in cosmological simulations, we refer to Rácz et al. (2021).

In this work, we propose another non-trivial topology for cosmological simulations, the cylindrical S1 × ℝ2 topological manifold. This space is periodic only along one axis with a periodicity of Lz. For simplicity, we chose this as the ‘z’-axis and

F S 1 × R 2 ( r , h ) = n = N cut | r z n L z | < N cut L z N cut G F ( | r n L z e z | , h ) r n L z e z | r n L z e z | Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}(\boldsymbol{r}, h) = \sum \limits _{\begin{matrix} n=-N_{\mathrm{cut} } \\ |r_z-n L_z|< N_{\mathrm{cut} } L_z \end{matrix}}^{N_{\mathrm{cut} }}-G\mathcal{F} (|\boldsymbol{r} - n L_z \boldsymbol{e}_z|, h)\frac{\boldsymbol{r}-n L_z\boldsymbol{e}_z}{|\boldsymbol{r}-n L_z \boldsymbol{e}_z|} \end{aligned} $$(8)

summation describes the gravitational force field of a particle in this manifold, where ez = {0, 0, 1} is the unit vector in the z direction, rz is the z component of the r vector, and Ncut is the cut-off distance of the summation in linear cylinder size units. While this summation formula still converges slowly, the contribution of distant periodic images now can be directly summed, since the number of images scales only with Ncut. Nevertheless, the Ewald summation method still can be used in S1 × ℝ2 for a more accurate force calculation. A comparison between the gravitational forces in ℝ3, T3, and S1 × ℝ2 manifolds are shown in Fig. 1. It is important to note that while the Newtonian gravitational forces in a T3 space are always weaker than in ℝ3, the S1 × ℝ2 forces are weaker only in axial directions, whereas they are always stronger in radial directions.

Thumbnail: Fig. 1. Refer to the following caption and surrounding text. Fig. 1.

Comparison of gravitational force laws between the periodic cubic (T3) and the periodic cylindrical (S1 × ℝ2) geometry. Each plot demonstrates the deviation from the Newton’s law of universal gravitation due to the periodic topology. In both cases, a test particle was placed to the centre of the simulation volume, and the gravitational force field was calculated both in the corresponding and in ℝ3 topology. The heat maps are showing the |F|/|F3| ratio of the force field magnitudes. The vector plots are demonstrating the F − F3 difference of the gravitational force fields around the particle. The length of the arrows is proportional to the magnitude of the difference between the forces.

In comoving cosmological simulations, we only follow the evolution of cosmic structures in comoving coordinates. Since Newtonian gravity is an attractive force, we have to introduce an external force that keeps the simulation from collapsing into the central axis. The net force in every point should be exactly zero for homogeneous matter distribution in comoving coordinates. This can be achieved, if we compensate for the gravitational field, Fcylinder(r), of the homogeneous cylinder in every point. Due to the construction of the summation expressed in Eq. (8), all particles experience the gravitational pull of a cylinder of a height of 2 ⋅ Ncut ⋅ Lz, as if they were in the central plane of this cylinder. This gravitational force is calculated by Chang (1988) and takes the form of

F h ( ϱ , R , L ) = 2 G ρ 0 [ 2 0 R ln ( L 2 + R 2 + ϱ 2 + 2 ϱ R 2 Y 2 + L L 2 + R 2 + ϱ 2 2 ϱ R 2 Y 2 + L ) d Y + 0 R ln ( R 2 + ϱ 2 + 2 ϱ R 2 Y 2 R 2 + ϱ 2 2 ϱ R 2 Y 2 ) d Y ] , Mathematical equation: $$ \begin{aligned}&F_h(\varrho ,R,L) \nonumber \\&\quad = 2G\rho _0\left[-2\int ^R_0 \ln \left( \frac{\sqrt{L^2+R^2+\varrho ^2+2\varrho \sqrt{R^2-Y^2}}+L}{\sqrt{L^2+R^2+\varrho ^2-2\varrho \sqrt{R^2-Y^2}}+L}\right) dY \right. \nonumber \\&\quad \left. + \int ^R_0 \ln \left( \frac{\sqrt{R^2+\varrho ^2+2\varrho \sqrt{R^2-Y^2}}}{\sqrt{R^2+\varrho ^2-2\varrho \sqrt{R^2-Y^2}}}\right) dY\right], \end{aligned} $$(9)

for particles within the simulation volume, where ϱ = x 2 + y 2 Mathematical equation: $ \varrho = \sqrt{x^2+y^2} $ is the radial coordinate measured from the central axis, L = Ncut ⋅ Lz, while ρ0 is the mean matter density and R is the radius of the simulation volume. If Ncut → ∞, then the formula above can be simplified to

F h ( ϱ ) = 2 π G ρ 0 ϱ . Mathematical equation: $$ \begin{aligned} F_h(\varrho ) = -2\pi G\rho _0\varrho . \end{aligned} $$(10)

Using these formulae, we can write the equations of motion of a self-gravitating N-body system in S1 × ℝ2 topology in comoving coordinates as

m i x i ¨ = j = 1 j i N m i m j F S 1 × R 2 ( x i x j , h i + h j ) a ( t ) 3 2 m i H ( t ) · x ˙ i m i F h ( ϱ , R , N cut L z ) . Mathematical equation: $$ \begin{aligned} m_i \ddot{\boldsymbol{x}_i}&= \sum ^N_{\begin{matrix} j = 1 \\ j\ne i \end{matrix}} \frac{m_i m_j \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}(\boldsymbol{x}_i - \boldsymbol{x}_j, h_i + h_j)}{a(t)^3} - 2 m_i H(t) \cdot \boldsymbol{\dot{x}}_i \nonumber \\ &\quad - m_iF_h(\varrho , R, N_{\mathrm{cut} }L_z). \end{aligned} $$(11)

This coupled, second-order differential equation system is solved in our StePS implementation using a kick-drift-kick (KDK) leapfrog integrator (Klypin & Shandarin 1983), with cosmic time, t, as the integration parameter.

2.2. Ewald summation in S1 × ℝ2 topological manifold

To precisely calculate the periodic forces in cylindrical S1 × ℝ2 topological manifold, one must employ an Ewald summation along the one periodic direction. This problem has been explored in molecular dynamics (Grzybowski & Bródka 2002) and electrostatics (Tornberg 2015; Saffar Shamshirgar & Tornberg 2017), where these boundary conditions are useful in describing charged particles in strings, pores or channels. In our case, the gravitational force between masses mi and mj separated by r is split into real- and reciprocal-space parts as

F S 1 × R 2 ( r ) = F S 1 × R 2 real ( r ) + F S 1 × R 2 Fourier ( r ) + F S 1 × R 2 m = 0 . Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}(\boldsymbol{r}) = \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}^\mathrm{real}(\boldsymbol{r}) + \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}^\mathrm{Fourier}(\boldsymbol{r}) + \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}^{m = 0}. \end{aligned} $$(12)

The real-space part of the Ewald split,

F S 1 × R 2 real ( r ) = G n = n max n max r n | r n | 3 [ erfc ( α | r n | ) + 2 α π | r n | e α 2 | r n | 2 ] , Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}^\mathrm{real} (\boldsymbol{r}) = -G\,\sum _{n=-n_{\rm max}}^{n_{\rm max}} \frac{\boldsymbol{r}_n}{|\boldsymbol{r}_n|^{3}}\, \left[ {\text{ erfc}}(\alpha |\boldsymbol{r}_n|) + \frac{2\alpha }{\sqrt{\pi }}\,|\boldsymbol{r}_n|\,e^{-\alpha ^2 |\boldsymbol{r}_n|^{2}} \right], \end{aligned} $$(13)

is identical in form to the T3 case, but the image set now runs over one integer along the z-axis, where rn = r + nLzez and α is the Ewald-split parameter. In Fourier space, the z component of the wavevector k z = 2 π m L z Mathematical equation: $ k_z=\frac{2\pi m}{L_z} $ is discrete due to periodicity in z, but continuous in the other components. Carrying out the two-dimensional Fourier integrals, the force contribution at a 𝜚 radial and z axial separation becomes

F S 1 × R 2 Fourier ( ϱ , z ) = 2 G L z m = 1 m max [ cos ( k m z ) B ( k m , ϱ ) ] , Mathematical equation: $$ \begin{aligned} \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}^\mathrm{Fourier}(\varrho ,z) = -\frac{2\,G}{L_z} \sum _{m = 1}^{m_{\rm max}} \boldsymbol{\nabla } \left[ \cos (k_m z) \mathcal{B} (k_m, \varrho ) \right], \end{aligned} $$(14)

where the kernel,

B ( k m , ϱ ) = e k m ϱ erfc ( k m 2 α + α ϱ ) + e k m ϱ erfc ( k m 2 α α ϱ ) , Mathematical equation: $$ \begin{aligned} \mathcal{B} (k_m,\varrho ) = e^{k_m \varrho } \text{ erfc}\left(\frac{k_m}{2\alpha } + \alpha \varrho \right) + e^{-k_m \varrho } \text{ erfc}\left(\frac{k_m}{2\alpha } - \alpha \varrho \right), \end{aligned} $$(15)

avoids the use of modified Bessel functions by utilising the analytical Gaussian filtering instead. The m = 0 mode represents the background contribution of the periodic mass line, yielding a radial force of

F ϱ m = 0 = 2 G L z ϱ ( 1 e α 2 ϱ 2 ) . Mathematical equation: $$ \begin{aligned} F_{\varrho }^{m = 0} = -\frac{2\,G}{L_z \varrho }(1 - e^{-\alpha ^2 \varrho ^2}). \end{aligned} $$(16)

While this Ewald summation converges faster than the direct summation of the periodic images, it is still too slow to calculate directly between every particle-particle interaction. To overcome this issue in the StePS implementation, we build a 2D lookup table,

D ( ρ , z ) = F S 1 × R 2 ( ρ , z ) F R 3 ( ρ , z ) , Mathematical equation: $$ \begin{aligned} \boldsymbol{D}(\rho , z) = \boldsymbol{F}_{\mathrm{S} ^1\times \mathbb{R} ^2}(\rho , z) - \boldsymbol{F}_{\mathbb{R} ^3}(\rho , z) , \end{aligned} $$(17)

on an equally spaced grid in 𝜚 and z cylindrical coordinates, where F3(𝜚, z) is the nearest-image Newtonian force. This correction vector is smoothly interpolated during the simulation with cloud-in-cell (CIC) or triangular shaped cloud (TSC) method and added to the nearest image interactions.

Since the direct summation of the periodic images in S1 × ℝ2 is possible, we used Ncut = 107 real-space periodic images in both direction to construct a brute-force reference lookup-table. We used this to find the optimal α Ewald-split parameters for fixed nmax and mmax values. This can be seen in Fig. 2.

Thumbnail: Fig. 2. Refer to the following caption and surrounding text. Fig. 2.

Accuracy of S1 × ℝ2 periodic summation methods. For all tests, the correction lookup table D(ρ, z) was computed on a 144 × 128 grid, varying the truncation parameter Ncut or the Ewald parameters α, nmax, and mmax. Using these tables, we reconstructed the full periodic force field FS1 × ℝ2(ρ, z) = F3(ρ, z)+D(ρ, z) and compared it against a reference field. This reference field was generated via direct summation using Ncut = 107 periodic images, requiring approximately 104 s of computation time. Left: Mean force errors of direct periodic real-space summation as a function of Ncut. Although summation occurs only along a single direction (the z-axis), convergence remains exceptionally slow. Center: S1 × ℝ2 Ewald summation force accuracy as a function of the Ewald splitting parameter α with fixed nmax = 5 and mmax = 12 values. Using only 5 periodic images in real space and 12 modes in reciprocal space is sufficient to achieve single-precision (32-bit) floating-point accuracy when the optimal splitting parameter is applied. Right: Same as the center panel, but with fixed nmax = 7 and mmax = 14. Increasing both nmax and mmax by two improves the force accuracy by nearly three orders of magnitude (a factor of ∼600).

2.3. Background evolution

The background expansion of the Universe is described by the scale factor, a(t), and the Hubble parameter, H(t), and used in Eq. (11). These can be calculated for any given time by solving the Friedmann equation (Peacock 1999; Frieman et al. 2008)

( a ˙ a ) 2 = H 0 2 [ Ω r , 0 a 4 + Ω m , 0 a 3 + Ω k , 0 a 2 + Ω DE ( a ) ] , Mathematical equation: $$ \begin{aligned} \left(\frac{\dot{a}}{a}\right)^2 = H_0^2 \left[ \Omega _{r,0} a^{-4} + \Omega _{m,0} a^{-3} + \Omega _{k,0} a^{-2} + \Omega _{DE}(a) \right], \end{aligned} $$(18)

where Ωr, 0 is the radiation,Ωm, 0 is the non-relativistic matter, Ωk, 0 is the curvature, and

Ω DE ( a ) = Ω D E , 0 exp [ 3 1 a 1 + w DE ( a ) a d a ] Mathematical equation: $$ \begin{aligned} \Omega _{DE}(a) = \Omega _{DE,0} \exp \left[ -3 \int _1^a \frac{1 + w_{DE}(a\prime )}{a\prime } da\prime \right] \end{aligned} $$(19)

is the dark energy density parameter. In a Chevallier-Polarski-Linder (CPL) parametrisation (Chevallier & Polarski 2001; Linder 2003), the wDE(a) dark energy equation of state parameter is written as

w DE ( a ) = w 0 + w a ( 1 a ) , Mathematical equation: $$ \begin{aligned} w_{DE}(a) = w_0 + w_a (1 - a), \end{aligned} $$(20)

where w0 and wa are free parameters of the model. The wa = 0 corresponds to the wCDM model, while the cosmological constant (ΛCDM) is recovered when w0 = −1 and wa = 0 in this parametrisation. For the ΛCDM, wCDM, and general CPL cosmologies, the scale factor, a(t), is determined by solving Eq. (18) with a fourth-order Runge-Kutta method in our StePS implementation. This Friedmann solver uses the same timestep length as the N-body integrator. Our current implementation also supports the use of tabulated expansion histories, which can be loaded from an ASCII file. When using these tabulated histories, the code interpolates between the provided values. The interpolation scheme can be configured to use linear, quadratic, or cubic algorithms.

2.4. Force calculation

To solve Eq. (11), we have to calculate the acceleration of each particle at every timestep. The calculation of the Hubble drag and the boundary term scales with 𝒪(N), where N is the total number of particles in the simulation. The gravitational interaction between the particles is considerably more complex, since a naive approach requires evaluating all pairwise forces, leading to a computational cost of 𝒪(N2).

2.4.1. Direct

The first public version of the StePS code supported only direct force calculation, and this option remains available. This was feasible because the original ℝ3 StePS algorithm employs a radially decreasing resolution, allowing a large dynamical range to be covered with only a few million particles. In such a configuration, the computational cost of the 𝒪(N2) pairwise summation is manageable, especially when combined with efficient GPU parallelization. This approach leverages the zoom-in nature of the method: high resolution is concentrated near the centre, while outer regions are represented by fewer, more massive particles, significantly reducing the total N compared to uniform-resolution simulations. A direct force calculation was implemented in StePS for both CPUs and GPUs using MPI-OpenMP and MPI-OpenMP-CUDA parallelisation, respectively. In the newly implemented S1 × ℝ2 topological manifold, which applies a similar zoom-in strategy in cylindrical coordinates, direct summation remains practical only for smaller cylinders. Because the resolution along the periodic axis is constant, simulations of larger volumes become less efficient with this method. Nevertheless, direct summation is retained in the code as a benchmark due to its simplicity and minimal force-computation errors.

2.4.2. Octree

For larger particle numbers, the 𝒪(N2) force calculation method becomes inefficient even on GPUs. To address this, the new StePS version implements a Barnes & Hut (1986) octree force calculation method for both the original ℝ3 and the new cylindrical S1 × ℝ2 topological manifold to reduce the complexity to 𝒪(N log N). In our implementation, the octree domains are always cubic and the size of the root node is always twice that of the largest linear dimension of the simulation volume: either the cylinder’s height or diameter in the S1 × ℝ2 topology, or the simulation diameter in the ℝ3 mode.

To minimize systematic errors arising from spatial correlations of the octree geometry, the code introduces random shifts and rotations of the domain at every timestep. In cylindrical topology, the domain center is shifted randomly along the cylinder axis and rotated around the same axis by a random angle. In ℝ3 mode, the domain center is shifted randomly within a sphere of a radius Rsim/2 from the simulation center, while the octree is rotated around a random axis by a random angle. These transformations help decorrelate force errors and improve the statistical isotropy of the simulation.

In contrast to direct summation, the octree method offers a dramatic improvement in performance for large particle numbers, but at the cost of introducing small force errors that depend on tree parameters and particle distribution. This is particularly important for maintaining radial balance in both the S1 × ℝ2 and ℝ3 cases, where long-range force accuracy governs the stability of the system. While a direct summation automatically satisfies this requirement, the octree-based calculations can lead to spurious radial collapse or expansion if uncorrected. Such a radial instability would change the background density over time during a simulation, which could alter the linear and non-linear power spectrum in a cosmological case. The current StePS implementation performs a calibration step before the simulation starts: the initial particle load (glass) is used to measure the radial force error under the same octree parameters as the simulation, applying multiple random shifts and rotations. From these measurements, a radial lookup table can be constructed, which is then used during the run to correct octree forces by subtracting the interpolated radial error at every timestep. This correction ensures that the large-scale radial equilibrium is preserved in comoving coordinates without sacrificing the efficiency of the octree. We demonstrate the implemented octree force calculation accuracy with and without a radial correction in a cosmological simulation at different redshifts in Fig. 3.

Thumbnail: Fig. 3. Refer to the following caption and surrounding text. Fig. 3.

Force accuracy as a function of the octree opening angle, Θ, in a cylindrical cosmological volume at different redshifts. We evolved 6 ⋅ 104 particles in standard ΛCDM cosmology with direct force calculation in a periodic cylinder with Lz = 200.0 Mpc height and Rsim = 100.0 Mpc radius for this accuracy test. After the simulation was finished, we calculated the FBH octree forces with our StePS simulation code. The FD direct forces were used as a ground truth in the comparison. We calculated the octree forces with and without the radial force correction. Left: Relative total ⟨|FBH − FD|/|FD|⟩ force error. The magnitude of the force error is behaving similarly as in the well tested cubic T3 case. The new radial force correction calculated from the initial particle load increases the accuracy in all redshifts. Center: Mean radial ⟨FBH, 𝜚/FD, 𝜚⟩ force error. While the raw radial octree force have a non-zero expected value at high Θ values, the implemented radial correction fixes this in all redshifts for Θ ≤ 0.5. It is critical to use this correction, since a systematic bias in radial direction will cause contraction or expansion of the simulated volume, which will alter the structure formation due to the changed background density. Right: Mean tangential ⟨FBH, ϑ/FD, ϑ⟩ force error. In contrast to the radial case, the measured tangential force errors are consistent with a zero mean. A non-zero systematic bias in this component would cause errors in the total angular momentum.

The octree implementation is available only with MPI-OpenMP parallelization, making it suitable for CPU clusters. The GPU accelerated octree force calculation will be implemented in the future.

3. Generating initial conditions

The first step in running a cosmological N-body simulation is to generate initial conditions that are consistent with the chosen cosmological parameters. This is typically done in two separate steps: (i) prepare a particle distribution that represents a homogeneous density field and (ii) imprint the density fluctuations predicted by linear theory for the adopted cosmological model. In this section, we outline these steps for the S1 × ℝ2 topological manifold.

3.1. Simulation geometry and initial particle load

The main simulation challenge in non-finite-volume topological manifolds is to handle the edge effects where the simulation transitions from the unresolved to the resolved volume. The original spherical StePS algorithm addressed this in ℝ3 by compactifying space via the inverse stereographic projection. In S1 × ℝ2 topological manifold, we applied the same technique in two dimensions to the non-compact (x, y) directions.

The inverse stereographic projection is a bijection between the compact n-sphere Sn and ℝn (excluding the projection point Q). Here, we compactify ℝ2 to S2 and work in cylindrical coordinates (𝜚,φ, z). Only the radial coordinate ϱ = x 2 + y 2 Mathematical equation: $ \varrho=\sqrt{x^2+y^2} $ is transformed as

ω = 2 arctan ( ϱ D s ) , Mathematical equation: $$ \begin{aligned} \omega = 2\,\arctan \!\left(\frac{\varrho }{D_s}\right), \end{aligned} $$(21)

where Ds is the diameter of the S2 sphere used in the mapping and ω ∈ [0, π) is the new compact coordinate. The point ω → π corresponds to 𝜚 → ∞ and is excluded from the finite computational domain. This corresponds to the last volume element around Q. Next, we tessellate the compactified domain uniformly in the coordinates (ω, φ, z). To avoid excessively steep variations in the non-compact resolution, we enforced a constant mass resolution inside a cylindrical core ω < ωc, where ωc is the maximum compact coordinate for which constant mass resolution is maintained. We then placed a single particle at a random location in each compact cell and assigned it a mass of m i = ρ ¯ V i Mathematical equation: $ m_i = \bar{\rho}\,V_i $, where ρ ¯ Mathematical equation: $ \bar{\rho} $ is the mean comoving density and Vi is the corresponding cell volume in the non-compact (𝜚,φ, z) coordinates. This ensures that the compact-to-physical Jacobian of the inverse stereographic map is properly accounted for. Once the sample particles are prepared, we transform the compact radius back to the non-compact radius using a stereographic projection,

ϱ = D s tan ω 2 · Mathematical equation: $$ \begin{aligned} \varrho = D_s\,\tan {\frac{\omega }{2}} \cdot \end{aligned} $$(22)

Following this transformation, we have a zoom-in geometry in the non-compact space where the spatial resolution smoothly decreases with the radial 𝜚 coordinate, until we reach the edge of the resolved region (Rsim). The distribution of the particle masses for an example realisation as a function of the radial 𝜚 coordinate can be seen in Fig. 4. Using Eq. (22), the non-compact radius of constant resolution 𝜚c can be calculated.

Thumbnail: Fig. 4. Refer to the following caption and surrounding text. Fig. 4.

Mass resolution as a function of radial coordinate 𝜚 in an example cylindrical glass. The parameters of this glass are the following: DS = 70 Mpc, Rsim = 500.0 Mpc, ωc = 1.63973 RAD, Lz = 500 Mpc, and the total particle number is Npart = 1.2 ⋅ 106. The glass has constant resolution for 𝜚 < 𝜚c = DStan(ωc/2) = 75.0 Mpc to avoid unwanted mixing of particles with widely different masses in the simulations.

To use this distribution as an initial particle load during the initial condition generation, we required the net comoving gravitational acceleration on each particle to be approximately zero. The usual method for this is to use this particle distribution as an initial condition for glass-making (White 1994). The StePS simulation code is able to generate such glasses in S1 × ℝ2 topology by running a comoving cosmological N-body simulation with repulsive gravity. During the simulation, the particles are losing energy due to the Hubble-drag term in Eq. (11), and after 𝒪(105 − 106) expansion factors, they are settling down in a glass-like structure where the net gravitational acceleration of every particle is negligible.

3.2. Initial perturbations

Once the initial particle load is ready, we generated the initial perturbations using the stepsic2 code (Pál et al. in prep.)1. This program supports T3, ℝ3, and S1 × ℝ2 topologies and can be applied in either the Zel’dovich approximation (1LPT) or second-order Lagrangian perturbation theory (2LPT). Given the cosmology, we can compute the linear matter power spectrum at the time of the initial scale factor (ainit) as

P lin ( k , a init ) = D 2 ( a init ) T 2 ( k ) P 0 ( k ) , Mathematical equation: $$ \begin{aligned} P_{\rm lin}(k,a_{\rm init}) \;=\; D^2(a_{\rm init})\,T^2(k)\,P_0(k), \end{aligned} $$(23)

where P0(k) is the primordial power spectrum, T(k) is the transfer function, and D(a) is the linear growth function. We then realised a Gaussian random field, δ(k), following the standard Rayleigh–phase sampling (Sirko 2005). For each independent Fourier mode, we draw a random phase θk ∼ 𝒰(−π, π) and an amplitude, Ak, from a Rayleigh distribution with scale parameter, σk, chosen so that the real and imaginary parts of δ(k) end up independent Gaussian variates with zero mean and variance σk2 = Plin(|k|,ainit)/2. We then enforced the Hermitian symmetry δ(−k) = δ*(k) to ensure a real configuration-space field and proceeded to compute the displacement and velocity fields.

The initial comoving positions, xi, and velocities, i, were obtained by displacing the Lagrangian particle coordinates, qi, of the initial particle load according to the Zel’dovich expression,

x i = q i + i k k 2 δ ( k ) e i q i k , Mathematical equation: $$ \begin{aligned} \boldsymbol{x}_i&= \boldsymbol{q}_i + \int \frac{i\boldsymbol{k}}{k^2} \delta (\boldsymbol{k}) e^{i\boldsymbol{q}_i\boldsymbol{k}},\end{aligned} $$(24)

x ˙ i = D ˙ ( a init ) D ( 1 ) i k k 2 δ ( k ) e i q i k , Mathematical equation: $$ \begin{aligned} \dot{\boldsymbol{x}}_i&= \frac{\dot{D}(a_{\rm init})}{D(1)}\int \frac{i\boldsymbol{k}}{k^2} \delta (\boldsymbol{k}) e^{i\boldsymbol{q}_i\boldsymbol{k}}, \end{aligned} $$(25)

or, alternatively, with a 2LPT approximation (Buchert 1994; Jenkins 2010).

4. Results

4.1. ΛCDM simulation

To validate the new simulation method, we run a new cosmological N-body simulation with the updated version of our StePS code in S1 × ℝ2 topology. We used the best-fit Planck 2018 (Planck Collaboration VI 2020) ΛCDM cosmological parameters and a 2LPT method to generate the initial conditions of a periodic cylinder with a height of Lz = 1.0 Gpc and resolved radius of Rsim = 500 Mpc. As an initial particle load, we used a cylindrical glass with height 500 Mpc and radius = 500 Mpc, repeated along the z axis. The initial power spectrum was calculated by CAMB (Code for Anisotropies in the Microwave Background) (Lewis et al. 2000; Lewis & Challinor 2011) at z = 0, and backscaled to the zinit = 49 initial redshift with the linear growth function. The parameters of the simulation can be seen in Table 1. The simulation was run on the CSC Puhti2 supercomputer using 640 CPU cores and 3085 timesteps. On average, one integration timestep took 60 seconds of wall-clock time. Overall 138 particle snapshots were stored between redshifts 31 and 0. The pySPHviewer (Benítez-Llambay 2017) visualisation of the dark matter distribution in this simulation in different slices and redshifts can be seen in Fig. 5. In our S1 × ℝ2 topology, a cosmic web forms from the small initial density fluctuations due to gravity, similarly to the T3 and ℝ3 simulations.

Thumbnail: Fig. 5. Refer to the following caption and surrounding text. Fig. 5.

Thin slices of the dark matter density field from the first S1 × ℝ2 StePS simulation at z = 11, z = 3, and z = 0 redshifts in comoving coordinates. Each slice has a thickness of 15.0 Mpc and each column shows a different slice orientation. The late-time non-linear cosmic web is visually similar to that found in T3 and ℝ3 simulations: voids, walls, filaments, and dark matter halos are clearly visible. Due to the zoom-in nature of the StePS S1 × ℝ2 simulation method, the spatial resolution is highest along the central axis, while only the largest structures are resolved near the Rsim simulation radius.

Table 1.

Parameters of the first cosmological N-body simulation in S1 × ℝ2 topology.

4.2. Power spectra

The isotropic P(k) power spectrum of the dark matter density field is a standard statistic used to quantify the clustering. This is defined as

δ ( k ) δ ( k ) = ( 2 π ) 3 δ D ( k k ) P ( k ) , k | k | , Mathematical equation: $$ \begin{aligned} \left\langle \delta (\boldsymbol{k})\,\delta ^*(\boldsymbol{k}\prime ) \right\rangle = (2\pi )^3\,\delta _{\rm D}(\boldsymbol{k}-\boldsymbol{k}\prime )\,P(k), \qquad k\equiv |\boldsymbol{k}|, \end{aligned} $$(26)

where δD is the Dirac delta function and the angle brackets denote an ensemble average and

δ ( k ) = δ ( x ) e i k · x d 3 x = ρ DM ( x ) ρ ¯ DM ρ ¯ DM e i k · x d 3 x Mathematical equation: $$ \begin{aligned} \delta (\boldsymbol{k}) = \int \delta (\boldsymbol{x})\,e^{-i\boldsymbol{k}\cdot \boldsymbol{x}}\,\mathrm{d}^3x = \int \frac{\rho _{\rm DM}(\boldsymbol{x})-\bar{\rho }_{\rm DM}}{\bar{\rho }_{\rm DM}} \,e^{-i\boldsymbol{k}\cdot \boldsymbol{x}}\,\mathrm{d}^3x \end{aligned} $$(27)

is the Fourier transform of the dark matter density contrast of the simulation. In a periodic T3 volume, P(k) can be estimated efficiently using FFTs on a uniform grid. In the S1 × ℝ2 topology, however, the StePS zoom-in particle load implies a strongly position-dependent effective sampling and a non-trivial window, so making a direct FFT-based estimate on a single uniform grid is not straightforward. We therefore estimated the power spectra from particle snapshots using the Feldman–Kaiser–Peacock (FKP) method (Feldman et al. 1994). The FKP estimator was originally developed to measure galaxy power spectra from redshift surveys with non-uniform selection functions and complex survey geometries. It constructs a weighted fluctuation field by subtracting a synthetic, unclustered ‘random’ catalogue that follows the same selection function and window as the data and then it applies a Fourier transform to this weighted field. This random catalogue in our case is the initial conditions that was used during glass making. The estimated power spectra of a few selected snapshots can be seen in Fig. 6. The estimated power spectra follow the back-scaled CAMB predictions on linear scales, while showing a good agreement with the non-linear Mead et al. (2021) halofit power spectrum emulator, which was calibrated on large cubic T3 simulations.

Thumbnail: Fig. 6. Refer to the following caption and surrounding text. Fig. 6.

Dark matter power spectra of four selected snapshots (solid lines) with the corresponding theoretical linear power spectra (dashed lines) and the non-linear Mead et al. (2021) halofit power spectra (dotted dashed lines). Our S1 × ℝ2 StePS simulation is capable of following both linear and non-linear structure formation.

4.3. Dark matter halos

The dark matter halos are gravitationally bound dark matter regions that have decoupled from the cosmic expansion and collapsed (Wechsler & Tinker 2018). While these halos are the prospective hosts of galaxies, the present runs are dark-matter-only, so individual galaxies are not explicitly resolved in our simulations. As a consequence of the S1 × ℝ2 zoom-in configuration, low-mass halos and the fine internal structure of halos can be captured with high fidelity near the axis, while more massive halos are resolvable within larger volumes, according to the M(𝜚) mass resolution profile in Fig. 4. As existing halo finders are not designed for S1 × ℝ2 zoom-in geometries, we implemented our own spherical-overdensity (SO) halo finder, StePS_HF (Rácz et al. in prep.).

StePS_HF follows the SO algorithm (Tormen et al. 1998; Despali et al. 2016) widely used in cosmological analyses, adapted to the S1 periodicity along the z direction and the non-compact, radially varying the resolution in the transverse plane. After loading one snapshot, we reconstructed a local density for each particle using a k-nearest-neighbour estimator that is robust to inhomogeneous sampling. We then identified the highest-density unflagged particle as a provisional centre and grew a sphere around it, accumulating mass until the mean enclosed density first dropped below the chosen threshold, ρ ¯ ( < R vir ) = ρ vir ( z ) Mathematical equation: $ \bar{\rho}({ < }R_{\mathrm{vir}}) = \rho_{\mathrm{vir}}(z) $, where ρvir is the redshift-dependent virial density from spherical collapse (Bryan & Norman 1998). Whenever the resulting candidate contained at least Np, min particles, we refined its centre by replacing the seed position with the centre of mass of the innermost Np, min particles and recomputing essential parameters (Rvir, Mvir), other mass definitions (M200c, M200b, M500c, M1000c, etc.), the corresponding radii, and other halo properties such as the peculiar velocity (V), Klypin scale radius (RKlypin, Klypin et al. 2011), concentration (c), angular momentum (J), Bullock-spin (λB, Bullock et al. 2001), and total energy (E). All particles within Rvir were then flagged as members and the process was repeated on the remaining unflagged particles until no seeds above threshold remain.

We used Np, min = 15 as the minimum threshold for halo particles and identified dark matter halos in late-time snapshots. While this minimal particle number is usually sufficient to identify halo positions, a higher threshold is needed for the reliable measurement of structural parameters (Knebe et al. 2011). At the final state (redshift 0), we found 1.1 ⋅ 105 dark matter halos. The spatial distribution of these halos is visualised in Fig. 7 at three selected redshifts. Overall, 68 parameters were calculated for each identified halo.

Thumbnail: Fig. 7. Refer to the following caption and surrounding text. Fig. 7.

Spatial distribution of dark matter halos in the new S1 × ℝ2 StePS simulation at different redshifts, in comoving coordinates. Due to the zoom-in geometry, and the fact that low-mass halos form first, halos first appear close to the central axis, where the resolution is highest, and the smallest halos can be resolved. As structure formation proceeds towards higher masses, halos can later be found at larger radii, where the resolution is lower, and only more massive halos can be resolved. Towards larger ϱ = x 2 + y 2 Mathematical equation: $ \varrho=\sqrt{x^2+y^2} $ only increasingly massive halos are resolved, so the apparent decline in number density at large 𝜚 is a selection effect.

4.4. Identifying signals of anisotropy

A recent analysis of the James Webb Space Telescope (JWST) Advanced Deep Extragalactic Survey (JADES) reported a statistically significant deviation from isotropy in galaxy spin directions (Shamir 2025). Motivated by these findings and by the fact that the gravity is inherently anisotropic in S1 × ℝ2 topology, we have aimed to detect corresponding late-time signatures of anisotropy in our simulation. In our setup, the compact direction is the periodic z-axis and the manifold retains an SO(2) rotational symmetry around this axis. Since we assumed statistical isotropy during the initial condition generation, any global anisotropy at the halo scales should appear as a deviation from uniformity in the distribution of the angle

θ Jz = cos 1 ( J z | J | ) Mathematical equation: $$ \begin{aligned} \theta _{Jz} = \cos ^{-1}\left(\frac{J_{z}}{|\boldsymbol{J}|}\right) \end{aligned} $$(28)

between the halo angular-momentum vector, J, and the z-axis. We measured J for every halo with Npart ≥ 100 particles to ensure accurate angular momenta, binned the halos by mass and tested the distribution against the isotropic expectation and plotted the results in Fig. 8. Isotropy was quantified by testing uniformity of cos θJz with Kolmogorov–Smirnov tests in each mass bin. Our result shows that for Lz = 1.0 Gpc comoving periodicity, within our statistical precision and for all mass bins considered, the halo spin–axis distribution is consistent with statistical isotropy in our ΛCDM simulation. We emphasise that smaller compact lengths could in principle enhance anisotropy, but such values are strongly constrained by CMB observations (Planck Collaboration XVIII 2016) and by modern large-scale galaxy surveys (Roukema & Edge 1997; Hawkins et al. 2002; Luminet 2016). Our result shows that the S1 × ℝ2 topology, at least for the comoving Lz = 1.0 Gpc periodicity, does not provide a natural explanation for the JWST rotation-sense asymmetry reported by Shamir (2025).

Thumbnail: Fig. 8. Refer to the following caption and surrounding text. Fig. 8.

Distribution of the halo spin orientation angle, θJz, with respect to the simulation z-axis, shown for three mass bins at redshift z = 0.5 in our S1 × ℝ2ΛCDM simulation. We only used halos with Npart > 100 in this analysis to reliably measure the angular momentum vectors. The histogram uses equal-area binning on the unit sphere, so that an isotropic spin distribution implies equal expected counts per bin. Each panel is annotated with the one-sample Kolmogorov-Smirnov test on u = 1 2 ( 1 + cos ( θ Jz ) ) [ 0 , 1 ] Mathematical equation: $ u=\frac{1}{2}(1+\cos(\theta_{Jz}))\in[0,1] $ against the uniform null. The three mass bins show no departures from the isotropic expectation. We found similar distributions in all other output redshifts and mass bins with no clear signs of anisotropy.

5. Summary

We present a new capability of the StePS simulation code that enables compactified cosmological N-body simulations in S1 × ℝ2 topology. We summarise the large-scale modifications of the gravitational field induced by this slab periodic boundary condition, described the simulation algorithm, and outline the initial condition generation procedure. We present the first S1 × ℝ2ΛCDM simulation run with our StePS code and show that it reproduces the expected linear and non-linear growth of structures. The ΛCDM simulation particle outputs, post-processed data, and example notebooks are freely available on our project webpage3.

The new simulation topology offers several practical advantages compared to the usual T3 setup:

  • Since the angular momentum in this topology is conserved along the axis of periodicity, the S1 × ℝ2 StePS simulations are ideal for studying systems where this quantity plays an important role; for instance, in the context of cosmic filaments and their interactions with dark matter halos or anisotropic cosmological models, such as Bianchi type VII models.

  • The zoom-in implementation improves the balance between small- and large-scale modes relative to a constant-resolution T3 run: small scales are resolved at high fidelity only within ω < ωc around the central axis, while long-wavelength modes are sampled over substantially larger volumes.

  • Similarly, the halo catalogues sample the smallest halos near the axis, while more massive and rarer halos are sampled from much larger volumes due to the zoom-in strategy in ℝ2.

These benefits come with some limitations:

  • Since almost all simulation post-processing pipelines assume T3 geometry, processing the outputs of StePS usually requires heavy modifications in existing pipelines.

  • The zoom-in strategy introduces selection effects and sampling challenges that are absent in constant-resolution T3 simulations and these must be accounted for.

  • The anisotropic force field induced by the topology can imprint artefacts, similarly to known issues in the T3 case (Rácz et al. 2021). Based on preliminary tests, such effects might become non-negligible at late times if the periodic length is small, Lz ≲ 200 Mpc. A detailed characterisation of these systematics will be presented in future work.

We do not expect that the new algorithm will replace the well-tested cubic T3 simulations; rather, the aim of this work is to provide an alternative for cases where cubic symmetry can limit the results. This new simulation method is now part of the version 2 release of StePS along the ℝ3 and T3 topological manifolds. This simulation code is freely available as an open-source project at our github4 repository under GNU General Public License v2.0.

Acknowledgments

GR and TS acknowledge support of the Research Council of Finland grant 354905 and support by the European Research Council via ERC Consolidator grant KETJU (no. 818930). This work has been supported by the Hungarian National Research, Development and Innovation Office (NKFIH, grant OTKA NN147550). IS acknowledges NASA ROSES grants 80NSSC24K1489 and 24-ADAP24-0074, contract number 80NM0018F0610 via a JPL sub-award. The authors wish to acknowledge CSC – IT Center for Science, Finland, for computational resources.

References

  1. Aarseth, S. J., Gott, J. R., III., & Turner, E. L. 1979, ApJ, 228, 664 [Google Scholar]
  2. Barnes, J., & Hut, P. 1986, Nature, 324, 446 [NASA ADS] [CrossRef] [Google Scholar]
  3. Benítez-Llambay, A. 2017, Astrophysics Source Code Library [record ascl:1712.003] [Google Scholar]
  4. Broadhurst, T. J., Ellis, R. S., Koo, D. C., & Szalay, A. S. 1990, Nature, 343, 726 [Google Scholar]
  5. Bryan, G. L., & Norman, M. L. 1998, ApJ, 495, 80 [NASA ADS] [CrossRef] [Google Scholar]
  6. Buchert, T. 1994, MNRAS, 267, 811 [NASA ADS] [Google Scholar]
  7. Bullock, J. S., Dekel, A., Kolatt, T. S., et al. 2001, ApJ, 555, 240 [NASA ADS] [CrossRef] [Google Scholar]
  8. Chang, H. Y. 1988, CQG, 5, 507 [Google Scholar]
  9. Chevallier, M., & Polarski, D. 2001, Int. J. Mod. Phys. D, 10, 213 [Google Scholar]
  10. Cooley, J. W., & Tukey, J. W. 1965, Math. Comput., 19, 297 [Google Scholar]
  11. Despali, G., Giocoli, C., Angulo, R. E., et al. 2016, MNRAS, 456, 2486 [NASA ADS] [CrossRef] [Google Scholar]
  12. Einasto, J., Einasto, M., Gottlöber, S., et al. 1997, Nature, 385, 139 [Google Scholar]
  13. Euclid Collaboration (Castander, F. J., et al.) 2025, A&A, 697, A5 [Google Scholar]
  14. Ewald, P. P. 1921, Ann. Phys., 369, 253 [Google Scholar]
  15. Feldman, H. A., Kaiser, N., & Peacock, J. A. 1994, ApJ, 426, 23 [Google Scholar]
  16. Frieman, J. A., Turner, M. S., & Huterer, D. 2008, ARA&A, 46, 385 [Google Scholar]
  17. Genel, S., Vogelsberger, M., Springel, V., et al. 2014, MNRAS, 445, 175 [Google Scholar]
  18. Grzybowski, A., & Bródka, A. 2002, Mol. Phys., 100, 635 [Google Scholar]
  19. Hawkins, E., Maddox, S. J., & Merrifield, M. R. 2002, MNRAS, 336, L13 [Google Scholar]
  20. Hernquist, L., Bouchet, F. R., & Suto, Y. 1991, ApJS, 75, 231 [NASA ADS] [CrossRef] [Google Scholar]
  21. Hockney, R. W., & Eastwood, J. W. 1988, Computer Simulation Using Particles (Bristol: Hilger) [Google Scholar]
  22. Jenkins, A. 2010, MNRAS, 403, 1859 [NASA ADS] [CrossRef] [Google Scholar]
  23. Klypin, A. A., & Shandarin, S. F. 1983, MNRAS, 204, 891 [NASA ADS] [Google Scholar]
  24. Klypin, A. A., Trujillo-Gomez, S., & Primack, J. 2011, ApJ, 740, 102 [NASA ADS] [CrossRef] [Google Scholar]
  25. Knebe, A., Knollmann, S. R., Muldrew, S. I., et al. 2011, MNRAS, 415, 2293 [Google Scholar]
  26. Lewis, A., & Challinor, A. 2011, Astrophysics Source Code Library [record ascl:1102.026] [Google Scholar]
  27. Lewis, A., Challinor, A., & Lasenby, A. 2000, ApJ, 538, 473 [Google Scholar]
  28. Linder, E. V. 2003, Phys. Rev. Lett., 90, 091301 [Google Scholar]
  29. Luminet, J.-P. 2016, Universe, 2, 1 [Google Scholar]
  30. Mead, A. J., Brieden, S., Tröster, T., & Heymans, C. 2021, MNRAS, 502, 1401 [Google Scholar]
  31. Monaghan, J. J., & Lattanzio, J. C. 1985, A&A, 149, 135 [NASA ADS] [Google Scholar]
  32. Peacock, J. A. 1999, Cosmological Physics (Cambridge, UK: Cambridge University Press) [Google Scholar]
  33. Peebles, P. J. E. 1970, AJ, 75, 13 [Google Scholar]
  34. Planck Collaboration VI. 2020, A&A, 641, A6 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  35. Planck Collaboration XVIII. 2016, A&A, 594, A18 [Google Scholar]
  36. Potter, D., Stadel, J., & Teyssier, R. 2017, Comput. Astrophys. Cosmol., 4, 2 [NASA ADS] [CrossRef] [Google Scholar]
  37. Press, W. H., & Schechter, P. 1974, ApJ, 187, 425 [Google Scholar]
  38. Rácz, G., Szapudi, I., Csabai, I., & Dobos, L. 2018, MNRAS, 477, 1949 [Google Scholar]
  39. Rácz, G., Szapudi, I., Dobos, L., Csabai, I., & Szalay, A. S. 2019, Astron. Comput., 28, 100303 [Google Scholar]
  40. Rácz, G., Szapudi, I., Csabai, I., & Dobos, L. 2021, MNRAS, 503, 5638 [CrossRef] [Google Scholar]
  41. Roukema, B. F., & Edge, A. C. 1997, MNRAS, 292, 105 [Google Scholar]
  42. Saffar Shamshirgar, D., & Tornberg, A.-K. 2017, J. Comput. Phys., 347, 341 [Google Scholar]
  43. Shamir, L. 2025, MNRAS, 538, 76 [Google Scholar]
  44. Sirko, E. 2005, ApJ, 634, 728 [NASA ADS] [CrossRef] [Google Scholar]
  45. Springel, V., White, S. D. M., Jenkins, A., et al. 2005, Nature, 435, 629 [Google Scholar]
  46. Springel, V., Pakmor, R., Zier, O., & Reinecke, M. 2022, Astrophysics Source Code Library [record ascl:2204.014] [Google Scholar]
  47. Tormen, G., Diaferio, A., & Syer, D. 1998, MNRAS, 299, 728 [NASA ADS] [CrossRef] [Google Scholar]
  48. Tornberg, A.-K. 2015, Adv. Comput. Math., 42, 227 [Google Scholar]
  49. Wechsler, R. H., & Tinker, J. L. 2018, ARA&A, 56, 435 [NASA ADS] [CrossRef] [Google Scholar]
  50. Weinberger, R., Springel, V., & Pakmor, R. 2020, ApJS, 248, 32 [Google Scholar]
  51. White, S. D. M. 1976, MNRAS, 177, 717 [NASA ADS] [CrossRef] [Google Scholar]
  52. White, S. D. M. 1994, ArXiv e-prints [arXiv:astro-ph/9410043] [Google Scholar]
  53. Xu, G. 1995, ApJS, 98, 355 [NASA ADS] [CrossRef] [Google Scholar]
  54. Zeldovich, Y. B., & Starobinskij, A. A. 1984, Pisma v Astron. Zh., 10, 323 [Google Scholar]

All Tables

Table 1.

Parameters of the first cosmological N-body simulation in S1 × ℝ2 topology.

All Figures

Thumbnail: Fig. 1. Refer to the following caption and surrounding text. Fig. 1.

Comparison of gravitational force laws between the periodic cubic (T3) and the periodic cylindrical (S1 × ℝ2) geometry. Each plot demonstrates the deviation from the Newton’s law of universal gravitation due to the periodic topology. In both cases, a test particle was placed to the centre of the simulation volume, and the gravitational force field was calculated both in the corresponding and in ℝ3 topology. The heat maps are showing the |F|/|F3| ratio of the force field magnitudes. The vector plots are demonstrating the F − F3 difference of the gravitational force fields around the particle. The length of the arrows is proportional to the magnitude of the difference between the forces.

In the text
Thumbnail: Fig. 2. Refer to the following caption and surrounding text. Fig. 2.

Accuracy of S1 × ℝ2 periodic summation methods. For all tests, the correction lookup table D(ρ, z) was computed on a 144 × 128 grid, varying the truncation parameter Ncut or the Ewald parameters α, nmax, and mmax. Using these tables, we reconstructed the full periodic force field FS1 × ℝ2(ρ, z) = F3(ρ, z)+D(ρ, z) and compared it against a reference field. This reference field was generated via direct summation using Ncut = 107 periodic images, requiring approximately 104 s of computation time. Left: Mean force errors of direct periodic real-space summation as a function of Ncut. Although summation occurs only along a single direction (the z-axis), convergence remains exceptionally slow. Center: S1 × ℝ2 Ewald summation force accuracy as a function of the Ewald splitting parameter α with fixed nmax = 5 and mmax = 12 values. Using only 5 periodic images in real space and 12 modes in reciprocal space is sufficient to achieve single-precision (32-bit) floating-point accuracy when the optimal splitting parameter is applied. Right: Same as the center panel, but with fixed nmax = 7 and mmax = 14. Increasing both nmax and mmax by two improves the force accuracy by nearly three orders of magnitude (a factor of ∼600).

In the text
Thumbnail: Fig. 3. Refer to the following caption and surrounding text. Fig. 3.

Force accuracy as a function of the octree opening angle, Θ, in a cylindrical cosmological volume at different redshifts. We evolved 6 ⋅ 104 particles in standard ΛCDM cosmology with direct force calculation in a periodic cylinder with Lz = 200.0 Mpc height and Rsim = 100.0 Mpc radius for this accuracy test. After the simulation was finished, we calculated the FBH octree forces with our StePS simulation code. The FD direct forces were used as a ground truth in the comparison. We calculated the octree forces with and without the radial force correction. Left: Relative total ⟨|FBH − FD|/|FD|⟩ force error. The magnitude of the force error is behaving similarly as in the well tested cubic T3 case. The new radial force correction calculated from the initial particle load increases the accuracy in all redshifts. Center: Mean radial ⟨FBH, 𝜚/FD, 𝜚⟩ force error. While the raw radial octree force have a non-zero expected value at high Θ values, the implemented radial correction fixes this in all redshifts for Θ ≤ 0.5. It is critical to use this correction, since a systematic bias in radial direction will cause contraction or expansion of the simulated volume, which will alter the structure formation due to the changed background density. Right: Mean tangential ⟨FBH, ϑ/FD, ϑ⟩ force error. In contrast to the radial case, the measured tangential force errors are consistent with a zero mean. A non-zero systematic bias in this component would cause errors in the total angular momentum.

In the text
Thumbnail: Fig. 4. Refer to the following caption and surrounding text. Fig. 4.

Mass resolution as a function of radial coordinate 𝜚 in an example cylindrical glass. The parameters of this glass are the following: DS = 70 Mpc, Rsim = 500.0 Mpc, ωc = 1.63973 RAD, Lz = 500 Mpc, and the total particle number is Npart = 1.2 ⋅ 106. The glass has constant resolution for 𝜚 < 𝜚c = DStan(ωc/2) = 75.0 Mpc to avoid unwanted mixing of particles with widely different masses in the simulations.

In the text
Thumbnail: Fig. 5. Refer to the following caption and surrounding text. Fig. 5.

Thin slices of the dark matter density field from the first S1 × ℝ2 StePS simulation at z = 11, z = 3, and z = 0 redshifts in comoving coordinates. Each slice has a thickness of 15.0 Mpc and each column shows a different slice orientation. The late-time non-linear cosmic web is visually similar to that found in T3 and ℝ3 simulations: voids, walls, filaments, and dark matter halos are clearly visible. Due to the zoom-in nature of the StePS S1 × ℝ2 simulation method, the spatial resolution is highest along the central axis, while only the largest structures are resolved near the Rsim simulation radius.

In the text
Thumbnail: Fig. 6. Refer to the following caption and surrounding text. Fig. 6.

Dark matter power spectra of four selected snapshots (solid lines) with the corresponding theoretical linear power spectra (dashed lines) and the non-linear Mead et al. (2021) halofit power spectra (dotted dashed lines). Our S1 × ℝ2 StePS simulation is capable of following both linear and non-linear structure formation.

In the text
Thumbnail: Fig. 7. Refer to the following caption and surrounding text. Fig. 7.

Spatial distribution of dark matter halos in the new S1 × ℝ2 StePS simulation at different redshifts, in comoving coordinates. Due to the zoom-in geometry, and the fact that low-mass halos form first, halos first appear close to the central axis, where the resolution is highest, and the smallest halos can be resolved. As structure formation proceeds towards higher masses, halos can later be found at larger radii, where the resolution is lower, and only more massive halos can be resolved. Towards larger ϱ = x 2 + y 2 Mathematical equation: $ \varrho=\sqrt{x^2+y^2} $ only increasingly massive halos are resolved, so the apparent decline in number density at large 𝜚 is a selection effect.

In the text
Thumbnail: Fig. 8. Refer to the following caption and surrounding text. Fig. 8.

Distribution of the halo spin orientation angle, θJz, with respect to the simulation z-axis, shown for three mass bins at redshift z = 0.5 in our S1 × ℝ2ΛCDM simulation. We only used halos with Npart > 100 in this analysis to reliably measure the angular momentum vectors. The histogram uses equal-area binning on the unit sphere, so that an isotropic spin distribution implies equal expected counts per bin. Each panel is annotated with the one-sample Kolmogorov-Smirnov test on u = 1 2 ( 1 + cos ( θ Jz ) ) [ 0 , 1 ] Mathematical equation: $ u=\frac{1}{2}(1+\cos(\theta_{Jz}))\in[0,1] $ against the uniform null. The three mass bins show no departures from the isotropic expectation. We found similar distributions in all other output redshifts and mass bins with no clear signs of anisotropy.

In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.

Initial download of the metrics may take a while.