1

I have this 2*2 unitary matrix one looks like U =[ -0.2840 - 0.5319i, -0.0000 - 0.7978i; -0.0000 - 0.7978i ,-0.2840 + 0.5319i] I want to represent this unitary matrix by a CU3 gate which looks like

enter image description here

Can someone suggest a faster way to determine all the angles? Is there any open-source code that I can use to determine these angles? Thank you for any help and suggestions.

2 Answers2

2

You can essentially just read off those angles. Consider the top-left matrix element $$ U_{00}=-0.2840-0.5319i=e^{i\gamma}\cos(\theta/2). $$ If you take the mod-square, you get $$ |U_{00}|^2=0.2840^2+0.5319^2=\cos^2(\theta/2). $$ From there, $$ e^{i\gamma}=U_{00}/\cos(\theta/2). $$ Alternatively, $$ \tan\gamma=\frac{-0.5319}{-0.2840}. $$

DaftWullie
  • 63,351
  • 4
  • 57
  • 142
1

You can use Qiskit's OneQubitEulerDecomposer class as follows:

from qiskit.quantum_info.synthesis.one_qubit_decompose import OneQubitEulerDecomposer
import numpy as np

unitary = np.array([ [-0.284 - 0.5319j, -0.0 - 0.7978j], [ -0.0 - 0.7978j ,-0.284 + 0.5319j] ])

decomposer = OneQubitEulerDecomposer('U3') theta, phi, lambda_, gamma = decomposer.angles_and_phase(unitary)

Egretta.Thula
  • 12,146
  • 1
  • 13
  • 35