Given a complex unitary $2*2$ matrix $A$ that represents some quantum gate on a single qubit.

What is the formula to extract to $\theta_X, \theta_Y, \theta_Z $ rotations around each one of the axes in the Bloch Sphere?

I will mention that I know that :

$$U_3(\theta, \phi, \lambda) = \begin{pmatrix}\cos(\theta/2) & -e^{i\lambda}\sin(\theta/2) \\ e^{i\phi}\sin(\theta/2) & e^{i\lambda + i\phi}\cos(\theta/2)\end{pmatrix}$$

But while trying to use it, I struggled with $cos()=complex-value$ that gave me complex angles


1 Answer 1


The Euler angles that you obtain depend on the decomposition that you implement over your 1 qubit gate. i.e it is possible to decompose any 1 qubit gate $U$ as:

$$ U = e^{i\gamma}R_z(\theta)R_y(\phi)R_z(\lambda)$$


$$ U = e^{i\gamma}R_z(\theta)R_x(\phi)R_z(\lambda)$$

In those cases, you'd obtain 2 $\theta_Z$ angles and 1 $\theta_Y$ or 2 $\theta_Z$ angles and 1 $\theta_X$ respectively. You can fin the methodology for some of the decompositions in this page:


Qiskit has a class to implement several types of decompositions:


You can see the source code to know how they work:


  • $\begingroup$ Thabk you so much! $\endgroup$
    – Ron Cohen
    May 29 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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