-
Notifications
You must be signed in to change notification settings - Fork 34
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
♻️ Eliminate DD terminal nodes #381
Conversation
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
This commit completely eliminates the static DD node terminals and replaces them by using nullptr instead. For one, this eliminates some global static variables. Furthermore, DD terminal nodes are no longer associated with the index -1. This allows changing the qubit index to an unsigned type and unlocks double the number of qubits. Finally, analysis has shown that the DD node size does not increase when using 16 bits for the qubit index. Hence, the package now directly supports up to 65536 qubits. Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #381 +/- ##
=====================================
Coverage 89.0% 89.1%
=====================================
Files 97 97
Lines 11708 11713 +5
Branches 2098 2103 +5
=====================================
+ Hits 10431 10437 +6
+ Misses 1277 1276 -1
|
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Cpp-Linter Report ✔️No problems need attention. Have any feedback or feature suggestions? Share it here. |
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.
Thanks a lot for this effort! The increase in available qubits is really nice.
You correctly point out that decrementing loops that check for >=0
require attention. Please wait a bit before merging so I can make this work correctly in the simulator :)
It took some effort, but the simulator works now :) |
Nice. Thanks for your work on that! |
Description
This PR completely eliminates the static DD node terminals and replaces them by using
nullptr
instead.For one, this eliminates some global static variables.. Yay 😃
Furthermore, DD terminal nodes are no longer associated with the index
-1
. This allows changing the qubit index to an unsigned type and unlocks double the number of qubits (while also allowing to get rid of somestatic_cast
s).Finally, analysis has shown that the DD node size does not increase when using 16 bits for the qubit index (due to alignment). Hence, the package now directly supports up to
65536
qubits 🥳.Note that this, naturally, is a breaking change. Qubit indices are now unsigned and checks for a terminal node should now use the respective functions of the Node classes instead of relying the variable index to be
-1
.Something to look out for: Any decreasing loops that used a Qubit index for iteration and relied on
>=0
stopping conditions have to be revised since they now just wrap around at zero.Checklist: