-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
add relational, min, max, floor, ceil, sqrt, arctan2 to ParameterExpression #5278
Conversation
These functions won't yield correct results. Using Max and Min from ParameterExpression module is preferred. Numpy or python's function return possibly incorrect result.
@ewinston Any update on this PR? |
Hi @peendebak this pr opens up broadened functionality of ParameterExpressions and there may be some concern about whether it is needed particularly when considering the desire to reduce dependence on sympy due to speed considerations. Do you have a use case you were considering? |
@ewinston I have two use cases. Both involve These cases do not require the full PR, but just the Both cases can be solved by first casting to Another option that keeps the
|
This PR is old, and I think that incoming changes to how classical types are handled will render all of the relational parts anyway. I've laid out my reasoning in other places (e.g. #7497 (review)), but primarily I think that right now The uses cited all seem to revolve around issues caused by Mathematical operations that return real values could be useful, but it doesn't seem like they're super pressing. |
My use case for this was getting the RVGate to be in the standard_gates directory. I believe at the time that gates in that directory were required to take ParameterExpression arguments but the decomposition method we used needed something numeric. Using relationals and Piecewise I had a symbolic decomposition just about worked out (which exists in these tests) but abandoned it since it was just a "would be nice" sort of thing. I'll close this now unless there is stronger justification in the future. |
Summary
Adds relational expressions to ParameterExpression as well as
floor
,ceil
,max
,min
,sqrt
,arctan2
,and
,or
,piecewise
.Details and comments
Depends on #4854
Resolves #5276
Resolves #6376