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
Elliptic curve cardinality sometimes Rational with bad consequences for efficiency #2659
Comments
Attachment: 9029.patch.gz |
Attachment: 2659-ec-cardinality.patch.gz |
comment:3
The attached is (I believe) a simpler solution to the issue, after applying the patches for #2653 it is as fast as forceably casting everything to be an integer. There is other stuff in |
comment:4
If Robert's patch quite certainly always results in the cached order being Integer then I am happy to remove the casts from my patch. He is right to observe that I slipped in a second tweak in my patch, which I did while investigating the example cited. Although that tweak is desirable, it reveals that some more thought needs to be put in to deciding the exact strategy to carry out in determining the group order, group structure and individual point orders, since they are all very interrelated. That really needs to be thought through. I also have waiting: a patch for abelian_group() which sppeds up the place where linear_relation() is called; and some more code for the cases j=0 and j=1728 (for characteristics other than 2 and 3). I had been planning to keep drip-feeding these in as I have time to code and test them, rather than going for another big bang. |
Attachment: 9122.patch.gz |
comment:5
Attachment: 9123.patch.gz Despite the patch at #2653 making sure that the trace of Frobenius is always Integer and not Rational, the trace (and hence the cardinality) still sometimes ended up as Rational. 9122.patch followed by 9123.patch sorts this out, and also tidies up the handling of the exceptional cases where Frobenius is actually an Integer and the Frobenius Order is Z. With added doctests. NB The handling of cardinality in case j=0 and j=1728 is still incomplete but will be patched separately. |
comment:6
Only apply 9123.patch. The changes in 9122.patch are in #210. |
comment:8
Merged in Sage 3.0.alpha1 |
Some of the code for computing the cardinality of an elliptic curve over a non-prime finite field manages to cache a value of type Rational instead of Integer. [This is caused by norms from orders being of type Rational -- see #2653.]
As a consequence the code for computing orders of points can fail to make use of the cached group order which sloes it down a lot (it has to use bsgs).
Example: before patching (2.11.alpha1)
After patching:
-- all very fast.
Attached patch should apply to 2.11.alpha1.
Component: algebraic geometry
Issue created by migration from https://trac.sagemath.org/ticket/2659
The text was updated successfully, but these errors were encountered: