-
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
Update fake backend and fake provider to use versioned interface #6286
Update fake backend and fake provider to use versioned interface #6286
Conversation
As was reported in Qiskit#6280 the algorithms path doesn't work on minimal examples of the Backend and Jobs interface and instead only works in practice on ibmq, aer, or basic aer backends. Part of the reason for this was that all the testing of algorithms is done exclusively on those providers and there wasn't a minimal example to test against that doesn't have legacy overhead (like qobj, etc). This commit updates the fake providers and fake backends to use the latest version of the provider, backend, and job interfaces and to be strictly compatible (ie no qobj support). Besides exercising the new interface version it also enables us to test the eventual fix for Qiskit#6280 when it's available.
The code looks good. However, |
I wasn't proposing this to be backported or included in a patch release, I agree this isn't valid for that. The tension here is that there actually isn't any backend available for local testing that rejects qobj currently, which only makes issues like #6280 more likely. This felt like the right place to do it since these are the test backends. It's also worth noting that we do run the tutorials here and none of them failed with this. The textbook might be a different, but I believe they're still using |
When I searched for |
…to-versioned-interface
2 of the tests added in #6299 depend on the fake backends in qiskit.test.mock being strict BackendV1 backends (that reject qobj) and also having other aspects of the interface implemented (mainly run kwargs). However the change which updated the fake backends to use BackendV1 (#6286) is not backportable as it's an API change, so these tests are runnable in stable/0.17. This commit just removes these tests because even if we could get them running without #6286 we wouldn't be actually testing the v1 interface (which is their purpose).
…andle QasmQobj (backport #6299) (#6343) * Add support on QuantumInstance/run_circuits for Backends that don't handle QasmQobj (#6299) * Support BackendV1 * Add error mitigation logic. Co-authored-by: Matthew Treinish <[email protected]> * Fix run_circuits calls * add unit tests * Update qiskit/utils/run_circuits.py Add check for providers that don't support it. Co-authored-by: Matthew Treinish <[email protected]> * Add error mitigation test Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit a0ed7ff) * Remove tests that depend on BackendV1 fake backends 2 of the tests added in #6299 depend on the fake backends in qiskit.test.mock being strict BackendV1 backends (that reject qobj) and also having other aspects of the interface implemented (mainly run kwargs). However the change which updated the fake backends to use BackendV1 (#6286) is not backportable as it's an API change, so these tests are runnable in stable/0.17. This commit just removes these tests because even if we could get them running without #6286 we wouldn't be actually testing the v1 interface (which is their purpose). * Fix lint Co-authored-by: Manoel Marques <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit fixes the merge conflicts from backporting Qiskit#6391 to stable/0.17. The tests added in Qiskit#6391 are just removed because they can't actually run without Qiskit#6286 which isn't backportable.
…6391) (#6414) * Respect max_experiments in QuantumInstance BackendV1 path (#6391) * Respect max_experiments in QuantumInstance BackendV1 path In #6299 support was fixed for strict BackendV1 backends that only take QuantumCircuit objects (instead of qobj) for the input. That was fixed by adding a parallel path when running with a new backend. However that parallel path wasn't identical and was missing the support the qobj path had for splitting an algorithm run into multiple jobs if the backend if the number of circuits was greater than the max_experiments set in the backend. This would result on some providers' backends, such as ionq and aqt, both of which have max_experiments set to 1. This commit fixes this issue by splitting the circuits list into smaller sublists when the len(circuits) > max_experiments (or the old env var, which we should change the name of at some point). * Fix issues with results and split circuits path * Fix copy paste issue * Update qiskit/utils/run_circuits.py * Add release notes * Fix whitespace Co-authored-by: Kevin Krsulich <[email protected]> Co-authored-by: Manoel Marques <[email protected]> (cherry picked from commit 9d4bb91) # Conflicts: # qiskit/utils/run_circuits.py # test/python/algorithms/test_backendv1.py * Fix merge conflicts This commit fixes the merge conflicts from backporting #6391 to stable/0.17. The tests added in #6391 are just removed because they can't actually run without #6286 which isn't backportable. * Fix lint Co-authored-by: Matthew Treinish <[email protected]>
…kit/qiskit#6286) * Update fake backend and fake provider to use versioned interface As was reported in Qiskit/qiskit#6280 the algorithms path doesn't work on minimal examples of the Backend and Jobs interface and instead only works in practice on ibmq, aer, or basic aer backends. Part of the reason for this was that all the testing of algorithms is done exclusively on those providers and there wasn't a minimal example to test against that doesn't have legacy overhead (like qobj, etc). This commit updates the fake providers and fake backends to use the latest version of the provider, backend, and job interfaces and to be strictly compatible (ie no qobj support). Besides exercising the new interface version it also enables us to test the eventual fix for Qiskit/qiskit#6280 when it's available. * Fix lint * Add legacy fake backends using BaseBackend
Summary
As was reported in #6280 the algorithms path doesn't work on minimal
examples of the Backend and Jobs interface and instead only works in
practice on ibmq, aer, or basic aer backends. Part of the reason for
this was that all the testing of algorithms is done exclusively on those
providers and there wasn't a minimal example to test against that
doesn't have legacy overhead (like qobj, etc). This commit updates the
fake providers and fake backends to use the latest version of the
provider, backend, and job interfaces and to be strictly compatible (ie
no qobj support). Besides exercising the new interface version it also
enables us to test the eventual fix for #6280 when it's available.
Details and comments