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

Add missing get_inverse definitions #227

Open
edyounis opened this issue Feb 27, 2024 · 3 comments · May be fixed by #249
Open

Add missing get_inverse definitions #227

edyounis opened this issue Feb 27, 2024 · 3 comments · May be fixed by #249
Labels
feature request New feature or request

Comments

@edyounis
Copy link
Member

edyounis commented Feb 27, 2024

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.

@edyounis edyounis added the feature request New feature or request label Feb 27, 2024
@Youngcius
Copy link

@edyounis would you like to be assigned to this issue? I am glad to try to solve it.

@edyounis
Copy link
Member Author

edyounis commented Jun 1, 2024

Hey I realized I only should have assigned this once completed.

@Youngcius
Copy link

Alright. I made a pull request "add feature get_inverse" just now that might need your review.

@Youngcius Youngcius linked a pull request Jun 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants