Skip to content

Commit

Permalink
Fix Python noisy sample generation
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Oct 30, 2024
1 parent 7b2c659 commit d8b0e82
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pennylane_qrack/qrack_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8b0e82

Please sign in to comment.