Repository navigation
Fix add/sub optimizations including the same symbols (backport #16752) - #16759
Conversation
* Fix add and sub optimizations for same symbols Previously add/sub optimizations for binary expressions with that contain the same symbol and a value in the other slot, where the values evaluate to zero, would generically be set to 0. * Fix more cases - there's no valid (Pow, Pow) optimization - added missing cases for mul/div optimizations * Rm trailing prints * Simplify match statements --------- Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> (cherry picked from commit 4b0b834) # Conflicts: # test/python/circuit/test_parameter_expression.py
|
Cherry-pick of 4b0b834 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
|
Julien Gacon (@Cryoris) - could you please fix the conflict here? |
Coverage Report for CI Build 31705481781Coverage increased (+0.01%) to 87.759%Details
Uncovered Changes
Coverage Regressions12 previously-covered lines in 2 files lost coverage.
Coverage Stats
π - Coveralls |
Previously add/sub optimizations for binary expressions with that contain the same symbol and a value in the other slot, where the values evaluate to zero, would generically be set to 0.
This was caused by the same faulty optimization in
add_optandsub_opt, where the addition/subtraction of twoBinary { op, lhs, rhs }components checked if thelhsparts summed to 0, without considering what was in therhspart.For example:
or even in general additions
AI/LLM disclosure
This is an automatic backport of pull request #16752 done by [Mergify](https://mergify.com).