Skip to content

Conversation

@viathor
Copy link
Collaborator

@viathor viathor commented Apr 29, 2020

The PR makes layout and capitalization of swap-like gates consistent.

Before:

In [3]: cirq.Circuit(cirq.PhasedISwapPowGate().on(q0, q1), cirq.ISwapPowGate().on(q0, q1), cirq.FSimGate(0, 0).on(q0, q1))
Out[3]: 
0: ───PhISwap(0.25)───iSwap───fsim(0, 0)───
      │               │       │
1: ───PhISwap(0.25)───iSwap───#2───────────

After:

n [3]: cirq.Circuit(cirq.PhasedISwapPowGate().on(q0, q1), cirq.ISwapPowGate().on(q0, q1), cirq.FSimGate(0, 0).on(q0, q1))
Out[3]: 
0: ───PhISwap(0.25)───ISwap───FSim(0, 0)───
      │               │       │
1: ───PhISwap(0.25)───ISwap───FSim(0, 0)───

@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Apr 29, 2020
@viathor viathor requested a review from Strilanc April 29, 2020 00:17
@viathor
Copy link
Collaborator Author

viathor commented Apr 29, 2020

This also changes "swap" to "Swap" when unicode isn't being used.

@viathor viathor requested review from dabacon and kevinsung April 29, 2020 18:05
Copy link
Contributor

@Strilanc Strilanc left a comment

Choose a reason for hiding this comment

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

i refers to sqrt(-1), I refers to Identity. It really is an iSwap in my opinion. Not sure if the consistency benefits are worth it in the diagrams.. Opinions? It's certainly a bit odd that in the code it gets capitalized if it doesnt in the diagrams.

@viathor
Copy link
Collaborator Author

viathor commented May 2, 2020

Reverted back to iSwap with the small i. PTAL.

@viathor viathor requested a review from Strilanc May 2, 2020 01:15
@viathor
Copy link
Collaborator Author

viathor commented May 5, 2020

PTAL

@viathor viathor added the Ready for Re-Review For when reviewers take their time. label May 5, 2020
@viathor viathor merged commit 32c769f into quantumlib:master May 8, 2020
@viathor viathor deleted the consistent-rendering-for-swap-like-gates branch May 8, 2020 14:07
@viathor viathor removed the Ready for Re-Review For when reviewers take their time. label May 8, 2020
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 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.

3 participants