1. Introduction
The
model is the current standard model of cosmology. Increasingly large and precise observational results have largely confirmed its accuracy, such as cosmic microwave background (CMB), large scale structure and gravitational lensing. Future observation projects lead us into an era of higher precision in order to detect potential deviations from a pure cold dark matter (CDM) model, such as nonzero neutrino masses, primordial non-Gaussianities, and variations of gravity. Among these, the neutrino mass is proven to be nonzero by particle physics and neutrino mass effects on cosmology are guaranteed to exist. In laboratory experiments, the neutrino mass-squared differences are determined by measuring the atmospheric and solar neutrino oscillations [
1], indicating that the total mass of neutrinos is nonzero, with a lower bound of
, although they cannot determine the absolute neutrino mass or the mass hierarchy. The tritium
-decay experiment, like KATRIN, gives an upper limit of
at a 90% confidence level [
2]. On the other hand, cosmological observations provide an upper limit on the total neutrino mass
[
3]. The absence of lower bound constraints on neutrino mass in cosmology implies that the absolute mass of neutrinos remains unmeasured. Detecting the cosmological effects of neutrino mass and precisely constraining its value are key objectives of next-generation galaxy surveys.
From the theoretical side, neutrinos affect cosmic evolution through two primary mechanisms. In the early Universe, relativistic neutrinos have high velocity dispersion, behaving as radiation. They modulate the expansion history by changing the matter–radiation equality [
4], altering the acoustic and damping angular scales of CMB [
5]. In the late Universe, neutrinos cool down and become non-relativistic, while their thermal velocities are still higher than those of CDM; this free-streaming mechanism suppresses their gravitational clustering and thus damps the small-scale matter power spectrum and the high multipoles of the CMB anisotropy, and modulates the halo mass function (HMF) and halo bias [
6,
7]. Apart from traditional methods, various novel methods have been proposed to constrain the lower bound of neutrino mass, for example, a dipole asymmetry in the cross-power spectrum due to the velocity field between neutrinos and CDM [
8], wakes formed as neutrinos passing through dark matter halos [
9], misalignments in angular momentum between neutrino and CDM halos due to differing tidal fields [
10], and differential neutrino condensation between neutrino-rich and neutrino-poor halos [
11]. Neutrino perturbations couple to nonlinear CDM clustering, and thus, the above effects are also nonlinear, so we must use simulations to accurately calibrate these effects. Additionally, a combination of variations of cosmological parameters may also mimic neutrino mass effects, so a large number of simulations spanning a high-dimensional parameter space will also be needed. To achieve this and meet the scientific requirements for next-generation surveys, such as CSST [
12], we need a method to simulate the effects of massive neutrinos that balances accuracy and efficiency.
Efficiently simulating neutrinos is challenging due to their high thermal velocities [
13,
14]. Particle-based approaches partition neutrino phase space into
N-body particles; however, they suffer from prohibitive shot noise on small scales due to the neutrino thermal velocities that contaminate small-scale signals. Increasing the number of neutrino particles to suppress this noise is computationally expensive [
15]. Alternative methods have been developed to simulate neutrino effects. The grid-based method computes only CDM particles and incorporates neutrino effects by adding an independently evolved linear neutrino density field in Fourier space, which is a fully linear approach [
16]. The semi-linear method improves the linear approach by taking into account the nonlinear evolution history of matter density perturbations to estimate neutrino density perturbations [
17]. It is more accurate than the fully linear method and is still efficient [
7,
18]. A recent extension, the SuperEasy method [
19], further simplifies the linear response implementation by introducing a closed-form rational function to approximate neutrino clustering, achieving sub-percent accuracy with minimal computational cost. The hybrid method treats neutrinos as linear fields in the early Universe, computes their evolution on grids, and converts some of the slower neutrinos into particles at low redshift during simulation, thereby capturing their nonlinear clustering properties more effectively [
7,
20]. The fluid method models different neutrino species as fluids rather than particles, solving the Boltzmann equations directly on a grid [
13,
21,
22]. While this method can accurately reproduce nonlinear clustering, its numerical complexity often results in instability and artificial numerical artifacts in simulations. The Newtonian motion gauge approach [
23,
24,
25] provides a simple method to include massive neutrino effects in N-body simulation. It incorporates the additional potential contribution of neutrinos via modification of the dark matter initial conditions and by employing a dynamically evolving coordinate system [
6], avoiding direct neutrino simulations. It can also capture the full impact of linear neutrino perturbations on the nonlinear evolution of CDM particles in N-body simulation.
Given the fact that no neutrino effects have been discovered observationally from large scale structure, we tend to focus on lower-order effects. The semi-linear method captures most of the neutrino-CDM nonlinear coupling, although it neglects out-of-phase correlations. Despite this, it can accurately model key nonlinear neutrino effects, such as HMF modulation and neutrino torque. We have incorporated a revised version of the semi-linear neutrino method into
CUBE 2.0, a parallel, high-precision, and memory-efficient
N-body algorithm. Our implementation enables efficient high-resolution large scale structure simulations with varying neutrino masses and hierarchies. In
Section 2, we briefly introduce the code and relevant algorithm. In
Section 3, we analyze the accuracy of the simulation. Discussions are presented in
Section 4.
2. Methods
2.1. CDM Evolution
We use
CUBE 2.0 as the basic structure to evolve the overall large scale structure, and the neutrino module is an add-on functional.
CUBE 2.0 is an efficient, parallel cosmological
N-body simulation code based on the Particle-Mesh-Particle-Particle (
) algorithm. The preceding version,
CUBE [
26], optimized the memory usage by the fixed point structure (FPS) storage, reducing the memory footprint as low as 6 bytes per particle.
CUBE 2.0 implements an adaptive innermost grid (PM3) to complement the original two-layer PM (PM1/PM2) framework to substantially alleviate the particle-particle (PP) computation. The resolution of the adaptive grid matches the local density, ensuring that the total computation time of both PP and PM3 is minimized. Furthermore, by employing the optimized Green’s function [
27] for gravitational calculations, the code achieves maximum relative errors below
(with mean errors below
) in pairwise gravitational interactions between particles.
The advantages of our cosmological simulations lie primarily in their highly memory-efficient storage of particle information. On average, our method requires only 20 bytes per particle—a significant reduction compared to the widely used Gadget2, which consumes approximately 80 bytes per particle [
28]. This represents a several-fold optimization in memory usage for dark matter particle storage [
29].
In terms of computational efficiency, CUBE 2.0 has been validated for large scale simulations (over 16,000 cores in 512 nodes) [Yu et al. in prep.], demonstrating the robustness of its three-layer parallel structure. It achieves strong and weak scalability exceeding , while maintaining its advantage in the memory economy.
2.2. Semi-Linear Neutrino Modeling
The neutrino module is built on the above CDM evolution. We consider the following components of the universe—the cosmological constant (), radiation (), CDM (), baryonic matter () and neutrinos (). Since we do not distinguish CDM and baryons in this work, we can safely absorb baryons into CDM, and they are collectively referred to as “cold matter” (). Neutrinos can be divided into relativistic () and non-relativistic () components, with cosmic time dependency. Therefore, the total matter component is ().
To better understand the two components of neutrinos, we describe neutrinos as a fluid with an effective pressure
. The equation of state is given by
, where
is a function that decreases with
a. Relativistic neutrinos can thus be described as
The evolution of neutrinos satisfies
, or equivalently,
where
, and
,
is the neutrino temperature and the neutrino-to-photon temperature ratio today.
is the number of massive neutrinos,
is the Boltzmann constant, and
We also define the fraction of non-relativistic neutrinos
The semi-linear response method models neutrino effects by correcting the CDM density (no neutrinos) field into the total matter density field
, where the correction function
is defined as
This enables CDM particles to evolve under the gravitational potential of the total matter field. Incorporating the non-relativistic fraction
from Equation (
4), the correction function resolves as
Here
is the CDM power spectrum calculated in simulation (see
Section 2.3).
is the neutrino power spectrum using equation form Equation (63) of [
17] derived from the integral of the total matter power spectrum evolution.
To test the accuracy of the finite integral, we estimate the neutrino power spectrum using the semi-linear method, derived from the theoretical nonlinear matter power spectra generated by
CAMB, and test the interpolation strategy (labeled as “interp.”). In
Figure 1, we present the residuals of the square root of the power spectrum (rather than the power spectrum itself, as they are more closely related to errors in the correction function), which agree with the predictions of the nonlinear theory on scales
, while significant deviations emerge on small scales. However, these small-scale discrepancies are negligible, as demonstrated by the redshift
correction function; for
, the correction function drops to
, indicating that neutrinos behave nearly homogeneously on this scale. This ensures that, despite slight deviations in the power spectra estimates, the overall correction function aligns perfectly with theoretical predictions, with the relative error controlled below
. Since the wavenumber at the particle-particle (PP) scale is evidently much greater than 1, we assume that neutrinos are completely homogeneous at this scale. Accordingly, the effective mass contributing to the gravitational interaction between particles should be scaled by a factor of
, leading to a correction factor of
for the PP interaction force.
The expansion history of the universe, which couples with the effects of neutrinos, influences the clustering of matter, making it necessary to use an accurate expansion history.
CUBE solves the expansion history during simulation steps (on-the-fly computation) and introduces subtle discrepancies in the expansion history under varying simulation resolutions and precisions. Although these variations diminish with reduced time-step size and remain acceptable in pure CDM simulations, they become problematic for massive neutrino simulations that require higher accuracy and stability. To address this, we implement a precomputed expansion history obtained by solving the Friedmann equation:
where the final term accounts for the neutrino component [
30].
For convenience, we set the present superconformal time
to zero, and we integrate backward in time to obtain the expansion history at higher redshifts:
We show the differences in the expansion history and Hubble expansion rate between the on-the-fly algorithm and the new algorithm in
Figure 2. The error between the two algorithms reaches a maximum of around
, which can lead to significant differences in large scale structure evolution. On the other hand, the variations in the expansion history for different neutrino masses are on the order of
, meaning that the integration error must be controlled below
. Therefore, choosing an integration step size of
is sufficient to meet this requirement.
2.3. Power Spectrum Estimation
The semi-linear method requires integrating the matter power spectrum to obtain the neutrino power spectrum. To account for effects such as cosmic variance, we need to compute the matter power spectrum from simulations rather than using a theoretical one. However, calculating the global power spectrum at the same resolution as the simulation is time- and memory-consuming, and can be comparable to executing a simulation step at low redshift. Therefore, computing the global power spectrum at each step is not practical. Reducing the resolution of the global power spectrum would improve computational efficiency, but would also result in the loss of much nonlinear information. To address this, we calculate the global power spectrum at specific redshifts and use interpolation and extrapolation to estimate the power spectrum at other redshifts. Our analysis compares various selection schemes and interpolation algorithms, revealing that quadratic interpolation maintains the relative error of the matter power spectra within while achieving neutrino power spectrum accuracy at the level relative to non-interpolated methods. This approach yields correction functions with residual errors below , satisfying the precision requirements for most cosmological studies.
To control the memory consumption in power spectrum calculations during simulations, we develop a power spectrum combining approach by extending Welch’s method [
31] to three dimensions and integrating it with buffer designs from Particle-Mesh (PM) algorithms. This involved the creation of novel 3D window functions that maintain uniform weighting across all data points with minimized variance. Our approach accelerates the process by a factor of 10 compared to full-resolution global calculations while maintaining equivalent accuracy (
Figure 3), crucially avoiding additional memory overhead since density field computations are intrinsic to PM algorithms. Our combining power spectrum implementation proceeds as follows.
Compute the low-resolution global power spectrum at the PM1 grid points.
Calculate tiered spectra at standard and high resolutions (PM2/PM3 grids) through all subvolumes:
- (a)
Apply the window function to the density field within the subvolume.
- (b)
Calculate
, then perform a noise correction [
32] to obtain
.
- (c)
Average all
, then apply the alias correction [
32] to obtain
.
- (d)
Automatically apply a cut-off on the power spectrum to account for grid effects.
Combine the three levels of ) based on the sampling count and obtain .
Due to the fact that semi-linear corrections require the application of correction functions to the grid, the k-modes of the power spectrum cannot perfectly match all k-modes of the density field, especially when smoothing the k-modes via binning. We choose to retain all actual k-modes below to prevent interpolation errors in sparsely sampled low-frequency regions, implementing interpolation only at higher frequencies where spectral sampling density permits reliable estimation.
3. Simulations
The above neutrino module is built into the parallel
N-body code
CUBE 2.0. By using it, we run a series of simulations with different resolutions, box sizes, and neutrino masses (see
Table 1 for specific parameters). In tuning neutrino masses, we set the density parameters of total matter and baryons to
and
, respectively. In the simulation with massless neutrinos,
. In the simulation with massive neutrinos,
, where a portion of the dark matter is replaced by neutrinos. The dimensionless Hubble constant
is set to
. This section presents the data results from these simulations, starting with an analysis of the matter clustering and then examining the halo statistics.
3.1. Matter Clustering
In
Figure 4, we visualize the results of simulations by CDM and neutrino overdensities. The top left panel shows the CDM overdensity from a slice of 1.2
thickness, taken from the massless neutrino simulation, showing the obvious cosmic web structure. Although there would be trace differences if it were taken from non-zero-neutrino-mass simulations, they are indistinguishable by eye, so we plot only one of them. The rest three panels show neutrino overdensities from the simulation with sum of neutrino masses set to
,
, and
, taken from the same slice from the simulation volume. It can be seen that a neutrino follows the structure of CDM on large scales, while their small scale structure is suppressed by their velocity dispersions. This effect is more prominent for lighter neutrino masses. Similar to CDM, total matter overdensity remains visually indistinguishable across simulations as well; however, quantitative analysis can reveal up to 10% variations in clustering strength, confirming that neutrinos modulate both their own, but also total clustering dynamics.
The power spectrum effectively quantifies the impact of neutrinos on the clustering of total matter. In
Figure 5, we show the total matter power spectrum at redshift
for all simulations and the power spectrum suppression for different neutrino masses. The results from simulations show that the suppression amplitudes are consistent with
Halofit predictions [
33], robust across resolutions and box sizes. Although from
Figure 4, the overdensities of more massive neutrinos are stronger, their greater fractional contribution to the total matter leads to a deeper total matter power suppression.
3.2. Halo Statistics
The neutrino mass effects on halo statistics are shown in
Figure 6. It compares two cosmological scenarios: one with massless neutrinos and the other with massive neutrinos of total mass
; furthermore, the evolution of the HMF from
to
is shown.
The results reveal a suppression of the HMF in the presence of massive neutrinos compared to the massless neutrino case. This suppression is more pronounced for higher halo masses, as massive halos typically originate from high-density peaks in the initial matter distribution. The presence of massive neutrinos reduces the amplitude of these high-density peaks, thereby diminishing the formation of massive halos. Furthermore, the reduction is more substantial at higher redshifts, reflecting the cumulative impact of neutrinos on structure formation over cosmic time.
The suppression of the HMF due to massive neutrinos has important implications for observational probes such as galaxy clustering and weak gravitational lensing, as these observables are sensitive to the underlying halo population. Current and upcoming large scale structure surveys with higher precision, such as DESI and CSST, may provide constraints on neutrino masses by measuring the HMF at different redshifts.
To ensure the consistency with observational studies that often select galaxy samples based on number density, we construct four halo samples with number densities of
,
,
, and
at redshift
. For each sample, we calculated the halo two-point correlation function, as shown in
Figure 7.
Interestingly, we find that the two-point correlation function in the massive neutrino cosmology is slightly higher (by a few percent) than the massless neutrino cosmology. This result appears counterintuitive, as neutrinos, due to their free-streaming behavior, are expected to suppress matter clustering and delay structure growth, as evidenced by the reduction in the matter power spectrum discussed in
Section 3.1. The observed increase in the halo two-point correlation function can be attributed to the enhanced halo bias in the presence of massive neutrinos. Specifically, massive neutrinos increase the clustering strength of halos relative to the underlying matter distribution, which compensates for the suppression of the matter power spectrum and leads to a net increase in the halo two-point correlation function [
6].
4. Conclusions
Building on the semi-linear method, we extend the algorithm to incorporate the influence of massive neutrinos on the expansion history of the universe and the evolution of their non-relativistic components, implementing these effects within a hierarchical multi-level PM grid structure, CUBE 2.0. We further assume that neutrinos are completely homogeneous on small scales and introduced corresponding corrections to the PP gravitational calculations.
To enhance the efficiency of matter power spectrum estimation, we develop a segmented power spectrum estimation algorithm. By taking advantage of the intrinsic grid hierarchy of the multi-level PM scheme, this method introduces negligible additional memory or computational costs. Correction functions at each simulation step are obtained through interpolation/extrapolation of the power spectrum.
By a series of cosmological simulations featuring a range of neutrino masses, resolutions, and box sizes, the incorporation of massive neutrinos incurs minimal additional computational costs. The resulting matter power spectra and suppression features not only affirm the accuracy of our simulations but also highlight the robustness of the numerical framework.
The evolution of the HMF with redshift shows that neutrinos suppress halo formation, and this suppression gradually weakens at lower redshifts. This suggests that statistical analysis at different redshifts may offer a way to constrain the neutrino mass. Additionally, the two-point correlation function of halos indicates enhanced halo bias in massive neutrino cosmologies.
A key advantage of our cosmological simulation is its highly efficient memory usage for particle storage. While conventional codes like Gadget2 require approximately 80 bytes per particle [
28], our implementation needs only 20 bytes per particle. Additionally, our neutrino simulation employs a power spectrum combining technique, eliminating the need to compute the global power spectrum and ensuring that neutrino-related calculations introduce negligible memory overhead. Thanks to these memory optimizations, our framework enables subsequent high-resolution simulations with a large number of particles.
Leveraging the computational efficiency of our approach, future work will aim to carry out large-volume simulations to explore neutrino-induced parameter degeneracies and their interplay with other cosmological observables.