diff --git a/qiskit_aer/aerprovider.py b/qiskit_aer/aerprovider.py index 8d22ad12f7..6ef2af3a2b 100644 --- a/qiskit_aer/aerprovider.py +++ b/qiskit_aer/aerprovider.py @@ -23,10 +23,11 @@ from .backends.unitary_simulator import UnitarySimulator -class AerProvider(Provider): +class AerProvider: """Provider for Aer backends.""" _BACKENDS = None + version = 1 @staticmethod def _get_backends(): @@ -64,7 +65,13 @@ def _get_backends(): return AerProvider._BACKENDS def get_backend(self, name=None, **kwargs): - return super().get_backend(name=name, **kwargs) + backends = self.backends(name, **kwargs) + if len(backends) > 1: + raise QiskitBackendNotFoundError("More than one backend matches the criteria") + if not backends: + raise QiskitBackendNotFoundError("No backend matches the criteria") + + return backends[0] def backends(self, name=None, filters=None, **kwargs): # pylint: disable=arguments-differ diff --git a/releasenotes/notes/providerABC-61311d8e5ae56d71.yaml b/releasenotes/notes/providerABC-61311d8e5ae56d71.yaml new file mode 100644 index 0000000000..3dba173053 --- /dev/null +++ b/releasenotes/notes/providerABC-61311d8e5ae56d71.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + The class :class:`.AerProvider` does not implement Qiskit's ``Provider``, as it is now deprecated. + This fix removes the raising of the warning from Qiskit.