Bell-basis conversion circuit (source code)

= Bell-basis conversion circuit
{c}
{title2=$U=\operatorname{CNOT}(H\otimes I)$}

Apply a <Hadamard gate> to the first qubit, then a <controlled-NOT gate> from the first to the second. This maps a <computational-basis state> $|ij\rangle$ to the <Bell state> with phase bit $i$ and parity bit $j$. Its inverse uses the same gates in reverse order because each gate is self-inverse but they do not commute. Applying the forward sequence twice is not generally a decoding operation.