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 handling in circuit.repeat #5588

Merged
merged 3 commits into from
Jan 7, 2021

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Jan 6, 2021

Summary

Fixes #5586.

Details and comments

Fix the global phase of the output of circuit.repeat. If a circuit with global
phase is appended to another circuit, the global phase is currently not propagated.
The simulators rely on this, since the phase otherwise gets applied multiple times.
This sets the global phase of circuit.repeat to 0 instead of multiplying the existing
phase times the number of repetitions.

@Cryoris Cryoris added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jan 6, 2021
@Cryoris Cryoris requested a review from a team as a code owner January 6, 2021 14:13
@ewinston
Copy link
Contributor

ewinston commented Jan 6, 2021

#5586 (comment)

@jlapeyre jlapeyre self-requested a review January 6, 2021 20:58
Copy link
Contributor

@jlapeyre jlapeyre left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit 7e40ed1 into Qiskit:master Jan 7, 2021
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jan 7, 2021
mergify bot pushed a commit that referenced this pull request Jan 7, 2021
* global phase should not be propagated in repeat

* add reno

(cherry picked from commit 7e40ed1)
kdk pushed a commit that referenced this pull request Jan 7, 2021
* global phase should not be propagated in repeat

* add reno

(cherry picked from commit 7e40ed1)

Co-authored-by: Julien Gacon <gaconju@gmail.com>
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 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.repeat duplicates global phase
4 participants