Skip to content

Commit

Permalink
cleaning the code
Browse files Browse the repository at this point in the history
  • Loading branch information
rochisha0 committed Jul 16, 2024
1 parent c3f5dc6 commit 8210e1f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions qutip/core/qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,11 @@ def expm(self, dtype: LayerType = _data.Dense) -> Qobj:
"""
if not self._dims.issquare:
raise TypeError("expm is only valid for square operators")
if isinstance(self.data, _data.CSR) or isinstance(
self.data, _data.Dia):
return Qobj(_data.expm(self._data, dtype=_data.Dense),
dims=self._dims,
isherm=self._isherm,
copy=False)
return Qobj(_data.expm(self._data, dtype=self.dtype),
if isinstance(self.data, (_data.CSR, _data.Dia)):
dtype = self.dtype
else:
dtype = None
return Qobj(_data.expm(self._data, dtype=dtype),
dims=self._dims,
isherm=self._isherm,
copy=False)
Expand Down

0 comments on commit 8210e1f

Please sign in to comment.