Cosmological N-body Simulator Development
A validation-first simulator for a reproducible dark-matter N-body baseline and LSS signal studies

Project Overview
Cosmological N-body Simulator is a C++20 cosmological N-body simulator under active development.
The objective is to produce results that can be compared with published studies and independent codes when the initial conditions, cosmology, units, force calculation and halo definitions are matched. The immediate research task is to quantify the converged ranges of the matter power spectrum, halo mass function, two-point correlation function and basic halo properties before studying the nonlinear transfer of early-Universe signals.
The source includes an experimental path that applies a bounded scalar response to the linear matter spectrum. It is not a direct primordial non-Gaussian initial condition or a detection result.
Current Scope
The reference path is serial CIC Particle-Mesh gravity with global KDK integration in a periodic comoving box. TreePM, MPI PM and CUDA/cuFFT paths are preliminary implementation or validation routes and do not carry production accuracy or performance claims. The figures and individual runs shown here are not scientific detections.
Current Implementation
A reproducible DMO pipeline connecting initial conditions, native analysis products and presentation.

Run configuration used on this page
- Box size:
- Particle lattice:
- PM and IC meshes: each
- Cosmology: , ,
- Initial conditions: 1LPT at
- Outputs:
Numerical and Mass Resolution
The calculations below use only values recorded in Cosmology_Simulation/configs/user_run.toml and the native metadata for the corresponding run. Particle sampling, PM resolution, IC resolution and softening control different numerical errors and are therefore not combined into one universal resolution value.
Total particle count
Mean particle spacing
Because the PM and IC meshes also contain 256 cells per dimension,
The corresponding particle, PM-mesh and IC-mesh Nyquist references are also equal:
Particle mass
The code mass unit is , and the critical density in this unit system is . The particle mass is
Therefore the mass resolution of this run is
Minimum FoF catalogue mass
The native analysis includes groups containing at least 32 particles.
This is a catalogue selection floor, not a convergence-qualified completeness limit or physical reliability threshold.
Softening
The configured value softening_comoving_Mpc_h = -1 is resolved by the simulator's default rule:
Softening and the PM cell size are reference scales. The trusted domain must be established through convergence runs that vary particle number, mesh, timestep and solver.
Analysis Products and Presentation
The simulator owns the scientific definitions of halo finding, mass, pair counts and native analysis products. The separate MySimPlot repository is a presentation layer that verifies native manifests and SHA-256 identities before rendering. It does not redefine halo membership, masses or estimators, and it applies no smoothing, fitting or fallback estimator.
The differential and cumulative halo-mass-function normalizations are
Error bars are central Garwood intervals for Poisson counting uncertainty only; they exclude cosmic variance and inter-bin covariance.
Figure: FoF halo mass function at . The native catalogue uses linking length and a minimum 32-particle selection. The plot shows the differential distribution, cumulative abundance and exact bin counts. The displayed minimum mass is a catalogue inclusion floor, not a completeness limit.
Development Plan
- Establish the convergence domain by varying particle number, PM and IC meshes, starting redshift and timestep.
- Compare fields and summary statistics with an independent code using matched initial conditions.
- After baseline validation, extend the bounded early-Universe response study to higher-order statistics and halo observables.
Research Limitations
The current model is dark-matter-only. Finite volume and resolution, cosmic variance, halo finding, baryonic physics and observational selection can alter the measured signals. Interpretations of new-physics signatures will therefore be limited to domains supported by convergence tests, independent-code comparisons and separate statistical validation.