-
Notifications
You must be signed in to change notification settings - Fork 33
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
♻️ Refactor handling of gate matrices and inverses #752
♻️ Refactor handling of gate matrices and inverses #752
Conversation
0c22ab7
to
3d824d7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #752 +/- ##
=======================================
- Coverage 92.2% 91.8% -0.5%
=======================================
Files 126 128 +2
Lines 13832 13857 +25
Branches 2153 2159 +6
=======================================
- Hits 12762 12721 -41
- Misses 1070 1136 +66
|
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.
Hey 👋
Many thanks for starting to work on this! Great to see someone taking this on!
I really like the solution with the flags for indicating the inverse type of a gate and indicating whether a gate is diagonal! Very elegant.
I added some inline comments that are mostlly minor except one bigger one that might trigger some further refactorings. However, I believe these might be worth it.
One thing on top of all of that: It would be great if you could address the clang-tidy complaints.
Typically these are posted as PR comments, but that feature does not work for PRs from forks. You can still see the warnings either in the check summary here: https://github.com/cda-tum/mqt-core/pull/752/checks or when looking through the "Files Changed" tab on GitHub.
Thanks again and let me know if anything is unclear!
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.
Oops, clicked the wrong button 🙃
4632650
to
165f26b
Compare
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 iteration here. This is looking great already and I like where this is heading.
I went through everything in detail again and added my feedback inline. Hope that makes sense. Please let me know if it doesn't!
165f26b
to
337ba29
Compare
I tried to implement your thoughts as good as possible. One change necessary to transition the test to retrieve the DD via the I hope this is a further improvement to the previous draft. |
I am also trying to understand why one CI build fails, but I don't see how my changes produced this error. Would you happen to have an idea, or would you be able to help me with that? |
That failure is unrelated to your changes and either due to an update in pandas or an update in |
Turns out it's something else entirely. It's due to |
Okay, thanks. Then, I will rebase onto the new main so that the test passes again. Do you have any further change requests regarding my pull request? |
Sounds good. |
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 again for your work on this!
I really like the way this is going and how it simplifies certain aspects in the library.
I feel we are really close to the finish line here. There are a couple of errors that snuck their way into the last couple of commits and some further suggestions for getting the implementation even cleaner and more performant.
I am fairly optimistic that this will be the last round of iteration.
@Joshy-R gentle ping just in case this might have flown under the radar. A couple of bits and pieces changed over the last couple of weeks that lead to merge conflicts here. However, these should be easy to resolve (hopefully). |
No worries, I will take a look at this over the weekend and implement the requested changes. |
refractor functions to receive Operation as const referece instead of pointer refractor getStandardOperationDD to receive targets as vector, remove overload that takes two targets and inline helper function as it now only has a single use
661f110
to
b15b5b8
Compare
b15b5b8
to
76468f5
Compare
I have implemented most of the requested changes (see comment above). macos-14 is failing due to some caches. Retriggering the pipeline will likely fix the issue. Please let me know if you would like me to make any changes. |
Thanks for your work on this. I'll try to have a look at your changes later today or early tomorrow. |
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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 another round of changes.
I just went through the PR and made some final adjustments.
I also added the extensive-cpp-ci
label, which kicks off a whole set of CI runs under different OSes and compilers, and checks whether everything still works.
Depending on how this goes, this is ready to go in 🚀
Many thanks again for your contribution. Great work. 🙌🏼
Signed-off-by: burgholzer <burgholzer@me.com>
Just pushed another small commit (c595265), where the main aim was to get some coverage for the lines that were reported uncovered. This has led me to an intersting observation on this PR:
which is quite impressive for such a considerably small change ⚡ |
Our coverage collection certainly does not like const static variables in functions. |
Description
These commits change how matrices are created from an OpType that reduces the number of switch statements necessary.
The downside of this approach is that some functions can be called with arguments that do not affect the returned value. As the user never calls these functions, I see this as acceptable.
I also removed the CX_MAT and CZ_MAT, as they are only used in tests and do not occur in any other repository.
Fixes #484
Checklist:
I have not squashed the commits to make them easier to review, but I can squash them if desired.