Lensing

Lensing#

Implements weak lensing of the CMB temperature and polarization spectra.

  1. Lensing potential spectrum C_l^{psi psi}, comes from the Weyl potential (the fourth source channel of discocmb.sources). The lensing potential is computed by integrating the Weyl potential along the line of sight (Lewis & Challinor 2006, eq. 4.6, CAMB’s sources(3)):

    psi(n) = -2 int_0^{chi_*} dchi (chi_* - chi) / (chi chi_*) phi_W(chi n, tau_0 - chi),

    so Theta_l^psi(k) = -2 int dchi W(chi) phi_W(k, tau_0 - chi) j_l(k chi) and C_l^{psi psi} = 4 pi int dln k P_R(k) |Theta_l^psi(k)|^2, with the normalization of discocmb.cmb_power_spectrum(). The kernel is broad in chi, so the transfer function is smooth in k. The solved modes suffice for the quadrature, and the projection is a small matrix product per cosmology (exact_lensing_operator(), lensing_transfer()).

  2. Lensed spectra are computed using the full-sky correlation-function method of Challinor & Lewis (2005, Phys. Rev. D 71, 103010), as per CAMB’s CorrFuncFullSky. We keep the isotropic part of the deflection to all orders, F_l = exp(-l(l+1) sigma^2/2), and the anisotropic part to second order in c_l = l(l+1) C_gl,2 / 2. With b_l = (2l+1)/(4pi) the lensed correlation functions areL

    xi   = sum_l b_l C_l^TT F_l [d_00 + c_l d_{1-1} + c_l^2/4 (d_00 + d_{2-2})], xi_+ = sum_l b_l C_l^EE F_l [d_22 + c_l d_13 + c_l^2/4 (d_22 + d_04)], xi_- = sum_l b_l C_l^EE F_l [d_{2-2} + c_l/2 (d_{1-1} + d_{3-3}) + c_l^2/8 (2 d_{2-2} + d_00 + d_{4-4})], xi_X = sum_l b_l C_l^TE F_l [d_20 + c_l/2 (d_11 + d_{1-3}) + c_l^2/8 (3 d_20 + d_{2-4})],

    where d_{mm'} = d^l_{mm'}(beta) are Wigner d-functions, sigma^2(beta) = C_gl(0) - C_gl(beta), C_gl = sum_l b_l l(l+1) C_l^psi d^l_11 and C_gl,2 is the same sum with d^l_{1-1}. Gauss-Legendre quadrature in cos(beta) transforms them back: C~_l^TT = 2 pi int xi d^l_00, C~_l^TE = 2 pi int xi_X d^l_20, C~_l^EE +- C~_l^BB = 2 pi int xi_+- d^l_{2 +-2}. The d-functions depend only on l_max and the node count, so lensing_tables() builds them once, into the grid. lensed_spectra() then needs a few dozen matrix products per cosmology.

    Only the lensing correction goes through the quadrature. The unlensed correlation function is each sum above with F_l = 1 and no c_l terms, and it transforms back to the unlensed spectrum, so

    C~_l = C_l + 2 pi int (xi_lensed - xi_unlensed) d^l,

    with F_l - 1 in the leading term of each difference. The difference decays with angle: lensing_tables() drops the nodes beyond beta_max (pi / 16 in the grid) and tapers the weights to zero before it, which leaves the spectra within 5e-5 of the full range for a sixteenth of the nodes. The large low-l power also stays out of the single-precision sums, whose rounding it would otherwise spread over the damping tail (4e-3 of TT at l = 2500).

discocmb.lensed_spectra(cl, grid, *, chunk: int = 32) → LensedSpectra[source]#

Return the lensed TT, TE, EE and BB of the unlensed Spectra cl.

cl comes from cmb_power_spectrum() or solve_cmb() on grid, whose Wigner tables the sums use, and each lensed spectrum is (n_c, grid.lmax + 1) in the units of cl. The lensed spectra are good to a few hundred multipoles below grid.lmax: to l ~ 2500 with the default grid.

The sums run in the precision of the grid, chunk cosmologies at a time. Only the lensing correction goes through the quadrature, so double precision moves the lensed spectra by 2e-6 and costs 55 ms more for a batch of 128.

namedtuple discocmb.lensing.LensedSpectra(tt: jax.Array, te: jax.Array, ee: jax.Array, bb: jax.Array)[source]#

Bases: NamedTuple

Lensed spectra from lensed_spectra(), each (n_c, lmax + 1) from l = 0.

Fields:
  1.  tt (Array) – The lensed temperature spectrum.

  2.  te (Array) – The lensed temperature and E-mode cross spectrum.

  3.  ee (Array) – The lensed E-mode spectrum.

  4.  bb (Array) – The lensed B-mode spectrum.