From 28da693b8ac7d4612f989360f4eff500c7c5152e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:46:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/qibo/backends/numpy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qibo/backends/numpy.py b/src/qibo/backends/numpy.py index eba0e8204a..7248b2348e 100644 --- a/src/qibo/backends/numpy.py +++ b/src/qibo/backends/numpy.py @@ -400,7 +400,11 @@ 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) - valid_shape = 2 * (2**circuit.nqubits,) if circuit.density_matrix else (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,