Skip to content

Commit

Permalink
Fixes #2178
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Jun 27, 2024
1 parent 9831bcb commit 85237e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qiskit_aer/aerprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/providerABC-61311d8e5ae56d71.yaml
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 85237e9

Please sign in to comment.