Skip to content

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

Closed
kevinsung opened this issue May 9, 2018 · 4 comments
Closed

Constructing controlled gates #389

kevinsung opened this issue May 9, 2018 · 4 comments

Comments

@kevinsung
Copy link
Collaborator

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.

@Strilanc
Copy link
Contributor

Strilanc commented May 9, 2018

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.

@idk3
Copy link

idk3 commented May 9, 2018

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.

@Strilanc
Copy link
Contributor

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?

@Strilanc
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants