After reading some books I'm very confused about one question. For example in Nielsen and Chuang chapter 4.2 the universal gate U could be used to construct the Rz gate, which means a turn around the z-axis. They also describe the special T-gate, which gives me the same question.

I found this equation here:

$$\begin{bmatrix} e^{i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{bmatrix}\begin{bmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & e^{i\theta} \end{bmatrix}$$

Why is this equation is true? Why I need to do this math, if a Rz Operation is still a turn around z?

  • 3
    $\begingroup$ "Why is this equation true?" -- Have you tried multiplying the matrices on the left hand side together and seeing what you get? "Why I need to do this math, if a Rz Operation is still a turn around z?" -- The idea is you want a universal set of gates, that is roughly a set of gates that, by multiplying them together, allows you to recover any other gate. So this question is trying to demonstrate that by using one gate you can recover another gate. $\endgroup$
    – Rammus
    Mar 29, 2021 at 8:23

1 Answer 1


The equation you gave is showing an alternate expression of the $R_z$ rotation gate that differs from the definition by a global phase. This can be made clear if we use a different symbol for the phase difference:

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

where, for $\alpha = \theta$,

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

If we were to use $ \alpha = \theta = \pi / 4 $ we would have

$$ \begin{bmatrix} e^{i \frac{\pi}{8}} & 0 \\ 0 & e^{i \frac{\pi}{8}} \end{bmatrix} \begin{bmatrix} e^{-i \frac{\pi}{8}} & 0 \\ 0 & e^{i \frac{\pi}{8}} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \frac{\pi}{4}} \end{bmatrix} $$

which you will recognize as the definition of the $T$ gate. This type of phase/rotation decomposition is universal. In fact, any arbitrary single-qubit unitary operator can be written in the form

$$ U = e^{i\alpha} R_{\hat{n}}(\theta) $$

for some real numbers $\alpha$ and $\theta$, and a real-three dimensional unit vector $\hat{n}$ (the same universal $U$ gate that you mentioned). To convince yourself this is true you can work through Nielsen and Chuang Exercise 4.8.

  • $\begingroup$ ok I understand. But how I can construct the first matrix (positive $i$ for the first value) if the definition says to have a $-i$? I'm very sorry but this isn't clear for me :( $\endgroup$
    – ToastyX
    Apr 3, 2021 at 11:00
  • $\begingroup$ The first matrix is simply a phase shift, the second matrix is where the rotation happens. What do you mean by "construct"? $\endgroup$
    – ryanhill1
    Apr 3, 2021 at 16:40
  • $\begingroup$ okay understand this is the phase shifting. But why we don't use just the second matrix (as described in Nielsen and Chuang as "historical") only, if the global phase doesn't matter? This is also for the phase shift, because the sources I look at just make a phase shift with a "1" as first matrix value and not like matrix you given. It's confusing for me. Should the calculation to "1" undo the global phase? $\endgroup$
    – ToastyX
    Apr 3, 2021 at 19:20
  • $\begingroup$ Yes, there are many instances when the global phase "doesn't matter" but it is still important to acknowledge, so by default we define the Rz gate without any phase shift. If we incorporated a phase shift into the definition of the Rz gate and not any other rotation gates things could get confusing. And there are multiple ways to induce a phase shift, another of which is the matrix you mentioned that uses the "1" as the first value. But try not to get too bogged down on one representation vs another. Instead, just make sure the underlying math makes sense. $\endgroup$
    – ryanhill1
    Apr 5, 2021 at 12:49

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.