diff --git a/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py b/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py index 9c3cb195eff..f6a90401f01 100644 --- a/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py +++ b/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py @@ -813,18 +813,15 @@ class EllipticCurveIsogeny(EllipticCurveHom): sage: phi.codomain() Elliptic Curve defined by y^2 + x*y = x^3 + 24*x + 6 over Finite Field of size 31 - Composition tests (see :trac:`16245`):: + Composition tests (see :trac:`16245`, cf. :trac:`34410`):: sage: E = EllipticCurve(j=GF(7)(0)) sage: phi = E.isogeny([E(0), E((0,1)), E((0,-1))]); phi Isogeny of degree 3 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 to Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 sage: phi2 = phi * phi; phi2 - Composite map: + Composite morphism of degree 9 = 3^2: From: Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 To: Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 - Defn: Isogeny of degree 3 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 to Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 - then - Isogeny of degree 3 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 to Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 7 Examples over relative number fields used not to work (see :trac:`16779`):: @@ -1276,6 +1273,52 @@ def __neg__(self): sage: P = E((7,13)) sage: phi(P) + negphi(P) == 0 True + + sage: E = EllipticCurve(GF(23), [0,0,0,1,0]) + sage: f = E.torsion_polynomial(3)/3 + sage: phi = EllipticCurveIsogeny(E, f, E) + sage: phi.rational_maps() == E.multiplication_by_m(3) + False + sage: negphi = -phi + sage: negphi.rational_maps() == E.multiplication_by_m(3) + True + + sage: E = EllipticCurve(GF(17), [-2, 3, -5, 7, -11]) + sage: R. = GF(17)[] + sage: f = x+6 + sage: phi = EllipticCurveIsogeny(E, f) + sage: phi + Isogeny of degree 2 from Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 7*x + 6 over Finite Field of size 17 to Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 4*x + 8 over Finite Field of size 17 + sage: phi.rational_maps() + ((x^2 + 6*x + 4)/(x + 6), (x^2*y - 5*x*y + 8*x - 2*y)/(x^2 - 5*x + 2)) + sage: negphi = -phi + sage: negphi + Isogeny of degree 2 from Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 7*x + 6 over Finite Field of size 17 to Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 4*x + 8 over Finite Field of size 17 + sage: negphi.rational_maps() + ((x^2 + 6*x + 4)/(x + 6), + (2*x^3 - x^2*y - 5*x^2 + 5*x*y - 4*x + 2*y + 7)/(x^2 - 5*x + 2)) + + sage: E = EllipticCurve('11a1') + sage: R. = QQ[] + sage: f = x^2 - 21*x + 80 + sage: phi = EllipticCurveIsogeny(E, f) + sage: (xmap1, ymap1) = phi.rational_maps() + sage: negphi = -phi + sage: (xmap2, ymap2) = negphi.rational_maps() + sage: xmap1 == xmap2 + True + sage: ymap1 == -ymap2 - E.a1()*xmap2 - E.a3() + True + + sage: K. = NumberField(x^2 + 1) + sage: E = EllipticCurve(K, [0,0,0,1,0]) + sage: R. = K[] + sage: phi = EllipticCurveIsogeny(E, x-a) + sage: phi.rational_maps() + ((x^2 + (-a)*x - 2)/(x + (-a)), (x^2*y + (-2*a)*x*y + y)/(x^2 + (-2*a)*x - 1)) + sage: negphi = -phi + sage: negphi.rational_maps() + ((x^2 + (-a)*x - 2)/(x + (-a)), (-x^2*y + (2*a)*x*y - y)/(x^2 + (-2*a)*x - 1)) """ output = copy(self) E2 = output._codomain @@ -1345,8 +1388,7 @@ def __clear_cached_values(self): sage: phi = EllipticCurveIsogeny(E, x) sage: old_ratl_maps = phi.rational_maps() sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: phi.set_post_isomorphism(WeierstrassIsomorphism(phi.codomain(), (-1,0,0,0))) - ... + sage: phi._set_post_isomorphism(WeierstrassIsomorphism(phi.codomain(), (-1,0,0,0))) sage: old_ratl_maps == phi.rational_maps() False sage: old_ratl_maps[1] == -phi.rational_maps()[1] @@ -1358,8 +1400,7 @@ def __clear_cached_values(self): sage: phi = EllipticCurveIsogeny(E, f) sage: old_ratl_maps = phi.rational_maps() sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: phi.set_post_isomorphism(WeierstrassIsomorphism(phi.codomain(), (-13,13,-13,13))) - ... + sage: phi._set_post_isomorphism(WeierstrassIsomorphism(phi.codomain(), (-13,13,-13,13))) sage: old_ratl_maps == phi.rational_maps() False sage: phi._EllipticCurveIsogeny__clear_cached_values() @@ -1384,12 +1425,10 @@ def __perform_inheritance_housekeeping(self): sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism sage: E2 = phi.codomain() sage: post_isom = WeierstrassIsomorphism(E2, (41, 37, 31, 29)) - sage: phi.set_post_isomorphism(post_isom) - ... + sage: phi._set_post_isomorphism(post_isom) sage: E1pr = WeierstrassIsomorphism(E, (-1, 2, -3, 4)).codomain() sage: pre_isom = E1pr.isomorphism_to(E) - sage: phi.set_pre_isomorphism(pre_isom) - ... + sage: phi._set_pre_isomorphism(pre_isom) """ EllipticCurveHom.__init__(self, self._domain, self._codomain) @@ -1582,8 +1621,7 @@ def __set_pre_isomorphism(self, domain, isomorphism): sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism sage: E1pr = WeierstrassIsomorphism(E, (-1, 2, -3, 4)).codomain() sage: pre_isom = E1pr.isomorphism_to(E) - sage: phi.set_pre_isomorphism(pre_isom) - ... + sage: phi._set_pre_isomorphism(pre_isom) sage: phi._EllipticCurveIsogeny__set_pre_isomorphism(E, WeierstrassIsomorphism(E, (-1, 3, -3, 4))) sage: E == phi.domain() True @@ -1625,8 +1663,7 @@ def __set_post_isomorphism(self, codomain, isomorphism): sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism sage: E2 = phi.codomain() sage: isom = WeierstrassIsomorphism(E2, (-1,2,-3,4)) - sage: phi.set_post_isomorphism(isom) - ... + sage: phi._set_post_isomorphism(isom) sage: phi._EllipticCurveIsogeny__set_post_isomorphism(E2, WeierstrassIsomorphism(phi.codomain(), (1,-2,3,-4))) sage: E2 == phi.codomain() True @@ -2716,76 +2753,6 @@ def kernel_polynomial(self): return self.__kernel_polynomial - def set_pre_isomorphism(self, preWI): - r""" - Modify this isogeny by precomposing with a Weierstrass isomorphism. - - .. WARNING:: - - Isogenies will be immutable in a future release of Sage. - This method is deprecated in favor of using the ``*`` operator - to compose elliptic-curve morphisms. - - EXAMPLES:: - - sage: E = EllipticCurve(GF(31), [1,1,0,1,-1]) - sage: R. = GF(31)[] - sage: f = x^3 + 9*x^2 + x + 30 - sage: phi = EllipticCurveIsogeny(E, f) - sage: Epr = E.short_weierstrass_model() - sage: isom = Epr.isomorphism_to(E) - sage: phi.set_pre_isomorphism(isom) - ... - sage: phi.rational_maps() - ((-6*x^4 - 3*x^3 + 12*x^2 + 10*x - 1)/(x^3 + x - 12), (3*x^7 + x^6*y - 14*x^6 - 3*x^5 + 5*x^4*y + 7*x^4 + 8*x^3*y - 8*x^3 - 5*x^2*y + 5*x^2 - 14*x*y + 14*x - 6*y - 6)/(x^6 + 2*x^4 + 7*x^3 + x^2 + 7*x - 11)) - sage: phi(Epr((0,22))) - (13 : 21 : 1) - sage: phi(Epr((3,7))) - (14 : 17 : 1) - - sage: E = EllipticCurve(GF(29), [0,0,0,1,0]) - sage: R. = GF(29)[] - sage: f = x^2 + 5 - sage: phi = EllipticCurveIsogeny(E, f) - sage: phi - Isogeny of degree 5 from Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 29 to Elliptic Curve defined by y^2 = x^3 + 20*x over Finite Field of size 29 - sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: inv_isom = WeierstrassIsomorphism(E, (1,-2,5,10)) - sage: Epr = inv_isom.codomain() - sage: isom = Epr.isomorphism_to(E) - sage: phi.set_pre_isomorphism(isom) - ... - sage: phi - Isogeny of degree 5 from Elliptic Curve defined by y^2 + 10*x*y + 20*y = x^3 + 27*x^2 + 6 over Finite Field of size 29 to Elliptic Curve defined by y^2 = x^3 + 20*x over Finite Field of size 29 - sage: phi(Epr((12,1))) - (26 : 0 : 1) - sage: phi(Epr((2,9))) - (0 : 0 : 1) - sage: phi(Epr((21,12))) - (3 : 0 : 1) - sage: phi.rational_maps()[0] - (x^5 - 10*x^4 - 6*x^3 - 7*x^2 - x + 3)/(x^4 - 8*x^3 + 5*x^2 - 14*x - 6) - - sage: E = EllipticCurve('11a1') - sage: R. = QQ[] - sage: f = x^2 - 21*x + 80 - sage: phi = EllipticCurveIsogeny(E, f); phi - Isogeny of degree 5 from Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 7820*x - 263580 over Rational Field - sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: Epr = E.short_weierstrass_model() - sage: isom = Epr.isomorphism_to(E) - sage: phi.set_pre_isomorphism(isom) - ... - sage: phi - Isogeny of degree 5 from Elliptic Curve defined by y^2 = x^3 - 13392*x - 1080432 over Rational Field to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 7820*x - 263580 over Rational Field - sage: phi(Epr((168,1188))) - (0 : 1 : 0) - """ - from sage.misc.superseded import deprecation - deprecation(32388, 'Elliptic-curve isogenies will be immutable in a future release of Sage.' - ' Use phi*psi instead of phi.set_pre_isomorphism(psi) to obtain the composite isogeny.') - return self._set_pre_isomorphism(preWI) - def _set_pre_isomorphism(self, preWI): """ Modify this isogeny by pre-composing with a @@ -2793,9 +2760,7 @@ def _set_pre_isomorphism(self, preWI): For internal use only. - TESTS: - - These tests were copied from :meth:`set_pre_isomorphism`:: + TESTS:: sage: E = EllipticCurve(GF(31), [1,1,0,1,-1]) sage: R. = GF(31)[] @@ -2868,58 +2833,6 @@ def _set_pre_isomorphism(self, preWI): self.__set_pre_isomorphism(domain, isom) - def set_post_isomorphism(self, postWI): - r""" - Modify this isogeny by postcomposing with a Weierstrass isomorphism. - - .. WARNING:: - - Isogenies will be immutable in a future release of Sage. - This method is deprecated in favor of using the ``*`` operator - to compose elliptic-curve morphisms. - - EXAMPLES:: - - sage: E = EllipticCurve(j=GF(31)(0)) - sage: R. = GF(31)[] - sage: phi = EllipticCurveIsogeny(E, x+18) - sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: phi.set_post_isomorphism(WeierstrassIsomorphism(phi.codomain(), (6,8,10,12))) - ... - sage: phi - Isogeny of degree 3 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 31 to Elliptic Curve defined by y^2 + 24*x*y + 7*y = x^3 + 22*x^2 + 16*x + 20 over Finite Field of size 31 - - sage: E = EllipticCurve(j=GF(47)(0)) - sage: f = E.torsion_polynomial(3)/3 - sage: phi = EllipticCurveIsogeny(E, f) - sage: E2 = phi.codomain() - sage: post_isom = E2.isomorphism_to(E) - sage: phi.set_post_isomorphism(post_isom) - ... - sage: phi.rational_maps() == E.multiplication_by_m(3) - False - sage: phi.switch_sign() - ... - sage: phi.rational_maps() == E.multiplication_by_m(3) - True - - Example over a number field:: - - sage: R. = QQ[] - sage: K. = NumberField(x^2 + 2) - sage: E = EllipticCurve(j=K(1728)) - sage: ker_list = E.torsion_points() - sage: phi = EllipticCurveIsogeny(E, ker_list) - sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: post_isom = WeierstrassIsomorphism(phi.codomain(), (a,2,3,5)) - sage: phi - Isogeny of degree 4 from Elliptic Curve defined by y^2 = x^3 + x over Number Field in a with defining polynomial x^2 + 2 to Elliptic Curve defined by y^2 = x^3 + (-44)*x + 112 over Number Field in a with defining polynomial x^2 + 2 - """ - from sage.misc.superseded import deprecation - deprecation(32388, 'Elliptic-curve isogenies will be immutable in a future release of Sage.' - ' Use psi*phi instead of phi.set_post_isomorphism(psi) to obtain the composite isogeny.') - return self._set_post_isomorphism(postWI) - def _set_post_isomorphism(self, postWI): """ Modify this isogeny by post-composing with a @@ -2927,9 +2840,7 @@ def _set_post_isomorphism(self, postWI): For internal use only. - TESTS: - - These tests were copied from :meth:`set_post_isomorphism`:: + TESTS:: sage: E = EllipticCurve(j=GF(31)(0)) sage: R. = GF(31)[] @@ -2982,150 +2893,6 @@ def _set_post_isomorphism(self, postWI): self.__set_post_isomorphism(codomain, isom) - def get_pre_isomorphism(self): - r""" - Return the pre-isomorphism of this isogeny, or ``None``. - - .. NOTE:: - - Pre- and post-isomorphisms are an implementation detail of - how isogenies are currently represented in Sage. They have - limited inherent mathematical meaning and this method may - disappear in a future release. - - EXAMPLES:: - - sage: E = EllipticCurve(GF(31), [1,1,0,1,-1]) - sage: R. = GF(31)[] - sage: f = x^3 + 9*x^2 + x + 30 - sage: phi = EllipticCurveIsogeny(E, f) - sage: phi.get_post_isomorphism() - sage: Epr = E.short_weierstrass_model() - sage: isom = Epr.isomorphism_to(E) - sage: phi.set_pre_isomorphism(isom) - ... - sage: isom == phi.get_pre_isomorphism() - True - - sage: E = EllipticCurve(GF(83), [1,0,1,1,0]) - sage: R. = GF(83)[]; f = x+24 - sage: phi = EllipticCurveIsogeny(E, f) - sage: E2 = phi.codomain() - sage: phi2 = EllipticCurveIsogeny(E, None, E2, 2) - sage: phi2.get_pre_isomorphism() - Elliptic-curve morphism: - From: Elliptic Curve defined by y^2 + x*y + y = x^3 + x over Finite Field of size 83 - To: Elliptic Curve defined by y^2 = x^3 + 62*x + 74 over Finite Field of size 83 - Via: (u,r,s,t) = (1, 76, 41, 3) - """ - return self.__pre_isomorphism - - def get_post_isomorphism(self): - r""" - Return the post-isomorphism of this isogeny, or ``None``. - - .. NOTE:: - - Pre- and post-isomorphisms are an implementation detail of - how isogenies are currently represented in Sage. They have - limited inherent mathematical meaning and this method may - disappear in a future release. - - EXAMPLES:: - - sage: E = EllipticCurve(j=GF(31)(0)) - sage: R. = GF(31)[] - sage: phi = EllipticCurveIsogeny(E, x+18) - sage: phi.get_post_isomorphism() - sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism - sage: isom = WeierstrassIsomorphism(phi.codomain(), (6,8,10,12)) - sage: phi.set_post_isomorphism(isom) - ... - sage: isom == phi.get_post_isomorphism() - True - - sage: E = EllipticCurve(GF(83), [1,0,1,1,0]) - sage: R. = GF(83)[]; f = x+24 - sage: phi = EllipticCurveIsogeny(E, f) - sage: E2 = phi.codomain() - sage: phi2 = EllipticCurveIsogeny(E, None, E2, 2) - sage: phi2.get_post_isomorphism() - Elliptic-curve morphism: - From: Elliptic Curve defined by y^2 = x^3 + 65*x + 69 over Finite Field of size 83 - To: Elliptic Curve defined by y^2 + x*y + y = x^3 + 4*x + 16 over Finite Field of size 83 - Via: (u,r,s,t) = (1, 7, 42, 42) - """ - return self.__post_isomorphism - - - def switch_sign(self): - r""" - Compose this isogeny with `[-1]` (negation). - - .. WARNING:: - - Isogenies will be immutable in a future version of Sage. - This method is deprecated in favor of using the unary ``-`` - operator to negate elliptic-curve morphisms. - - EXAMPLES:: - - sage: E = EllipticCurve(GF(23), [0,0,0,1,0]) - sage: f = E.torsion_polynomial(3)/3 - sage: phi = EllipticCurveIsogeny(E, f, E) - sage: phi.rational_maps() == E.multiplication_by_m(3) - False - sage: phi.switch_sign() - ... - sage: phi.rational_maps() == E.multiplication_by_m(3) - True - - sage: E = EllipticCurve(GF(17), [-2, 3, -5, 7, -11]) - sage: R. = GF(17)[] - sage: f = x+6 - sage: phi = EllipticCurveIsogeny(E, f) - sage: phi - Isogeny of degree 2 from Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 7*x + 6 over Finite Field of size 17 to Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 4*x + 8 over Finite Field of size 17 - sage: phi.rational_maps() - ((x^2 + 6*x + 4)/(x + 6), (x^2*y - 5*x*y + 8*x - 2*y)/(x^2 - 5*x + 2)) - sage: phi.switch_sign() - ... - sage: phi - Isogeny of degree 2 from Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 7*x + 6 over Finite Field of size 17 to Elliptic Curve defined by y^2 + 15*x*y + 12*y = x^3 + 3*x^2 + 4*x + 8 over Finite Field of size 17 - sage: phi.rational_maps() - ((x^2 + 6*x + 4)/(x + 6), - (2*x^3 - x^2*y - 5*x^2 + 5*x*y - 4*x + 2*y + 7)/(x^2 - 5*x + 2)) - - sage: E = EllipticCurve('11a1') - sage: R. = QQ[] - sage: f = x^2 - 21*x + 80 - sage: phi = EllipticCurveIsogeny(E, f) - sage: (xmap1, ymap1) = phi.rational_maps() - sage: phi.switch_sign() - ... - sage: (xmap2, ymap2) = phi.rational_maps() - sage: xmap1 == xmap2 - True - sage: ymap1 == -ymap2 - E.a1()*xmap2 - E.a3() - True - - sage: K. = NumberField(x^2 + 1) - sage: E = EllipticCurve(K, [0,0,0,1,0]) - sage: R. = K[] - sage: phi = EllipticCurveIsogeny(E, x-a) - sage: phi.rational_maps() - ((x^2 + (-a)*x - 2)/(x + (-a)), (x^2*y + (-2*a)*x*y + y)/(x^2 + (-2*a)*x - 1)) - sage: phi.switch_sign() - ... - sage: phi.rational_maps() - ((x^2 + (-a)*x - 2)/(x + (-a)), (-x^2*y + (2*a)*x*y - y)/(x^2 + (-2*a)*x - 1)) - """ - from sage.misc.superseded import deprecation - deprecation(32388, 'Elliptic-curve isogenies will be immutable in a future release of Sage.' - ' Use -phi instead of phi.switch_sign() to obtain the negated isogeny.') - E2 = self._codomain - self._set_post_isomorphism(WeierstrassIsomorphism(E2, (-1, 0, -E2.a1(), -E2.a3()))) - def dual(self): r""" Return the isogeny dual to this isogeny. diff --git a/src/sage/schemes/elliptic_curves/hom.py b/src/sage/schemes/elliptic_curves/hom.py index 0ff9011fdd4..76087e95c7f 100644 --- a/src/sage/schemes/elliptic_curves/hom.py +++ b/src/sage/schemes/elliptic_curves/hom.py @@ -75,12 +75,9 @@ def _composition_(self, other, homset): sage: phi * iso Isogeny of degree 2 from Elliptic Curve defined by y^2 = x^3 + 9*x over Finite Field of size 19 to Elliptic Curve defined by y^2 = x^3 + 15*x over Finite Field of size 19 sage: phi.dual() * phi - Composite map: + Composite morphism of degree 4 = 2^2: From: Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 19 To: Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 19 - Defn: Isogeny of degree 2 from Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 19 to Elliptic Curve defined by y^2 = x^3 + 15*x over Finite Field of size 19 - then - Isogeny of degree 2 from Elliptic Curve defined by y^2 = x^3 + 15*x over Finite Field of size 19 to Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 19 """ if not isinstance(self, EllipticCurveHom) or not isinstance(other, EllipticCurveHom): raise TypeError(f'cannot compose {type(self)} with {type(other)}') @@ -93,8 +90,8 @@ def _composition_(self, other, homset): if ret is not NotImplemented: return ret - # fall back to generic formal composite map - return Morphism._composition_(self, other, homset) + from sage.schemes.elliptic_curves.hom_composite import EllipticCurveHom_composite + return EllipticCurveHom_composite.from_factors([other, self]) @staticmethod diff --git a/src/sage/schemes/elliptic_curves/hom_composite.py b/src/sage/schemes/elliptic_curves/hom_composite.py index 6528d7bef5d..1e2ca2658b0 100644 --- a/src/sage/schemes/elliptic_curves/hom_composite.py +++ b/src/sage/schemes/elliptic_curves/hom_composite.py @@ -769,48 +769,17 @@ def is_injective(self): @staticmethod def make_default(): r""" - Calling this method will override the composition method - of :class:`EllipticCurveHom` such that it constructs a - :class:`EllipticCurveHom_composite` object by default, - rather than a :class:`sage.categories.map.FormalCompositeMap`. + This method does nothing and will be removed. - .. WARNING:: - - This method exists only temporarily to make testing more - convenient while :class:`EllipticCurveHom_composite` is - not yet the default. + (It is a leftover from the time when :class:`EllipticCurveHom_composite` + wasn't the default yet.) EXAMPLES:: sage: from sage.schemes.elliptic_curves.hom_composite import EllipticCurveHom_composite - sage: E = EllipticCurve(GF(587), [1,0]) - sage: P = E(3,404) - sage: phi = E.isogeny(7*P) - sage: psi = phi.codomain().isogeny(phi(P)) - sage: psi * phi - Composite map: - From: Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 587 - To: Elliptic Curve defined by y^2 = x^3 + 296*x + 164 over Finite Field of size 587 - Defn: Isogeny of degree 7 from Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 587 to Elliptic Curve defined by y^2 = x^3 + 126*x + 500 over Finite Field of size 587 - then - Isogeny of degree 7 from Elliptic Curve defined by y^2 = x^3 + 126*x + 500 over Finite Field of size 587 to Elliptic Curve defined by y^2 = x^3 + 296*x + 164 over Finite Field of size 587 sage: EllipticCurveHom_composite.make_default() - sage: psi * phi - Composite morphism of degree 49 = 7^2: - From: Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 587 - To: Elliptic Curve defined by y^2 = x^3 + 296*x + 164 over Finite Field of size 587 - sage: (psi * phi).factors() - (Isogeny of degree 7 from Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 587 to Elliptic Curve defined by y^2 = x^3 + 126*x + 500 over Finite Field of size 587, - Isogeny of degree 7 from Elliptic Curve defined by y^2 = x^3 + 126*x + 500 over Finite Field of size 587 to Elliptic Curve defined by y^2 = x^3 + 296*x + 164 over Finite Field of size 587) + doctest:warning ... """ - def _composition_(self, other, homset): - if not isinstance(self, EllipticCurveHom) or not isinstance(other, EllipticCurveHom): - raise TypeError(f'cannot compose {type(self)} with {type(other)}') - ret = self._composition_impl(self, other) - if ret is not NotImplemented: - return ret - ret = other._composition_impl(self, other) - if ret is not NotImplemented: - return ret - return EllipticCurveHom_composite.from_factors([other, self]) - EllipticCurveHom._composition_ = _composition_ + from sage.misc.superseded import deprecation + deprecation(34410, 'calling EllipticCurveHom_composite.make_default() is no longer necessary') +