-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation compatibility with qutip-v5
#192
Conversation
SolverOptions is removed from qutip5. Ignore the future warning for qutip.Options for now. The use of qutip.Options should be removed in ~1 year after the official release of qutip5
- Turn-off progress bar for the solvers
In qutip-v5, a bra ket multiplication returns a number instead of a Qobj. This makes it hard to keep the code clean and compatible for both version. This helper function changes the returned value so that it is identical to the one returned by qutip-v4.
@hodgestar qutip-qip/src/qutip_qip/utilities.py Lines 8 to 16 in 8c3af66
|
We should definitely have a nice solution for cases like Rather than the function you have now, I recommend creating a def to_scalar(qobj_or_scalar):
if isinstance(qobj_or_scalar, Qobj):
if qobj_or_scalar.dims == [[1], [1]]: # <-- maybe this check should also handle more dims?
return qobj_or_scalar[0, 0]
else:
raise ValueError(...)
return qobj_or_scalar This avoids explicit version checks and implements a more specific set of functionality. |
Yes, the example you provide is better, avoiding the version check. There are indeed other cases instead of just And now thinking about it again. You are also right that unless we can have this for both qutip-v4 and v5, it is not gonna be sufficient. Maybe we could just provide the example above as part of the upgrade guide. |
qutip-v5
. They are no longer needed in the new alpha version.qutip-v5
.qutip-v5
.Note that
doctest
still doesn't fully pass withqutip-v5
because of the spaces in printedQobj._repr_
. But this should be fine if we only build the doc againstqutip-v4.7
for now.