Skip to content

Commit

Permalink
Update src/qibo/backends/numpy.py
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello authored Jun 19, 2024
1 parent 9bb04fb commit eaac905
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/qibo/backends/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,7 @@ def execute_circuit(self, circuit, initial_state=None, nshots=1000):
return self.execute_circuit(initial_state + circuit, None, nshots)
elif initial_state is not None:
initial_state = self.cast(initial_state)
if circuit.density_matrix:
valid_shape = 2 * (2**circuit.nqubits,)
else:
valid_shape = (2**circuit.nqubits,)
valid_shape = 2 * (2**circuit.nqubits,) if circuit.density_matrix else (2**circuit.nqubits,)
if tuple(initial_state.shape) != valid_shape:
raise_error(
ValueError,
Expand Down

0 comments on commit eaac905

Please sign in to comment.