Skip to content
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

Fix an error in qasm3 exporter when operating on unitary gates (backport #13633) #13663

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 14, 2025

Summary

Fixes a bug causing the qasm3 exporter to crash on circuits containing a unitary gate.

Fixes #13362.

Details and comments

The bug results from the params field of the unitary operation being handled incorrectly, due to it being a somewhat nonstandard field (as opposed to the params field of u gate, for instance, which is used differently).

This problem was already handled in the qasm2 exporter by a call to _qasm2_decomposition in the operation, if present. This PR integrates the same solution in the qasm3 exporter, renaming the method to _qasm_decomposition.


This is an automatic backport of pull request #13633 done by [Mergify](https://mergify.com).

* Fix error in qasm3 exporter when operating on unitary gates

* Update test/python/qasm3/test_export.py

Co-authored-by: Jake Lishman <jake@binhbar.com>

* Update releasenotes/notes/fix-qasm-3-unitary-2da190be6ba25bbd.yaml

Co-authored-by: Jake Lishman <jake@binhbar.com>

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
(cherry picked from commit 087e393)
@mergify mergify bot requested a review from a team as a code owner January 14, 2025 15:56
@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

@github-actions github-actions bot added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jan 14, 2025
@github-actions github-actions bot added this to the 1.3.2 milestone Jan 14, 2025
@jakelishman jakelishman enabled auto-merge January 14, 2025 16:15
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12771464864

Details

  • 9 of 9 (100.0%) changed or added relevant lines in 4 files are covered.
  • 18 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.02%) to 88.916%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/two_qubit_decompose.rs 1 91.96%
crates/qasm2/src/lex.rs 5 92.48%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 12768464675: -0.02%
Covered Lines: 79164
Relevant Lines: 89032

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Jan 14, 2025
Merged via the queue into stable/1.3 with commit c196408 Jan 14, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants