-
Notifications
You must be signed in to change notification settings - Fork 82
create DirtyOutOfPlaceMontgomeryModMul #1395
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
Conversation
mpharrigan
left a comment
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.
see comments
| target += Tm | ||
| target >>= self.window_size | ||
| qrom_indices = (qrom_indices << self.window_size) | m | ||
| return target, qrom_indices |
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.
this is now duplicate code, right? See my other comment about how we can make the classical action more readable / useful
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.
no .. this is part of the classical action function for DirtyOutOfPlaceMontgomeryModMul
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.
this code is nearly identical to SingleWindowModMul.on_classical_vals. Can you explain the distinction (if any) between the two, preferably in code 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.
the main difference is that SingleWindowModMul.on_classical_vals operates on bitarrays. this methods operates on ints.
added a comment.
9d731ff to
9a99dcc
Compare
mpharrigan
left a comment
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.
can you please address my remaining new comments, then lgtm
Originall created in #1371. I had to recreate the PR because of issues with my clone of Qualtran.
I addressed the comments on the original PR and switched from QROM to QROAMClean which leads to a better Toffoli complexity than in table 8 in Litinski https://arxiv.org/abs/2306.08585.
This implementation follows appendix C4 in Gouzien https://arxiv.org/abs/2302.06639 and has Toffoli complexity of$2.25n^2+8.25n-1$ which is better than the $2.25n^2+9n$ in table 8 in Litinski https://arxiv.org/abs/2306.08585