I am working with the set $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$

where $\mathrm{H}$ is the Hadamard gate, and $\mathrm{P}(\theta)$ is the phase gate with angle $\theta$.

I want to build other gates with these gates, like $R_z(\theta)$, Control-$R_z(\theta)$, or Control-$P(\theta)$

How can I do this?


1 Answer 1


In your question, you don't define $P(\theta)$ or $R_z(\theta)$. I'm going to assume: $$ P(\theta)=\left(\begin{array}{cc} 1 & 0 \\ 0 & e^{i\theta} \end{array}\right)\qquad R_z(\theta)=\left(\begin{array}e^{-i\theta} & 0 \\ 0 & e^{i\theta} \end{array}\right). $$ In this case, you simply have that $$ R_z(\theta)=P(2\theta)e^{-i\theta}\equiv P(2\theta), $$ the point being that global phases are irrelevant. However, the difference is important when you look at the controlled-gates. Let's say we can create either controlled-$P$ or controlled-$R_z$. We can create the other via the identity

enter image description here

The extra $P(-\theta)$ is the gate that compensates for the extra phase.

To make controlled-$R_z$, the trick is to notice the identities $R_z(\theta_1)R_z(\theta_2)=R_z(\theta_1+\theta_2)$ and $XR_z(\theta)X=R_z(-\theta)$, where we will replace the Xs by controlled-not so that the change in rotation angle only happens if the control qubit is 1. Hence, we have

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.