I'm new with Qiskit and I'm struggling with creating my own controlled gates. I'm trying to create a ZYZ decomposition of a controlled unitary gate I created. I'm trying to use the method TwoQubitBasisDecomposer
. Here is a piece of my code
U = Operator([[a,b],[c,d]]) #forms an unitary matrix
ucirc = QuantumCircuit(1)
ucirc.unitary(U,0)
c_ucirc = ucirc.control()
Ug = c_ucirc.to_gate()
UgZYZ = TwoQubitBasisDecomposer(Ug, euler_basis="ZYZ")
print(UgZYZ.basis)
When printing the basis Qiskit returns the equivalent two-qubit decomposed gate
However, I don't know how to actually get the gate itself to insert on other algorithms. How can I proceed? All methods within TwoQubitBasisDecomposer
ask for a target. What is such a target?