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

Exponent should be drawn on target qubit in CX and CCX gates #4462

Merged
merged 3 commits into from Sep 21, 2021

Conversation

tanujkhattar
Copy link
Collaborator

CX and CCX gates currently print the exponent on the bottom most qubit in the circuit diagram. This PR modifies this behavior to always draw the exponent on the target qubit, which is also the expected behavior for other ControlledOperations. This came up in discussions on #4167 (comment)

Note that behavior of CZ and CCZ is left unchanged, i.e. draws exponent on the bottom most qubit, since these gates are symmetrical across all applied qubits.

BREAKING CHANGE: Tests depending upon diagrams of CX and CCX can now fail.

@tanujkhattar tanujkhattar added the BREAKING CHANGE For pull requests that are important to mention in release notes. label Aug 24, 2021
@tanujkhattar tanujkhattar requested review from cduck, vtomole and a team as code owners August 24, 2021 16:50
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Aug 24, 2021
@CirqBot CirqBot added the size: S 10< lines changed <50 label Aug 24, 2021
@tanujkhattar tanujkhattar changed the title Exponent should be drawn on target in CX and CCX gates Exponent should be drawn on target qubit in CX and CCX gates Aug 24, 2021
Copy link
Contributor

@maffoo maffoo left a comment

Choose a reason for hiding this comment

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

One minor comment, otherwise LGTM

cirq-core/cirq/ops/common_gates_test.py Outdated Show resolved Hide resolved
@tanujkhattar tanujkhattar added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Sep 21, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Sep 21, 2021
@CirqBot CirqBot merged commit 9f6c359 into quantumlib:master Sep 21, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Sep 21, 2021
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
…lib#4462)

`CX` and `CCX` gates currently print the exponent on the bottom most qubit in the circuit diagram. This PR modifies this behavior to always draw the exponent on the target qubit, which is also the expected behavior for other `ControlledOperations`. This came up in discussions on quantumlib#4167 (comment)

Note that behavior of `CZ` and `CCZ` is left unchanged, i.e. draws exponent on the bottom most qubit, since these gates are symmetrical across all applied qubits. 

BREAKING CHANGE: Tests depending upon diagrams of `CX` and `CCX` can now fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE For pull requests that are important to mention in release notes. cla: yes Makes googlebot stop complaining. size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants