Skip to content

Deprecate implementation of _base_iterator#5402

Merged
CirqBot merged 8 commits into
quantumlib:masterfrom
daxfohl:base-iterator
Jun 2, 2022
Merged

Deprecate implementation of _base_iterator#5402
CirqBot merged 8 commits into
quantumlib:masterfrom
daxfohl:base-iterator

Conversation

@daxfohl

@daxfohl daxfohl commented May 25, 2022

Copy link
Copy Markdown
Collaborator

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, cduck and vtomole as code owners May 25, 2022 21:56
@daxfohl daxfohl requested a review from 95-martin-orion May 25, 2022 21:56
@CirqBot CirqBot added the size: S 10< lines changed <50 label May 25, 2022

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

Copy link
Copy Markdown
Collaborator

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.

Comment thread cirq-core/cirq/sim/simulator.py Outdated
@daxfohl

daxfohl commented Jun 1, 2022

Copy link
Copy Markdown
Collaborator Author

@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
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
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