Skip to content

Commit

Permalink
apply changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
thisac committed May 27, 2021
1 parent dc88464 commit ff90b90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pennylane_cirq/simulator_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def _expand_state(self, state_vector, wires):
# get indices for which the state is changed to input state vector elements
ravelled_indices = np.ravel_multi_index(unravelled_indices.T, [2] * self.num_wires)

state_vector = self._scatter(ravelled_indices, state_vector, [2 ** self.num_wires])
state_vector = self._reshape(state_vector, [2] * self.num_wires)
state_vector = self._asarray(state_vector, dtype=self.C_DTYPE)
state = np.zeros([2 ** self.num_wires], dtype=np.complex128)
state[ravelled_indices] = state_vector
state_vector = state.reshape([2] * self.num_wires)

return state_vector.flatten()

Expand Down

0 comments on commit ff90b90

Please sign in to comment.