# Dark matter relic materials (AC73)

These files reproduce every number in the Sandbox Physics Lab
`/labs/dark-matter-freeze-out-freeze-in/` and the tutorial
`/stories/dark-matter-relics/recompute-a-relic-abundance/`.
They need Python 3.9 or later with NumPy and SciPy. The saved outputs were made
with Python 3.9.6, NumPy 2.0.2 and SciPy 1.13.1.

Everything here is output of an offline teaching model, not a measurement. The
only measured input is Omega h^2 = 0.120 +/- 0.001 (Planck 2018 VI,
arXiv:1807.06209v4 abstract, combined temperature, polarization and lensing analysis).

## Run

    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, the checks a few seconds.
check_independent_limits.py reads relic-benchmarks.json and inputs.json from
its own folder.

## Files

| File | Role |
| --- | --- |
| relic_model.py | Reference model mirrored by the Lab's TypeScript code |
| inputs.json | Constants, solver settings and the six Lab presets |
| run_relic_benchmarks.py -> relic-benchmarks.json | Preset summaries, freeze-in closed form, cross-section scan for both starts |
| check_independent_limits.py -> independent-checks.json | Graded independent checks, printed-versus-used comparisons, reading aids and failure cases |

## Model and units

- Equation: dY/dln x = -k(x) [Y^2 - Yeq^2], k = A sigma0 F(x) / (x E(x)),
  x = m/T, Y = n/s.
- A = s(m)/H_rad(m) = (2 pi sqrt(10)/15) sqrt(g*) m M_Pl = 2.995e21 for m = 100 GeV.
- g* = g*s = 86.25 held constant, g = 2, M_Pl = 2.435e18 GeV (reduced).
- Yeq = 45 g x^2 K2(x) / (4 pi^4 g*s), Maxwell-Boltzmann. The relativistic
  plateau 5.36e-3 is 17 % below the Bose-Einstein value 0.278 g/g*s.
- F(x) = <sigma v>/sigma0 for a contact interaction with constant matrix element
  and massless products (Gondolo-Gelmini average). F -> x^2/4 for x << 1 and
  F -> 1 for x >> 1; F(20) = 0.8639.
- E(x) = sqrt(1 + (x_r/x)^n), an extra fluid with rho ~ a^-(4+n) equal to
  radiation at T_r = m/x_r (D'Eramo, Fernandez and Profumo 2017), with g* fixed.
- Cross-sections in cm^3/s; 1 GeV^-2 = 1.167329e-17 cm^3/s.
- Omega h^2 = 2.7439e8 (m/GeV) Y_inf (s0 = 2891.28 cm^-3,
  rho_crit/h^2 = 1.05371e-5 GeV cm^-3).
- Solver: BDF2 in ln x from x = 1e-3, 250 steps per e-fold, implicit Euler on
  the first step; each step is a quadratic in Y solved by its non-negative root.
  Standard expansion ends at x = 1000; faster expansion at max(1000, 50 x_r).
- Settling point: last x where Y differs from its final value by more than 10 %.

## Independent checks

None of the graded checks uses the dimensionless equation above as evidence:

- F(x) from the integral over the pair energy squared s;
- a cosmic-time solution of dn/dt + 3Hn = -<sigma v>(n^2 - n_eq^2) in GeV units
  with the Friedmann H, solved with SciPy's Radau method;
- the freeze-in yield as a double integral of the collision rate, and the
  closed form (3 pi^2/32) a^2 lambda, a = 45 g/(4 pi^4 g*s);
- Steigman, Dasgupta and Beacom (2012) eqs. 12 and 26; D'Eramo et al. (2017)
  eqs. C10 and C12 and their Fig. 1 cross-section 1.7e-9 GeV^-2;
- the logarithmic law of D'Eramo et al. eqs. C16 and C18 for n = 2.

17 graded checks pass. The Fig. 1 reading aid reuses the model's own solver and
is not a graded check.

## Printed versus used

- PDG 2025 eq. (27.2) prints dn/dt - 3Hn. The model uses + 3Hn, as in D'Eramo
  et al. eq. (15) and Steigman et al. eq. (1); with the minus sign the density
  would grow without reactions.
- D'Eramo et al. eq. (19) prints the factor (T_f/T_r)^(n/2). Their eqs. C12 and
  C22 imply (T_r/T_f)^(n/2); with time-domain freeze-out points the printed form
  misses by factors of 250 to 5e10, the inverted one holds to 2-15 %.
- D'Eramo et al. eq. (20) omits A/(m M_Pl) = 12.3 compared with eqs. C3, C16
  and C18. At x = 500 for the kination preset: printed 3.35e-9, restored
  2.73e-10, cosmic-time solution 2.81e-10.
- The sentence after D'Eramo et al. eq. (C22) refers to "Eq. (C22)" where
  eq. (C12) is meant.

## Known limits and failure cases

- Constant g* puts the required cross-section 8 % above the Steigman et al.
  fit (2.136e-26 vs 1.980e-26 cm^3/s for m = 100 GeV).
- Constant g* also drops the factor [g*(T_r)/g*(T)][g*s(T)/g*s(T_r)]^((4+n)/3)
  in D'Eramo et al. eq. (6), so faster-expansion relics are 2 to 3 times below
  their Fig. 1 at T_r = 20 MeV.
- Doubling the steps per e-fold changes Y_inf by 2.3e-4 (default), 3.0e-5
  (kination) and 5e-9 (freeze-in); 50 steps per e-fold is off by 1.0 %.
- Forward Euler with 250 steps per e-fold diverges at x = 0.00102.
- Using x^(3/2) e^-x for Yeq everywhere gives 5.7 % of the correct freeze-in yield.
- A constant <sigma v> makes freeze-in depend on the start: a factor 10.1
  between x_start = 1e-3 and 1e-2.
- Omitted: co-annihilation, resonances, thresholds, Sommerfeld enhancement,
  kinetic decoupling, decays and entropy release.

## Licence

Scripts and outputs written for Sandbox Physics. No third-party data files are
redistributed; published values are quoted with their source.
