Respect max_experiments in QuantumInstance BackendV1 path#6391
Merged
Conversation
In Qiskit#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).
9cd7b8d to
a961c90
Compare
mtreinish
commented
May 10, 2021
Comment on lines
+463
to
+464
| if is_local_backend(backend): | ||
| max_circuits_per_job = sys.maxsize |
Member
Author
There was a problem hiding this comment.
I just copied this from the qobj path, but I don't think this is actually correct. We should probably defer to the max_experiments value in the configuration because a local backend might not accept the max list size circuits for a single job.
manoelmarques
previously approved these changes
May 10, 2021
mtreinish
commented
May 11, 2021
manoelmarques
approved these changes
May 13, 2021
kdk
approved these changes
May 13, 2021
mergify Bot
pushed a commit
that referenced
this pull request
May 14, 2021
* 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 <kevin.krsulich@ibm.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> (cherry picked from commit 9d4bb91) # Conflicts: # qiskit/utils/run_circuits.py # test/python/algorithms/test_backendv1.py
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this pull request
May 14, 2021
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.
1ucian0
pushed a commit
that referenced
this pull request
May 17, 2021
…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 <kevin.krsulich@ibm.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> (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 <mtreinish@kortar.org>
This was referenced Dec 20, 2021
5 tasks
ElePT
pushed a commit
to ElePT/qiskit
that referenced
this pull request
Jun 27, 2023
* Respect max_experiments in QuantumInstance BackendV1 path In Qiskit#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 <kevin.krsulich@ibm.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
ElePT
pushed a commit
to ElePT/qiskit-algorithms-test
that referenced
this pull request
Jul 17, 2023
…kit#6391) * Respect max_experiments in QuantumInstance BackendV1 path In Qiskit/qiskit#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 <kevin.krsulich@ibm.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
ElePT
pushed a commit
to ElePT/qiskit-algorithms
that referenced
this pull request
Jul 27, 2023
…kit#6391) * Respect max_experiments in QuantumInstance BackendV1 path In Qiskit/qiskit#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 <kevin.krsulich@ibm.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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).
Details and comments