Suppose that the available sky map is
\begin{equation}
\boldsymbol{x}=\boldsymbol{s}+\boldsymbol{n}
\end{equation}
where s is the actual sky signal and n is the noise contribution, we denote its covariance matrix as N.
And we call the covariance matrix of the signal C
\begin{equation}
C\left(\hat{\boldsymbol{x}}, \hat{\boldsymbol{x}}^{\prime}\right) \equiv\left\langle X^{*}(\hat{\boldsymbol{x}}) X\left(\hat{\boldsymbol{x}}^{\prime}\right)\right\rangle
\end{equation}
If we assume statistical isotropy $C\left(\hat{\boldsymbol{x}}, \hat{\boldsymbol{x}}^{\prime}\right)$ becomes a function of only $\hat{x} · x'$ and it can be expanded on the
Legendre polynomial
\begin{equation}
C\left(\hat{\boldsymbol{x}} \cdot \hat{\boldsymbol{x}}^{\prime}\right)=\frac{1}{4 \pi} \sum_{\ell=0}^{\infty}(2 \ell+1) C_{\ell} P_{\ell}\left(\hat{\boldsymbol{x}} \cdot \hat{\boldsymbol{x}}^{\prime}\right)
\end{equation}
Assuming signal and noise to be uncorrelated, the probability of a realisation of x and likelihood
function for the power spectrum is
\begin{equation}
P\left(\boldsymbol{x} \mid C_{\ell}\right)=\mathcal{L}\left(C_{\ell}\right)=\frac{\exp \left\{-\frac{1}{2} \boldsymbol{x}^{\top}(\boldsymbol{N}+\boldsymbol{C})^{-1} \boldsymbol{x}\right\}}{\sqrt{(2 \pi)^{\mathcal{N}_{p}} \operatorname{det}(\boldsymbol{N}+\boldsymbol{C})}}
\end{equation}
where the dependence on the power spectrum $C_{\ell}$ is inside $C$.
Pseudo-power spectrum estimator
pseudo basis for temperature
For full sky survey,
\begin{equation}
{a}_{\ell m} \equiv \int{Y}_{\ell m}^{*} s \mathrm{~d} \Omega
\end{equation}
For a cut sky survey, $\tilde{s} = Ws$
\begin{equation}
\tilde{a}_{\ell m} \equiv \int{Y}_{\ell m}^{*} \tilde{s} \mathrm{~d} \Omega = \int{Y}_{\ell m}^{*} Ws \mathrm{~d} \Omega = \int \tilde{Y}_{\ell m}^{*} s \mathrm{~d} \Omega
\end{equation}
\begin{equation}\label{eq:pseudo_TT}
\boxed{
\tilde{Y}_{\ell m} \equiv W Y_{\ell m}, \text{c.f. Eq.\ref{eq:pseudo_EB}}
}
\end{equation}
where the window function $W$ is a function on the sphere that is different from zero only inside the
observed region. (Smith 2006) Also, the performance of the estimators is improved (on angular scales with signal-to-noise ratio < 1) by choosing W(x) to be smaller where the noise is larger, in order to downweight noisy regions.
Frequently, the weight function is also apodized near the survey boundary,
in order to reduce harmonic ringing.
\begin{equation}
\tilde{a}_{\ell m} \equiv \int \tilde{Y}_{\ell m}^{*} s \mathrm{~d} \Omega = \int \tilde{Y}_{\ell m}^{*} \sum_{\ell^{\prime} m^{\prime}} a_{\ell^{\prime} m^{\prime}} Y_{\ell^{\prime} m^{\prime}} \mathrm{d} \Omega=\sum_{\ell^{\prime} m^{\prime}} K_{\ell m \ell^{\prime} m^{\prime}}^{0} a_{\ell^{\prime} m^{\prime}}
\end{equation}
\begin{equation}
K_{\ell m \ell^{\prime} m^{\prime}}^{0} \equiv \int \tilde{Y}_{\ell m}^{*} Y_{\ell^{\prime} m^{\prime}} \mathrm{d} \Omega
\end{equation}
\begin{equation}
\begin{aligned}
\tilde{C}_{\ell} &=\sum_{m=-\ell}^{\ell} \frac{\tilde{a}_{\ell m}^{*} \tilde{a}_{\ell m}}{2 \ell+1} \\
&=\sum_{m=-\ell}^{\ell} \frac{1}{2 \ell+1} \sum_{\ell^{\prime} m^{\prime} \ell^{\prime \prime} m^{\prime \prime}} a_{\ell^{\prime} m^{\prime}}^{*} a_{\ell^{\prime \prime} m^{\prime \prime}} K_{\ell m \ell^{\prime} m^{\prime}}^{0}\left(K_{\ell m \ell^{\prime \prime} m^{\prime \prime}}^{0}\right)^{*}
\end{aligned}
\end{equation}
Assuming statistical isotropy, i.e., $\left\langle a_{\ell^{\prime} m^{\prime}}^{*} a_{\ell^{\prime \prime} m^{\prime \prime}}\right\rangle= C_{\ell'}\delta_{\ell' \ell''} \delta_{m'm''}$,
the expected value of the pseudo-power spectrum simplifies to
\begin{equation}
\left\langle\tilde{C}_{\ell}\right\rangle=\sum_{\ell^{\prime}} M_{\ell \ell^{\prime}} C_{\ell^{\prime}}
\end{equation}
\begin{equation}
M_{\ell \ell^{\prime}} \equiv \sum_{m=-\ell}^{\ell} \sum_{m^{\prime}=-\ell^{\prime}}^{\ell^{\prime}} \frac{1}{2 \ell+1} K_{\ell m \ell^{\prime} m^{\prime}}^{0}\left(K_{\ell m \ell^{\prime} m^{\prime}}^{0}\right)^{*}
\end{equation}
Armed with these relations, the true auto- and cross-power spectra can be estimated from the pseudo-power spectra by inverting above equation
\begin{equation}
C_{\ell}=\sum_{\ell^{\prime}} M^{-1}_{\ell \ell^{\prime}} \left\langle \tilde{C}_{\ell^{\prime}} \right\rangle
\end{equation}
Mode coupling and E to B leakage
E-B decomposition
Stokes parameters
The parameters $I$ and $V$ are physical observables independent of the coordinate system, but Q and U depend on the orientation of the x and y axes
IQUV.
$$
\text { Here }\left\{\begin{array}{c}
E_{x}^{\prime}(t)=E_{x}(t) \cos \theta+E_{y}(t) \sin \theta \\
E_{y}^{\prime}(t)=-E_{x}(t) \sin \theta+E_{y}(t) \cos \theta
\end{array}\right.
$$
Using the definitions of $\mathrm{S}$ and $\mathrm{S}$ '
$$
\left(\begin{array}{c}
S_{o}^{\prime} \\
S_{1}^{\prime} \\
S_{2}^{\prime} \\
S_{3}^{\prime}
\end{array}\right)=\left(\begin{array}{c}
E_{x}^{\prime} E_{x}^{\prime *}+E_{y}^{\prime} E_{y}^{\prime *} \\
E_{x}^{\prime} E_{x}^{\prime *}-E_{y}^{\prime} E_{y}^{\prime *} \\
E_{x}^{\prime} E_{y}^{\prime *}+E_{y}^{\prime} E_{x}^{\prime *} \\
i\left(E_{x}^{\prime} E_{y}^{\prime *}-E_{y}^{\prime} E_{x}^{\prime *}\right)
\end{array}\right) \quad\left(\begin{array}{c}
S_{o} \\
S_{1} \\
S_{2} \\
S_{3}
\end{array}\right)=\left(\begin{array}{c}
E_{x} E_{x}^{*}+E_{y} E_{y}^{*} \\
E_{x} E_{x}^{*}-E_{y} E_{y}^{*} \\
E_{x} E_{y}^{*}+E_{y} E_{x}^{*} \\
i\left(E_{x} E_{y}^{*}-E_{y} E_{x}^{*}\right)
\end{array}\right)
$$
And inserting the expressions for $E^{\prime}$ we get
$$
\left(\begin{array}{c}
S_{o}^{\prime} \\
S_{1}^{\prime} \\
S_{2}^{\prime} \\
S_{3}^{\prime}
\end{array}\right)=\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & \cos 2 \theta & \sin 2 \theta & 0 \\
0 & -\sin 2 \theta & \cos 2 \theta & 0 \\
0 & 0 & 0 & 1
\end{array}\right)\left(\begin{array}{l}
S_{o} \\
S_{1} \\
S_{2} \\
S_{3}
\end{array}\right)
$$
or
\begin{aligned}
I & \equiv\left\langle E_{x}^{2}+E_{y}^{2}\right\rangle \\
Q & \equiv\left\langle E_{x}^{2}-E_{y}^{2}\right\rangle \\
U & \equiv\left\langle 2 \operatorname{Re}\left(E_{x} E_{y}^{*}\right)\right\rangle \\
V & \equiv\left\langle-2 \operatorname{Im}\left(E_{x}^{*} E_{y}\right)\right\rangle
\end{aligned}
(Davide's thesis)
It is important to notice how the Stokes parameters change under parity change and rotation of the reference coordinate system. $I$ is a scalar while $V$ is a pseudo-scalar
(it changes sign under parity transformation).
More important to us, Q and U change if the x-y plane is rotated by an angle $\theta$. One
can easily show that in the new system x'-y':
\begin{equation}
\left(Q^{\prime} \pm i U^{\prime}\right)=e^{\mp 2 \theta i}(Q \pm i U)
\end{equation}
or, equivalently, one can gather Q and U in a 2-vector and express the same relation as
\begin{equation}
\left(\begin{array}{c}
Q \\
U
\end{array}\right)^{\prime}=\left[\begin{array}{cc}
\cos (2 \theta) & \sin (2 \theta) \\
-\sin (2 \theta) & \cos (2 \theta)
\end{array}\right]\left(\begin{array}{c}
Q \\
U
\end{array}\right)
\end{equation}
This relations express the spin-2 nature of the linear polarization field that can thus be represented as a head-less vector.
The factor of two before $\theta$ represents the fact that any polarization ellipse is indistinguishable from one rotated by 180°
WIKI .
Spin weighted spherical harmonics
\begin{equation}
\begin{aligned}
T(\hat{\boldsymbol{n}}) &=\sum_{l m} a_{l m} Y_{l m}(\hat{\boldsymbol{n}}) \\
(Q \mp i U)(\hat{\boldsymbol{n}}) &=\sum_{l m} {}_{\pm 2} a_{l m} {}_{\pm 2} Y_{l m}(\hat{\boldsymbol{n}})
\end{aligned}
\end{equation}
$$\bf{Some \quad mathematics}$$
$\eth (\bar{\eth})$ corresponds to the spin-raising
(lowering) operator for an arbitrary function ${}_sf(\hat n)$ with spin $s$,
\begin{eqnarray}
\eth {}_sf(\hat n) \equiv -\sin^s \theta \left(\frac{\partial}{\partial \theta} + \frac{i}{\sin \theta}\frac{\partial}{\partial \phi}\right) \sin^{-s}\theta {}_s f(\hat n) , \\
\bar{\eth} {}_s f(\hat n) \equiv -\sin^{-s} \theta \left(\frac{\partial}{\partial \theta} - \frac{i}{\sin \theta}\frac{\partial}{\partial \phi}\right) \sin^s\theta {}_sf(\hat n) ,
\end{eqnarray}
If $f$ is a spin- $s$ function, then $\eth f$ has spin $s+1$. Conversely, if $f$ has spin- $s$ function, then $\bar{\eth} f$ has spin $s-1$.
Therefore the spherical harmonics with spin ±2 can be derived from the spin-0 spherical harmonics as
\begin{equation}
\begin{gathered}
{ }_{2} Y_{l m}=[(l-2) ! /(l+2) !]^{1 / 2} \eth \eth Y_{l m} \\
{-2} Y_{l m}=[(l-2) ! /(l+2) !]^{1 / 2} \bar{\eth} \bar{\eth} Y_{l m}
\end{gathered}
\end{equation}
A vector field (spin 1) on a two dimensional manifold can be decomposed into a gradient and a curl
component by the Helmholtz theorem. Similarly the spin ±2 polarization field can be naturally expressed
in terms of its gradient and curl components, respectively called E and B fields in analogy with the
electromagnetism. They are both spin-0 fields, their harmonic coefficients can be derived from those of
the harmonic coefficients of the spin-2 field
\begin{equation}
\begin{gathered}
a_{\ell m}^E=-\frac{1}{2}\left(_2 a_{\ell m}+_{-2} a_{\ell m}\right) \\
a_{\ell m}^B=\frac{i}{2}\left({ }_{2} a_{\ell m}-{ }_{-2} a_{\ell m}\right)
\end{gathered}
\end{equation}
Conversely, Q and U can be written in terms of E and B:
\begin{equation}
\begin{aligned}
Q &=-\sum_{\ell m}\left(a_{\ell m}^E { }_{1} X_{\ell m}+i a_{\ell m}^B{ }_{2} X_{\ell m}\right) \\
U &=-\sum_{\ell m}\left(a_{\ell m}^E { }_{1} X_{\ell m}+i a_{\ell m}^E{ }_{2} X_{\ell m}\right)
\end{aligned}
\end{equation}
where ${ }_{1} X_{\ell m} \equiv\left({ }_{2} Y_{\ell m}+{ }_{-2} Y_{\ell m}\right) / 2$ and
${ }_{2} X_{\ell m} \equiv\left({ }_{2} Y_{\ell m}-{ }_{-2} Y_{\ell m}\right) / 2$.
Group Q and U into a column vector P : $\boldsymbol{P}(\boldsymbol{x}) \equiv\left(\begin{array}{c}Q \\ U\end{array}\right)(\boldsymbol{x})$:
\begin{equation}
\boldsymbol{P}=-\sum_{\ell m}\left(a_{\ell m}^E \boldsymbol{Y}^E_{\ell m}+a^B_{\ell m}\boldsymbol{Y}^B_{\ell m}\right)
\end{equation}
where the basis for the electric and magnetic component of the spin-2 spherical harmonics is defined as
\begin{equation}
\begin{array}{r}
\boldsymbol{Y}^E_{\ell m} \equiv\left(\begin{array}{c}
{ }_{1} X_{\ell m} \\
-i{ }_{2} X_{\ell m}
\end{array}\right)=\boldsymbol{D}_{E} Y_{\ell m} \\
\boldsymbol{Y}^B_{\ell m} \equiv\left(\begin{array}{c}
i_{2} X_{\ell m} \\
{ }_{1} X_{\ell m}
\end{array}\right)=\boldsymbol{D}_{B} Y_{\ell m}
\end{array}
\label{eq:basis_EB}
\end{equation}
The second order differential operators in the second equality are defined as
\begin{equation}
\begin{aligned}
\boldsymbol{D}_{E} & \equiv \frac{1}{2}\left(\begin{array}{c}
\eth\eth+\bar{\eth} \bar{\eth} \\
-i(\eth \eth-\bar{\eth} \bar{\eth})
\end{array}\right) \\
\boldsymbol{D}_{B} & \equiv \frac{1}{2}\left(\begin{array}{c}
i(\eth \eth-\bar{\eth} \bar{\eth}) \\
\eth \eth+\bar{\eth} \bar{\eth}
\end{array}\right)
\end{aligned}
\end{equation}
$\boldsymbol{D}_{E}$ and $\boldsymbol{D}_{B} $ are the spin-2 analogues of the familiar gradient and curl operators. Applying $\boldsymbol{D}_{E}$ or $\boldsymbol{D}_{B}$ to a scalar field
gives $E$ and $B$ fields that have vanishing "curl" and "gradient" respectively.
Basis for polarization fields Bunn et.al., 2003
On a manifold without boundary, any polarization field can be uniquely separated into an E part and a B part. But if
there is a boundary, i.e., if only some subset $\Omega$ of the sky has
been observed, this decomposition is not unique. We can represent the space of all polarization fields on $\Omega$ as a direct sum of three subspaces: pure E, pure B, and
ambiguous modes, which are modes that satisfy both the E-mode and B-mode conditions simultaneously.
In the quest of separating the E and B contributions the ambiguous modes are not very useful, since we cannot know
whether they are due to a cosmological E or B signal. If we are willing to assume, on either observational or theoretical
grounds, that E dominates over B on the angular scale of interest, then it may be sensible to assume that power found
in the ambiguous modes is E power.
Standard pseudo-$C_{\ell}$ method for EE and BB power spectra
\begin{equation}
\boxed{
\pm 2 \tilde{Y}_{\ell m} \equiv W_{\pm 2} Y_{\ell m}, \text{c.f. Eq.\ref{eq:pseudo_TT}, \ref{eq:pseudo_pure}}
}
\label{eq:pseudo_EB}
\end{equation}
Complete coupling matrix(Davide's thesis and appendix A of M. L. Brown et.al., 2005)
\begin{equation}
\left\langle\left(\begin{array}{c}
\tilde{C}_{\ell}^{T T} \\
\tilde{C}_{\ell}^{T E} \\
\tilde{C}_{\ell}^{T B} \\
\tilde{C}_{\ell}^{E E} \\
\tilde{C}_{\ell}^{E B} \\
\tilde{C}_{\ell}^{B B}
\end{array}\right) \right\rangle= \sum_{\ell'}\left(\begin{array}{cccccc}
M_{\ell \ell^{\prime}}^{00} & & & & & \\
& M_{\ell \ell^{\prime}}^{0+} & M_{\ell \ell^{\prime}}^{0-} & & & \\
& -M_{\ell \ell^{\prime}}^{0-} & M_{\ell \ell^{\prime}}^{0+} & & & \\
& & & M_{\ell \ell^{\prime}}^{++} & \left(M_{\ell \ell^{\prime}}^{-+}+M_{\ell \ell^{\prime}}^{+-}\right) & M_{\ell \ell^{\prime}}^{--} \\
& & & -M_{\ell \ell^{\prime}}^{+-} & \left(M_{\ell \ell^{\prime}}^{++} - M_{\ell \ell^{\prime}}^{--}\right) & M_{\ell \ell^{\prime}}^{-+} \\
& & & M_{\ell \ell^{\prime}}^{--} & -\left(M_{\ell \ell^{\prime}}^{-+}+M_{\ell \ell^{\prime}}^{+-}\right) & M_{\ell \ell^{\prime}}^{++}
\end{array}\right)\left(\begin{array}{l}
C_{\ell'}^{T T} \\
C_{\ell'}^{T E} \\
C_{\ell'}^{T B} \\
C_{\ell'}^{E E} \\
C_{\ell'}^{E B} \\
C_{\ell'}^{B B}
\end{array}\right)
\end{equation}
See also Namaster Eq.28
The presence of many zero blocks is due to the fact that the pseudo basis does not mix temperature
and polarization. However, the polarization pseudo-basis mixes $E$ and $B$ modes whenever the $M^{−−}$ block
is not zero, causing a problem analogous to the mixing of power from different $\ell$s with very different
$C_{\ell}$s. The mixing matrix quantifies which fraction of the $E$ power leaks into the pseudo-$B$ and effectively
corrects for it when applying the inverted mixing matrix on the pseudo-power spectrum. However, the
cosmic variance of EE severely affects the BB uncertainty, especially at large scales. This problem is
overcome by using the pure estimators.
Also see Namaster paper
B-mode purification refers to the map-level removal of the
contamination from E modes in the B-mode component of a given
map caused by an incomplete sky coverage and vice versa. The
procedure is particularly useful in situations in which the E-mode
component of the signal is significantly larger than the B modes,
as is the case in for the CMB. In this case, removing the leakage
at the power-spectrum level (i.e. the standard pseudo-$C_{\ell}$ approach)
produces a suboptimal estimator in which the variance in the Bmode power spectrum is dominated by the variance of the leaked
E modes.
E/B purification
Construct a pure B pseudo-basis
\begin{equation}
\tilde{\boldsymbol{Y}}_{\ell m}^B \equiv \boldsymbol{D}_{B}\left(W Y_{\ell m}\right), \text{c.f. Eq.\ref{eq:pseudo_EB}, \ref{eq:basis_EB}}
\label{eq:pseudo_pure}
\end{equation}
See Namaster Eq.29
\begin{eqnarray*}
B^p_{\ell m}= \int \text{d}\hat{\boldsymbol {\theta }} \tilde{\boldsymbol{Y}}_{\ell m}^{B^\dagger}
{\boldsymbol P}(\hat{\boldsymbol {\theta }})= \int \text{d}\hat{\boldsymbol {\theta }}\left({\boldsymbol D}_{B}(W\, Y_{\ell m})\right)^\dagger \, {\boldsymbol P}(\hat{\boldsymbol {\theta }}).
\end{eqnarray*}
Since ${\boldsymbol D}_{B}(W\, Y_{\ell m})$ is a B-mode quantity, $B^p_{\ell m}$ should receive contributions only from B modes.
See Namaster Fig.11 and Smith 2006 Fig.7.