rigetti / qiskit-rigetti

Qiskit provider serving Rigetti hardware & simulator backends.
Apache License 2.0
7 stars 7 forks source link

Upgrade backend to BackendV2 #44

Open jselig-rigetti opened 6 months ago

jselig-rigetti commented 6 months ago

Without this change, the following error occurs when using a live backend with the example from the README:

qiskit.transpiler.exceptions.TranspilerError: 'Number of qubits greater than device.'

This is due to https://github.com/Qiskit/qiskit/blob/main/qiskit/compiler/transpiler.py#L485 not using the direct backend.coupling_map as it would if RigettiQCSBackend were based on BackendV2

A workaround for now is to call execute explicitly with the coupling_map argument like the following, as described in https://github.com/rigetti/qiskit-rigetti/pull/43

job = execute(circuit, backend, shots=10, coupling_map=backend.coupling_map)