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

Add ParallelGate and deprecate ParallelGateOperation #4398

Merged
merged 14 commits into from
Aug 20, 2021

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented Aug 10, 2021

This PR deprecates ParallelGateOperation in favor of a new ParallelGate which should be instead. See #4358 for more details.

This PR also adds support for ParallleGate in neutral atoms and pasqal devices, where currently ParallelGateOperation is used.

The uses of ParallelGateOperation will be removed later during deprecation.

@tanujkhattar tanujkhattar requested review from cduck, vtomole and a team as code owners August 10, 2021 03:23
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Aug 10, 2021
@tanujkhattar tanujkhattar marked this pull request as draft August 10, 2021 04:29
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.

Just a few minor comments.

cirq-core/cirq/neutral_atoms/neutral_atom_devices_test.py Outdated Show resolved Hide resolved
cirq-core/cirq/neutral_atoms/neutral_atom_devices_test.py Outdated Show resolved Hide resolved

@pytest.mark.parametrize(
'gate, num_copies, qubits',
(
Copy link
Contributor

Choose a reason for hiding this comment

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

turbo nit: I would suggest using list for the list of parametrization cases, since it's homogeneous, unlike the tuples for each case. Applies in several places below, too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just to confirm, you mean replacing the outermost "tuple of tuples" with a "list of tuples", i.e.

@pytest.mark.parametrize(
    'gate, num_copies, qubits',
    [ # List instead of tuple
        (cirq.SingleQubitGate(), 2, cirq.LineQubit.range(2)),
        (cirq.X ** 0.5, 4, cirq.LineQubit.range(4)),
    ]
)

cirq-core/cirq/ops/parallel_gate.py Outdated Show resolved Hide resolved
cirq-core/cirq/ops/parallel_gate.py Outdated Show resolved Hide resolved
cirq-core/cirq/ops/parallel_gate.py Outdated Show resolved Hide resolved
cirq-core/cirq/ops/parallel_gate.py Outdated Show resolved Hide resolved
cirq-core/cirq/ops/parallel_gate_test.py Outdated Show resolved Hide resolved
cirq-core/cirq/neutral_atoms/neutral_atom_devices.py Outdated Show resolved Hide resolved
@tanujkhattar tanujkhattar marked this pull request as ready for review August 11, 2021 17:07
CirqBot pushed a commit that referenced this pull request Aug 11, 2021
…#4411)

I had to deprecate a serializable value in #4398 and couldn't find documentation around how to do it. This PR adds the relevant documentation.
@CirqBot CirqBot added size: XL lines changed >1000 size: L 250< lines changed <1000 and removed size: XL lines changed >1000 labels Aug 12, 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.

Minor comments, then LGTM

cirq-pasqal/cirq_pasqal/pasqal_device.py Show resolved Hide resolved
cirq-core/cirq/neutral_atoms/neutral_atom_devices.py Outdated Show resolved Hide resolved
@tanujkhattar tanujkhattar added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Aug 20, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Aug 20, 2021
@CirqBot
Copy link
Collaborator

CirqBot commented Aug 20, 2021

Automerge cancelled: A status check is failing.

@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 Aug 20, 2021
@tanujkhattar tanujkhattar added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Aug 20, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Aug 20, 2021
@CirqBot CirqBot merged commit 11f751f into quantumlib:master Aug 20, 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 Aug 20, 2021
@tanujkhattar tanujkhattar deleted the parallel_gate branch August 20, 2021 18:54
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
…quantumlib#4411)

I had to deprecate a serializable value in quantumlib#4398 and couldn't find documentation around how to do it. This PR adds the relevant documentation.
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
This PR deprecates `ParallelGateOperation` in favor of a new `ParallelGate` which should be instead. See quantumlib#4358 for more details. 

This PR also adds support for `ParallleGate` in neutral atoms and pasqal devices, where currently `ParallelGateOperation` is used. 

The uses of `ParallelGateOperation` will be removed later during deprecation.
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. size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create ParallelGate which should be the underlying gate for ParallelGateOperation
3 participants