# HG changeset patch
# User Johan Bosman <johan.g.bosman@gmail.com>
# Date 1303380656 -7200
# Node ID 9195a8e263e6406566069a385f89fe9492679742
# Parent 20922b3723b6f797f7a1e4868dbe493a6f5c46b6
Trac 11229: bugfix in rational functions defining isogenies
diff -r 20922b3723b6 -r 9195a8e263e6 sage/schemes/elliptic_curves/ell_curve_isogeny.py
a
|
b
|
|
1416 | 1416 | ((x^2 + 1)/x, (x^2*y - y)/x^2) |
1417 | 1417 | sage: phi._EllipticCurveIsogeny__initialize_rational_maps() |
1418 | 1418 | |
| 1419 | sage: E = EllipticCurve([1,2,3,4,5]) |
| 1420 | sage: Eshort = E.short_weierstrass_model() |
| 1421 | sage: phi = E.isogeny(E(0), Eshort) |
| 1422 | sage: phiX, phiY = phi.rational_maps() |
| 1423 | sage: phiX(1,2), phiY(1,2) |
| 1424 | (63, 864) |
1419 | 1425 | """ |
1420 | | |
1421 | | if (self.__rational_maps_initialized): |
| 1426 | if self.__rational_maps_initialized: |
1422 | 1427 | return |
1423 | 1428 | |
1424 | 1429 | if precomputed_maps is None: |
… |
… |
|
1429 | 1434 | else: |
1430 | 1435 | X_map, Y_map = precomputed_maps |
1431 | 1436 | |
1432 | | if (self.__prei_x_coord_ratl_map is not None): |
| 1437 | if self.__prei_x_coord_ratl_map is not None: |
1433 | 1438 | prei_X_map = self.__prei_x_coord_ratl_map |
1434 | 1439 | prei_Y_map = self.__prei_y_coord_ratl_map |
1435 | | |
1436 | | X_map = X_map.subs(x=prei_X_map, y=prei_Y_map) |
1437 | | Y_map = Y_map.subs(x=prei_X_map, y=prei_Y_map) |
1438 | | |
1439 | | if (self.__posti_x_coord_ratl_map is not None): |
1440 | | X_map = self.__posti_x_coord_ratl_map.subs(x=X_map, y=Y_map) |
1441 | | Y_map = self.__posti_y_coord_ratl_map.subs(x=X_map, y=Y_map) |
| 1440 | X_map, Y_map = X_map.subs(x=prei_X_map, y=prei_Y_map), \ |
| 1441 | Y_map.subs(x=prei_X_map, y=prei_Y_map) |
| 1442 | |
| 1443 | if self.__posti_x_coord_ratl_map is not None: |
| 1444 | X_map, Y_map = \ |
| 1445 | self.__posti_x_coord_ratl_map.subs(x=X_map, y=Y_map), \ |
| 1446 | self.__posti_y_coord_ratl_map.subs(x=X_map, y=Y_map) |
1442 | 1447 | |
1443 | 1448 | self.__X_coord_rational_map = X_map |
1444 | 1449 | self.__Y_coord_rational_map = Y_map |
1445 | | |
1446 | 1450 | self.__rational_maps_initialized = True |
1447 | 1451 | |
1448 | | return |
1449 | | |
1450 | 1452 | |
1451 | 1453 | def __init_kernel_polynomial(self): |
1452 | 1454 | r""" |