# Design a circuit implementing the unitary matrix

Is it possible to design a circuit implementing the unitary matrix

$$U-\begin{bmatrix} R_{\Theta_1} & 0 & 0 & 0 \\ 0 & R_{\Theta_2} & 0 & 0 \\ 0 & 0 & R_{\Theta_3} & 0 \\ 0 & 0 & 0 & R_{\Theta_4} \\ \end{bmatrix}$$

for given four angles $$\Theta_1,...,\Theta_4$$ , where 0 is 2×2-dimensional zero matrix and $$R_{\Theta}$$ is the rotation matrix with angle $$\Theta$$?

If so, can we implement it on the available quantum programming platforms such as Qiskit, CirQ, PyQuil, or ProjectQ?

• If you write the matrix explicitly and the matrix is unitary, then for qiskit, you can first from qiskit.quantum_info.operators import Operator, and then O=Operator(yourUnitaryMatrix) Dec 11, 2020 at 0:58
• @YitianWang The matrix defined by Marija is always unitary as it made from rotation matrix. I think she is asking for a generalized parameterized circuit that this matrix can be decomposed into. Dec 11, 2020 at 4:38
• Thanks for the prompt, the form of her matrix is unitary. The instruction my earlier provided can do such things, but I do not know how IBM quantum computer really do when simulating such an operation(like how they decompose a single-qubit unitary, i.e., one qubit sets of $\hat S, \hat H, \hat T$ or $\sigma_x, \sigma_z$ blabla). Other packages is out of my familiarity. Dec 11, 2020 at 9:20

At worst, you could perform the construction but depending on your different rotations, you may be able to make some efficiency savings. For example, one improvement that you can always make is you could start by applying $$R_1$$ on the first qubit without controlling it off anything, and then applying $$R_iR_1^\dagger$$ for the other three controlled-controlled operations.