Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FakeProviderForBackendV2() #49

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}.")
Loading