-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support even powers of SWAP gate in CliffordSimulator #3661
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
Conversation
Part of #2423 |
cirq/ops/swap_gates.py
Outdated
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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be ActOnCliffordTableauArgs
Friendly ping! |
#3659 adds support for odd powers