# How can I factor Hadamard gates according to $U=e^{i\delta}R_x(\alpha)R_y(\beta)R_z(\gamma)$

According to the formula $$U=e^{i\delta}R_x(\alpha)R_y(\beta)R_z(\gamma)$$, We know that a single quantum gate can be decomposed arbitrarily, But according to the book Quantum Computation. by Nielsen, I get $$H=-iR_x(\pi)R_y(\pi/2)$$, It makes me wonder how can I get rid of the phase $$-i$$?

• – glS
Jul 9 at 15:29

There's a small error but important error in your decomposition of $$U$$: you have three $$Z$$ rotations, but the middle rotation should be over a different angle. In principle this can be any angle, but let's focus on the often used middle-$$Y$$-rotation, so that the decomposition becomes:
$$U \hat{=}\, e^{i\alpha}R_{Z}(\beta)R_{Y}(\gamma)R_{Z}(\delta).$$
Then, if we take $$\{\alpha = \frac{\pi}{2}, \beta = 0, \gamma = \frac{\pi}{2}, \delta = \pi\}$$, we get:
$$\begin{split} &\, e^{\frac{i\pi}{2}}R_{Z}(0)R_{Y}(\frac{\pi}{2})R_{Z}(\pi) \\ =&\, e^{\frac{i\pi}{2}} \begin{bmatrix}1 & 0 \\ 0 & 1\end{bmatrix} \begin{bmatrix}\cos(\frac{\pi}{4}) & -\sin(\frac{\pi}{4}) \\ \sin(\frac{\pi}{4}) & \cos(\frac{\pi}{4})\end{bmatrix} \begin{bmatrix}e^{\frac{-i\pi}{2}} & 0 \\ 0 & e^{\frac{i\pi}{2}}\end{bmatrix} \\ =&\, (i)\frac{1}{\sqrt{2}}\begin{bmatrix}1 & -1 \\ 1 & 1\end{bmatrix} \begin{bmatrix}-i & 0 \\ 0 & i\end{bmatrix} \\ =& \, \frac{1}{\sqrt{2}}\begin{bmatrix}1 & -1 \\ 1 & 1\end{bmatrix} \begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix} \\ =& \, \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix} = H. \end{split}$$ Alternatively, you could take $$\{\alpha = \frac{3\pi}{2}, \beta = -\pi, \gamma = \frac{-\pi}{2}, \delta = 0\}$$