-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Schoof's Algorithm #19071
base: master
Are you sure you want to change the base?
Schoof's Algorithm #19071
Conversation
abhinav-anand-addepar
commented
Apr 4, 2020
- ntheory
- Implement schoof's algorithm
✅ Hi, I am the SymPy bot (v158). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
|
Codecov Report
@@ Coverage Diff @@
## master #19071 +/- ##
=============================================
+ Coverage 75.730% 75.819% +0.088%
=============================================
Files 647 650 +3
Lines 168733 169202 +469
Branches 39767 39873 +106
=============================================
+ Hits 127783 128288 +505
+ Misses 35389 35338 -51
- Partials 5561 5576 +15 |
short_com["p9"] = exp(y2, p, fl) | ||
short_com["alpha2"] = alpha**2 % fl | ||
short_com["beta2"] = beta**2 % fl | ||
short_com["p5p4"] = short_com["p4"]*short_com["p5"] % fl |
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.
It think it could be cleaner to just use variables for these, and pass them through to the various functions as parameters.
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.
I will make the changes.
References | ||
========== | ||
|
||
[1] http://jjmcgee.asp.radford.edu/SchoofsAlgorithm06.pdf |
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.
Is the code here all based on this reference or are there other references too? If the code here is based on some pseudocode from a paper, that is fine, but you should indicate that so that it is clear where we can look to understand the code.
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.
Yes this is based on the pseudocode from the referenced paper.
I think this needs a lot more tests. We should aim for full coverage of the code, particularly all the different |
from .factor_ import divisors | ||
from .residue_ntheory import polynomial_congruence | ||
|
||
|
||
|
||
|
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.
X = symbols('X') | ||
Y = symbols('Y') | ||
div = {} | ||
if domain != QQ: |
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.
if domain != QQ: | |
if domain is not QQ: |
QQ
should be a unique object.
Division Polynomials of an elliptic curve over finite fields. | ||
|
||
""" | ||
from sympy import simplify |
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.
from sympy import simplify | |
from sympy import _simplify |
l = 1 | ||
i = 1 | ||
p = self.modulus | ||
X = self.X | ||
Y = self.Y | ||
L = [] | ||
m = 1 | ||
f2 = {} | ||
y2 = poly(X**3 + self._a4*X+self._a6, X, modulus=p) |
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.
l = 1 | |
i = 1 | |
p = self.modulus | |
X = self.X | |
Y = self.Y | |
L = [] | |
m = 1 | |
f2 = {} | |
y2 = poly(X**3 + self._a4*X+self._a6, X, modulus=p) | |
l, i, m = 1, 1, 1 | |
p, X, Y = self.modulus, self.X, self.Y | |
L, f2 = [], {} | |
y2 = poly(X**3 + self._a4*X+self._a6, X, modulus=p) |
p1 = short_com["p3"] | ||
p1 = poly(X, X, modulus=p) - p1 |
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.
p1 = short_com["p3"] | |
p1 = poly(X, X, modulus=p) - p1 | |
p1 = poly(X, X, modulus=p) - short_com["p3"] |
return p_16 % f(l) | ||
|
||
|
||
def f(k): |
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.
A more descriptive function name?
@abh2k Was this PR a part of your GSoC project? |
No. |