Skip to content
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

What about non-default decompose? #842

Closed
kevinsung opened this issue Aug 9, 2018 · 2 comments
Closed

What about non-default decompose? #842

kevinsung opened this issue Aug 9, 2018 · 2 comments

Comments

@kevinsung
Copy link
Collaborator

kevinsung commented Aug 9, 2018

Presumably, CompositeGate implements default_decompose instead of simply decompose because other decomposition methods could be added. What's the plan/intended usage pattern?

I have a situation where the decomposition could depend on the state that it is applied to. In particular, if you know that the gate is being applied to a computational basis state then there is a smarter decomposition than the default one. So I propose adding a method that takes a computational basis state as a parameter and outputs a decomposition that depends on it. Maybe we can call that one decompose?

Maybe I'm trying to be too general and I should just implement this method in my own gate?

@Strilanc
Copy link
Contributor

Strilanc commented Aug 9, 2018

I think default_decompose should stick pretty strictly to "here's how you get into (or closer to) 1 and 2 qubit gates with knowable matrices". This would be a separate thing.

You might want a different form of the gate, like ComputationalBasisBla?

It seems like the number of possibly-relevant details for decomposition is unlimited, and making a list of all of them in an args object is bound to be over-complicated.

@kevinsung
Copy link
Collaborator Author

Okay I made an issue to have a more specific discussion: quantumlib/OpenFermion-Cirq#252.

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

2 participants