How can I construct a CNOT gate using a CZ and H gates?
And I also need to prove it using these identities:
\begin{equation} H = (1/\sqrt{2})(X+Z)\\ XZ = -ZX\\ X^2 = Z^2 = H^2 = 1\\ HXH = Z\\ HZH = X\\ \end{equation}
Thank you!
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.
Sign up to join this communityHow can I construct a CNOT gate using a CZ and H gates?
And I also need to prove it using these identities:
\begin{equation} H = (1/\sqrt{2})(X+Z)\\ XZ = -ZX\\ X^2 = Z^2 = H^2 = 1\\ HXH = Z\\ HZH = X\\ \end{equation}
Thank you!
Remember that when you apply a CNOT (CX) gate to two qubits, $q_0$ (controlled) and $q_1$ (target), then when $q_0$ is in the $|1\rangle$ state, you apply the $X$ gate to the target quit $q_1$. And when $q_0$ is in the $|0\rangle$ state, you simply do nothing. CZ is the same. when $q_0$ is $|1\rangle$ you apply $Z$ to $q_1$, and when $q_0$ is $|0\rangle$ you do nothing.
Now, if you consider the circuit $\big( I \otimes H \big) CZ \big(I \otimes H \big)$ which can be drawn as:
With the above circuit, note that when the controlled qubit, $q_0$, is in the state $|0\rangle$, $CZ$ do nothing to $q_1$ and so you will end up with just $H \cdot H = I$. Thus, when $q_0$ is $|0\rangle$, nothing happens, just as the case when we have $CX$.
Now. ote that when the controlled qubit, $q_0$, is in the state $|1\rangle$,$CZ$ will apply the gate $Z$ to $q_1$. Thus, you have $H \cdot Z \cdot H = X$. Thus, when $q_0$ is $|1\rangle$, we apply the gate $X$ to $q_1$. This is exactly the case in $CX$.
Therefore, in both cases, when $q_0$ is $|0\rangle$ and $q_1$ is $|1\rangle$, we have the same result as $CX$. This implies that the above circuit is indeed exactly the same as the circuit