Skip to content

Fix phase for controlled Rz#3569

Merged
kdk merged 8 commits into
Qiskit:masterfrom
ewinston:crz_cu1
Dec 9, 2019
Merged

Fix phase for controlled Rz#3569
kdk merged 8 commits into
Qiskit:masterfrom
ewinston:crz_cu1

Conversation

@ewinston
Copy link
Copy Markdown
Contributor

@ewinston ewinston commented Dec 8, 2019

Summary

Since the controlled gate implementation uses the gate definition to generate controlled versions and the Rz gate's definition uses U1, which differs by a global phase to Rz, the controlled version was really a controlled U1. This PR instead bases off the definition of the CrzGate.

Also, the unitary gate overrides the standard control implementation to directly generate a controlled unitary. The returned gate is a UnitaryGate instead of ControlledGate currently.

Details and comments

Copy link
Copy Markdown
Member

@chriseclectic chriseclectic left a comment

Choose a reason for hiding this comment

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

I suggest removing the phase kwarg from UnitaryGate._compute_control_matrix). It isn't needed for this PR

Comment thread qiskit/extensions/unitary.py Outdated
chriseclectic
chriseclectic previously approved these changes Dec 9, 2019
@mtreinish mtreinish added this to the 0.11 milestone Dec 9, 2019
@kdk kdk merged commit db88513 into Qiskit:master Dec 9, 2019
@ewinston ewinston deleted the crz_cu1 branch June 9, 2020 19:52
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* fix crz

* add implementation for controlled unitary

* fix crz

* add implementation for controlled unitary

* remove phase arg from controlled unitary

* linting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants