-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size #12653
Conversation
…is gate because its size Co-authored-by: Elena Peña Tapia <[email protected]>
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 9659396940Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @1ucian0 LGTM, I left a small reno suggestion (am I allowed to approve?)
releasenotes/notes/fixes_GenericBackendV2-668e40596e1f070d.yaml
Outdated
Show resolved
Hide resolved
Pull Request Test Coverage Report for Build 9663589789Details
💛 - Coveralls |
Co-authored-by: Elena Peña Tapia <[email protected]>
It seems you are. |
Pull Request Test Coverage Report for Build 9663987131Details
💛 - Coveralls |
I think we need to add an internal path for building a target for 1 qubit, because |
Pull Request Test Coverage Report for Build 9667579174Details
💛 - Coveralls |
I think I prefer to keep the default simple (without different values depending on the number of qubits) and be explicit on the |
I think that can work too. If we see this is causing problems we can always correct the 1q path. |
@Mergifyio backport stable/0.46 stable/1.1 |
✅ Backports have been created
|
…is gate because its size (#12653) * GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size Co-authored-by: Elena Peña Tapia <[email protected]> * reno * Update releasenotes/notes/fixes_GenericBackendV2-668e40596e1f070d.yaml Co-authored-by: Elena Peña Tapia <[email protected]> * another single qubit backend --------- Co-authored-by: Elena Peña Tapia <[email protected]> (cherry picked from commit e36027c)
…is gate because its size (#12653) * GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size Co-authored-by: Elena Peña Tapia <[email protected]> * reno * Update releasenotes/notes/fixes_GenericBackendV2-668e40596e1f070d.yaml Co-authored-by: Elena Peña Tapia <[email protected]> * another single qubit backend --------- Co-authored-by: Elena Peña Tapia <[email protected]> (cherry picked from commit e36027c) # Conflicts: # qiskit/providers/fake_provider/generic_backend_v2.py # test/visual/mpl/graph/test_graph_matplotlib_drawer.py
…is gate because its size (#12653) (#12667) * GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size Co-authored-by: Elena Peña Tapia <[email protected]> * reno * Update releasenotes/notes/fixes_GenericBackendV2-668e40596e1f070d.yaml Co-authored-by: Elena Peña Tapia <[email protected]> * another single qubit backend --------- Co-authored-by: Elena Peña Tapia <[email protected]> (cherry picked from commit e36027c) Co-authored-by: Luciano Bello <[email protected]>
…is gate because its size (backport #12653) (#12666) * GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size (#12653) * GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size Co-authored-by: Elena Peña Tapia <[email protected]> * reno * Update releasenotes/notes/fixes_GenericBackendV2-668e40596e1f070d.yaml Co-authored-by: Elena Peña Tapia <[email protected]> * another single qubit backend --------- Co-authored-by: Elena Peña Tapia <[email protected]> (cherry picked from commit e36027c) # Conflicts: # qiskit/providers/fake_provider/generic_backend_v2.py # test/visual/mpl/graph/test_graph_matplotlib_drawer.py * Fix Conflict * Update test_graph_matplotlib_drawer.py * black --------- Co-authored-by: Luciano Bello <[email protected]> Co-authored-by: Elena Peña Tapia <[email protected]>
…is gate because its size (Qiskit#12653) * GenericBackendV2 should fail when the backend cannot allocate the basis gate because its size Co-authored-by: Elena Peña Tapia <[email protected]> * reno * Update releasenotes/notes/fixes_GenericBackendV2-668e40596e1f070d.yaml Co-authored-by: Elena Peña Tapia <[email protected]> * another single qubit backend --------- Co-authored-by: Elena Peña Tapia <[email protected]>
Summary
GenericBackendV2 should not accept backends that are too small for certain gates. The following examples should be rejected:
GenericBackendV2(num_qubits=1, basis_gates=["cx", "id"])
GenericBackendV2(num_qubits=2, basis_gates=["ccx", "id"])
@ElePT found this!