-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Constructing controlled gates #389
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
Comments
I'm unsure that this functionality makes sense in the context of near-term hardware. Not because it wouldn't be useful, but because I think this particular transformation needs to be worked into an algorithm from the top with an eye towards locality instead of on an operation-by-operation level in order for it to have any hope of fitting. |
Strong +1, IMO this objection prioritizes ideology over practicality / functionality. Converting U to C-U is generic enough that I'd expect users to want it even if it isn't really optimized (I can't speak for @kevinsung but I would find it useful if it wasn't optimized at all, or even if the gate decompositions weren't available). There are some extensions that I imagine would be especially useful - e.g. a way of marking some gates as not needing to be controlled - but I really think the basic functionality would be immediately valuable. |
How will this functionality play nice with locality restrictions on qubits? For example, how will the controllification get the control qubit next to the target qubits that it has to control? |
Basically the solution I came up with here is to allow the user to declare a controlled gate, but without a built-in way to decompose it into sub-operations. |
There is a similar issue at open at OpenFermion-Cirq. I'm wondering whether there are plans to support a way to automatically construct controlled versions of existing gates. That sounds like something users would definitely want to use. It would be cool if controlled versions of gates that can run on the simulator could also run on the simulator.
The text was updated successfully, but these errors were encountered: