Skip to content

HQIV/n-body

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HQIV N-body (PySCo)

Action-derived Horizon-Quantized Informational Vacuum (HQIV) physics for N-body simulations, built on top of PySCo. Primary test case: the Bullet Cluster — gas–galaxy offset and weak-lensing κ-map without dark matter.

This is the submodule for the HQIV repo. It is the single source of truth for N-body work: physics modules, run scripts, tests, and archived analysis.

n-body/
├── hqiv_modifications/   # φ field, inertia, vorticity, G_eff, Bullet ICs
├── scripts/              # run_bullet.py, postprocess_lensing.py, …
├── tests/                # unit tests (paper cross-check)
├── docs/                 # PAPER_VERIFICATION.md
├── analysis/             # committed reports + figures (no .npz)
├── runs/                 # run matrix and current results
└── pysco/                # PySCo submodule (git submodule)

Physics (paper/main.tex)

Module Equation File
Modified Einstein G_μν + γ(φ/c²)g_μν = (8πG_eff/c⁴)T_μν background via background_wrapper.py
Inertia factor f = max(a_loc/(a_loc + φ/6), f_min) inertia_factor.py
Varying G G_eff = G₀(H/H₀)^α, α≈0.6 g_eff.py
φ field φ = 2c²/Θ_local phi_field.py
Vorticity source ∂ω/∂t + (v·∇)ω = (∂f/∂φ)(k×∇φ)·ê_ω vorticity_source.py
Bullet ICs Two NFW halos + gas/galaxy split bullet_ic.py

Full paper-to-code audit: docs/PAPER_VERIFICATION.md.


Quick start

1. Clone with submodules

git clone --recursive https://github.com/HQIV/n-body.git
cd n-body
git submodule update --init pysco

Or from the parent HQIV repo:

git submodule update --init n-body
cd n-body && git submodule update --init pysco

2. Install dependencies

pip install numpy scipy matplotlib
pip install pysco-cosmo   # or use the pysco/ submodule

3. Smoke test

python3 scripts/run_bullet.py --resolution 64 --npart 1e5 --steps 100
python3 tests/test_hqiv.py -v

4. Production run (detached, resource-capped)

Heavy 512³ runs can exhaust RAM and freeze the IDE. Use the nohup wrapper:

BULLET_MEM_GB=8 BULLET_CPU_PCT=70 \
  scripts/run_bullet_nohup.sh output/bullet_5mpc_512 logs/bullet.log

5. Lensing post-process

python3 scripts/postprocess_lensing.py \
  --output output/bullet_5mpc_512/ \
  --snapshot snapshot_00040.npz

# Multi-snapshot report (needs snapshots on disk under output/)
python3 scripts/compile_bullet_report.py

Current results (May 2026)

512³, 5 Mpc box, γ=0.40 (bullet_5mpc_512)

Snapshot z offset lensing–gas [kpc]
10 0.96 2 505
20 0.92 568
30 0.89 221
40 0.85 569

At z≈0.89 the offset reaches 221 kpc, within ~20% of the Clowe et al. (2006) observed ~180 kpc. Figures: analysis/bullet_5mpc_512/.

γ=0.432 best-fit scan (bullet_bestfit_gamma0432)

512³, 100 Mpc box, 8M gas + 1.6M galaxy particles. Final snapshot (z≈0.90) gave offset 25 921 kpc — the larger box and higher γ over-amplify the effect. See analysis/bullet_bestfit_gamma0432/lensing_summary.txt.

Paper figure run (64³, 20 steps, γ=0.40)

Used in paper/main.tex § Bullet Cluster. Produces lensing_comparison.png via postprocess_lensing.py. Fast (~minutes).


Configuration

Edit hqiv_modifications/config_hqiv.ini:

[hqiv_parameters]
gamma = 0.40           # thermodynamic coefficient
alpha_G = 0.6          # G_eff exponent
f_min = 0.01           # inertia floor

[bullet_cluster]
z_obs = 0.3
M_main = 2.5e14        # Msun
v_collision = 4500       # km/s

See runs/README.md for the full run matrix.


Relationship to parent HQIV repo

Location Role
n-body/ (this repo) Canonical N-body implementation
n-body_pysco_hqiv/ (legacy in parent) Pre-submodule copy; use n-body/ going forward
hqiv-class/ CLASS / HiCLASS CMB patches (companion submodule)
horizon_modes/python/ Lattice background table feeding CLASS

The N-body and CLASS branches share the same HQIV background parameters (H₀=73.2, baryon-only Ω_m, γ=0.40, α=0.6) but test different observables: Bullet offset/lensing vs CMB peaks and σ₈.


License

MIT — see parent HQIV repo. PySCo: see pysco/LICENSE.

References

  1. Ettinger (2026), HQIV paper — paper/main.tex in parent repo
  2. Clowe et al. (2006), Bullet Cluster weak lensing
  3. PySCo: Breton et al., https://github.com/mianbreton/pysco

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors