COSMO·EMU
— da
σ8(z) —

COSMO·EMU — neural emulator of the matter power spectrum P(k, z)

  • w0waCDM + Σmν
  • k ∈ [10−4, 10] h Mpc−1
  • z ∈ [0, 3]
  • CAMB · HMcode-2020
Hero figure. Upper panel: emulated matter power spectrum. Lower panel: ratio to the fiducial cosmology. The shaded region beyond k = 5 h/Mpc lies outside the validated accuracy range. Use the parameter sliders to change the cosmology; the curves update every frame. The view toggle switches to a 3D ridge plot of P(k, z) over all redshifts.

Cosmic web: lognormal density field generated from the displayed power spectrum, fixed random seed

Three-dimensional lognormal realisation. Brighter points mark denser regions.
Two-dimensional slice; the same random phases are reused for every cosmology.

Two-point correlation function from a Hankel transform of P(k), showing the baryon acoustic oscillation peak

ξ(r) = (1/2π²) ∫ dk k² P(k) sin(kr)/(kr), with Gaussian damping exp(−k² · (0.25 h⁻¹Mpc)²) for numerical convergence. The vertical marker shows the location of the local maximum near the BAO scale.

Inference lab: mock power spectrum data generated from a true cosmology (realistic mode: Euclid spectroscopic bins with linear galaxy bias; idealized mode: matter P(k) with other parameters fixed), then an affine-invariant ensemble MCMC in a Web Worker using the emulator as the likelihood engine

—eval/s
0eval
—CAMB
Data: non-linear P(k) of the true cosmology θ★ at z = 0.5 and z = 1, 0.02 ≤ k ≤ 0.3 h/Mpc, volume 2 (h⁻¹Gpc)³ per redshift bin (mode count N = V k³ Δln k / 2π²), number density 10⁻³ (h/Mpc)³, scattered with a fixed seed. Idealized: matter P(k) directly, no galaxy bias, no redshift-space distortions. Free parameters: Ωm, ln10¹⁰As, w0; the others are fixed to their true values. σ8 is derived.
Corner plot: 1D marginal histograms on the diagonal, 2D sample clouds below. Amber crosshairs mark θ★.

Inside the emulator: the live forward pass from cosmological parameters through the neural network and principal components to the power spectrum

Accuracy of the emulator against CAMB on held-out test cosmologies never used in training

Speed: time to compute one power spectrum, CAMB versus the emulator in Python and in this browser

About COSMO·EMU

An emulator is a fast surrogate for an expensive simulation code. COSMO·EMU replaces the Boltzmann code CAMB, which needs of order a second per cosmology, with a small neural network that returns the same matter power spectrum in well under a millisecond, inside your browser. That speed is what makes live parameter exploration and in-page Bayesian inference possible.

Method: CAMB computed the linear matter power spectrum and the HMcode-2020 non-linear boost for thousands of flat w0waCDM cosmologies with massive neutrinos, sampled over 8 parameters and redshifts 0 to 3. Each log-spectrum is compressed with principal component analysis and a multilayer perceptron maps the parameters and redshift to the component weights; the non-linear spectrum is the emulated linear spectrum times the emulated boost. The network weights are downloaded once and evaluated here in JavaScript and WebAssembly.

Accuracy is measured against CAMB on held-out test cosmologies never used for training.

The page shows the spectrum and its ratio to a Planck-2018 fiducial, a lognormal cosmic-web realisation, the correlation function with the baryon acoustic peak, an MCMC inference lab, the accuracy figures and a speed benchmark. Every figure has a text description. The current spectrum can be downloaded as CSV or JSON, and a free JSON API reproduces it. A plain-text description for people and AI agents is at llms.txt. Press the question-mark key for keyboard shortcuts. Author: Daniel Azemar, azemar.eu.

Keyboard shortcuts

N
PNL: switch to the non-linear spectrum
L
Plin: switch to the linear spectrum
R
θfid: reset to the fiducial cosmology
Space
z: 3 → 0: play or pause the redshift animation
1 to 6
θfid · S8↓ · Σmν↑ · w<−1 · w>−1 · w0wa: cosmology presets
M
MCMC: run or stop the MCMC in the inference lab
?
show or hide this list