Skip to content

Commit 273f461

Browse files
Add support for v2 provider interface (qiskit-community/qiskit-aqua#1270)
* Add support for v2 provider interface In Qiskit#5086 the v2 provider interface is being added. This starter interface is basically a drop in replacement for the v1 interface with 3 changes it's explicitly versioned at the object level, Backend.run() can take in a circuit object, and Job objects can also be async or sync. Eventually the interace will likely evolve towards a model similar to what was initially done in Qiskit#4885. This commit adds initial support for v2 provider backend objects, the explicit type checking for BaseBackend objects is blocking the terra PR from moving forward (because it switched BasicAer to use the v2 interface). This initial support just means accepting v2 Backend objects in addition to v1 BaseBackend objects. Depends on Qiskit#5086 * Fix import path * fix style Co-authored-by: Manoel Marques <[email protected]>
1 parent bd7d433 commit 273f461

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

qiskit/aqua/utils/run_circuits.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import numpy as np
2323
from qiskit.providers import BaseBackend, JobStatus, JobError
24+
from qiskit.providers import Backend
2425
from qiskit.providers.jobstatus import JOB_FINAL_STATES
2526
from qiskit.providers.basicaer import BasicAerJob
2627
from qiskit.qobj import QasmQobj
@@ -218,7 +219,7 @@ def run_qobj(qobj, backend, qjob_config=None, backend_options=None,
218219
backend_options = backend_options or {}
219220
noise_config = noise_config or {}
220221

221-
if backend is None or not isinstance(backend, BaseBackend):
222+
if backend is None or not isinstance(backend, (Backend, BaseBackend)):
222223
raise ValueError('Backend is missing or not an instance of BaseBackend')
223224

224225
with_autorecover = not is_simulator_backend(backend)

0 commit comments

Comments
 (0)