Obtain a two-qubit unitary's matrix in a way that will work after a qasm2 round-trip
Opened this issue · 3 comments
Following Jake's comment at Qiskit/qiskit#12100 (comment), which should try replacing our use of Gate.to_matrix
with a call to quantum_info.Operator(op).data
. There should be a code comment right above this that says why this change was made (with a hyperlink). We should also add a test to circuit-knitting-toolbox/test/cutting/test_cutting_workflows.py
to ensure that one can cut an arbitrary UnitaryGate
after it has undergone a qasm2 round-trip.
This all was prompted by a test in #520 that had to be modified not to use XXPlusYYGate
.
Looks like Jake has proposed a fix. We may not need to fix this at all on our end.
It looks like this will be fixed in Qiskit 1.1.1: Qiskit/qiskit#12523.
It might actually be worth doing this. If an Instruction
consists of only gates, the Operator(op).data
seems to work, but .to_matrix()
does not. It's worth some additional investigation.