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

Strip _v2 from name in fake BackendV2 classes #9453

Closed
pedrorrivero opened this issue Jan 25, 2023 · 6 comments · Fixed by #9465
Closed

Strip _v2 from name in fake BackendV2 classes #9453

pedrorrivero opened this issue Jan 25, 2023 · 6 comments · Fixed by #9465
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@pedrorrivero
Copy link
Member

Environment

  • Qiskit Terra version: 0.22.2
  • Python version: 3.11
  • Operating system: MacOS

What is happening?

Fake BackendV2 classes have _v2 appended to the end of their names despite the fact that they use the same device specification as their BackendV1 counterparts.

This is inconsistent with the naming convention used for real backends, where the name is independent of the backend version that exposes it; making such name exclusively tight to the underlying device and therefore a good device identifier.

How can we reproduce the issue?

from qiskit.providers.fake_provider import FakeNairobi, FakeNairobiV2
from qiskit.providers import BackendV2Converter

backend = BackendV2Converter(FakeNairobi())
print(f"{backend.name=!r}")

backend = FakeNairobiV2()
print(f"{backend.name=!r}")

Outputs:

backend.name='fake_nairobi'
backend.name='fake_nairobi_v2'

What should happen?

Name attr in fake backends should depend only on the fake device that gets exposed, and not on the Backend version that exposes it (i.e. consistent with the behavior for real backends).

Any suggestions?

Strip _v2 from name in fake BackendV2 classes.

@pedrorrivero pedrorrivero added the bug Something isn't working label Jan 25, 2023
@HuangJunye HuangJunye added the good first issue Good for newcomers label Jan 25, 2023
@shivalee12
Copy link
Contributor

I would like to work on this issue

@github-project-automation github-project-automation bot moved this to Tagged but unassigned in Contributor Monitoring Jan 26, 2023
@HuangJunye HuangJunye moved this from Tagged but unassigned to PR open / Contributor working on it in Contributor Monitoring Jan 26, 2023
@javabster javabster moved this from PR open / Contributor working on it to Assigned in Contributor Monitoring Feb 2, 2023
@kdk
Copy link
Member

kdk commented Feb 6, 2023

This seems reasonable to me. @mtreinish Can you say if the _v2 on the backend names was needed, or if it's okay to be removed?

@HuangJunye
Copy link
Collaborator

HuangJunye commented Feb 6, 2023

@kdk The _v2 was introduced by me in this PR #7643 and I didn't give much thoughts about it at the time. We had a Slack discussion about this and the consensus is to remove it. We should use isinstance(backend, BackendV2) instead of backend name to check backend version.

@kdk
Copy link
Member

kdk commented Feb 7, 2023

Thanks for the context @HuangJunye , that sounds good to me!

@shivalee12
Copy link
Contributor

hi sorry for the late response, I had exams going on
Could you please also elaborate on which sections of notes should be updated?
deprecation and fixes? or issues as well?

@HuangJunye
Copy link
Collaborator

hi sorry for the late response, I had exams going on Could you please also elaborate on which sections of notes should be updated? deprecation and fixes? or issues as well?

@shivalee12 the upgrade section is suitable for this change.

@github-project-automation github-project-automation bot moved this from Assigned to Done in Contributor Monitoring Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants