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

Support even powers of SWAP gate in CliffordSimulator #3661

Merged
merged 6 commits into from Feb 1, 2021

Conversation

smitsanghavi
Copy link
Collaborator

#3659 adds support for odd powers

@smitsanghavi smitsanghavi requested review from cduck, vtomole and a team as code owners January 10, 2021 07:40
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jan 10, 2021
@smitsanghavi
Copy link
Collaborator Author

Part of #2423

args.axes = args.axes[::-1]
protocols.act_on(ops.CNOT, args)
if isinstance(args, (sim.ActOnStabilizerCHFormArgs, sim.ActOnCliffordTableauArgs)):
if not protocols.has_stabilizer_effect(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Specialize this instead of going through the general method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When you say specialize, do you mean to call the private method instead of protocol or inlining as you mentioned in the below comment?

if isinstance(args, (sim.ActOnStabilizerCHFormArgs, sim.ActOnCliffordTableauArgs)):
if not protocols.has_stabilizer_effect(self):
return NotImplemented
if isinstance(args, sim.ActOnStabilizerCHFormArgs):
Copy link
Contributor

Choose a reason for hiding this comment

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

We're already in a block that has done this check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It could be ActOnCliffordTableauArgs

cirq/ops/swap_gates.py Outdated Show resolved Hide resolved
@smitsanghavi smitsanghavi added the Ready for Re-Review For when reviewers take their time. label Jan 15, 2021
@smitsanghavi
Copy link
Collaborator Author

Friendly ping!

@Strilanc Strilanc added automerge Tells CirqBot to sync and merge this PR. (If it's running.) and removed Ready for Re-Review For when reviewers take their time. labels Feb 1, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Feb 1, 2021
@CirqBot CirqBot merged commit d8598dc into quantumlib:master Feb 1, 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 Feb 1, 2021
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.

None yet

3 participants