-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix run_batch results format for SimulatedLocalProcessor #5026
Merged
dstrain115
merged 5 commits into
quantumlib:master
from
dstrain115:fix_simulated_batch_results
Feb 25, 2022
Merged
Fix run_batch results format for SimulatedLocalProcessor #5026
dstrain115
merged 5 commits into
quantumlib:master
from
dstrain115:fix_simulated_batch_results
Feb 25, 2022
Conversation
This file contains 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
- batch_results returns a list of list of results - results should return a flattened list. - It used to just return the first result, it now returns all results in a flattened format. - Also, noticed that run_batch did not work in async mode. Fixed that.
dstrain115
requested review from
wcourtney,
a team,
vtomole,
cduck and
verult
as code owners
February 25, 2022 13:41
mpharrigan
reviewed
Feb 25, 2022
Comment on lines
121
to
127
if batch_size == 1: | ||
program = parent.get_circuit() | ||
results = self._sampler.run_sweep( | ||
program=program, params=sweeps[0] if sweeps else None, repetitions=reps | ||
) | ||
self._state = quantum.enums.ExecutionStatus.State.SUCCESS | ||
return [results] |
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.
can you not just run_batch with one program? That is, why do you need these two if cases?
mpharrigan
approved these changes
Feb 25, 2022
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 for the quick fix
95-martin-orion
pushed a commit
to 95-martin-orion/Cirq
that referenced
this pull request
Mar 2, 2022
…5026) * Fix run_batch results format for SimulatedLocalProcessor - batch_results returns a list of list of results - results should return a flattened list. - It used to just return the first result, it now returns all results in a flattened format. - Also, noticed that run_batch did not work in async mode. Fixed that.
rht
pushed a commit
to rht/Cirq
that referenced
this pull request
May 1, 2023
…5026) * Fix run_batch results format for SimulatedLocalProcessor - batch_results returns a list of list of results - results should return a flattened list. - It used to just return the first result, it now returns all results in a flattened format. - Also, noticed that run_batch did not work in async mode. Fixed that.
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.
all results in a flattened format.