Skip to content

Commit

Permalink
Remove FakeBackendV2 import deprecated in Qiskit 0.46 (qiskit-communi…
Browse files Browse the repository at this point in the history
…ty#1420)

### Summary

In qiskit 0.46, several classes in the `qiskit.providers.fake_provider`
module were deprecated, including
`qiskit.providers.fake_provider.fake_backend.FakeBackendV2`. However,
the removal PR failed to address this particular class, so while this
particular `FakeBackendV2` was no longer part of the public API, the
import path would still work. This oversight will be addressed in
Qiskit/qiskit#11997, but in order to merge this
PR we must make sure that all the downstream libraries covered by
`qiskit-neko` are up-to-date with the change.

This change adds an alternative import path for this class in
qiskit-experiments. It follows the pattern from other 1.0 import
deprecations. The removal would roll out in the 1.1 release, but it is
indicated as a 1.0 removal because that is when it should have
technically taken place.

### Details and comments

Blocks Qiskit/qiskit#11997.
  • Loading branch information
ElePT authored Mar 12, 2024
1 parent 6845440 commit 428c9bc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion qiskit_experiments/framework/backend_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,24 @@ class unifies data access for various data fields.
from qiskit.providers.models import PulseBackendConfiguration
from qiskit.providers import BackendV1, BackendV2
from qiskit.providers.fake_provider import FakeBackend
from qiskit.providers.fake_provider.fake_backend import FakeBackendV2
from qiskit.utils.deprecation import deprecate_func

try:
# Removed in Qiskit 1.0.
from qiskit.providers.fake_provider.fake_backend import FakeBackendV2
except ImportError:

class FakeBackendV2:
"""Dummy class for when FakeBackendV2 import fails
This class is only used in isinstance checks. If the import fails, then
there won't be an instance of the class either so any dummy class is
fine.
"""

pass


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

0 comments on commit 428c9bc

Please sign in to comment.