-
Notifications
You must be signed in to change notification settings - Fork 2
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
[CQT-127] Allow Qubit to accept QubitLike #325
Conversation
0b31beb
to
1af958e
Compare
8a56410
to
767a9c5
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.
Beautiful work!
I've added a few comments and one check to review.
I wouldn't be sure to always stop using a Qubit(index)
syntax. Sometimes it may be clearer to know the type of the arguments.
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 have done a more in depth review now.
My main comment is:
- I don't think we have to change to using
QubitLike
everywhere. For example, for internal functions, such asexpand_ket
, that we are alredy calling with operands of typeQubit
. - It's enough letting the programer use integers instead of
Qubit
types in the code that is, let's say, exposed. For example, through the CircuitBuilder, when you construct a gate.
My other bigger concern was: can't we have an implicit "from int" constructor? But I see constructor overloading is not really a built-in Python feature.
Other than that, it looks great to me.
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.
Some last comments.
Thanks for the changes.
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 think all conversations are resolved now, so let's go!
Make QubitLike type
Reformat Qubit dataclass