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

Add AnnotatedOperation.params and fix some control issues (backport #12752) #12828

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 26, 2024

Summary

Adds support for AnnotatedOperation.params and, leveraging that, fixes some issues when controlling standard gates that are parameterized. Closes #10311, #10697 and #12135.

Since this PR also changes AnnotatedOperation it's probably too large for a backport?

Details and comments

  • AnnotatedOperation.params is a proxy to to base_op.params, if it exists. If the base_op has no params, returns an empty list (as discussed with the team offline).
  • The annotated argument in Gate.control now is None per default, which allows to set it to True for gates that cannot be eagerly synthesized. A test for each gate that failed previously is added.
  • The S/Sdg gates didn't return CS/CSdg gates for a single control, that's also been fixed.

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

* AnnotatedOp.params support and Gate.control fix

* add reno

* lint

* update reno

* review comments

- use attribute error
- more clearly state the new None arg in reno and Gate class

* review from Elena

* Fix ``AttributeError`` test

* lint

* Apply suggestions from code review

Co-authored-by: Elena Peña Tapia <[email protected]>

---------

Co-authored-by: Elena Peña Tapia <[email protected]>
(cherry picked from commit 1512535)
@mergify mergify bot requested a review from a team as a code owner July 26, 2024 16:37
@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 Changelog: New Feature Include in the "Added" section of the changelog Changelog: Bugfix Include in the "Fixed" section of the changelog labels Jul 26, 2024
@github-actions github-actions bot added this to the 1.2.0 milestone Jul 26, 2024
@ElePT ElePT enabled auto-merge July 26, 2024 16:56
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10114622119

Details

  • 97 of 97 (100.0%) changed or added relevant lines in 18 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 89.962%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 4 92.62%
Totals Coverage Status
Change from base Build 10113660492: 0.02%
Covered Lines: 66182
Relevant Lines: 73567

💛 - Coveralls

@ElePT ElePT added this pull request to the merge queue Jul 26, 2024
Merged via the queue into stable/1.2 with commit c5d8b01 Jul 26, 2024
18 checks passed
@mergify mergify bot deleted the mergify/bp/stable/1.2/pr-12752 branch July 26, 2024 18:36
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 Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants