# Can you use Rz to flip from $|+\rangle$ to $|-\rangle$?

Here's the Rz matrix:

$$Rz(\theta) = \begin{bmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{bmatrix}$$

As I understand it, Rz rotates around the Z axis on the Bloch sphere. Since $$|+\rangle$$ and $$|-\rangle$$ are both on the Bloch sphere X-Y plane, it seems you should be able to rotate between them; however, I can't figure out a value of $$\theta$$ to do that.

Am I misunderstanding how the rotation gates work, or is there just a solution I'm not seeing?

The more elegant approach is to view $$R_z(\phi)$$ as a linear transformation acting on the basis $$\{|0\rangle, |1\rangle\}$$. $$|0\rangle$$ is mapped to $$e^{i\phi/2}|0\rangle$$ and $$|1\rangle$$ is mapped to $$e^{-i\phi/2}|1\rangle$$ by the transformation. As, $$|+\rangle = \frac{1}{\sqrt 2}(|0\rangle +|1\rangle)$$ it'd be mapped to $$R_z(\phi)|+\rangle = \frac{1}{\sqrt 2}(e^{i\phi/2}|0\rangle + e^{-i\phi/2}|1\rangle)$$. Now the question is, for what value of $$\phi$$ (if at all), $$R_z|+\rangle$$ coincides with $$|-\rangle = \frac{1}{\sqrt 2}(|0\rangle - |1\rangle)$$. As global phase factors are irrelevant in quantum mechanics, you just need to check for what value of $$\phi$$ (if at all) the coefficients of the basis vectors are in proportion i.e.,

$$\frac{e^{i\phi/2}}{e^{-i\phi/2}} = \frac{1}{-1} \implies e^{i\phi} = -1 \implies e^{i\phi} = e^{i\pi} \implies \phi = \pi$$

assuming $$\phi \in [0, 2\pi)$$.

Obviously, the Bloch sphere visualization (as in @kludg's answer) makes it even more evident. You can clearly see that a anti-clockwise rotation of $$\phi = \pi$$ (180 degrees) about the $$z$$-axis ($$|0\rangle$$ - $$|1\rangle$$ axis) takes the $$|+\rangle$$ state to the $$|-\rangle$$ state.

P.S: I used $$R_z(\phi)$$ instead of $$R_z(\theta)$$ in order to match the convention in the above diagram.

If you use $$\theta = \pi$$, you get the following:

$$Rz(\pi)\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = \begin{bmatrix} e^{-i \pi/2} & 0 \\ 0 & e^{i \pi/2} \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = \begin{bmatrix} -i & 0 \\ 0 & i \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = -i\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{-1}{\sqrt{2}} \end{bmatrix}$$

Which is equal to $$|-\rangle$$ under the global phase $$-i = e^{-i\pi/2}$$.

• to visualise the rotations in the Bloch sphere it might be more natural to work directly with density matrices. In this case, you can see quite nicely how $R_z(\theta)$ acts as a rotation when you consider its action (via conjugation) on states: $\rho\mapsto R_z(\theta)\rho R_z(\theta)^\dagger$.
– glS
Dec 22, 2019 at 16:41

Just think where $$|+\rangle$$ and $$|-\rangle$$ states on the Bloch sphere ($$x$$ axis): On IBM Q the Rz gate is defined as

$$\begin{equation} Rz(\theta) = \begin{pmatrix} 1 & 0 \\ 0 & \mathrm{e}^{i\theta} \end{pmatrix} \end{equation}$$

If you put $$\theta = \pi$$ then the matrix turns to

$$\begin{equation} Rz(\pi) = \begin{pmatrix} 1 & 0 \\ 0 & \mathrm{e}^{i\pi} \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} =Z \end{equation}$$ Hence $$Rz(\pi)|+\rangle = |-\rangle$$.

You can rewrite your matrix as

$$\begin{equation} Rz(\theta) = \begin{pmatrix} \mathrm{e}^{-i\frac{\theta}{2}} & 0 \\ 0 & \mathrm{e}^{i\frac{\theta}{2}} \end{pmatrix} = \mathrm{e}^{-i\frac{\theta}{2}} \begin{pmatrix} 1 & 0 \\ 0 & \mathrm{e}^{i\theta} \end{pmatrix} \end{equation}$$

Hence the only difference is a global phase.

Overall, Rz gate matrix as defined on IBM Q seems to more convinient as you do not have to deal with a global phase coeficient.

• I disagree with IBM Q conventions; in QM, spin 1/2 rotation matrices are related to Pauli matrices as $R_i(\theta)=\exp(i \theta/2\cdot \sigma_i)$ and this defines $R_z(\theta)$; and IBM for the sake of petty simplification is making a mess of QM conventions. Dec 22, 2019 at 7:50
• @kludg: I understand your objection but in the end the result is the same regardless which matrix (either QM approach or IBM approach) is used as the only difference is omission of global phase. Quantum states which differ only in global phase are considered to be same, so both approaches work. Or do I understand anything in wrong way? Dec 22, 2019 at 8:49
• This is the question of using common conventions. For example, it is possible to define Pauli matrices differently; fortunately physicists are wise to avoid a mess and everybody uses the form proposed by Pauli; IMO IBM Q designers were not wise when defined $R_z(\theta)$ matrix. Dec 22, 2019 at 9:43
• @kludg: OK, thanks for explanation. Dec 22, 2019 at 9:53