Skip to content
DAH
Wiki/PhysicsTheoryMature

Cosmological perturbation theory and Boltzmann codes

Linear perturbations of an FLRW universe coupled to Boltzmann equations for photons, neutrinos, baryons and dark matter, solved by CAMB and CLASS to predict CMB spectra and the matter power spectrum.

On this page18 sections
Why other work relies on it

Every CMB, BAO, weak-lensing and Lyman-α likelihood calls a Boltzmann code. Downstream it underlies the Hubble tension and sound-horizon models, DESI dynamical dark energy, the S8 tension, the neutrino mass sum, Lyman-α warm and fuzzy dark-matter bounds, primordial B-modes and delensing, and CMB birefringence.

The math that grows tiny early ripples forward in time to predict the afterglow of the Big Bang.

  1. 1Smooth universe plus tiny ripples
  2. 2Follow each ripple size separately
  3. 3Light and matter form ringing plasma
  4. 4Freed light freezes the pattern in
  5. 5Codes predict spectra to compare with data

Setting up. Start with a perfectly smooth expanding universe (the FLRW model). Add small perturbations to the metric (the geometry) and to the density, velocity and temperature of each ingredient: photons, neutrinos, ordinary (baryonic) matter and cold dark matter. Keep only terms linear in the perturbation. This is accurate while the ripples are small.

Gauges. Splitting the universe into smooth part plus ripples is a choice, called a gauge. Different choices describe the same physics but make different-looking equations. Two common choices are the conformal Newtonian gauge, which looks like Newtonian gravity, and the synchronous gauge. Physical predictions must not depend on the choice.

Fourier modes. Because the linearized equations treat different spatial wave-numbers k separately, each mode can be evolved by itself. The starting values come from inflation, which predicts a nearly scale-invariant power spectrum: the amplitude of ripples is almost the same on all sizes, with slightly more on large scales. Two numbers describe it: the amplitude A_s and the tilt n_s.

The Boltzmann hierarchy. Photons and neutrinos are not simple fluids, so we track how their distribution depends on direction. We expand that dependence into multipoles (monopole, dipole, quadrupole and higher), which gives a long chain of coupled equations. In practice the chain is cut off at a finite length.

Tight coupling and acoustic oscillations. Early on, photons scatter off electrons very frequently (Thomson scattering), so photons and baryons move as one fluid. Gravity compresses it and radiation pressure pushes it back, producing sound waves with speed c_s about c/√3 reduced slightly by the baryon loading. The distance a sound wave can travel before the universe becomes transparent is the sound horizon, and it acts as a standard ruler: the baryon acoustic oscillation (BAO) scale. Photon diffusion damps small scales (Silk damping).

Recombination. About 380,000 years after the Big Bang, electrons and nuclei combine and photons escape. The detailed ionization history must be computed accurately, with codes such as RECFAST or HyRec, because the data are now very precise.

Output. CAMB and CLASS solve these equations on a grid of k and time and use a line-of-sight integral to quickly give the CMB temperature and polarization spectra, and the matter power spectrum.

Limits. At late times and small scales, matter clumps strongly and the linear approximation fails; that needs simulations (see the N-body entry).

Go deeper

The full technical text.

What it is

The theory perturbs the FLRW metric to first order and evolves each species' phase-space distribution with the linearized Einstein–Boltzmann system. Scalar metric perturbations come in two common gauges (Ma and Bertschinger 1995). The conformal Newtonian gauge is ds2=a2(τ)[−(1+2ψ)dτ2+(1−2ϕ)δijdxidxj]ds^2 = a^2(\tau)[-(1+2\psi)d\tau^2 + (1-2\phi)\delta_{ij}dx^i dx^j], and the synchronous gauge uses hh and η\eta. Bardeen (1980) built the gauge-invariant combinations. In Fourier space each mode kk evolves independently, and the initial conditions are set by an inflationary spectrum PR(k)=As(k/k∗)ns−1\mathcal{P}_\mathcal{R}(k) = A_s (k/k_*)^{n_s - 1} (adiabatic in the base model).

The core machinery

Hierarchy. Photon temperature and polarization perturbations and massless neutrinos are expanded in Legendre multipoles Θℓ(k,τ)\Theta_\ell(k,\tau), giving an infinite coupled hierarchy. Thomson scattering at rate κ˙=aneσT\dot\kappa = a n_e \sigma_T couples photons to baryons. Massive neutrinos also need a momentum grid. The hierarchy is truncated at a finite ℓmax⁡\ell_{\max} with a free-streaming closure.

Tight coupling and acoustic oscillations. For κ˙≫k\dot\kappa \gg k the photon–baryon fluid oscillates with sound speed cs=c/3(1+R)c_s = c/\sqrt{3(1+R)}, R=3ρb/4ργR = 3\rho_b/4\rho_\gamma. The comoving sound horizon at the baryon drag epoch, rd=∫zd∞cs(z) dzH(z),r_d = \int_{z_d}^{\infty} \frac{c_s(z)\,dz}{H(z)}, is the BAO standard ruler. Photon diffusion damps small scales roughly as e−k2/kD2e^{-k^2/k_D^2} (Silk damping).

Recombination. The visibility function g=κ˙e−κg = \dot\kappa e^{-\kappa} depends on the ionization history, computed with RECFAST, HyRec or CosmoRec at the accuracy needed for Planck. Reionization adds a large-angle bump in polarization controlled by τ\tau.

Line of sight. Seljak and Zaldarriaga (1996) wrote Θℓ(k,τ0)\Theta_\ell(k,\tau_0) as a time integral of sources times spherical Bessel functions. The CMB spectrum is then Cℓ=4π∫dln⁡k PR(k) ∣Δℓ(k)∣2C_\ell = 4\pi\int d\ln k\, \mathcal{P}_\mathcal{R}(k)\, |\Delta_\ell(k)|^2 for T, E and B. Scalars source only T and E. Primordial tensors source B (amplitude rr), and lensing converts E into B.

Matter. The linear spectrum is P(k,z)=2π2k3PR(k)T2(k)D2(z)P(k,z) = \tfrac{2\pi^2}{k^3}\mathcal{P}_\mathcal{R}(k) T^2(k) D^2(z), with the growth rate f=dln⁡D/dln⁡af = d\ln D/d\ln a entering redshift-space distortions as fσ8f\sigma_8 and lensing through S8=σ8Ωm/0.3S_8 = \sigma_8\sqrt{\Omega_m/0.3}. Massive neutrinos, warm dark matter and fuzzy (ultralight) dark matter suppress power below their free-streaming or Jeans scales. Projected observables use the Limber approximation, Cℓ≈∫dχ W2(χ)χ−2P(k=(ℓ+1/2)/χ)C_\ell \approx \int d\chi\, W^2(\chi)\chi^{-2} P(k = (\ell+1/2)/\chi).

Beyond linear. The halo model and fitted emulators such as HMcode-2020 (which includes baryonic feedback) extend P(k)P(k) into the non-linear regime that weak lensing probes.

Techniques to master

Gauge transformations and gauge-invariant variables; the Boltzmann equation in an expanding background; tight-coupling and radiation-streaming approximations; stiff ODE integration over many kk modes; Bessel-function quadrature; the Fisher matrix and MCMC wrappers (Cobaya, MontePython) that call CAMB or CLASS.

Reading path

Start with Dodelson and Schmidt, Modern Cosmology (2nd ed.), and Baumann, Cosmology. Then read Ma and Bertschinger (1995) line by line, Seljak and Zaldarriaga (1996), the CAMB paper of Lewis, Challinor and Lasenby (2000), and CLASS I–II (Lesgourgues 2011; Blas, Lesgourgues and Tram 2011) for approximation schemes. Read the source of either code alongside.

Where it bites

Sound-horizon reduction models (early dark energy, extra NeffN_{\rm eff}, varying electron mass) change rdr_d through the integral above and are tested against ACT, SPT and DESI. DESI's evolving-dark-energy preference and the neutrino-mass bound both enter through H(z)H(z) and growth, and the ∑mν\sum m_\nu limit comes from free-streaming suppression. The S8S_8 problem hinges on the non-linear and baryonic corrections to P(k)P(k). Lyman-α WDM and FDM bounds use the small-scale cutoff in the transfer function. B-mode delensing needs the lensing B-mode template, and birefringence rotates E into B.

Words on this page (12)
Words on this page
perturbation
A small deviation from a smooth, simple background that is treated with simplified equations.
power spectrum
A plot of how strong the ripples are at each size scale.
Boltzmann equation
An equation that tracks how a gas of particles, such as photons, is distributed in position and direction as it scatters.
gauge
A choice of how to label space and time; physical predictions should not depend on it.
Thomson scattering
The scattering of light off free electrons, which kept light and matter tightly coupled in the early universe.
baryon acoustic oscillations
A characteristic distance imprinted in the distribution of matter by early sound waves; used as a ruler.
sound horizon
The farthest distance a sound wave in the early universe could travel before the light was released.
Silk damping
The smoothing-out of small ripples caused by photons leaking from one region to another.
recombination
The time when electrons and nuclei first joined into neutral atoms and the universe became transparent.
cosmic inflation
A proposed burst of extremely fast expansion in the very early universe that stretched tiny quantum fluctuations into seeds of structure.
cosmic microwave background
The oldest light we can see, released about 380,000 years after the Big Bang.
multipole
One term in a breakdown of a pattern over directions: monopole (average), dipole (one side vs the other), quadrupole, and finer ones.
New to this? Read first (4)
New to this? Read first
AI-reviewedAn AI drafted this explanation. Check it against the technical text.

Understanding map

map of the whole wiki →

What to read before Cosmological perturbation theory and Boltzmann codes (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.

  1. Start with
  2. Step 2
  3. Then

Open problems & questions

No open problems or questions on this entry.

Progress timeline

  1. Sep 3, 2020
    HMcode-2020

    An updated halo-model fit for the non-linear matter power spectrum, including a baryonic-feedback response, is calibrated against simulations.

    source
  2. Apr 14, 2011
    CLASS

    The Cosmic Linear Anisotropy Solving System is released, with documented approximation schemes and accuracy controls that make it an independent cross-check on CAMB.

    source
  3. Nov 10, 1999
    CAMB

    Lewis, Challinor and Lasenby present the code that became CAMB, extending the line-of-sight method to closed FRW models.

    source
  4. Mar 8, 1996
    Line-of-sight integration (CMBFAST)

    Seljak and Zaldarriaga replace the full multipole hierarchy by a source-times-Bessel integral, speeding up CMB spectrum computation by orders of magnitude.

    source
  5. Jun 11, 1995
    Synchronous and Newtonian gauge equations

    Ma and Bertschinger give the full linear Einstein–Boltzmann system in both gauges, including massive neutrinos. It is the template for every later Boltzmann code.

    source