Skip to content

Conversation

dabacon
Copy link
Collaborator

@dabacon dabacon commented Jun 26, 2020

Fixes #3111

Presently the control override on XPowGate results in copying over the global phase shift of the XPowGate to the CXPowGate (similar for other control constuctions). This is inconsistent with most people's notion of "control" where the identity component has no phase.

This makes this override occur only when the global phase is zero.

@dabacon dabacon requested review from Strilanc and smitsanghavi June 26, 2020 15:20
@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Jun 26, 2020
Note that this only transforms into a CZPowGate (or controlled version
of that gate) if the global shift of the ZPowGate is 0, otherwise
it produces a normal ControlledGate.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like the above two paragraphs can actually be combined more concisely into a single paragraph listing the preconditions for the specialization to occur.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Combined for this and all other gates.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was suggesting more along the lines of:

This method will specialize the control only if:
1. global shift is 0
2. the last of the controls is a default-type control qubit (followed by the clarifying what that means)

It would make the prerequisites clearer to the reader. But it's a minor documentation nit and not worth blocking the PR.

@dabacon dabacon requested a review from smitsanghavi June 29, 2020 23:12
@dabacon dabacon added the Ready for Re-Review For when reviewers take their time. label Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gate inconsistencies between versions when using controlled interface
3 participants