-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added Conway polynomials to the database ... #5
Conversation
... for primes in the range [65537, 109987] and degree (1,2,3) to fix an inconsistency issue in Sage, which currently disrupts the generation of certain finite fields, such as GF((65537, 12)). The polynomials were computed using GAP. Consistency check: There are 3911 primes in the given range, and 3*3911 = 11733 = 47092 - 35359 added lines in the file
Hi, thanks for the ping. The file He's a GAP contributor, so the first think you might try is contacting him to include these in the database? We'd have to make a new release of conway-polynomials afterwards, but that's no big deal. |
I wrote him a mail with the updated |
Sounds good. If he doesn't want to add them for some reason I'm sure we can work out some other way to include them in this package. Probably just in a separate file -- the reason we include our own "pristine" copy of |
Frank Lübeck has checked the new entries with GAP and has updated the database on his website. I guess you can merge this PR or close it and take the file from the website, as you prefer. Also there is a consistency check of the database length in |
If you don't mind, could you open a PR for the length check in sage, but allow it to support both the old and new versions? That way no coordination is needed between the conway-polynomials release and sage. |
I just pushed v0.10 with the new database, it should appear on pypi in a minute. I grabbed the new database from Frank's site but gave you credit in the commit message and |
With sagemath 10.4.beta5 I get:
|
The database test is fixed by sagemath/sage#37949. Not sure about the others yet. |
The others are probably related to the exact results given in tests involving Update: The hardcoded point |
Same issue for the Tate pairing test; these can both be fixed by instead choosing
which results in
and
in the respective tests. Update: The above updates to the tests of Update 2: Ideas to avoid coordination:
|
Neither of those sound too crazy to me. I think you should do what you think is right and ping @JohnCremona, @GiacomoPope, @yyyyx4, or someone else who has worked on that file recently for a rubber stamp. I wound up maintaining conway-polynomials because I like to create python boilerplate, not because I know anything about elliptic curves. |
Anything that makes the tests independent of the FF representation is good. But since the tests are also examples, there's some advantage on showing explicit elements. Maybe just hardcode the description of GF(65537^2), e.g.: --- a/src/sage/schemes/elliptic_curves/ell_point.py
+++ b/src/sage/schemes/elliptic_curves/ell_point.py
@@ -1836,9 +1836,10 @@ class EllipticCurvePoint_field(SchemeMorphism_point_abelian_variety_field):
Check that the original Sage implementation still works::
sage: # needs sage.rings.finite_rings
- sage: GF(65537^2).inject_variables()
+ sage: F = GF(65537^2, modulus=[3, 46810, 1], name='z2')
+ sage: F.inject_variables()
Defining z2
- sage: E = EllipticCurve(GF(65537^2), [0,1])
+ sage: E = EllipticCurve(F, [0,1])
sage: P = E(22, 28891)
sage: Q = E(-93, 40438*z2 + 31573)
sage: P.weil_pairing(Q, 7282, algorithm='sage')
@@ -2052,9 +2053,10 @@ class EllipticCurvePoint_field(SchemeMorphism_point_abelian_variety_field):
Check that the PARI output matches the original Sage implementation::
sage: # needs sage.rings.finite_rings
- sage: GF(65537^2).inject_variables()
+ sage: F = GF(65537^2, modulus=[3, 46810, 1], name='z2')
+ sage: F.inject_variables()
Defining z2
- sage: E = EllipticCurve(GF(65537^2), [0,1])
+ sage: E = EllipticCurve(F, [0,1])
sage: P = E(22, 28891)
sage: Q = E(-93, 40438*z2 + 31573)
sage: P.tate_pairing(Q, 7282, 2) This is using the old definition, maybe it's preferable to use --- a/src/sage/schemes/elliptic_curves/ell_point.py
+++ b/src/sage/schemes/elliptic_curves/ell_point.py
@@ -1836,13 +1836,14 @@ class EllipticCurvePoint_field(SchemeMorphism_point_abelian_variety_field):
Check that the original Sage implementation still works::
sage: # needs sage.rings.finite_rings
- sage: GF(65537^2).inject_variables()
- Defining z2
- sage: E = EllipticCurve(GF(65537^2), [0,1])
+ sage: F = GF(65537^2, modulus=[3, -1, 1], name='a')
+ sage: F.inject_variables()
+ Defining a
+ sage: E = EllipticCurve(F, [0,1])
sage: P = E(22, 28891)
- sage: Q = E(-93, 40438*z2 + 31573)
+ sage: Q = E(-93, 2728*a + 64173)
sage: P.weil_pairing(Q, 7282, algorithm='sage')
- 19937*z2 + 65384
+ 53278*a + 36700
Passing an unknown ``algorithm=`` argument should fail::
@@ -2052,13 +2053,14 @@ class EllipticCurvePoint_field(SchemeMorphism_point_abelian_variety_field):
Check that the PARI output matches the original Sage implementation::
sage: # needs sage.rings.finite_rings
- sage: GF(65537^2).inject_variables()
- Defining z2
- sage: E = EllipticCurve(GF(65537^2), [0,1])
+ sage: F = GF(65537^2, modulus=[3, -1, 1], name='a')
+ sage: F.inject_variables()
+ Defining a
+ sage: E = EllipticCurve(F, [0,1])
sage: P = E(22, 28891)
- sage: Q = E(-93, 40438*z2 + 31573)
+ sage: Q = E(-93, 2728*a + 64173)
sage: P.tate_pairing(Q, 7282, 2)
- 34585*z2 + 4063
+ 19078*a + 45623
The point ``P (self)`` must have ``n`` torsion::
|
Thanks for the suggestion! I'll move the removed tests to the examples with fixed moduli instead, but for |
Ping received. I am happy with the solutions proposed |
…eparation for database update Motivated by sagemath#35357, the database of Conway polynomials will be enlarged to ensure compatibility in the generation of finite fields (see sagemath/conway-polynomials#5 for details). To prepare for this update, we slightly relax the length check in `sage.databases.conway` to be compatible with both the old and the new version of the database. URL: sagemath#37949 Reported by: Sebastian A. Spindler Reviewer(s): Michael Orlitzky, Sebastian A. Spindler
…or Conway database update As part of the Conway polynomials database update, two tests in `schemes.elliptic_curves.ell_point` caused issues due to their dependency on the precise implementation of the finite field `GF(65537^2)`: - The first test (of `.weil_pairing`) checks whether the Sage implementation still works for an example of fixed `7282`-torsion points - The second test (of `.tate_pairing`) checks whether the new implementation, which uses PARI up to reduction of the pairing, coincides with the old Sage implementation (still used e.g. in SageMathCell, but not available in the current code anymore) To help with the database update, we adapt these tests to not be dependent on the exact minimal polynomial used for finite field generation: - We turn both tests into examples (with fixed moduli) for their respective methods - We modify the test of `.weil_pairing` to check for two randomly chosen `7282`-torsion points whether `algorithm="sage"` and `algorithm="pari"` yield the same result Please let me know if you think other polynomial-independent tests are better suited as replacements. See sagemath/conway-polynomials#5 (especially [comment 10](https://github.com/sagemath/conway- polynomials/pull/5#issuecomment-2101462886) and Update 2 in [comment 11](https://github.com/sagemath/conway- polynomials/pull/5#issuecomment-2101498241)) for more details. CC: @yyyyx4 @GiacomoPope @JohnCremona URL: sagemath#37967 Reported by: Sebastian A. Spindler Reviewer(s):
…eparation for database update Motivated by sagemath#35357, the database of Conway polynomials will be enlarged to ensure compatibility in the generation of finite fields (see sagemath/conway-polynomials#5 for details). To prepare for this update, we slightly relax the length check in `sage.databases.conway` to be compatible with both the old and the new version of the database. URL: sagemath#37949 Reported by: Sebastian A. Spindler Reviewer(s): Michael Orlitzky, Sebastian A. Spindler
…or Conway database update As part of the Conway polynomials database update, two tests in `schemes.elliptic_curves.ell_point` caused issues due to their dependency on the precise implementation of the finite field `GF(65537^2)`: - The first test (of `.weil_pairing`) checks whether the Sage implementation still works for an example of fixed `7282`-torsion points - The second test (of `.tate_pairing`) checks whether the new implementation, which uses PARI up to reduction of the pairing, coincides with the old Sage implementation (still used e.g. in SageMathCell, but not available in the current code anymore) To help with the database update, we adapt these tests to not be dependent on the exact minimal polynomial used for finite field generation: - We turn both tests into examples (with fixed moduli) for their respective methods - We modify the test of `.weil_pairing` to check for two randomly chosen `7282`-torsion points whether `algorithm="sage"` and `algorithm="pari"` yield the same result Please let me know if you think other polynomial-independent tests are better suited as replacements. See sagemath/conway-polynomials#5 (especially [comment 10](https://github.com/sagemath/conway- polynomials/pull/5#issuecomment-2101462886) and Update 2 in [comment 11](https://github.com/sagemath/conway- polynomials/pull/5#issuecomment-2101498241)) for more details. CC: @yyyyx4 @GiacomoPope @JohnCremona URL: sagemath#37967 Reported by: Sebastian A. Spindler Reviewer(s):
…eparation for database update Motivated by sagemath#35357, the database of Conway polynomials will be enlarged to ensure compatibility in the generation of finite fields (see sagemath/conway-polynomials#5 for details). To prepare for this update, we slightly relax the length check in `sage.databases.conway` to be compatible with both the old and the new version of the database. URL: sagemath#37949 Reported by: Sebastian A. Spindler Reviewer(s): Michael Orlitzky, Sebastian A. Spindler
…or Conway database update As part of the Conway polynomials database update, two tests in `schemes.elliptic_curves.ell_point` caused issues due to their dependency on the precise implementation of the finite field `GF(65537^2)`: - The first test (of `.weil_pairing`) checks whether the Sage implementation still works for an example of fixed `7282`-torsion points - The second test (of `.tate_pairing`) checks whether the new implementation, which uses PARI up to reduction of the pairing, coincides with the old Sage implementation (still used e.g. in SageMathCell, but not available in the current code anymore) To help with the database update, we adapt these tests to not be dependent on the exact minimal polynomial used for finite field generation: - We turn both tests into examples (with fixed moduli) for their respective methods - We modify the test of `.weil_pairing` to check for two randomly chosen `7282`-torsion points whether `algorithm="sage"` and `algorithm="pari"` yield the same result Please let me know if you think other polynomial-independent tests are better suited as replacements. See sagemath/conway-polynomials#5 (especially [comment 10](https://github.com/sagemath/conway- polynomials/pull/5#issuecomment-2101462886) and Update 2 in [comment 11](https://github.com/sagemath/conway- polynomials/pull/5#issuecomment-2101498241)) for more details. CC: @yyyyx4 @GiacomoPope @JohnCremona URL: sagemath#37967 Reported by: Sebastian A. Spindler Reviewer(s):
... for primes in the range$[65537, 109987]$ and degrees $(1,2,3)$ to fix an inconsistency issue in Sage, which currently disrupts the generation of certain finite fields, e.g.
GF((65537, 12))
(see sagemath/sage#35357).Note: I believe that only the polynomials of degree$2$ are needed to fix the bug, since the degree $1$ polynomials seem to be computed correctly by the code for pseudo-Conway polynomials in Sage and the degree $3$ polynomials are not related to the issue. I have added all polynomials up to degree $4$ for consistency with previous entries, but if it is preferable to keep the database small, I could also modify the update to only include the polynomials of degree $2$ and $4.$
The polynomials were computed via calls to GAP using the following code:
Since the diff is quite large, here is a consistency check: There are$3911$ primes in the given range, and $3 \cdot 3911 = 11733$ lines were added to the file.
Please let me know