Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Mar 12, 2024
1 parent 3c6258f commit 1ba37f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qibo/hamiltonians/hamiltonians.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ def __mul__(self, o):
if self.backend.np.real(o) >= 0: # TODO: check for side effects K.qnp
r._eigenvalues = o * self._eigenvalues
elif not self.backend.issparse(self.matrix):
r._eigenvalues = o * self.backend.np.flip(self._eigenvalues, (0,))
axis = (0,) if isinstance(self.backend, PyTorchBackend) else 0
r._eigenvalues = o * self.backend.np.flip(self._eigenvalues, axis)
if self._eigenvectors is not None:
if self.backend.np.real(o) > 0: # TODO: see above
r._eigenvectors = self._eigenvectors
Expand Down

0 comments on commit 1ba37f9

Please sign in to comment.