-
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
fix(phirgen): pattern match on all possible regwise/bitwise ops #94
fix(phirgen): pattern match on all possible regwise/bitwise ops #94
Conversation
Marking as ready since the translation is correct. Currently PECOS doesn't support |
0489eca
to
e4752f8
Compare
@@ -118,23 +125,36 @@ def regwise_cop(exp: LogicExp) -> JsonDict: | |||
cop = "<=" | |||
case RegWiseOp.GEQ: | |||
cop = ">=" | |||
case RegWiseOp.NOT: | |||
cop = "~" | |||
case other: |
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.
Why drop this error handler?
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.
If we are matching all possibilities, the other
case is unreachable.
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.
If we are matching all possibilities, the
other
case is unreachable.
Indeed, but is there any guarantee that we are? What if pytket were to add another one in the future (or the function were passed an invalid argument)? Wouldn't it be safer to keep the check?
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.
Thanks for making me think extra hard about this. Found a solution, just pushed.
e4752f8
to
facfb20
Compare
I need to confirm whether PECOS/PHIR supports the
POW
operation as the spec doesn't list it.