Solution (source code)

= Solution

Let $A$ be the known set of affected <qubits>, with $|A|\leq d-1$. Expand arbitrary operators on $A$ in <tensor products> of $I,X,Y,Z$. These <Pauli operators> span the complete error space on $A$.

By the <distance of a quantum error-correcting code>, every <Pauli operator> $F$ of weight below $d$ has scalar compression $PFP=c_FP$. For two errors $E_a,E_b$ on the same known set $A$, their product $E_a^\dagger E_b$ is also supported entirely on $A$. Its weight is therefore at most $|A|$, rather than twice $|A|$. Expansion in the Pauli basis consequently gives
$$
PE_a^\dagger E_bP=C_{ab}P.
$$
The <Knill--Laflamme condition> applies to the full operator space on $A$, so it gives a recovery for any error channel acting on that subsystem. \b[Every set of at most $d-1$ known error locations is correctable.] This is <quantum erasure correction>; the ability to use the locations is what improves the guarantee over unknown-location errors.