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

Migrate the resolve_gate decomposition methods to each gate class #266

Open
BoxiLi opened this issue Jan 14, 2025 · 0 comments
Open

Migrate the resolve_gate decomposition methods to each gate class #266

BoxiLi opened this issue Jan 14, 2025 · 0 comments

Comments

@BoxiLi
Copy link
Member

BoxiLi commented Jan 14, 2025

Currently, the method to decomposition gates to native gates (iSWAP, CNOT, SWAP) is hosted under https://github.com/qutip/qutip-qip/blob/master/src/qutip_qip/circuit/_decompose.py and linked together through a method resolve_gate. This makes it very hard to add new methods, e.g. decomposition of MS gate to CNOT.

The propose is to move those methods to the corresponding gate class, and then have a general function that automatically finds the decomposition chain e.g., (MS -> iSWAP) or if not available (MS->CNOT->iSWAP). The result does not have to be optimal but it should be very flexible. Adding a new decomposition method can be done within the gate class. This also makes adding new gates much easier.

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

1 participant