Haar twirling conditional expectation (source code)

= Haar twirling conditional expectation
{c}
{title2=$\mathcal E_A(O)=d_B^{-1}\operatorname{Tr}_B(O)\otimes I_B$}

For an operator on a tensor-product <Hilbert space>, averaging unitary conjugations on subsystem $B$ with normalized <Haar measure> gives $\mathcal E_A(O)=(\operatorname{Tr}_B O/d_B)\otimes I_B$. It fixes precisely the operators acting trivially on $B$ and is contractive in <operator norm>. Writing $O-UOU^\dagger=[O,U]U^\dagger$ converts localization error into a <commutator> bound.