Skip to content
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

Deprecate implementation of _base_iterator #5402

Merged
merged 8 commits into from
Jun 2, 2022

Conversation

daxfohl
Copy link
Contributor

@daxfohl daxfohl commented May 25, 2022

Fixes #5400

Add a deprecation warning that _base_iterator is going to be made abstract, and copy (with intent to move) the implementation to SimulatorBase.

Once the deprecation timeline has passed we can safely make SimulatesIntermediateState._base_iterator abstract, and remove _create_simulation_state, _create_act_on_args and _core_iterator declarations from SimulatesIntermediateState completely. This makes SimulatesIntermediateState more true to its name, as it should not be concerned with how or where the subclass creates the initial state, even from the interface standpoint.

@95-martin-orion

@daxfohl daxfohl requested review from a team, vtomole and cduck as code owners May 25, 2022 21:56
@CirqBot CirqBot added the size: S 10< lines changed <50 label May 25, 2022
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

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

Somewhat concerned about how this affects the simulation story - is SimulatorBase now a valid superclass for external simulators? When should a simulator implement it vs. the other interfaces?

In related news, we really need to nail this down in documentation.

cirq-core/cirq/sim/simulator.py Outdated Show resolved Hide resolved
@daxfohl
Copy link
Contributor Author

daxfohl commented Jun 1, 2022

@95-martin-orion merging?

@95-martin-orion 95-martin-orion added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 2, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 2, 2022
@CirqBot CirqBot merged commit 08eec02 into quantumlib:master Jun 2, 2022
@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 Jun 2, 2022
@daxfohl daxfohl deleted the base-iterator branch June 6, 2022 00:56
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Fixes quantumlib#5400

Add a deprecation warning that _base_iterator is going to be made abstract, and copy (with intent to move) the implementation to SimulatorBase.

Once the deprecation timeline has passed we can safely make `SimulatesIntermediateState._base_iterator` abstract, and remove `_create_simulation_state`, `_create_act_on_args` and `_core_iterator` declarations from `SimulatesIntermediateState` completely. This makes `SimulatesIntermediateState` more true to its name, as it should not be concerned with how or where the subclass creates the initial state, even from the interface standpoint.

@95-martin-orion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SimulatesIntermediateState._base_iterator docstring says it'll be deprecated
3 participants