Skip to content

Commit

Permalink
Use internal FakeProvider in place of one removed in Qiskit 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wshanks committed Feb 3, 2024
1 parent f958426 commit 45480bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qiskit_experiments/framework/backend_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class unifies data access for various data fields.

try:
# Removed in Qiskit 1.0. Different from the other FakeBackendV2's
from qiskit.providers.fake_provider import FakeBackendV2
from qiskit.providers.fake_provider import QiskitFakeBackendV2
except ImportError:

class QiskitFakeBackendV2:
Expand Down
10 changes: 9 additions & 1 deletion qiskit_experiments/test/fake_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"""Fake backend class for tests."""
import uuid
from qiskit.circuit.library import Measure
from qiskit.providers import ProviderV1
from qiskit.providers.backend import BackendV2
from qiskit.providers.fake_provider import FakeProvider
from qiskit.providers.options import Options
from qiskit.transpiler import Target

Expand All @@ -23,6 +23,14 @@
from qiskit_experiments.test.utils import FakeJob


class FakeProvider(ProviderV1):
"""Fake provider with no backends for testing"""

def backends(self, name=None, **kwargs):
"""List of available backends. Empty in this case"""
return []


class FakeBackend(BackendV2):
"""
Fake backend for test purposes only.
Expand Down

0 comments on commit 45480bc

Please sign in to comment.