Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 23, 2025

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 to main, 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).

* Fix spurious complex part in circuit funcs

* reno links

(cherry picked from commit e7fa11d)
@mergify mergify bot requested a review from a team as a code owner May 23, 2025 06:18
@qiskit-bot
Copy link
Collaborator

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:

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@Cryoris
Copy link
Contributor

Cryoris commented May 23, 2025

The tests added here only trigger the issue prior to #13278 -- so they don't actually check the changed behavior on main. We should add a test to explicitly check the fix, probably via the QPY compatibility checks where we dump a circuit and load it with v2.0 or before?

@coveralls
Copy link

coveralls commented May 23, 2025

Pull Request Test Coverage Report for Build 15270397280

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 18 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.01%) to 88.323%

Files with Coverage Reduction New Missed Lines %
crates/circuit/src/symbol_expr.rs 1 75.02%
crates/qasm2/src/expr.rs 1 94.23%
crates/qasm2/src/lex.rs 4 92.73%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 15188294429: -0.01%
Covered Lines: 78467
Relevant Lines: 88841

💛 - Coveralls

@ElePT ElePT added this to the 2.1.0 milestone May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants