Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Use ControlledGate instead of having ControlledXXYYGate, etc. #66

Open
kevinsung opened this issue Jun 15, 2018 · 6 comments
Open

Use ControlledGate instead of having ControlledXXYYGate, etc. #66

kevinsung opened this issue Jun 15, 2018 · 6 comments

Comments

@kevinsung
Copy link
Contributor

No description provided.

@kevinsung
Copy link
Contributor Author

Never mind, this wouldn't let me simulate the gates.

@Strilanc
Copy link
Contributor

Yeah, ControlledGate is not particularly "smart". It can make a matrix for you, and that's about it.

@kevinsung kevinsung changed the title Make CXXYY and CYXXY inherit from ControlledGate Use ControlledGate instead of having ControlledXXYYGate, etc. Jul 21, 2018
@kevinsung
Copy link
Contributor Author

This issue can genuinely be resolved once Cirq's simulator is upgraded and can simulate any KnownMatrixGate.

@kevinsung kevinsung reopened this Jul 21, 2018
@kevinsung
Copy link
Contributor Author

Ooh there might still be an advantage to keeping the classes though if we eventually want to define decompositions that respect nearest-neighbor interactions.

@Strilanc
Copy link
Contributor

Strilanc commented Jul 21, 2018

Also they can be simulated twice as fast, since you only need to affect half of the state vector, though this probably works best for qubits that represent areas of memory that are far apart (and of course we would have to implement the optimization in the first place).

@cduck
Copy link
Contributor

cduck commented Jul 23, 2018

They can inherit from ControlledGate and still override default_decompose() later.

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

No branches or pull requests

3 participants