haloemu¶
Halo- and matter-property emulator suite for the DEGRACE-pilot design — 64
ΛCDM / f(R) cosmologies, five boxes per model, snapshots at z = 0.25 and
z = 0.00. Every quantity is a Gaussian-process emulator addressed by a single
key (property, gravity, redshift) through one registry.
import os; os.environ.setdefault("JAX_PLATFORMS", "cpu")
from haloemu import get_registry
reg = get_registry()
n = reg.predict("hmf", "LCDM", 0.25, [0.31, 0.677, 0.967, 0.83]) # n(>M)
pk = reg.predict("pk_mm", "LCDM", 0.25, [0.31, 0.677, 0.967, 0.83]) # P(k)
xi = reg.predict("xi_mm", "fRn1", 0.25, [0.31, 0.677, 0.967, 0.83, -5.0]) # ξ(r)
A single prediction is milliseconds. Training and validation sweeps go to slurm.
What it emulates¶
| Family | Keys | Output |
|---|---|---|
| Halo mass function | hmf |
cumulative n(>M) |
| Halo bias | b_cum, b_diff |
b(>M) and differential b(M) |
| Matter clustering | pk_mm, xi_mm |
P(k), ξ(r) |
| Halo clustering | xi_hh, xi_hh_smallr, r_ab |
ξ_hh(r | M₁, M₂), cross-correlation coefficient |
| Pairwise velocity | vel_m10 … vel_c22 |
8 central moments of the radial pairwise velocity |
Both gravities (LCDM, fRn1) are registered. The f(R) clustering and HMF
artifacts are seed-paired modified-gravity boosts composed with the pinned
ΛCDM artifact — see Representations.
Headline accuracy (z = 0.25)¶
- ΛCDM matter clustering 0.3–0.8 %;
hmfinterior leave-one-out 0.49 % (median at the simulation noise floor). - Full-scale ξ_hh 1–2 % out to 60 Mpc/h.
- f(R) composed boosts 0.5–0.9 % LOO; the
hmfscreened tail is resolved (fiducial 0.3–0.5 %). - Pairwise velocity moments at/below the across-box SEM (interior-LOO χ ≈ 0.4–0.7 for ΛCDM).
Full numbers and the gates that produced them: Accuracy & gates
and the methods paper doc/emulation_methods.pdf.
Runnable examples¶
- Predicting — a worked notebook calling every emulator family (with output and plots).
- Training new emulators — the assemble → build → validate → register flow, CLI and programmatic.
Two audiences¶
- Humans — start at Getting started, then the per-property pages under Properties and the Guides.
- AI agents / Claude Code — see For AI agents and the compact
machine reference. A machine index lives at
/llms.txt.
Where this fits¶
haloemu was split out of the halocat repository, which it uses only at
training time for per-realisation data loaders and the cosmology design
table (and optionally freyja as an HMF cross-check). Prediction needs
neither — the trained artifacts ship in the package and run on a plain
pip install; see Portability. It is not part of
halocat. The legacy emulator_b_eff and b_diff packages remain importable
as thin compatibility shims.