Skip to content

Allow on_each for multi-qubit gates #4281

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

Merged
merged 8 commits into from
Jul 9, 2021
Merged

Conversation

daxfohl
Copy link
Collaborator

@daxfohl daxfohl commented Jul 2, 2021

Adds on_each support to the SupportsOnEachGate mixin for multi-qubit gates.

The handling here is not as flexible as for single-qubit gates, which allows any tree of gates and applies them depth-first. This allows the following two options for multi-qubit gates:

A: varargs form gate.on_each([q1, q2], [q3, q4])
B: explicit form gate.on_each([[q1, q2], [q3, q4]])

Discussion here, #4034 (comment). Part of #4236.

@daxfohl daxfohl requested review from cduck, vtomole and a team as code owners July 2, 2021 06:05
@daxfohl daxfohl requested a review from tanujkhattar July 2, 2021 06:05
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jul 2, 2021
@daxfohl
Copy link
Collaborator Author

daxfohl commented Jul 2, 2021

@mpharrigan @maffoo Here's the first part of #4236.

@balopat balopat requested review from maffoo and removed request for tanujkhattar July 2, 2021 13:12
@balopat balopat requested a review from mpharrigan July 2, 2021 13:12
@mpharrigan
Copy link
Collaborator

Can you provide a more detailed PR description that doesn't require the context of the previous PR to find the issue?

Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

The splitting of the PRs makes this super clear; thanks!

Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

LGTM. @maffoo are you happy?

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.

LGTM

@mpharrigan mpharrigan added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 8, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 8, 2021
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 8, 2021

Automerge cancelled: A required status check is not present.

Missing statuses: ['Changed files test', 'Lint check']

@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 Jul 8, 2021
@daxfohl
Copy link
Collaborator Author

daxfohl commented Jul 9, 2021

Looks like merge got canceled somehow. Can you try again?

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 9, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 9, 2021
@CirqBot CirqBot merged commit 4ec906d into quantumlib:master Jul 9, 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 Jul 9, 2021
@daxfohl daxfohl deleted the oneach_multi branch July 9, 2021 01:12
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Adds on_each support to the SupportsOnEachGate mixin for multi-qubit gates.

The handling here is not as flexible as for single-qubit gates, which allows any tree of gates and applies them depth-first. This allows the following two options for multi-qubit gates:

```
A: varargs form gate.on_each([q1, q2], [q3, q4])
B: explicit form gate.on_each([[q1, q2], [q3, q4]])
```


Discussion here, quantumlib#4034 (comment). Part of quantumlib#4236.
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
Adds on_each support to the SupportsOnEachGate mixin for multi-qubit gates.

The handling here is not as flexible as for single-qubit gates, which allows any tree of gates and applies them depth-first. This allows the following two options for multi-qubit gates:

```
A: varargs form gate.on_each([q1, q2], [q3, q4])
B: explicit form gate.on_each([[q1, q2], [q3, q4]])
```


Discussion here, quantumlib#4034 (comment). Part of quantumlib#4236.
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.

5 participants