-
Notifications
You must be signed in to change notification settings - Fork 28
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
Optimization by self-annihilating sequences #37
Comments
@DevelopDaily Absolutely it would be nice to have this optimization (and others)! Curiously, I thought we already had something that would do this in
Thanks for pointing this out! In general we're always looking to get more optimizations into |
Indeed, I'm glad you guys are doing research constantly in this area. I hope Since
|
I use two test cases to illustrate an issue.
Case 1 - cx gates
After
staq
with optimization:The cx gates have been cancelled nicely.
Case 2 - ccx gates
After
staq
with optimization:The ccx gates should also cancel each other out, shouldn't they?
I read an old article, which may not be directly related to what the
staq
wants to achieve. Nevertheless, the authors introduced an interesting idea of removing self-annihilating sequences. I am wondering ifstaq
could borrow the idea and repurpose it to optimize similar sequences forstaq
applications.In the classical world, a decent modern IDE can use static analysis to identify a lot of redundant code, dead code, suspicious code, no-op blocks, obvious stupidity, etc., before the complier is run. Do you think if
staq
can introduce a pass to target those usual suspects as well, especially the self-annihilating sequences? In the long run, that may even help the IDE vendors.The text was updated successfully, but these errors were encountered: