-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix more spurious complex parts in circuit functions (backport #14431) #14455
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
Conversation
* Fix spurious complex part in circuit funcs * reno links (cherry picked from commit e7fa11d)
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:
|
The tests added here only trigger the issue prior to #13278 -- so they don't actually check the changed behavior on |
Pull Request Test Coverage Report for Build 15443606152Details
💛 - Coveralls |
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.
LGTM
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.
As discussed offline, this is a strange edge case since CI cannot verify that this PR actually fixes the issue. We separately confirmed that this fixes the compatibility with Qiskit v2.0 and added tests to ensure the correct behavior is maintained.
…#14431) (Qiskit#14455) * Fix more spurious complex parts in circuit functions (Qiskit#14431) * Fix spurious complex part in circuit funcs * reno links (cherry picked from commit e7fa11d) * Add qpy compat test * Fix black * Fix lint, don't import circuit library element on older qiskit version * Remove venv * Fix indentation * Fix tests * Fix import * Fix access * debug * Change test * Restore backwards compat test * Remove reno --------- Co-authored-by: Julien Gacon <jules.gacon@googlemail.com> Co-authored-by: ElePT <epenatap@gmail.com> Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Summary
@ElePT reported that #13643 came back for other circuits, too. This essentially affects circuits that use operators as inputs, which have coefficients of complex types. This problem does not appear on
main
, I assume #13278 removes the 0 complex component. We could still consider to add this safetyguard tomain
, but there's no way to break it right now that I'm aware of.This is an automatic backport of pull request #14431 done by [Mergify](https://mergify.com).