From cd029ebc4f6bac1b0584b7c25ca5ab56c1c222a4 Mon Sep 17 00:00:00 2001 From: Dave Bacon Date: Tue, 9 Jan 2018 19:29:00 -0800 Subject: [PATCH] Fixes broken test that was borked when adding parens to handle line breaks. --- cirq/sim/google/xmon_simulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cirq/sim/google/xmon_simulator.py b/cirq/sim/google/xmon_simulator.py index cc038ee6955..afe330b9701 100644 --- a/cirq/sim/google/xmon_simulator.py +++ b/cirq/sim/google/xmon_simulator.py @@ -148,7 +148,7 @@ def _init_state(self, initial_state: int): self._shared_mem_dict['state_handle'] = state_handle def __del__(self): - for handle in self._shared_mem_dict.itervalues(): + for handle in self._shared_mem_dict.values(): mem_manager.SharedMemManager.free_array(handle) def __enter__(self): @@ -420,6 +420,6 @@ def _collapse_state(args: Dict[str, Any]): state = _state_shard(args) normalization = np.sqrt(prob_one if result else 1 - prob_one) - state *= _one_projector(args, index) * (result + state *= (_one_projector(args, index) * result + (1 - _one_projector(args, index)) * (1 - result)) state /= normalization