You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-37242: Improved algorithm choice for isogeny computation
Improved the logic for algorithm choice in
`EllipticCurve_field.isogeny()`:
- if we have multiple points, `factored` is used;
- if the order is known and composite, `factored` is used;
- if the order is known and (pseudo-)prime, we chose between the
traditional Velù formulae and Velù-sqrt, depending on a parameter; this
parameter may be supplied by the user with the `velu_sqrt_bound`
argument, and if `None` a global parameter is used (see below);
- in all the other cases we fall back to the traditional isogeny
algorithm.
The new `velu_sqrt_bound`:
- can be supplied as a parameter when calling `.isogeny()`;
- if supplied, is recursively passed to all calls to `factored`, such
that each single isogeny computation has the same bound;
- if not supplied, a global value is used instead; this is stored in the
object `_velu_sqrt_bound` from
`sage.schemes.elliptic_curves.hom_velusqrt`, and is initially set to
1000 (due to empirical observations) but can be manually set at runtime
by the user
#sd123
URL: #37242
Reported by: Riccardo Invernizzi
Reviewer(s): Giacomo Pope, grhkm21, Riccardo Invernizzi
subgroup of Elliptic Curve defined by y^2 + x*y = x^3 + x + 2
1311
1339
over Finite Field of size 31
1312
1340
1341
+
Order of the point known and composite::
1342
+
1343
+
sage: E = EllipticCurve(GF(31), [1,0,0,1,2])
1344
+
sage: P = E(26, 4)
1345
+
sage: assert P.order() == 12
1346
+
sage: print(P._order)
1347
+
12
1348
+
sage: E.isogeny(P)
1349
+
Composite morphism of degree 12 = 2^2*3:
1350
+
From: Elliptic Curve defined by y^2 + x*y = x^3 + x + 2 over Finite Field of size 31
1351
+
To: Elliptic Curve defined by y^2 + x*y = x^3 + 26*x + 8 over Finite Field of size 31
1352
+
1353
+
``kernel`` is a list of points::
1354
+
1355
+
sage: E = EllipticCurve(GF(31), [1,0,0,1,2])
1356
+
sage: P = E(21,2)
1357
+
sage: Q = E(7, 12)
1358
+
sage: print(P.order())
1359
+
6
1360
+
sage: print(Q.order())
1361
+
2
1362
+
sage: E.isogeny([P, Q])
1363
+
Composite morphism of degree 12 = 2*3*2:
1364
+
From: Elliptic Curve defined by y^2 + x*y = x^3 + x + 2 over Finite Field of size 31
1365
+
To: Elliptic Curve defined by y^2 + x*y = x^3 + 2*x + 26 over Finite Field of size 31
1366
+
1367
+
Multiple ways to set the `velu_sqrt_bound`::
1368
+
1369
+
sage: E = EllipticCurve_from_j(GF(97)(42))
1370
+
sage: P = E.gens()[0]*4
1371
+
sage: print(P.order())
1372
+
23
1373
+
sage: E.isogeny(P)
1374
+
Isogeny of degree 23 from Elliptic Curve defined by y^2 = x^3 + 6*x + 46 over Finite Field of size 97 to Elliptic Curve defined by y^2 = x^3 + 72*x + 29 over Finite Field of size 97
1375
+
sage: E.isogeny(P, velu_sqrt_bound=10)
1376
+
Elliptic-curve isogeny (using square-root Vélu) of degree 23:
1377
+
From: Elliptic Curve defined by y^2 = x^3 + 6*x + 46 over Finite Field of size 97
1378
+
To: Elliptic Curve defined by y^2 = x^3 + 95*x + 68 over Finite Field of size 97
1379
+
sage: from sage.schemes.elliptic_curves.hom_velusqrt import _velu_sqrt_bound
1380
+
sage: _velu_sqrt_bound.set(10)
1381
+
sage: E.isogeny(P)
1382
+
Elliptic-curve isogeny (using square-root Vélu) of degree 23:
1383
+
From: Elliptic Curve defined by y^2 = x^3 + 6*x + 46 over Finite Field of size 97
1384
+
To: Elliptic Curve defined by y^2 = x^3 + 95*x + 68 over Finite Field of size 97
1385
+
sage: _velu_sqrt_bound.set(1000) # Reset bound
1386
+
1387
+
If the order of the point is unknown, fall back to ``"traditional"``::
1388
+
1389
+
sage: E = EllipticCurve_from_j(GF(97)(42))
1390
+
sage: P = E(2, 39)
1391
+
sage: from sage.schemes.elliptic_curves.hom_velusqrt import _velu_sqrt_bound
1392
+
sage: _velu_sqrt_bound.set(1)
1393
+
sage: E.isogeny(P)
1394
+
Isogeny of degree 46 from Elliptic Curve defined by y^2 = x^3 + 6*x + 46 over Finite Field of size 97 to Elliptic Curve defined by y^2 = x^3 + 87*x + 47 over Finite Field of size 97
Isogeny of degree 31 from Elliptic Curve defined by y^2 = x^3 + 114*x + 544 over Finite Field of size 3217 to Elliptic Curve defined by y^2 = x^3 + 277*x + 1710 over Finite Field of size 3217
1447
+
Elliptic-curve isogeny (using square-root Vélu) of degree 103:
1448
+
From: Elliptic Curve defined by y^2 = x^3 + 277*x + 1710 over Finite Field of size 3217
1449
+
To: Elliptic Curve defined by y^2 = x^3 + 2979*x + 1951 over Finite Field of size 3217
1345
1450
"""
1346
1451
ifalgorithmisnotNoneanddegreeisnotNone:
1347
1452
raiseTypeError('cannot pass "degree" and "algorithm" parameters simultaneously')
Isogeny of degree 127 from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Finite Field in z2 of size 257^2 to Elliptic Curve defined by y^2 = x^3 + 151*x + 22 over Finite Field in z2 of size 257^2
0 commit comments