Skip to content

Add missing get_inverse definitions #227

Open
@edyounis

Description

@edyounis

Many gates throughout the library are missing get_inverse and get_inverse_params definitions.

These functions are called when inverting an Operation. This is used to find the inverse of a circuit using natural gate definitions rather than a bunch of DaggerGate wrappers. This allows users to print qasm output easily after inverting a circuit without much manual intervention.

Take a look at the U3Gate for a complete example. The inverse is the same gate but with different parameters. So the get_inverse function returns the same gate (U3Gate), and the get_inverse_params returns the inverted parameters.

There is a catch-all implementation for all gates that defaults to the DaggerGate wrapper, and in many cases, this is not necessary. We should implement these functions for all gates in the library that have simple inverses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions