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)
| 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.
git clone --recursive https://github.com/HQIV/n-body.git
cd n-body
git submodule update --init pyscoOr from the parent HQIV repo:
git submodule update --init n-body
cd n-body && git submodule update --init pyscopip install numpy scipy matplotlib
pip install pysco-cosmo # or use the pysco/ submodulepython3 scripts/run_bullet.py --resolution 64 --npart 1e5 --steps 100
python3 tests/test_hqiv.py -vHeavy 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.logpython3 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| 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/.
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.
Used in paper/main.tex § Bullet Cluster. Produces
lensing_comparison.png via postprocess_lensing.py. Fast (~minutes).
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/sSee runs/README.md for the full run matrix.
| 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 σ₈.
MIT — see parent HQIV repo. PySCo: see pysco/LICENSE.
- Ettinger (2026), HQIV paper —
paper/main.texin parent repo - Clowe et al. (2006), Bullet Cluster weak lensing
- PySCo: Breton et al., https://github.com/mianbreton/pysco