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 Target.instruction_supported when target.num_qubits == None (backport #13655) #13657

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 13, 2025

Summary

This PR fixes a small bug found in Target.instruction_supported, where target.num_qubits == None would cause Target.instruction_supported to always evaluate to False. This was handled in the original Python implementation by artificially overwriting qargs, but this would require a mutable variable in Rust, so I just added an additional condition to account for this case.

Details and comments

Bug discovered through #12850.


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

…13655)

* Fix Target.instruction_supported to correctly evaluate targets with num_qubits==None (restore pre-Rust-migration behavior)

* Apply Ray's suggestion

* Add reno

(cherry picked from commit 79f0e72)
@mergify mergify bot requested a review from a team as a code owner January 13, 2025 17:50
@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:

  • @Qiskit/terra-core

@github-actions github-actions bot added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jan 13, 2025
@github-actions github-actions bot added this to the 1.3.2 milestone Jan 13, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12753048562

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 21 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 88.916%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 9 91.98%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 12709260875: -0.02%
Covered Lines: 79154
Relevant Lines: 89021

💛 - Coveralls

@alexanderivrii alexanderivrii added this pull request to the merge queue Jan 14, 2025
Merged via the queue into stable/1.3 with commit c306c47 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