Skip to content

Change ParameterExpression __eq__ to sympy equals()#5760

Merged
mergify[bot] merged 11 commits intoQiskit:masterfrom
enavarro51:param_expr_eq_5611
Feb 2, 2021
Merged

Change ParameterExpression __eq__ to sympy equals()#5760
mergify[bot] merged 11 commits intoQiskit:masterfrom
enavarro51:param_expr_eq_5611

Conversation

@enavarro51
Copy link
Copy Markdown
Contributor

Summary

Fixes #5611

Details and comments

This PR changes the ParameterExpression __eq__ from using the sympy srepr method to using the equals method. The srepr method required an exact match of the expressions and would not handle a float equal to an int, for example. The equals method simplifies both expressions and will do normal float/int equality.

@enavarro51 enavarro51 requested a review from a team as a code owner February 1, 2021 15:01
@kdk kdk added the Changelog: Changed Add a "Changed" entry in the GitHub Release changelog. label Feb 1, 2021
@kdk kdk added this to the 0.17 milestone Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Changed Add a "Changed" entry in the GitHub Release changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParametereExpression.__eq__ doesn't gracefully convert numeric types

3 participants