Qobj Data Layer Specification and Tracking #1477
Replies: 5 comments
-
Thanks @jakelishman. Can we add "Qobj" in the title? Just to make very visible. Thanks! |
Beta Was this translation helpful? Give feedback.
-
New on 2020-06-12: Added a new design draft about data structure implementation choices. Added initial implementation of multiple-dispatch methods in a separate repository, which includes some discussion in jakelishman/qutip-dispatch#1. |
Beta Was this translation helpful? Give feedback.
-
New on 2020-06-22 Pull request #1296 containing the same dispatcher as mentioned previously, and base implementations of a |
Beta Was this translation helpful? Give feedback.
-
New on 2020-06-27 You can follow the development of the QuTiP developers' guide in my repo: https://github.com/jakelishman/qutip-devguide, or more usefully see the rendered version on that repo's GH page: https://jakelishman.github.io/qutip-devguide. |
Beta Was this translation helpful? Give feedback.
-
New on 2020-07-13 Work has begun on porting the |
Beta Was this translation helpful? Give feedback.
-
Last updated: 2020-08-12
This is an issue for tracking and publicising the development status of a separated data layer. This is a major breaking change to be introduced in QuTiP 5, and will change how library functions and users access the underlying data structures of
Qobj
. This document and issue will change over time.Development is taking place on the
dev.major
branch inqutip/qutip
. Pull requests implementing new features:qutip.core
.fast_csr_matrix
with the new Cython typeCSR
all across QuTiPWe are writing a new "developers' guide" to explain the logic behind the design decisions, and help new QuTiP developers work on the code. You can follow initial development hosted as a repo in my user account until we decide how this will be added to the main documentation. You can view a rendered version of the documentation at https://jakelishman.github.io/qutip-devguide.
Some design documents:
New design elements under consideration:
'type'
and'dims'
handling for tensor-product spacesMajor breaking changes to QuTiP:
Qobj.data
is no longer an instance ofscipy.sparse.spmatrix
, but the new abstract "data-layer type"core.data.Data
bra * ket
now returns a scalar, not aQobj
(no need to do(bra * ket).data[0, 0]
or(bra * ket).tr()
) any moreQobj.dims
are now never contracted silently (they were, but inconsistently before), but the new functionQobj.contract()
can be called to do this explicitlyQobj
no longer defines__array__
, and so cannot be treated as if it is a numpy array. Having this led to inconsistent behaviour whenQobj
was used in arithmetic with numpy arrays from the left and right, and allowed simple code to becomeQobj.dims
-unsafe implicitly. To get the full array view now, you must be explicit and callQobj.full()
- it is not enough to donp.array(qobj)
, and this behaviour is consistent withscipy.sparse
matrices.eseries
andessolve
are removedqutip.correlation
)vec2mat
andmat2vec
are renamed away from the terse MATLAB-compatible syntax to the more QuTiP-consistentvector_to_operator
andoperator_to_vector
Non-breaking changes:
qutip.core
andqutip.solve
containing the core code and the solvers respectively, but these packages export all their names to the fullqutip
namespace, so there are no user-facing changesQobj
is a bit more strict about enforcingQobj.type
-safety with input types to arithmetic operations, particularly with 1D subspacesQobj
understands the@
operator to mean matrix multiplication (it still understandsQobj * Qobj
to be matrix multiplication as well)Qobj
instantiation is massively faster (lower-bounded by ~5µs compared to the previous ~70µs) in internal use and when doing arithmetic. QuTiP internal functions are now much more aggressive at passing in thetype
andcopy=False
arguments, cutting out most type inference and unnecessary copying of data which were the largest time sinks.Discussions about the implementation of multiple-dispatch methods are on-going in the repository jakelishman/qutip-dispatch. See in particular some discussion in jakelishman/qutip-dispatch#1.
Other discussions are also at the
data-layer-devs
discussion board.Beta Was this translation helpful? Give feedback.
All reactions