Solution (source code)

= Solution

Use <superdense coding>. For the two-bit message $(a,b)\in\{0,1\}^2$, Alice applies $Z^aX^b$ to her half of the shared <Bell state>, where $X,Z$ are the <Pauli X gate> and <Pauli Z gate>. The encoded states are
$$
\begin{array}{c|c}
(a,b)&(Z^aX^b\otimes I)|\Phi^+\rangle\\\hline
(0,0)&(|00\rangle+|11\rangle)/\sqrt2\\
(0,1)&(|01\rangle+|10\rangle)/\sqrt2\\
(1,0)&(|00\rangle-|11\rangle)/\sqrt2\\
(1,1)&(|01\rangle-|10\rangle)/\sqrt2.
\end{array}
$$
These four <Bell states> are orthonormal. Alice then transmits her one <qubit> to Bob, who now holds both <qubits>. A <Bell-basis measurement> identifies the message with probability one.

More explicitly, Bob can apply a <CNOT gate> with the received <qubit> as control and his original <qubit> as target, followed by a <Hadamard gate> on the control. The <CNOT gate> sends the encoded state to
$$
\frac{|0\rangle+(-1)^a|1\rangle}{\sqrt2}\otimes|b\rangle,
$$
and the <Hadamard gate> sends this to $|a\rangle\otimes|b\rangle$. Computational-basis <projective measurements> therefore read out $a,b$ exactly. \b[One transmitted qubit, assisted by one previously shared Bell pair, communicates two classical bits.]