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

Rename old fake BackendV2 classes #7838

Closed
1 of 4 tasks
HuangJunye opened this issue Mar 30, 2022 · 5 comments
Closed
1 of 4 tasks

Rename old fake BackendV2 classes #7838

HuangJunye opened this issue Mar 30, 2022 · 5 comments
Labels
mod: fake_provider Related to the fake_provider module and fake backends type: enhancement It's working, but needs polishing

Comments

@HuangJunye
Copy link
Collaborator

HuangJunye commented Mar 30, 2022

What is the expected enhancement?

#7643 implemented mocked IBM Quantum Systems backends using the new BackendV2 interface.

There were older fake BackendV2 classes that were created before for testing. We need to rename, reorganize or remove those classes

https://github.com/Qiskit/qiskit-terra/blob/8105a80c84ce2447a1e224b85f4f56e98f074763/qiskit/test/mock/fake_mumbai_v2.py

https://github.com/Qiskit/qiskit-terra/blob/8105a80c84ce2447a1e224b85f4f56e98f074763/qiskit/test/mock/fake_backend_v2.py

  • FakeBackendV2
  • FakeBackend5QV2
  • FakeBackendSimple
@HuangJunye
Copy link
Collaborator Author

Reopening as #7839 only partially fixed this issue.

@mtreinish mtreinish added the mod: fake_provider Related to the fake_provider module and fake backends label Apr 1, 2022
@HuangJunye
Copy link
Collaborator Author

@mtreinish What would you suggest to replace the old FakeBackendV2 class? Should I choose one of the fake IBM Quantum systems to replace it, e.g. FakeMumbaiV2? And use a FakeBelemV2 to replace the usage of FakeBackend5QV2?

@HuangJunye
Copy link
Collaborator Author

I decided to use FakeManilaV2 which has 5Q qubits to replace FakeBackendV2, FakeBackend5QV2 and FakeBackendSimple. One thing I am not sure is how to deal with FakeBackendV2LegacyQubitProps.

https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_backend_v2.py#L103-L109

@HuangJunye
Copy link
Collaborator Author

@mtreinish Having a deeper look at the different classes of these fake backends.

FakeBackendSimple is only used in https://github.com/Qiskit/qiskit-terra/blob/main/test/python/algorithms/test_backendv2.py and https://github.com/Qiskit/qiskit-terra/blob/6aacabd99122be2c2d59ef29655217db6ab33f0f/test/python/providers/test_backend_v2.py#L68-L71 so I can probably replace it with a fake V2 IBM Quantum backend with more than 18 qubits (required for the shor factoring test) or (probably better approach) a fake V2 QasmSimulator.

The rest of them are written in a very specific way and the tests specifically test the details of these backends. I am not sure how to generalize them to base on the new FakeBackendV2 or a specific instance of a fake V2 IBM Quantum backend.

Or maybe I should just rename them and improve docstrings to describe what they are used for?

@1ucian0
Copy link
Member

1ucian0 commented Mar 24, 2024

I think this is can be closed, via #10918

@1ucian0 1ucian0 closed this as completed Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: fake_provider Related to the fake_provider module and fake backends type: enhancement It's working, but needs polishing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants