From 57aeaf99a41ea4610b6688d2fb2e564cca7dffe4 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 19 Apr 2022 19:46:29 -0400 Subject: [PATCH] Remove legacy providers interface (#7886) * 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> --- qiskit_ibm_provider/fake_provider/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qiskit_ibm_provider/fake_provider/__init__.py b/qiskit_ibm_provider/fake_provider/__init__.py index 0d06cfcb161b..c30be21a08fe 100644 --- a/qiskit_ibm_provider/fake_provider/__init__.py +++ b/qiskit_ibm_provider/fake_provider/__init__.py @@ -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 *