File tree 1 file changed +21
-2
lines changed
qiskit_experiments/framework
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,24 @@ class unifies data access for various data fields.
17
17
"""
18
18
from qiskit .providers .models import PulseBackendConfiguration
19
19
from qiskit .providers import BackendV1 , BackendV2
20
- from qiskit .providers .fake_provider import fake_backend , FakeBackendV2 , FakeBackend
20
+ from qiskit .providers .fake_provider import FakeBackendV2 , FakeBackend
21
+
22
+ # One of the FakeBackendV2's was moved from qiskit to qiskit-ibm-runtime. Check
23
+ # both packages until dropping support for qiskit<1
24
+ try :
25
+ from qiskit .providers .fake_provider .fake_backend import FakeBackendV2 as QiskitFakeBackendV2
26
+ except ImportError :
27
+
28
+ class QiskitFakeBackendV2 :
29
+ pass
30
+
31
+
32
+ try :
33
+ from qiskit_ibm_runtime .fake_provider .fake_backend import FakeBackendV2 as RuntimeFakeBackendV2
34
+ except ImportError :
35
+
36
+ class RuntimeFakeBackendV2 :
37
+ pass
21
38
22
39
23
40
class BackendData :
@@ -255,7 +272,9 @@ def is_simulator(self):
255
272
if self ._backend .configuration ().simulator or isinstance (self ._backend , FakeBackend ):
256
273
return True
257
274
if self ._v2 :
258
- if isinstance (self ._backend , (FakeBackendV2 , fake_backend .FakeBackendV2 )):
275
+ if isinstance (
276
+ self ._backend , (FakeBackendV2 , QiskitFakeBackendV2 , RuntimeFakeBackendV2 )
277
+ ):
259
278
return True
260
279
261
280
return False
You can’t perform that action at this time.
0 commit comments