-
Notifications
You must be signed in to change notification settings - Fork 4
9 implement dev tools and document usage #18
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
Conversation
opensquirrel/MatrixExpander.py
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
|
|||
# This should only be used for testing and on circuits with low number of qubits. | |||
def getBigMatrix(semantic, qubitOperands, totalQubits): | |||
def getBigMatrix(semantic: MultiQubitMatrixSemantic, qubitOperands, totalQubits): |
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.
The correct type here is the parent class Semantic
in the current code
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.
(see below isinstance
)
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.
Yes, makes sense!
Perhaps we should make Semantic
an ABC then?
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.
It is indeed an ABC! I just only recently discovered that you can use this in Python with an extra module - it's not in the language by default I believe.
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.
You need to import the abc
library indeed (https://docs.python.org/3/library/abc.html).
I was also thinking if it would be an idea to create ABCs for the various passes. And Users can then define new passes based on those interfaces. We have done a similar thing with NetSquid.
No description provided.