-
Notifications
You must be signed in to change notification settings - Fork 342
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
Check for multiples of pi at operator construction time #993
Conversation
f60d535
to
1e4beb6
Compare
41fa32a
to
fc128ad
Compare
fc128ad
to
431a622
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.
One concrete comment. Also, one nebulous concern: is there any danger in adding str
to the possible types of the operands for Mul
and Div
and then using the resulting trees (say, in pyQVM) to evaluate parameters? Do all interested parties know how to convert "pi"
back out to pi
?
@@ -549,11 +552,11 @@ def _check_for_pi(element): | |||
elif abs(num) == 1 and den == 1: | |||
return sign + "pi" | |||
elif abs(num) == 1: | |||
return sign + "pi/" + repr(den) |
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.
update the docstring to reflect the return type
Does pyQVM support parameteric programs? Even so, I should better understand the parameter model and make sure I'm not polluting it. |
@notmgsk you're going to want to pull this branch when you start working again. also, can you come up with a PR title that is a bit shorter (~50 chars)? thanks! |
In retrospect, I don't think this is an issue. |
Rather than trying to figure it out before printing. ffffflake
1df482e
to
ded07cd
Compare
Over in my type hints PR, I assumed they only consumed |
Sure: |
You can pass the
What I meant was are there any examples where a |
Closing out of frustration. The solution is ugly and I can't decide whether it will break other stuff. Will return another day. |
Rather than trying to figure it out at the time of printing.
Closes #943.
Checklist