Skip to content

Commit

Permalink
Use FakeProviderForBackendV2() (#49)
Browse files Browse the repository at this point in the history
* Use FakeProviderForBackendV2()

* Fix lint
  • Loading branch information
kt474 authored Oct 16, 2024
1 parent 67e525c commit 00ff2a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qiskit_neko/aer_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""Qiskit Aer default backend plugin."""

import qiskit_aer as aer
from qiskit_ibm_runtime import fake_provider
from qiskit_ibm_runtime.fake_provider import FakeProviderForBackendV2

from qiskit_neko import backend_plugin

Expand All @@ -23,7 +23,7 @@ class AerBackendPlugin(backend_plugin.BackendPlugin):

def __init__(self):
super().__init__()
self.mock_provider = fake_provider.FakeProvider()
self.mock_provider = FakeProviderForBackendV2()
self.mock_provider_backend_names = set()
for backend in self.mock_provider.backends():
if backend.version == 1:
Expand Down Expand Up @@ -52,5 +52,5 @@ def get_backend(self, backend_selection=None):
method = backend_selection.split("=")[1]
return aer.AerSimulator(method=method)
if backend_selection in self.mock_provider_backend_names:
return self.mock_provider.get_backend(backend_selection)
return self.mock_provider.backend(backend_selection)
raise ValueError(f"Invalid selection string {backend_selection}.")

0 comments on commit 00ff2a4

Please sign in to comment.