Skip to content

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 15443606152

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 10 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 87.911%

Files with Coverage Reduction New Missed Lines %
crates/transpiler/src/passes/unitary_synthesis.rs 1 94.57%
crates/circuit/src/symbol_expr.rs 4 75.21%
crates/qasm2/src/lex.rs 5 92.23%
Totals Coverage Status
Change from base Build 15431044070: 0.02%
Covered Lines: 81405
Relevant Lines: 92599

💛 - Coveralls

@ElePT ElePT added this to the 2.1.0 milestone May 27, 2025
@ElePT ElePT requested review from a team, nonhermitian and jyu00 as code owners June 4, 2025 08:42
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@Cryoris Cryoris left a 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.

@Cryoris Cryoris added this pull request to the merge queue Jun 5, 2025
Merged via the queue into main with commit be404e5 Jun 5, 2025
29 checks passed
@jakelishman jakelishman deleted the mergify/bp/main/pr-14431 branch June 9, 2025 15:41
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
…#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>
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