-
Notifications
You must be signed in to change notification settings - Fork 60
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
[WIP] Arraylias integration -Model- #282
[WIP] Arraylias integration -Model- #282
Conversation
I found that I need to refactor all this model folder, so I will rename it. |
I think yes - as far as I can tell this is all
I don't remember all the places where I think, unfortunately, handling of scipy CSR matrices is always going to be a weird edge case. I had wanted to handle these gracefully like all other array types, and to use
I'm not sure which of the two options I prefer. I originally wanted to implement the first to simplify the
Yeah maybe we can just add an internal function like
Is what you're trying to do here equivalent to:
We can't check
I'm actually starting to wonder if we even need As an aside: I see
but I think lines like this could just be changed to
so
I think this is okay - if a user is creating an array using |
Going to close this as we've moved beyond what this was originally prototyping. |
Summary
Updating Model folders
generator_modelhamiltonian_modellindblad_modeloperator_collectionsrotating_framerotating_wave_approximationDetails and comments
[TODO]
[Points to discuss]
1. The necessity of
to_numeric_matrix_type
asarray
?2. Registering
list
type to aliaslist
type will be used forList[sparse_matrix]
, and it may be replaced if a new class likeCsrMatrixList
is defined. However, it's unclear where this type is used. Conversion toCsrMatrixList
orBCOOList
is necessary in certain places. In dynamic, dealing withList[Sparse matrix]
, and it's uncertain whether registeringCsrMatrixList
toscipy_sparse
and custom functions inscipy_sparse
can adequately cover the role ofList[Sparse matrix]
. (Ref: Link)3. Replacing
Array.default_backend() == jax
Array
will be deprecated, and an alternative method needs consideration. The current code implementation involves checking ifoperators
is related tojax
usingis_operators_jax = any(lib in ("jax", "jax_sparse") for lib in DYNAMICS_NUMPY_ALIAS.infer_libs(operators))
. Functionalizing this process is desired.4.
isinstance(, ArrayLike)
5.
unp.to_dense
jnp.array()
. For instance, the difference betweento_BCOO
andunp.to_sparse
.to_BCOO
covers BCOO even with any array, whileunp.to_sparse
only changes to BCOO ifjnp.array()
is used.6.
Operator.from_label()
Operator.from_label().data
supportsnp.array()
, and if using the Jax model,Operator.from_label()
is utilized asjnp.array(Operator.from_label())
.