Solution (source code)

= Solution

\b[Impossible to implement as written: Bob is never given the basis string.] Step 7 requires him to know which incoming qubits were acted on by a <Hadamard gate>, but the announcement contains only the check positions. Since $H^{-1}=H$, knowing that a transformation is its own inverse does not identify which qubits need it.

Bob cannot recover the missing information from the qubits alone. For each encoded <Bell pair>, his <reduced density matrix> is
$$
\operatorname{Tr}_A[(I\otimes H^b)|\Phi^+\rangle\langle\Phi^+|(I\otimes H^b)]=I/2
$$
for either $b=0$ or $b=1$. His entire received register has the same <density matrix> $I/2^{2n}$ for every string $b$, so every local <quantum measurement> has statistics independent of $b$. Nor can one fixed unitary undo both possibilities: preserving $|\Phi^+\rangle$ requires that unitary to be proportional to $I$, whereas decoding $(I\otimes H)|\Phi^+\rangle$ requires it to be proportional to $H$. Supplying the missing basis announcement after receipt would repair the protocol and make it the third one, but that communication is absent from the printed sequence.