Skip to content

CMBLensing.py

CMBLensing.py is the JAX port of the Julia package CMBLensing.jl. It

  • simulates flat-sky CMB temperature and polarization fields, lensing potentials and noisy lensed data maps (load_sim),
  • lenses, inverse-lenses and adjoint-lenses fields with the LenseFlow ODE (lense_flow),
  • reconstructs the unlensed field and the lensing potential by joint MAP optimization (map_joint),
  • samples the LCDM parameters jointly with the field and the lensing potential by Gibbs sampling (sample_joint), extending the algorithm developed by Millea et al. 2020,
  • forecasts the sampler's posterior widths with a Gaussian Fisher forecast (fisher_forecast).

All array operations run in JAX (float64), so the code runs on CPU and GPU and is differentiable where it needs to be.

Where to start

I want to... Go to
install the package Installation
simulate a map and run map_joint MAP Estimation Tutorial
learn more about sampling the LCDM parameters Sampling Tutorial, LCDM Sampling
download the chains and other data behind the results Data
run a full experiment on a cluster HPC Setup
compare sampler data to the Fisher forecast Fisher Forecast, Chain Analysis
change the code Testing

Repository layout

cmb_lensing/                    the Python package
camb_splines/                   the 5D CAMB grid spline (gitignored, downloaded on first use)
camb_grid_generation/           scripts that build the 5D grid
get_lcdm_samples/               LCDM chains on the HPC (analysed by cmb_lensing/chain_analysis.py)
measure_phi_noise/              phi_noise_analysis.py (the N_phi spectra plots) +
  get_map_joint_phi_noise/        map_joint's per-mode N_phi
  get_sampler_phi_noise/          the sampler's per-mode N_phi
get_delensed_field_covariance/  the empirical delensed T covariance stencil
runtime_comparison/             map_joint timing, Python vs Julia
tests/                          A/B tests against CMBLensing.jl + the CAMB grid test
docs/                           this site (Markdown pages + tutorial notebooks)
paper/                          the paper source