Apply a Hadamard gate to qubit , followed by a controlled-NOT gate with controlling . The resulting Bell-basis conversion circuit is and gives
Thus map respectively to . The first input bit becomes the phase bit and the second becomes the parity bit.
Both gates are self-inverse, but inversion of their product reverses the order:
So the same two gates convert the Bell basis back to the computational basis when applied in reverse order: first the controlled-NOT, then the Hadamard. Using the forward order twice does not generally work, since these gates do not commute. For example, , which is not a computational-basis state.