Skip to content

Commit

Permalink
Remove legacy providers interface (Qiskit/qiskit#7886)
Browse files Browse the repository at this point in the history
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mtreinish and mergify[bot] authored Apr 19, 2022
1 parent dfb6714 commit 323c746
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qiskit_ibm_runtime/fake_provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@
from qiskit.test.mock.fake_provider import (
FakeProviderForBackendV2,
FakeProvider,
FakeLegacyProvider,
)
from qiskit.test.mock.fake_provider import FakeProviderFactory
from qiskit.test.mock.fake_backend import FakeBackend, FakeLegacyBackend
from qiskit.test.mock.fake_pulse_backend import FakePulseBackend, FakePulseLegacyBackend
from qiskit.test.mock.fake_qasm_backend import FakeQasmBackend, FakeQasmLegacyBackend
from qiskit.test.mock.fake_backend import FakeBackend
from qiskit.test.mock.fake_pulse_backend import FakePulseBackend
from qiskit.test.mock.fake_qasm_backend import FakeQasmBackend
from qiskit.test.mock.utils.configurable_backend import ConfigurableFakeBackend
from qiskit.test.mock.fake_backend_v2 import FakeBackendV2, FakeBackend5QV2
from qiskit.test.mock.fake_mumbai_v2 import FakeMumbaiFractionalCX
from qiskit.test.mock.fake_job import FakeJob, FakeLegacyJob
from qiskit.test.mock.fake_job import FakeJob
from qiskit.test.mock.fake_qobj import FakeQobj

from qiskit.test.mock.backends import *
Expand Down

0 comments on commit 323c746

Please sign in to comment.