diff --git a/pennylane_qrack/qrack_device.py b/pennylane_qrack/qrack_device.py index 5760b7b..0322547 100644 --- a/pennylane_qrack/qrack_device.py +++ b/pennylane_qrack/qrack_device.py @@ -673,14 +673,12 @@ def generate_samples(self): ) if self.noise != 0: - self._samples = [] + samples = [] for _ in range(self.shots): self._state.reset_all() self._apply() - self._samples.append(self._generate_sample()) - self._samples = QubitDevice.states_to_binary( - np.array([self._generate_sample()]), self.num_wires - ) + samples.append(self._generate_sample()) + self._samples = QubitDevice.states_to_binary(np.array(samples), self.num_wires) self._circuit = [] return self._samples