Skip to main content
Sandbox Physics
How dark matter was left over

Recompute a relic abundance with the saved scripts

Sandbox Physics ·

This tutorial reruns the Lab's relic model in Python and checks it in ways that do not reuse its own equation. The default case, a 100 GeV particle with ⟨σv⟩0=2.136×10−26 cm3 s−1\langle\sigma v\rangle_0=2.136\times10^{-26}\,\mathrm{cm^3\,s^{-1}}, ends with Y∞=4.373×10−12Y_\infty=4.373\times10^{-12} and Ωh2=0.120\Omega h^2=0.120. A separate solution in cosmic time agrees to 0.03 per cent, a direct collision integral reproduces the freeze-in yield to 0.0005 per cent, and the result sits 8 per cent above the published fit of Steigman, Dasgupta and Beacom because this model holds g∗g_* fixed. Three tempting shortcuts give wrong answers, and the scripts save each one.

Everything here is output of a teaching model, not a measurement. The only measured number used is the dark matter density Ωh2=0.120±0.001\Omega h^2=0.120\pm0.001 from Planck 2018. Planck Collaboration, 2018, abstract

Files, versions and units

The scripts need Python 3.9 or later with NumPy and SciPy; the saved files were made with Python 3.9.6, NumPy 2.0.2 and SciPy 1.13.1. The materials are in this collection's materials folder:

Masses and temperatures are in GeV. Cross-sections are entered in cm3 s−1\mathrm{cm^3\,s^{-1}} and converted with 1 GeV−2=1.167329×10−17 cm3 s−11\,\mathrm{GeV^{-2}}=1.167329\times10^{-17}\,\mathrm{cm^3\,s^{-1}}. The model holds g∗=g∗s=86.25g_*=g_{*s}=86.25, takes g=2g=2 internal states and MPl=2.435×1018 GeVM_{\mathrm{Pl}}=2.435\times10^{18}\,\mathrm{GeV}, and converts with Ωh2=2.744×108 (m/GeV) Y∞\Omega h^2=2.744\times10^{8}\,(m/\mathrm{GeV})\,Y_\infty.

mkdir ac73-check && cd ac73-check
base=https://sandboxphysics.com/stories/dark-matter-relics/materials
for name in relic_model.py inputs.json run_relic_benchmarks.py check_independent_limits.py relic-benchmarks.json independent-checks.json; do curl -fsSLO "$base/$name"; done
python3 -m venv .venv && .venv/bin/pip install numpy scipy
.venv/bin/python -I run_relic_benchmarks.py inputs.json my-relic-benchmarks.json
.venv/bin/python -I check_independent_limits.py my-independent-checks.json

The benchmark run takes about half a minute and the checks a few seconds. Compare your two new files with the saved ones; on another machine the last digits may differ.

Step 1: the solver and its step size

The model integrates dY/dln⁡x=−k(x) (Y2−Yeq2)\mathrm dY/\mathrm d\ln x=-k(x)\,(Y^2-Y_{\mathrm{eq}}^2) from x=10−3x=10^{-3} with 250 steps per e-fold of xx. Each step uses second-order backward differentiation, which evaluates the right side at the new point. Because the right side is quadratic in YY, each step is a quadratic equation with one non-negative root, so no iteration is needed:

a = 2 * h / 3 * k[i]
c = (4 * y[i - 1] - y[i - 2]) / 3 + 2 * h / 3 * k[i] * yeq[i] ** 2
y[i] = 2 * c / (1 + math.sqrt(1 + 4 * a * c))

Doubling the steps to 500 per e-fold changes Y∞Y_\infty by 2.3×10−42.3\times10^{-4} for the default case, 3.0×10−53.0\times10^{-5} for kination and 5×10−95\times10^{-9} for freeze-in. With 50 steps per e-fold the default case is off by 1.0 per cent. The settling point in the readouts is the last xx at which YY differs from its final value by more than 10 per cent.

Table 5.1 Presets from relic-benchmarks.json, m=100 GeVm=100\,\mathrm{GeV}.
Preset⟨σv⟩0\langle\sigma v\rangle_0, cm3 s−1\mathrm{cm^3\,s^{-1}}StartY∞Y_\inftyΩh2\Omega h^2Settles by xx
Freeze-out2.136×10−262.136\times10^{-26}equilibrium4.373×10−124.373\times10^{-12}0.1200.120208208
Stronger annihilation2.136×10−242.136\times10^{-24}equilibrium5.241×10−145.241\times10^{-14}0.001440.00144239239
Hot relic10−3810^{-38}equilibrium5.331×10−35.331\times10^{-3}1.46×1081.46\times10^{8}0.0010.001
Freeze-in2.571×10−452.571\times10^{-45}empty4.373×10−124.373\times10^{-12}0.1200.1201.591.59
Kination, Tr=20 MeVT_r=20\,\mathrm{MeV}2.136×10−262.136\times10^{-26}equilibrium1.466×10−101.466\times10^{-10}4.024.0280858085
Freeze-out, empty start2.136×10−262.136\times10^{-26}empty4.373×10−124.373\times10^{-12}0.1200.120208208

Where to look: the first and last rows are identical to every printed digit, which is the memory loss that defines freeze-out. Common misreading: the hot relic's settling point is the first grid point only because its value never changes by 10 per cent.

Step 2: checks that do not reuse the model equation

check_independent_limits.py recomputes each result by a different route.

Table 5.2 Independent checks from independent-checks.json.
CheckModelIndependent valueAgreement
F(20)F(20) from the ss integral0.863900.863900.863900.86390<10−5<10^{-5}
Default case, solved in cosmic time4.3733×10−124.3733\times10^{-12}4.3746×10−124.3746\times10^{-12}0.03%0.03\%
Kination, solved in cosmic time1.46582×10−101.46582\times10^{-10}1.46588×10−101.46588\times10^{-10}0.004%0.004\%
Freeze-in, collision double integral4.37346×10−124.37346\times10^{-12}4.37348×10−124.37348\times10^{-12}0.0005%0.0005\%
Freeze-in, closed form (3π2/32)a2λ(3\pi^2/32)a^2\lambda4.37346×10−124.37346\times10^{-12}4.37819×10−124.37819\times10^{-12}0.11%0.11\%
Γ/H\Gamma/H at x=25x=25, Friedmann HH against Steigman eq. 121.277521.277521.277671.277670.012%0.012\%
Inverse yield at x=500x=500, kination log law3.5629×1093.5629\times10^{9}3.5652×1093.5652\times10^{9}0.06%0.06\%

The cosmic-time solution does not use YY or xx at all. It integrates the number density n(t)n(t) with the stiff Radau method, takes HH from the Friedmann equation and the equilibrium density from the Bessel-function formula in physical units, and only at the end divides by the entropy density. The collision integral computes the production rate as a double integral over pair energy and temperature, with no use of FF. The Steigman row computes Γ/H\Gamma/H for slow particles from the Friedmann equation and compares it with the coefficient printed in their eq. (12). Steigman, Dasgupta and Beacom, 2012, section II.A The log-law row uses only the asymptotic form of D'Eramo and colleagues' eqs. (C16) and (C18). D'Eramo, Fernandez and Profumo, 2017, appendix C

Step 3: published values

Two comparisons are with published numbers that come from fuller calculations, so they are expected to differ.

Table 5.3 Cross-section that gives Ωh2=0.120\Omega h^2=0.120 for m=100 GeVm=100\,\mathrm{GeV}.
Source⟨σv⟩\langle\sigma v\rangle, cm3 s−1\mathrm{cm^3\,s^{-1}}⟨σv⟩\langle\sigma v\rangle, GeV−2\mathrm{GeV^{-2}}
This model2.136×10−262.136\times10^{-26}1.830×10−91.830\times10^{-9}
Steigman, Dasgupta and Beacom, eq. 26 fit1.980×10−261.980\times10^{-26}1.696×10−91.696\times10^{-9}
D'Eramo, Fernandez and Profumo, Fig. 11.98×10−261.98\times10^{-26}1.7×10−91.7\times10^{-9}

Both published values include g∗(T)g_*(T), which falls through the QCD transition, and both assume a constant cross-section. This model is 8 per cent higher. The Lee–Weinberg matching estimate, D'Eramo and colleagues' eqs. (C10) and (C12) with c=2−1c=\sqrt2-1, gives xf=21.7x_f=21.7 and Y∞=3.97×10−12Y_\infty=3.97\times10^{-12} for a constant cross-section, 3.4 per cent below the model's own constant-cross-section solution of 4.11×10−124.11\times10^{-12}.

Step 4: three shortcuts that fail

The script saves three failures on purpose.

  1. Forward Euler with the same 250 steps per e-fold. At x=10−3x=10^{-3} in the default case, the step times the reaction rate is 3×1043\times10^{4}, so the explicit update overshoots and diverges at x=0.00102x=0.00102, after five steps.
  2. The slow-particle formula Yeq∝x3/2e−xY_{\mathrm{eq}}\propto x^{3/2}\mathrm e^{-x} used everywhere. Freeze-in happens at x≃1x\simeq1 to 3, where that formula is wrong, and the yield comes out at 5.7 per cent of the correct value.
  3. A constant cross-section in freeze-in. Then the production rate does not fall off at high temperature, and the yield depends on the start: 1.891×10−81.891\times10^{-8} from x=10−3x=10^{-3} and 1.871×10−91.871\times10^{-9} from x=10−2x=10^{-2}, a factor of 10.1. The answer would be set by a starting temperature that no measurement fixes.

Step 5: compare a Lab export

In the dark matter relic Lab, press Export this record. The file holds the input, the summary and the solution at 20 points per decade of xx. Its summary.finalYield for the default case should match the wimpFreezeOut entry in relic-benchmarks.json to about 10−710^{-7}, the level at which the TypeScript and Python Bessel functions agree.

{"summary": {"finalYield": 4.37327e-12, "omegaH2": 0.119998, "settlingX": 207.64}}

The snippet shows the fields to compare, rounded; the exported file prints full precision.

What these checks do not cover

The model keeps g∗g_* constant, uses Maxwell–Boltzmann statistics, assumes a contact interaction with massless products and ignores co-annihilation, resonances and thresholds. The checks show that the code solves its stated equation correctly and that its scaling matches published work. Whether any real dark matter particle behaves this way is a question for experiments.

Sources

  1. Planck Collaboration, 2018, abstract
  2. Steigman, Dasgupta and Beacom, 2012, section II.A
  3. D'Eramo, Fernandez and Profumo, 2017, appendix C

Keep reading

What this page links to directly

See this series on the content map →

How dark matter was left over · Reading path

From thermal equilibrium to relentless dark matter

  1. ArticleWhy did any dark matter survive the hot early universe?
  2. ArticleEquilibrium, expansion and the reaction race
  3. ArticleThe Boltzmann equation and freeze-out
  4. ArticleFreeze-in, hot relics and faster expansion
  5. You are hereRecompute a relic abundance with the saved scripts
  6. ArticleHow to read the relentless dark matter paper of D'Eramo and colleagues
Something broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy