Skip to content

Commit

Permalink
fix bug in deprecated collapse_wavefunction (#3156)
Browse files Browse the repository at this point in the history
Fixes #3153.
  • Loading branch information
balopat committed Jul 21, 2020
1 parent ea20a18 commit 65f2b16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cirq/sim/clifford/clifford_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ def _apply_Y(self, qubit: int):
deadline='v0.10.0',
fix='Use collapse_state_vector instead.',
parameter_desc='collapse_wavefunction',
match=lambda args, kwargs: 'collapse_wave_function' in kwargs,
rewrite=lambda args, kwargs: (args, {(
'collapse_state_vector' if k == 'collapse_wave_function' else k): v
match=lambda args, kwargs: 'collapse_wavefunction' in kwargs,
rewrite=lambda args, kwargs: (args, {('collapse_state_vector' if k ==
'collapse_wavefunction' else k): v
for k, v in kwargs.items()}))
def perform_measurement(self,
qubits: Sequence[ops.Qid],
Expand Down
4 changes: 2 additions & 2 deletions cirq/sim/clifford/clifford_simulator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,9 @@ def test_deprecated():
'deprecated'):
_ = clifford_state.wave_function()

with cirq.testing.assert_logs('collapse_wave_function',
with cirq.testing.assert_logs('collapse_wavefunction',
'collapse_state_vector', 'deprecated'):
# pylint: disable=unexpected-keyword-arg,no-value-for-parameter
_ = clifford_state.perform_measurement([q],
prng=0,
collapse_wave_function=True)
collapse_wavefunction=True)

0 comments on commit 65f2b16

Please sign in to comment.