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 CircuitInstruction legacy iterable typing #12630

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

jakelishman
Copy link
Member

Summary

The legacy 3-tuple format of CircuitInstruction still exposes the object in the old tuple-like way of (Operation, list[Qubit], list[Clbit]), rather than the new-style attribute access using tuples for the qargs and cargs. This was inadvertantly changed when it moved to Rust.

Details and comments

Fix #12626.

No changelog because it's not in a release version of Qiskit.

The legacy 3-tuple format of `CircuitInstruction` still exposes the
object in the old tuple-like way of `(Operation, list[Qubit],
list[Clbit])`, rather than the new-style attribute access using tuples
for the qargs and cargs.  This was inadvertantly changed when it moved
to Rust.
@jakelishman jakelishman added Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Jun 21, 2024
@jakelishman jakelishman added this to the 1.2.0 milestone Jun 21, 2024
@jakelishman jakelishman requested a review from a team as a code owner June 21, 2024 11:04
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @kevinhartman
  • @mtreinish

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.

The fix looks good. Do you see this behavior being deprecated in the near future, or would it cause too much trouble? (seeing that it is not ideal for runtime but needed for backwards compat.)

@jakelishman
Copy link
Member Author

I opened #12631 to track deprecation - I'm just throwing together a PR to do it now too.

@coveralls
Copy link

coveralls commented Jun 21, 2024

Pull Request Test Coverage Report for Build 9612612289

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • 14 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.002%) to 89.736%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 92.37%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 9612593426: 0.002%
Covered Lines: 63511
Relevant Lines: 70775

💛 - Coveralls

@ElePT ElePT enabled auto-merge June 21, 2024 11:26
@ElePT ElePT added this pull request to the merge queue Jun 21, 2024
Merged via the queue into Qiskit:main with commit 22c145a Jun 21, 2024
15 checks passed
@jakelishman jakelishman deleted the fix-legacy-instruction-qargs branch June 21, 2024 16:44
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
The legacy 3-tuple format of `CircuitInstruction` still exposes the
object in the old tuple-like way of `(Operation, list[Qubit],
list[Clbit])`, rather than the new-style attribute access using tuples
for the qargs and cargs.  This was inadvertantly changed when it moved
to Rust.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CircuitInstruction qarg type changed without communication
4 participants