Design#
DISCO-CMB computes the spectra of a batch of cosmologies in three steps, on grid defined by a given fiducial cosmology:
DISCO-EB’s
solve_eb()computes and returns the line-of-sight sources viadiscocmb.sources, evaluated efficiently inside the Einstein-Boltzmann integration kernel.transfer_functions()projects them onto the transfer functions \(\Theta_\ell(k)\), \(E_\ell(k)\) and the lensing potential.cmb_power_spectrum()integrates these against the primordial power spectrum, \(C_\ell^{XY} = 4\pi \int \mathrm{d}\ln k \, P_\mathcal{R}(k) X_\ell(k) Y_\ell(k)\).
For convenience, solve_cmb() runs all three steps together.
Evaluating sources inside the E-B kernel#
DISCO-EB solves every wave mode of every cosmology in one GPU launch, and
compiles any component passed as extra into its kernel. This allows us to
include additional physics in the integration, such as
LineOfSightSources, which computes and returns the line-of-sight sources on-the-fly as the integration proceeds. This is much more memory-efficient than returning the entire Einstein-Boltzmann state through cosmic time.
Defining the integration grid#
Grid.from_fiducial is a helper function that defines the integration grid for the E-B solve based on the fiducial cosmology. It determines the wave-modes, save times and quadrature points we solve by checking where the sources vary for a fiducial cosmology. The
grid helper also computes and caches tables of Bessel functions and their derivatives,
\(j_\ell\), \(j_\ell'\), \(j_\ell''\) and \(j_\ell/x^2\), the lensing potential
operators and the Wigner \(d\)-functions.
From sources to spectra#
DISCO-EB’s solve keeps four sources at every save time: the monopole and ISW
term \(S\), the Doppler term \(S_{j1}\) and the polarization quadrupole
\(S_{j2}\), each multiplied by the visibility \(g = \kappa' e^{-\kappa}\). The
line-of-sight integral transfer_functions() projects them onto each multipole:
It evaluates both by resampling each cosmology’s sources onto the fiducial’s distance grid, stretched by \(\chi_*/\chi_*^\mathrm{fid}\). It then refines them in \(\ln k\) with a cubic spline and contracts them against the tables of \(j_\ell\), \(j_\ell'\), \(j_\ell''\) and \(j_\ell/x^2\) in batched matrix products.
cmb_power_spectrum() integrates the products of these
transfer functions over the wave modes:
by a trapezoidal integration on uniform steps in \(k\) at the projected multipoles, and a cubic spline in \(\ln\ell\) fills in every other multipole. The lensing potential \(C_\ell^{\psi\psi}\) comes the same way from the saved Weyl potential against the lensing kernel: exactly below \(\ell = 30\), and by the Limber approximation \(k = (\ell + 1/2)/\chi\) above.