-
Notifications
You must be signed in to change notification settings - Fork 29
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
Generalize concept of removing OpTypes #624
Conversation
For some reason some other tests fail, not sure why. Also, probably I don't need the functionality any more, so feel free to delete the PR |
Just from a Quick Look: The main reason for the tests failing is that the previous identity removal would also remove (multi-)controlled identities, while your version only removes single-qubit identities without controls. In general, I'd be in favour of getting this merged. It seems like a useful generalisation. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #624 +/- ##
=====================================
Coverage 91.6% 91.6%
=====================================
Files 148 148
Lines 14731 14736 +5
Branches 2365 2365
=====================================
+ Hits 13499 13504 +5
Misses 1232 1232
|
Now it should work. Also: I wrote a comment on the compound operations. Please remove it if it looks fine. |
Signed-off-by: burgholzer <[email protected]>
It doesn't work for nested compound operations, but neither did the original implementation. Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the adaptation. I just pushed some small changes. Most notably, switched to unordered_set
, which is a hash set and, thus, has fast membership testing (O(1)
on average) compared to set
(O(log n)
). Not that it makes that much of a difference here, but I guess it's still desirable to use the most appropriate data types when easily possible.
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
Description
To not only remove Identities but also other Operations I wrote a function that generalizes that concept and allows one to remove arbitrary operation types.
Checklist: