-
Notifications
You must be signed in to change notification settings - Fork 981
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
Can we use CircuitOperations to replace composite gates like QFT, SwapNetwork etc. ? #4338
Comments
I wholeheartedly support this change. IMO, the correct way to implement this is to convert existing composite gates to implementations of |
#4309 would be affected too. I have no strong opinion on the proposal but will follow whatever is decided. Just adding the note for context. |
Discussion on Cirq Sync:
|
Playing devil's advocate here, but for common patterns like QFT, it may be that some devices have specific implementations of those things optimized for those devices. If we convert them to generic subcircuits, then we lose the ability to allow these optimizations. We can hack them back in with tags or something, but that seems like a design flaw. |
As discussed in The drawbacks of each of the two possible ways for using circuit operations to replace composite gates are as follows: Way-1: Factory method returning circuit op for composite gates.Bad because it’s hard to determine whether a given circuit operation represents a QFT / Boolean hamiltonian gate etc. Way-2: Subclass inheriting from circuit operation.Comes with too much unnecessary baggage from circuit operation (eg: replace, repeat etc.) cc @95-martin-orion I'm closing this now. |
Gate Decomposition relationships are confusing (#930) and needs to be organized (#3242). The following diagram, generated via Visualizing Gate Relationships Colab, describes (best-effort) the current decompose relationships between gates.
One of the primary use cases of
cirq.decompose
protocol is to define composite gates likeQuantumFourierTransformGate
,SwapNetworkGate
etc. Such composite gates / operations fit better under the category of usefulCircuitOperations
rather than fundamental basic gates.This issue is to discuss whether we can replace these gates with
CircuitOperations
and how should this be done?cc @95-martin-orion
The text was updated successfully, but these errors were encountered: