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

Failure to retrieve FakeBackend from FakeProviderforBackendV2 #1396

Closed
arthurostrauss opened this issue Feb 11, 2024 · 0 comments · Fixed by #1402
Closed

Failure to retrieve FakeBackend from FakeProviderforBackendV2 #1396

arthurostrauss opened this issue Feb 11, 2024 · 0 comments · Fixed by #1402
Assignees
Labels
bug Something isn't working
Milestone

Comments

@arthurostrauss
Copy link

Describe the bug
There is an error occurring when trying to retrieve a FakeBackendV2 from the FakeProviderForBackendV2object through FakeProviderForBackendV2.backend(backend_name) method.

The error raised is:
filtered_backends = [backend for backend in self._backends if backend.name() == name]

TypeError: 'str' object is not callable

Steps to reproduce

  1. declare a FakeProviderForBackendV2 instance and a valid backend name, e.g. 'fake_jakarta'
  2. Call method backend()

Expected behavior
Should return a FakeBackend object

Suggested solutions
Adapt the code to the BackendV2 interface, where the name of the FakeBackend is an attribute and no longer a method (name instead of name())

Additional Information
It would be good to also adapt the backends attribute to fit the retrieval of backend through FakeProvider.get_backend() method as well.

  • qiskit-ibm-runtime version: 0.19.2
  • Python version: 3.11
  • Operating system: Mac OS Sonoma 14.3
@arthurostrauss arthurostrauss added the bug Something isn't working label Feb 11, 2024
@kt474 kt474 self-assigned this Feb 12, 2024
@kt474 kt474 added this to the 0.21.0 milestone Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants