## Some errors can be corrected on some states

In another one of their escapades, Alice prepares a quantum object in some state |\psi\rangle and sends it to Bob.
But en route, the object is intercepted by a malicious third party, Eve, who changes its state by applying one of a prescribed list of unitary operations U_1,\ldots,U_n, chosen with probability p_1,\ldots,p_n, respectively.
Let’s assume that Alice and Bob know the set of possible unitaries (which we can think of as errors), along with the associated probabilities, but they do *not* know which particular unitary operation was chosen by Eve in this run of their experiment.
Can Bob reconstruct the state |\psi\rangle?

The answer is “yes, but only *sometimes*” — it depends on the original state |\psi\rangle.

Let \mathcal{H} be the Hilbert space pertaining to the object, and let \mathcal{C} be a subspace of \mathcal{H} that contains |\psi\rangle.
Write \mathcal{C}_i to denote the subspace of \mathcal{H} given by the image of U_i applied to \mathcal{C}, i.e.
\mathcal{C}_i \coloneqq \{U_i|\phi\rangle \mid |\phi\rangle\in\mathcal{C}\}.
Suppose that these subspaces are all orthogonal to one another: for each |\phi\rangle\in\mathcal{C}, we have
\langle\phi|U^\dagger_i U_j|\phi\rangle = \delta_{ij}
(and if none of the U_i are equal to the identity, then we also ask for each \mathcal{C}_i to be orthogonal to \mathcal{C}).
Assume that the unitary applied by Eve was U_k.
Then all Bob has to do to reconstruct |\psi\rangle is

- perform a measurement, defined by projectors on the subspaces \mathcal{C}_i for i=1,\ldots n
- identify k
- apply U_k^\dagger.

Things hopefully become clearer with an example.
Consider an object composed of three qubits, and define the subspace \mathcal{C} to be the span of the two basis vectors |000\rangle and |111\rangle.
Suppose Eve applies one of the following four unitary operations, each with equal probability:
\begin{aligned}
U_0 &= \mathbf{1}\otimes\mathbf{1}\otimes \mathbf{1}
\\U_1 &= X\otimes\mathbf{1}\otimes \mathbf{1}
\\U_2 &= \mathbf{1}\otimes X\otimes \mathbf{1}
\\U_3 &= \mathbf{1}\otimes\mathbf{1}\otimes X
\end{aligned}
That is, the identity, or the bit-flip on the first, second, or third qubit.
These four operations generate the four subspaces
\begin{aligned}
\mathcal{C} = \mathcal{C}_0 &= \Big\langle|000\rangle,|111\rangle\Big\rangle
\\\mathcal{C}_1 &= \Big\langle|100\rangle,|011\rangle\Big\rangle
\\\mathcal{C}_2 &= \Big\langle|010\rangle,|101\rangle\Big\rangle
\\\mathcal{C}_3 &= \Big\langle|001\rangle,|110\rangle\Big\rangle.
\end{aligned}
which actually span the eight-dimensional Hilbert space \mathcal{H} of the three qubits, giving us a decomposition into orthogonal subspaces:
\mathcal{H}
\cong \mathcal{C}_0 \oplus \mathcal{C}_1 \oplus\mathcal{C}_2 \oplus \mathcal{C}_3

So suppose Alice prepares |\psi\rangle=\alpha|000\rangle+\beta|111\rangle (which is indeed a vector in \mathcal{C}), and Eve ends up applying U_3, the bit-flip to the third qubit.
This generates the state
(\mathbf{1}\otimes\mathbf{1}\otimes X)|\psi\rangle
= \alpha|001\rangle+\beta|110\rangle \in \mathcal{C}_3.
The projective measurement on these subspaces tells Bob that the new state is in the subspace \mathcal{C}_3, and hence the original state can be recovered by the operation U_3^\dagger=\mathbf{1}\otimes\mathbf{1}\otimes X.