-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Return Iterator
from simulator sweep methods
#4064
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
Comments
Concern: how do we deprecate this while keeping the same name? |
Given the amount of time necessary (and confusion generated) from reusing the same names to return iterators, it's preferable to just have separate |
This was referenced May 5, 2021
CirqBot
pushed a commit
that referenced
this issue
May 12, 2021
Fixes #4064. This PR provides `*_iter` methods for all simulator "sweep" methods. External simulators which implement the old list-based APIs will still function properly (through the magic of `@value.alternative`), but these simulators are advised to switch to the iterator-based API for better performance. Note that the list-based API is _not_ deprecated, and we have no plans to remove it at this time.
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
Fixes quantumlib#4064. This PR provides `*_iter` methods for all simulator "sweep" methods. External simulators which implement the old list-based APIs will still function properly (through the magic of `@value.alternative`), but these simulators are advised to switch to the iterator-based API for better performance. Note that the list-based API is _not_ deprecated, and we have no plans to remove it at this time.
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
Fixes quantumlib#4064. This PR provides `*_iter` methods for all simulator "sweep" methods. External simulators which implement the old list-based APIs will still function properly (through the magic of `@value.alternative`), but these simulators are advised to switch to the iterator-based API for better performance. Note that the list-based API is _not_ deprecated, and we have no plans to remove it at this time.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
Simulator methods that return multiple results can be difficult to work with, since each result object may contains a massive representation of the simulator state. An example of this can be seen in #3979 and #3990, where the
simulate_expectation_value_sweep
method can't simply invoke thesimulate_sweep
method for fear of generating (and storing!) all of the output states simultaneously.To resolve this, we should modify the simulator
*_sweep
methods to returnIterator
objects instead ofList
s.This would also cause sweeps to run one simulation at a time, which reduces the "black box" delay of large sweeps, and may provide opportunities for parallelizing the simulation and result-processing pipelines.
The text was updated successfully, but these errors were encountered: