# Optimal lensing fermilab

This page fills in some details of what was done for what I presented at the 2019 Fermilab meeting File:Millea cmbs4 fermilab 2019.pdf.

In all cases here, I am running the joint maximum a posteriori (MAP) estimate, which produces a joint best-fit ϕ, E, and B (or equivalently a joint best-fit ϕ, Ẽ, and B̃, which just corresponds to lensing the best-fit E/B by the best-fit ϕ to recover the best-fit lensed Ẽ/B̃). I mask the data (i.e. set noise to infinite) at ℓ<200 in E and/or B in the data. This ignores the ambiguous modes created by the data mask, but I don't think should matter since I compute the cross-correlation on a yet-smaller region interior to that, far enough away from the mask edge.

The data which I use comes from doing the following:

**Labelled "flat-sky"**I project the 02.xx simulations onto the flat-sky, and run my flat-sky joint MAP estimate on them. In practice I rotate (via rotate_alm) the maps to the north polar cap before projection. I do the projection onto a 2048x2048 map, which is nearly the same resolution as Healpix Nside=2048. I then do a map-level downgrade to 1024x1024, using an anti-aliasing filter which filters out modes > the downgraded Nyquist frequency before averaging over sets of 4 pixels (final resolution = 3.5', which I've checked is no significant information loss for the 4 and 6 arcmin beams of the channels considered).- Because we're near the limit of the validity of the flat-sky approximation (1200deg²), the CMB modes in the projected maps will be slightly coupled due to the sky curvature. The lensing estimate will interpret this coupling as lensing, hence inducing an additional mean-field in the reconstructed ϕ, beyond just the mask mean-field. I can subtract this mean-field and produce an unbiased estimate of ϕ, although a less optimal one than if I had modeled the sky curvature (Optimal_Bayesian_delensing_progress_update). I can then re-estimate the best-fit E/B at this ϕ to produce my lensed B template. I could also compute the marginal MAP estimate ϕ, which has the mean-field subtracted. However, I've checked in a few cases the mean-field has negligible impact on the quality of the B̃ template, hence I don't even bother doing this below.

**Labelled "curved-sky*"**To get a sense how good I expect to do once I have curved sky working, I also make my own sims directly on the flat-sky. These have the identical noise properties as the 02.xx sims and the same fsky, but no mode-coupling effect due to the sky curvature, which to first-order should be the same as if I had accounted for this in my analysis.

**Fig 1:**
Here's a comparison of the recovered ϕ. To compute this, I mask the reconstructed ϕ's to an even smaller patch than the data mask, then compute the correlation coefficient. The QE result is from Julien Carron (Ready_for_delensing_use_lensing_maps_02.00). You'll note this is not as close to 1 as in his post Lensing_reconstructions_02.00, and has a dip at L~600 not present there. I suspect this has to do with how we define the in-patch correlation and/or some artifact of projecting to the flat-sky, but I don't expect this has an impact on the results of this analysis and that the relative correlations on this plot can be trusted.

**Fig 2:**
Here's a comparison at the map level, masked according to the part of the sky on which I compute the cross correlation.

**Fig 3:** Finally, for reference here's the plot from my talk. This is in very good agreement with expectations calculated by Kimmy Wu for 95 (she gets 29%) and Raphael for 95+145 (he gets 24%). Also shown here only for reference is one case with B data used all the way to ℓ=30. This should *not* be interpreted as the delensing fraction achievable.