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
Add Qobj.get
to obtain the data in common type
#2141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this new interface and I'm fairly happy with the name extract
unless someone thinks of a better option.
The doc strings also need some updating.
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
What about |
|
@hodgestar, is the current naming fine for you? I |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I think I missed the last commit. Happy with the new name.
Description
I think that with the different data type a
Qobj
can contain, it would be useful to be able get the underlying data (ndarray, csr_matrix, jax.Array, etc.) easily from theQobj
. I added the methodQobj.get(copy)
for that.I allow direct access to the object in case it's needed for auto-differentiation or other advanced features.
I am open to a better name than
get
if it's too generic.