Skip to content

Migrate the resolve_gate decomposition methods to each gate class #266

@BoxiLi

Description

@BoxiLi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions