Skip to main content
Research project
In Progress

HYOWON

An independently developed C++20 cosmological N-body simulator

HYOWON

Institution

Personal Research

Collaboration

Independent Project

Timeline

Jul 2026 - Present

Updated:
Tags:cosmologyn-bodyc++scientific-computing

Project

HYOWON is a C++20 N-body simulator I am independently developing for ΛCDM structure formation. It follows gravitational evolution in an expanding periodic box, representing cold dark matter and baryons as one effective collisionless particle population.

Development scope

  • 1LPT/2LPT initial conditions and PM/TreePM gravity
  • Cosmological KDK time integration, HDF5 snapshots, and restart checkpoints
  • Density-field and halo-analysis outputs

2LPT reduces initial-condition transients relative to first-order displacements; TreePM combines a mesh-based long-range field with short-range tree forces (see the method references below).

The public v0.0.1 beta uses a flat matter–Λ background without gas hydrodynamics, cooling and feedback, or radiation and massive-neutrino evolution.

Generating initial conditions

This IC description is pinned to development source youngjinphys/DM_Cosmology_Simulation@53f820b6f80bf4c378ac0e2c7b8296dfdbfb903b (2026-09-12). That immutable repository-and-revision pair is the development tree reviewed for this section; it is separate from the public youngjinphys/HYOWON v0.0.1 release and does not imply identical implementation or qualification there.

hyowon_make_ic applies 1LPT or 2LPT displacements and momenta to a regular Cartesian particle lattice and writes native HDF5. It reads an external linear cold-plus-baryon power spectrum P(k), without running CAMB or CLASS internally. P(k) is multiplied by the squared ratio of HYOWON's flat matter–Λ growth function between the starting and table epochs. Spectrum metadata and SHA-256 bind declarations and input bytes; they do not certify physical accuracy. The σ8 integral diagnostic does not automatically correct input amplitudes.

Philox addresses random draws by (seed, mx, my, mz, stream), where m denotes integer Fourier modes rather than physical wavenumbers. Draws do not depend on loop or thread scheduling. gaussian samples amplitudes and phases; fixed fixes amplitudes. They use different streams, so switching modes with the same seed does not preserve phases. Fixed samples also have a different probability distribution from the Gaussian ensemble: mean predictions and variance/covariance estimation must be distinguished (see the fixed/paired reference below).

Fourier support K applies to both the first-order density and the final quadratic 2LPT source. When omitted, it is floor((N-1)/2), so increasing N also changes initial bandwidth. A common-map comparison across N holds IC mesh M, K, box, seed, spectrum, epochs, amplitude and pairing fixed, generating each particle lattice separately. This projected 2LPT map is not the unrestricted continuous second-order solution.

Same parameters versus same result

Cosmological parameters alone do not determine one particle state, but neither do they require results to differ. Identical inputs, generation coordinates and generator semantics define the same intended realization. A different seed supplies another sample, not a reproduction of the original calculation.

independent does not automatically choose a new seed. With the same seed and other inputs, it produces the same first-order field as pair_a; pair_b reverses that field's sign. The second-order LPT source is quadratic in the first-order field and is unchanged by this reversal. The complete pair-B displacement and momentum therefore are not simply the negatives of pair A.

Distinguish intended realization, actual particle state, complete file bytes, and final observables. Libm/FFTW and execution settings can change roundoff; even the same machine can select a different new FFTW_MEASURE plan. A different file SHA requires separating metadata changes from particle-state changes. Compare epoch and units, then ID-matched masses, positions and momenta. Reusing one IC does not freeze the evolved result when gravity, timesteps or parallel execution change; output epochs also enter the KDK integration boundaries.

Preserving ICs and restarting

For matched-initial-state comparisons, retain and reuse the canonical IC HDF5 and set ic.expected_snapshot_sha256 to its recorded generation-time object SHA-256. This identifies an experimental input, not a physically exact reference. Current serial and MPI restart paths reopen the original IC to re-establish provenance: a checkpoint is not a substitute for the source IC. An unchanged file can be relocated by updating its path; a regenerated file with a different SHA does not replace the original restart lineage.

Also archive the generate TOML, exact spectrum bytes, evidence JSON, and source/build/library information. Reproducing the experiment additionally requires the evolution TOML and CLI overrides. Snapshot-mode execution does not read the original spectrum or evidence JSON, so losing those files need not prevent a run while the IC survives. If the IC is deleted, regeneration can be attempted from the retained recipe, but a seed or hash alone cannot restore missing inputs. Bitwise regeneration and physical convergence require separate assessment.

Recent six-seed campaign

The records below were cross-checked against the completed runs and their run_metadata.json, provenance, and diagnostic outputs under /HYOWON/result/HYOWON-Beta_c1b88689622631c5488094d42e8000fbe1adec4e/L128_N256_M512_PM2LPT_deconvCICfalse_z79to0_dlnA0.05_snaps10 in Google Drive. The campaign producer source is youngjinphys/DM_Cosmology_Simulation@c1b88689622631c5488094d42e8000fbe1adec4e (2026-09-14). Its archived build provenance records HYOWON 0.0.3 with release stage Beta; this does not mean the binaries are identical to the public v0.0.1 release.

Shared physical and numerical configuration

  • Box: L = 128 h⁻¹ Mpc; particles: 256³ = 16,777,216; PM mesh: 512³; IC mesh: 512³
  • Mean particle spacing: 0.5 h⁻¹ Mpc; particle Nyquist wavenumber: k_Nyq = 2π ≈ 6.28319 h Mpc⁻¹; effective maximum IC integer mode per axis: K = 127
  • Cosmology: h = 0.7, Ωm = 0.3, ΩΛ = 0.7, Ωb = 0.05, σ8 = 0.8, ns = 1.0
  • Particle mass: 1.04073088 × 10¹⁰ h⁻¹ M☉, converted from the recorded particle_mass = 1.04073088058128 and HYOWON's internal mass unit of 10¹⁰ M☉/h
  • ICs: 2LPT, Gaussian amplitude, independent phase pairing; evolution gravity: pure PM with CIC deconvolution false
  • Integration: z = 79 → 0, global Δln a = 0.05; ten output scale factors at 0.025, 0.05, 0.1, 1/6, 0.25, 1/3, 0.5, 2/3, 5/6, 1.0
  • Runtime: 2 threads, MPI disabled, disk scratch. The build includes OpenMP and threaded FFTW; the archived FFTW record is from the 3.3.10 family.
  • Observed peak RSS was about 3.36 GiB for each of the six completed runs. This is process-level memory telemetry, not total cloud-node utilization.

Per-run record

  • seed 101 — runtime label 20260912T180933+0900; 10 snapshots completed; a 10-frame column_density_evolution.gif original is archived with the run.
  • seed 202 — runtime label 20260912T215313+0900; 10 snapshots completed; a 10-frame column_density_evolution.gif original is archived with the run.
  • seed 303 — runtime label 20260913T001242+0900; 10 snapshots completed; a 10-frame column_density_evolution.gif original is archived with the run.
  • seed 404 — latest completed runtime label 20260913T021302+0900; 10 snapshots completed; a 10-frame column_density_evolution.gif original is archived with the run.
  • seed 505 — latest completed runtime label 20260913T051605+0900; 10 snapshots completed; a 10-frame column_density_evolution.gif original is archived with the run.
  • seed 12345 — runtime label 20260913T074127+0900; 10 snapshots completed; a 10-frame column_density_evolution.gif original is archived with the run.

Each original GIF is 7200 × 2400 and visualizes the ten stored epochs. These animations are qualitative structure-formation views; they are not treated as evidence of convergence, force accuracy, or energy conservation.

Repository

HYOWON repository

The v0.0.1 source beta was published on 9 September 2026. The versioned README documents its build instructions, supported features, and limitations. Scientific convergence and multi-node reliability are not yet established.

Acknowledgements

The six development runs recorded on this page used cloud resources provided through 모두의 AI 실험실 (aitestbed.kr), supported by the Ministry of Science and ICT (MSIT) and operated by the National Information Society Agency (NIA), Republic of Korea. I gratefully acknowledge this cloud-resource support.

Method references