qiskit-ibm-runtime
qiskit-ibm-runtime copied to clipboard
Runtime transpilation fails for circuit with reset in it
Describe the bug
Attempting to execute a circuit with a reset in it via the Estimator
gives the following transpiler error:
RuntimeJobFailureError: 'Unable to retrieve job result. TRANSPILERERROR: "UNKNOWN OPERATION TYPE FOR DAGOPNODE(OP=INSTRUCTION(NAME='RESET', NUM_QUBITS=1, NUM_CLBITS=0, PARAMS=[]), QARGS=(QUBIT(QUANTUMREGISTER(27, 'Q'), 1),), CARGS=()).'
Steps to reproduce The circuit comes from here: https://quantum-enablement.org/events/skku-2022/Dynamical-decoupling.html#example-wormhole-teleportation
Expected behavior
I expect to be able to compute the observable 'ZIIIII'
with no issue.
Suggested solutions
Additional Information
- qiskit-ibm-runtime version: latest
- Python version:
- Operating system:
I tried to build a small test case similar to yours, using Estimator
, with a reset
but did not get a failure. I couldn't use your circuit because it doesn't use Estimator
as far as I could see (also because it is a huge example :).
Can you provide a small example that is failing?
I see now that it fails when running on a real device. On the simulator it passes. I will investigate further.
The problem appears to be in qiskit_ibm_primitives
. I will open an issue there.
I'm following up on this issue. I'm not sure this is the same error as reported, but here is a small piece of code that illustrates the same compiler error. Even though FakeAlmadenV2 is a V2 backend, it does not include the reset operation, which causes the transpilation to fail. This could be a problem with the provider as written, or maybe with the BackendV2Converter? The initialize command apparently includes a reset. (Transpilation works with a V1 backend (e.g., FakeAlmaden) and with the GenericBackendV2.)
This is with qiskit 1.0.2, and qiskit-ibm-runtime 0.22.0.
from qiskit import QuantumCircuit, QuantumRegister, transpile from qiskit.providers.fake_provider import GenericBackendV2 from qiskit_ibm_runtime.fake_provider import FakeAlmadenV2 from qiskit.quantum_info import Statevector
sv = Statevector.from_label("001100") qc = QuantumCircuit(6, name='prep') qc.initialize(sv.data, list(range(0,6)))
backend = GenericBackendV2(20) print(f'GenericBackendV2 operations: {backend.operation_names}') tqc = transpile(qc, backend) # this works
backend = FakeAlmadenV2() print(f'FakeAlmadenV2 operations: {backend.operation_names}') tqc = transpile(qc, backend) # this fails because backend has no reset operator
---- OUTPUT GenericBackendV2 operations: ['cx', 'id', 'rz', 'sx', 'x', 'reset', 'delay', 'measure'] FakeAlmadenV2 operations: ['u3', 'measure', 'u2', 'cx', 'id', 'u1', 'delay'] ...transpiler error happens here...
I think this was fixed, but someone should test it.
Confirmed this has been fixed