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 QuantumCircuit.barrier argument conversion #11272

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

jakelishman
Copy link
Member

Summary

The manual argument conversion within QuantumCircuit.barrier made it inconsistent with the rest of the circuit methods, and it would silently generate invalid circuit output when given iterables outside an expected set. This switches the method to use the standard argument conversion, bringing it inline with the rest of the circuit methods.

Details and comments

Fix #11208.

The manual argument conversion within `QuantumCircuit.barrier` made it
inconsistent with the rest of the circuit methods, and it would silently
generate invalid circuit output when given iterables outside an expected
set.  This switches the method to use the standard argument conversion,
bringing it inline with the rest of the circuit methods.
@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 Nov 17, 2023
@jakelishman jakelishman added this to the 0.45.1 milestone Nov 17, 2023
@jakelishman jakelishman requested a review from a team as a code owner November 17, 2023 21:56
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

mtreinish
mtreinish previously approved these changes Nov 17, 2023
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.

LGTM, just one inline question

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6909575184

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 85.915%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.76%
crates/qasm2/src/lex.rs 2 92.42%
Totals Coverage Status
Change from base Build 6897835680: 0.02%
Covered Lines: 65942
Relevant Lines: 76753

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Nov 17, 2023
Merged via the queue into Qiskit:main with commit 252dbd5 Nov 18, 2023
14 checks passed
mergify bot pushed a commit that referenced this pull request Nov 18, 2023
* Fix `QuantumCircuit.barrier` argument conversion

The manual argument conversion within `QuantumCircuit.barrier` made it
inconsistent with the rest of the circuit methods, and it would silently
generate invalid circuit output when given iterables outside an expected
set.  This switches the method to use the standard argument conversion,
bringing it inline with the rest of the circuit methods.

* Include link to issue

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
(cherry picked from commit 252dbd5)
github-merge-queue bot pushed a commit that referenced this pull request Nov 18, 2023
* Fix `QuantumCircuit.barrier` argument conversion

The manual argument conversion within `QuantumCircuit.barrier` made it
inconsistent with the rest of the circuit methods, and it would silently
generate invalid circuit output when given iterables outside an expected
set.  This switches the method to use the standard argument conversion,
bringing it inline with the rest of the circuit methods.

* Include link to issue

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
(cherry picked from commit 252dbd5)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
@jakelishman jakelishman deleted the fix-barrier-set branch November 18, 2023 07:39
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.

Barrier instruction ignores number of qubits when passed qubit operands as set
4 participants