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 QuantumCircuitData handling of Operation #9881

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

jakelishman
Copy link
Member

Summary

The legacy ability to directly mutate QuantumCircuit.data was not accounting for cases where the operation could be an implementor of Operation that is not Instruction. Actually using this functionality is still discouraged, but it should work.

Details and comments

Thanks to @kevinsung for pointing this out in #8714 (comment).

The legacy ability to directly mutate `QuantumCircuit.data` was not
accounting for cases where the operation could be an implementor of
`Operation` that is not `Instruction`.  Actually using this
functionality is still discouraged, but it should work.
@jakelishman jakelishman added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Mar 30, 2023
@jakelishman jakelishman requested a review from a team as a code owner March 30, 2023 15:32
@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 the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4566235628

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.07%) to 85.315%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/quantumcircuitdata.py 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/vf2_layout.rs 1 86.44%
Totals Coverage Status
Change from base Build 4565915586: -0.07%
Covered Lines: 66845
Relevant Lines: 78351

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

Seems straightforward enough, LGTM

@mtreinish mtreinish added this pull request to the merge queue Apr 4, 2023
Merged via the queue into Qiskit:main with commit 5f375a6 Apr 4, 2023
@jakelishman jakelishman deleted the fix-typehint-circuitinstruction branch April 6, 2023 11:55
giacomoRanieri pushed a commit to giacomoRanieri/qiskit-terra that referenced this pull request Apr 16, 2023
The legacy ability to directly mutate `QuantumCircuit.data` was not
accounting for cases where the operation could be an implementor of
`Operation` that is not `Instruction`.  Actually using this
functionality is still discouraged, but it should work.
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
The legacy ability to directly mutate `QuantumCircuit.data` was not
accounting for cases where the operation could be an implementor of
`Operation` that is not `Instruction`.  Actually using this
functionality is still discouraged, but it should work.
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