Skip to content

Commit

Permalink
fix: small fix to samples_to_decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Feb 5, 2024
1 parent 534377d commit a671f6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qibo/backends/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def samples_to_binary(self, samples, nqubits):
def samples_to_decimal(self, samples, nqubits):
qrange = self.np.arange(nqubits - 1, -1, -1, dtype="int32")
qrange = (2**qrange)[:, self.np.newaxis]
return self.np.matmul(self.to_numpy(samples), qrange)[:, 0]
return self.np.matmul(self.np.vstack(self.to_numpy(samples)), qrange)[:, 0]

def calculate_frequencies(self, samples):
res, counts = self.np.unique(samples, return_counts=True)
Expand Down

0 comments on commit a671f6e

Please sign in to comment.