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 global-phase of copied BlueprintCircuits #11456

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

jakelishman
Copy link
Member

Summary

Using BlueprintCircuit.copy() or .copy_empty_like() would previously erase the global phase as part of the rebuild operation. This overrides BlueprintCircuit.copy_empty_like() to ensure that it is always propagated through.

Details and comments

Using `BlueprintCircuit.copy()` or `.copy_empty_like()` would previously
erase the global phase as part of the rebuild operation.  This overrides
`BlueprintCircuit.copy_empty_like()` to ensure that it is always
propagated through.
@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 21, 2023
@jakelishman jakelishman added this to the 0.45.2 milestone Dec 21, 2023
@jakelishman jakelishman requested a review from a team as a code owner December 21, 2023 20:14
@qiskit-bot
Copy link
Collaborator

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

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7292776195

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 17 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.003%) to 87.537%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 91.41%
crates/qasm2/src/parse.rs 12 97.13%
Totals Coverage Status
Change from base Build 7287805073: 0.003%
Covered Lines: 59182
Relevant Lines: 67608

💛 - Coveralls

Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

LGTM

@kevinhartman kevinhartman added this pull request to the merge queue Jan 3, 2024
Merged via the queue into Qiskit:main with commit 19767bc Jan 3, 2024
13 checks passed
mergify bot pushed a commit that referenced this pull request Jan 3, 2024
Using `BlueprintCircuit.copy()` or `.copy_empty_like()` would previously
erase the global phase as part of the rebuild operation.  This overrides
`BlueprintCircuit.copy_empty_like()` to ensure that it is always
propagated through.

(cherry picked from commit 19767bc)
@jakelishman jakelishman deleted the fix-blueprintcircuit-copy branch January 3, 2024 17:34
github-merge-queue bot pushed a commit that referenced this pull request Jan 3, 2024
Using `BlueprintCircuit.copy()` or `.copy_empty_like()` would previously
erase the global phase as part of the rebuild operation.  This overrides
`BlueprintCircuit.copy_empty_like()` to ensure that it is always
propagated through.

(cherry picked from commit 19767bc)

Co-authored-by: Jake Lishman <[email protected]>
ShellyGarion pushed a commit to ShellyGarion/qiskit-terra that referenced this pull request Jan 18, 2024
Using `BlueprintCircuit.copy()` or `.copy_empty_like()` would previously
erase the global phase as part of the rebuild operation.  This overrides
`BlueprintCircuit.copy_empty_like()` to ensure that it is always
propagated through.
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.

4 participants