-
Notifications
You must be signed in to change notification settings - Fork 9
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 based on same sequence of Toffoli gates #113
Optimization based on same sequence of Toffoli gates #113
Conversation
… the same sequence of Toffoli gates in order to get transformed to the identity structure.
I think this question is suitable for this PR. We have considered Cube::Vector in many places. However, we don't require a Cube::Vector in the dd synthesis functionality (since path signature emplaced are always unique). Do we add a Cube::Set? By adding this we can also reduce the complexity of the function introduced in the above PR. |
Codecov Report
@@ Coverage Diff @@
## main #113 +/- ##
=======================================
+ Coverage 91.9% 92.2% +0.2%
=======================================
Files 32 32
Lines 2225 2233 +8
=======================================
+ Hits 2045 2059 +14
+ Misses 180 174 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Just went through the code and the corresponding paper. I think I only have minor comments/improvements on the code itself. Those can wait until later. As for the suggestion above: That would actually make a lot of sense. This is sort of similar to what the Reading this, I can only wonder if it would make sense to adopt |
The unordered set stores the signatures in random order right? Does the hash function affect the ordering in the unordered set? What type of hash function would be good for the TruthTable::Cube? just returning the cube.toInterger() be enough? |
It does store the elements as a hash table, so yes, the order is random. However, according to https://cplusplus.com/reference/unordered_set/unordered_set/operators/ the complexity of |
No, there is no such template specialization and it's not that easy to define a hash function for |
No, there is no such template specialization and it's not that easy to define a hash function for std::vector<std::optional>. Technically, you could also opt for using std::set. That should work out of the box, since operator< is defined for Cubes. |
I will go with this then |
…ed on the review comments.
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.
LGTM 👍🏻
Description
This PR adds an addition optimization technique which considers nodes that require the same sequence of Toffoli gates in order to get transformed to the identity structure. Hence, reducing the overall control bits and gate count
Checklist: