If I have a normalized $(\alpha,\beta)$ as $(0.24506+0.9633i,0.0046238+0.10943i)$ for a qubit $\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\right> + (\beta_1 + i\beta_2 )\left|1\right>$, how can I generate angles for a unitary gate by using above data and can I run this on qiskit?
1 Answer
Here is my attempt.
First, let's create the statevector:
from qiskit.quantum_info.states import Statevector
alpha = complex(0.24506488, 0.9633)
beta = complex(0.0046248, 0.10943)
sv = Statevector([alpha,beta])
$ \begin{bmatrix} 0.24506 + 0.9633i & 0.00462 + 0.10943i \\ \end{bmatrix} $
Then, we can initialize a circuit in that state and transpile it to a rotation-only basis:
from qiskit import QuantumCircuit, transpile
qc = QuantumCircuit(1)
qc.initialize(sv, [0])
transpile(qc, basis_gates=['rx', 'ry', 'rz']).draw()