Skip to content

Commit

Permalink
Fix for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericgig committed Oct 24, 2023
1 parent 31136fc commit fb532be
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions qutip/qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,15 @@ def __init__(self, inpt=None, dims=None, shape=None,
# use cases such as enr_fock and other enr_ functions.
# This does leave open the possibility of data still being
# misused such as Qobj(complex[n**2][1], dims = [[n],[n]])
if (self._data.shape[0] > np.prod(flatten(self.dims[0])) or
self._data.shape[1] > np.prod(flatten(self.dims[1]))) and \
self.type != 'super':

dims_size = (
np.prod(flatten(self.dims[0]), dtype=np.int64),
np.prod(flatten(self.dims[1]), dtype=np.int64)
)
shape = self._data.shape
if (
(shape[0] > dims_size[0] or shape[1] > dims_size[1])
and self.type != 'super'
):
raise ValueError(f"Qobj has smaller dims {self.dims} " +
f"than underlying shape {self._data.shape}")

Expand Down

0 comments on commit fb532be

Please sign in to comment.