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 broadcasting of QuantumCircuit.delay #11447

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

jakelishman
Copy link
Member

Summary

The object is supposed to "broadcast" like a gate; one instruction per qubit. This silently did the wrong thing when given a set as its argument, previously.

Details and comments

Fix #11446.

The object is supposed to "broadcast" like a gate; one instruction per
qubit.  This silently did the wrong thing when given a `set` as its
argument, previously.
@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Dec 20, 2023
@jakelishman jakelishman added this to the 0.45.2 milestone Dec 20, 2023
@jakelishman jakelishman requested a review from a team as a code owner December 20, 2023 20:42
@qiskit-bot
Copy link
Collaborator

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 7280573724

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.01%) to 87.549%

Files with Coverage Reduction New Missed Lines %
qiskit/circuit/delay.py 1 71.19%
crates/qasm2/src/lex.rs 5 92.17%
Totals Coverage Status
Change from base Build 7275149289: 0.01%
Covered Lines: 59141
Relevant Lines: 67552

💛 - 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.

This LGTM and seems straightforward enough. I do wonder if it's worth moving the gate broadcasting method to something more publicly reusable, but there also may not be a reason too because reusing the broadcasting logic outside of Gate might be sufficiently uncommon. Either way as a fix for backport this is good and minimal.

@mtreinish mtreinish added this pull request to the merge queue Jan 9, 2024
@jakelishman
Copy link
Member Author

I've harped on about it before, but I think a fair amount of the "broadcasting" is quite broken and really ought to be removed, or localised to QuantumCircuit.append. At any rate, this PR is logically the same as #11272, really.

Merged via the queue into Qiskit:main with commit 4c6eed9 Jan 9, 2024
13 checks passed
mergify bot pushed a commit that referenced this pull request Jan 9, 2024
The object is supposed to "broadcast" like a gate; one instruction per
qubit.  This silently did the wrong thing when given a `set` as its
argument, previously.

(cherry picked from commit 4c6eed9)

# Conflicts:
#	qiskit/circuit/quantumcircuit.py
@jakelishman jakelishman deleted the fix-delay-broadcast branch January 9, 2024 15:35
jakelishman added a commit that referenced this pull request Jan 9, 2024
The object is supposed to "broadcast" like a gate; one instruction per
qubit.  This silently did the wrong thing when given a `set` as its
argument, previously.

(cherry picked from commit 4c6eed9)
github-merge-queue bot pushed a commit that referenced this pull request Jan 9, 2024
The object is supposed to "broadcast" like a gate; one instruction per
qubit.  This silently did the wrong thing when given a `set` as its
argument, previously.

(cherry picked from commit 4c6eed9)

Co-authored-by: Jake Lishman <[email protected]>
ShellyGarion pushed a commit to ShellyGarion/qiskit-terra that referenced this pull request Jan 18, 2024
The object is supposed to "broadcast" like a gate; one instruction per
qubit.  This silently did the wrong thing when given a `set` as its
argument, previously.
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 mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circuit decoding error
4 participants