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
Improve docstring in states #2289
Conversation
…dims.in.creation
09a21a8
to
4d67ad9
Compare
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 left a couple of small questions, but otherwise this looks good.
We should document the methods of the dimension and space classes better (i.e. add docstrings which describe the arguments) but happy for that to happen sometime in a later PR.
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.
Looks good to me now. Removing _implicit_tensor_dimensions
made everything much nicer.
Thanks for adding to the flatten docstring. I suggested wording a small change to the note at the end.
I also suggested some small tweaks to qzero
which for me make the logic slightly clearer.
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
Description
As presented in #1722, the docstring of the states and operators functions are not consistent.
This change the docstring so that Number of basis states in Hilbert space is used everywhere, instead of fock states or vector states.
This set the variable names as:
N
dimensions
N_qubit
Added support for
dimensions
input to takeSpace
object.Added sanity check in dimensions object.
Added
scalar_like
method to dimensions object. In transform any dims[[2, 3], [2, 3]]
to it's scalar with same structure[[1, 1], [1, 1]]
.Added another input parameter to qzero to create rectangular operator
qzero([2],[3]).dims == [[2], [3]]
.Related issues or PRs
fix #1184, replace #2075