Closed kevinsung closed 1 year ago
I took a quick look at this, there are two issues the first is primarily an issue in the ibm runtime backend's Target
. The code used by the runtime provider to generate the Target
doesn't know about the ecr gate (or cz which will be an issue on some backends): https://github.com/Qiskit/qiskit-ibm-runtime/blob/main/qiskit_ibm_runtime/utils/backend_converter.py#L42-L49 . When the runtime doesn't know about the gate name it creates an opaque gate without a definition or matrix to represent the operation.
This leads to where the bug in terra is, the 2q unitary synthesis pass should be just ignoring gates in the target which it can't compute the matrix of since if there is no matrix the pass won't be able to do anything with that as a target anyway.
I pushed up a fix for the unitary synthesis pass to fix it's bug when using opaque gates. But I'm going to transfer this issue to qiskit-ibm-runtime because the real issue is that the backend's target isn't using ECRGate
and is instead creating a custom opaque gate with the name "ecr"
.
The code used by the runtime provider to generate the Target doesn't know about the ecr gate (or cz which will be an issue on some backends): https://github.com/Qiskit/qiskit-ibm-runtime/blob/main/qiskit_ibm_runtime/utils/backend_converter.py#L42-L49 .
The fix is simply to add ECRGate to that dictionary?
Yeah, just adding ECRGate
to that dictionary should fix this. It will tell the Target
constructor when it encounters the ecr
string in the configuration and properties payload that it means ECRGate
. We also should add CZGate
since ibm_prague
is using cz
as the entangling gate.
Environment
What is happening?
transpilation for an IBM Runtime backend fails when it involves unitary synthesis
How can we reproduce the issue?
What should happen?
it should work
Any suggestions?
it works if I get the backend from
IBMQ