-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 explicit _act_on_
function for SingleQubitCliffordGate
#5256
Comments
Quoting Orion from Cirq Sync: @daxfohl is doing "something" with act on args to make it cleaner and this looks related to his stuff. |
I removed everywhere where the gates had special simulator-specific handling in their act_on implementation, basically establishing a convention that simulators were a layer on top of gates, not vice-versa. This was mostly done in #4748. However IIUC these gates are targeted specifically to the Tableau sampler, and not be used as general-purpose gates. So it makes sense here to allow these gates to reference the Tableau directly in their act_on implementation. In fact it's a great example of when this pattern can be used, to create a special gate type specific to a simulator, without having to modify the simulator code itself. The alternative would be to add some abstract That said, it seems like overkill and I think the act_on implementation is cleaner. |
@BichengYing is something like https://github.com/quantumlib/Cirq/compare/main...daxfohl:clifford-acton?expand=1 what you're looking for? If so, I can open a PR. |
Is your feature request related to a use case or problem? Please describe.
No.
Describe the solution you'd like
The underlying data structure of SingleQubitCliffordGate is Clifford Tableau now but we don't have explicit
_act_on_
for it.By now, the effect of SingleQubitCliffordGate applying to ActOnCliffordTableauArgs implicit works through the decomposition and act_on function of some basic gates, like X, Y, Z, H, etc. But it can be directly applied with underlying Tableau without calling decomposition.
As for ActOnStabilizerCHFormArgs, I don't know if there is a way to do it through Tableau directly. We always can make that function as NotImplemented for CH_Form and fall back to old approach.
[optional] Additional context (e.g. screenshots)
See #5069 for the context.
What is the urgency from your perspective for this issue? Is it blocking important work?
P2 - we should do it in the next couple of quarters
The text was updated successfully, but these errors were encountered: