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

Add BackendV2 mocked backends #7391

Closed
mtreinish opened this issue Dec 9, 2021 · 3 comments · Fixed by #7643
Closed

Add BackendV2 mocked backends #7391

mtreinish opened this issue Dec 9, 2021 · 3 comments · Fixed by #7643
Assignees
Labels
help wanted community contributions welcome. For filters like http://github-help-wanted.com/ type: enhancement It's working, but needs polishing type: qa Issues and PRs that relate to testing and code quality
Milestone

Comments

@mtreinish
Copy link
Member

What is the expected enhancement?

The mock backends in qiskit/test/mock/backends are built using snapshots of IBM Quantum's devices. Right now they're built using BackendV1 (and BaseBackend for the legacy backend classes). To start fully testing the BackendV2 interface we should add variants of these fake backend classes using BackendV2. We shouldn't replace the BackendV1 objects since it's useful to exercise both versions of the interface while both are supported.

@mtreinish mtreinish added type: enhancement It's working, but needs polishing type: qa Issues and PRs that relate to testing and code quality help wanted community contributions welcome. For filters like http://github-help-wanted.com/ labels Dec 9, 2021
@mtreinish mtreinish added this to the 0.20 milestone Dec 9, 2021
@HuangJunye
Copy link
Collaborator

I am interested in working on this issue. @mtreinish Can you elaborate what's needed to be done here?

@mtreinish
Copy link
Member Author

It's basically to add a new base class similar to the current 3 built with backendV1 (https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_backend.py#L47 https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_qasm_backend.py#L29 and https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_pulse_backend.py#L23) that is built using the backendv2 interface. This will basically involve passing the json payloads we store and creating a Target and BackendV2 object from it.

There is documentation on this here: https://qiskit.org/documentation/apidoc/providers.html#writing-a-new-provider and an example of hand constructed ones (as opposed to those built from parsing json) here: https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_backend_v2.py and https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_mumbai_v2.py

@HuangJunye
Copy link
Collaborator

Thanks for the explanations. This sounds easy enough for me to tackle. If this is not too urgent, I can try get it done by the end of Jan. Please assign me to the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted community contributions welcome. For filters like http://github-help-wanted.com/ type: enhancement It's working, but needs polishing type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants