Transfer

Transfer#

Implements the line-of-sight integration of sources into the temperature, E-mode and lensing potential transfer functions.

Instead of following the photon hierarchy to l ~ 2500, one integral of the sources (discocmb.sources) against spherical Bessel functions gives the temperature transfer function,

Theta_l(k) = int_0^{tau_0} dtau [S j_l(x) + S_j1 j_l'(x) + S_j2 j_l''(x)]

with x = k (tau_0 - tau). The E-mode transfer function integrates the quadrupole term against j_l(x) / x^2,

E_l(k) = sqrt((l+2)!/(l-2)!) int_0^{tau_0} dtau S_j2 j_l(x) / x^2

(Zaldarriaga & Seljak 1997, CAMB’s sources(2)). The tables hold j_l(x) / x^2 directly as a fourth Bessel row. Dividing after linear interpolation would fail near x = 0, where j_2(x) / x^2 -> 1/15 and a reionized universe still has visibility.

transfer_functions() takes what discoeb.solve_eb() kept and the Grid it solved on. A 5-point Lagrange stencil (resample_stencil(), resample()) puts each cosmology’s sources, saved at shared scale factors and so at conformal times of its own, on the fiducial’s distances, stretched so that recombination sits on the fiducial’s dense points. project() refines them in ln k with the band of a spline operator and contracts them against the grid’s Bessel tables in chunks of modes. lensing_transfer() projects the saved Weyl potential against the lensing kernel, exactly at low l and by the Limber approximation above.

FFTLog lost against the table contraction: it needs 32768 log-spaced points to resolve recombination and costs ten times more.

discocmb.transfer_functions(values, grid) → Transfers[source]#

Return the Transfers of the sources values that a solve kept on grid.

values is discoeb.solve_eb()’s (n_c, 7, n_k, n_save) of keep at the modes grid.k_values and the scale factors grid.a_save. Traceable, and differentiable in values.

Each cosmology reaches conformal times of its own at the saves, its last the conformal age. A 5-point stencil resamples its sources onto the fiducial’s distances, stretched by its distance to last scattering over the fiducial’s (project()), and the Bessel tables of grid project them onto the multipoles. The lensing potential’s transfer reads the Weyl potential on the unstretched grid, since its kernel is broad in chi.

namedtuple discocmb.transfer.Transfers(theta: jax.Array, theta_e: jax.Array, scale: jax.Array, theta_psi: jax.Array, limber: jax.Array, grid: Any)[source]#

Bases: NamedTuple

The transfer functions of a batch, from transfer_functions().

The spectra are quadratic forms of these, weighted by the primordial spectrum (cmb_power_spectrum()), so a change of A_s or n_s alone needs no new solve. A JAX pytree, like the Grid it carries.

Fields:
  1.  theta (Array) – The temperature transfer functions (n_k_fine, n_ell, n_c) at k_fine / scale, without the factor scale.

  2.  theta_e (Array) – The E-mode transfer functions, likewise.

  3.  scale (Array) – Each distance to last scattering over the fiducial’s, (n_c,).

  4.  theta_psi (Array) – The lensing potential’s transfer functions at its exact multipoles, (n_c, n_ell_exact, n_k_lensing).

  5.  limber (Array) – The Limber integrand of the lensing potential without P_R, (n_c, n_ell_limber, n_save).

  6.  grid (Any) – The Grid the sources were projected on.