-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area/debuggingarea/performancearea/simulationcomplexity/lowintroduces/modifies 1-2 concepts, should take 1-2 days max for an advanced contributorintroduces/modifies 1-2 concepts, should take 1-2 days max for an advanced contributorkind/healthFor CI/testing/release process/refactoring/technical debt itemsFor CI/testing/release process/refactoring/technical debt itemsskill-level/beginnerNo background required, self-contained issueNo background required, self-contained issuetriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on
Description
The state_vector
method in StateVectorTrialResult
includes a copying of the state vector to resolve issue #3101:
Cirq/cirq/sim/state_vector_simulator.py
Line 215 in 8bf262e
return self._final_simulator_state.state_vector.copy() |
This eliminates the issue of mutating the state vector, but can significantly increase runtime for large circuits without a clear indication of the root cause. We should force users to explicitly make a copy of the state if they need it, either by renaming the method to state_vector_copy
or by removing it altogether and requiring users to copy the final_state_vector
field.
Related: qsim issue 237
Metadata
Metadata
Assignees
Labels
area/debuggingarea/performancearea/simulationcomplexity/lowintroduces/modifies 1-2 concepts, should take 1-2 days max for an advanced contributorintroduces/modifies 1-2 concepts, should take 1-2 days max for an advanced contributorkind/healthFor CI/testing/release process/refactoring/technical debt itemsFor CI/testing/release process/refactoring/technical debt itemsskill-level/beginnerNo background required, self-contained issueNo background required, self-contained issuetriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on