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

Need a better compilation for swap_to_sqrt_iswap #2635

Closed
mpharrigan opened this issue Dec 11, 2019 · 0 comments · Fixed by #2682
Closed

Need a better compilation for swap_to_sqrt_iswap #2635

mpharrigan opened this issue Dec 11, 2019 · 0 comments · Fixed by #2682
Assignees

Comments

@mpharrigan
Copy link
Collaborator

Right now it uses 4 sqrtiswaps to support arbitrary angle. For a plain ol' SWAP (common for routing qubits around) you should be able to get away with 3

        yield cirq.Y(a) ** 0.5
        yield cirq.Y(b) ** 0.5
        yield SQRT_ISWAP(a, b)
        yield cirq.Y(a) ** -0.5
        yield cirq.Y(b) ** -0.5
        yield SQRT_ISWAP(a, b)
        yield cirq.X(a) ** -0.5
        yield cirq.X(b) ** -0.5
        yield SQRT_ISWAP(a, b)
        yield cirq.X(a) ** 0.5
        yield cirq.X(b) ** 0.5

should do it.

cc @dstrain115 @john6060 @Strilanc

@dstrain115 dstrain115 self-assigned this Jan 15, 2020
dstrain115 added a commit to dstrain115/Cirq-1 that referenced this issue Jan 15, 2020
- Shortens length from 13 moments to 7 moments.
- Decomposition courtesy of mpharrigan.

Fixes quantumlib#2635
dstrain115 added a commit that referenced this issue Jan 16, 2020
* Better decomposition of SWAP into ISWAP ** 0.5

- Shortens length from 13 moments to 7 moments.
- Decomposition courtesy of @john6060 via @mpharrigan .

Fixes #2635
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 a pull request may close this issue.

2 participants