qutip / qutip-qtrl

The QuTiP quantum optimal control package
BSD 3-Clause "New" or "Revised" License
6 stars 7 forks source link

Refactoring of optimization to use dense and sparse format of v5 Qobj #14

Open flowerthrower opened 1 year ago

flowerthrower commented 1 year ago

Checks like

if dtype == Qobj: ...
if dtype == np.ndarray: ...

can be found all over dynamics.py (and other optimization related files). This is done to distinguish between "dense" and "sparse" representations. The new data layer structure in v5, however, supports both types within the Qobj class. Therefore dynamics.py and related tests should be adapted to the v5 changes.

ajgpitch commented 1 year ago

Thanks for raising this. When tackling this, one should remember that the checks for if dtype == ... are dotted around in other files too, so best to grep around and check.