From ee78bf7abdcb262647f92f2e5dd9622b68b4585f Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:03:38 +0400 Subject: [PATCH 1/3] fix: force int type to samples --- src/qibo/result.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qibo/result.py b/src/qibo/result.py index 905cbb8e49..4ea7c59c26 100644 --- a/src/qibo/result.py +++ b/src/qibo/result.py @@ -326,7 +326,7 @@ def samples(self, binary: bool = True, registers: bool = False): if self.measurements[0].result.has_samples(): self._samples = self.backend.np.concatenate( [ - self.backend.cast(gate.result.samples()) + self.backend.cast(gate.result.samples(), dtype="int32") for gate in self.measurements ], axis=1, From 445386deb26115dbf3c4975cd42da8126c3117c7 Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Wed, 7 Aug 2024 23:23:23 +0400 Subject: [PATCH 2/3] Update src/qibo/result.py Co-authored-by: Stefano Carrazza --- src/qibo/result.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qibo/result.py b/src/qibo/result.py index 4ea7c59c26..def4af4042 100644 --- a/src/qibo/result.py +++ b/src/qibo/result.py @@ -326,7 +326,7 @@ def samples(self, binary: bool = True, registers: bool = False): if self.measurements[0].result.has_samples(): self._samples = self.backend.np.concatenate( [ - self.backend.cast(gate.result.samples(), dtype="int32") + self.backend.cast(gate.result.samples(), dtype=self.backend.np.int32) for gate in self.measurements ], axis=1, From c32fe97c199f7597513c20bb0f5810e4bd549d54 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:24:05 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/qibo/result.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qibo/result.py b/src/qibo/result.py index def4af4042..91fef766b8 100644 --- a/src/qibo/result.py +++ b/src/qibo/result.py @@ -326,7 +326,9 @@ def samples(self, binary: bool = True, registers: bool = False): if self.measurements[0].result.has_samples(): self._samples = self.backend.np.concatenate( [ - self.backend.cast(gate.result.samples(), dtype=self.backend.np.int32) + self.backend.cast( + gate.result.samples(), dtype=self.backend.np.int32 + ) for gate in self.measurements ], axis=1,