Skip to content

Provide sweep-iterator API. #4094

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

Merged
merged 6 commits into from
May 12, 2021
Merged

Conversation

95-martin-orion
Copy link
Collaborator

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.

@95-martin-orion 95-martin-orion requested review from cduck, vtomole and a team as code owners May 7, 2021 17:38
@95-martin-orion 95-martin-orion requested a review from viathor May 7, 2021 17:38
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label May 7, 2021
@95-martin-orion
Copy link
Collaborator Author

Paging @daxfohl for review, since this touches on the ongoing simulator refactor.

@95-martin-orion
Copy link
Collaborator Author

Looks like I need to appease python/typing#449 for python3.6 compatibility.

@daxfohl
Copy link
Collaborator

daxfohl commented May 9, 2021

Everything looks fine to me.

@95-martin-orion 95-martin-orion requested review from balopat and removed request for viathor May 11, 2021 19:11
@95-martin-orion
Copy link
Collaborator Author

Reassigned owner review to @balopat (@viathor is on leave)

Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label May 12, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label May 12, 2021
@CirqBot CirqBot merged commit 849849d into quantumlib:master May 12, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels May 12, 2021
@95-martin-orion 95-martin-orion deleted the cirq-sim-iter branch May 12, 2021 18:08
rht pushed a commit to rht/Cirq that referenced this pull request 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 pull request 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
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return Iterator from simulator sweep methods
4 participants