Skip to content

Commit

Permalink
sagemathgh-38923: remove some deprecated functionality
Browse files Browse the repository at this point in the history
    
These should all be older than a year.
    
URL: sagemath#38923
Reported by: Lorenz Panny
Reviewer(s): Frédéric Chapoton
  • Loading branch information
Release Manager committed Nov 7, 2024
2 parents 5def0ff + 4fdcbd9 commit d2a0ad5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 121 deletions.
3 changes: 0 additions & 3 deletions src/sage/rings/finite_rings/element_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ from sage.structure.element cimport Element
from sage.structure.parent cimport Parent
from sage.rings.integer_ring import ZZ
from sage.rings.integer import Integer
from sage.misc.superseded import deprecated_function_alias


def is_FiniteFieldElement(x):
Expand Down Expand Up @@ -1104,8 +1103,6 @@ cdef class FinitePolyExtElement(FiniteRingElement):
f = f.reverse(self.parent().degree() - 1)
return f(p)

integer_representation = deprecated_function_alias(33941, to_integer)

def to_bytes(self, byteorder='big'):
r"""
Return an array of bytes representing an integer.
Expand Down
3 changes: 0 additions & 3 deletions src/sage/rings/finite_rings/finite_field_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ from sage.misc.cachefunc import cached_method
from sage.misc.prandom import randrange
from sage.rings.integer cimport Integer
import sage.rings.abc
from sage.misc.superseded import deprecation_cython as deprecation, deprecated_function_alias

# Copied from sage.misc.fast_methods, used in __hash__() below.
cdef int SIZEOF_VOID_P_SHIFT = 8*sizeof(void *) - 4
Expand Down Expand Up @@ -457,8 +456,6 @@ cdef class FiniteField(Field):
r = r * g + self(d)
return r

fetch_int = deprecated_function_alias(33941, from_integer)

def _is_valid_homomorphism_(self, codomain, im_gens, base_map=None):
"""
Return ``True`` if the map from ``self`` to codomain sending
Expand Down
3 changes: 0 additions & 3 deletions src/sage/rings/finite_rings/finite_field_givaro.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from sage.rings.integer import Integer
from sage.rings.finite_rings.element_givaro import Cache_givaro
from sage.libs.pari.all import pari
from sage.misc.superseded import deprecated_function_alias


class FiniteField_givaro(FiniteField):
Expand Down Expand Up @@ -488,8 +487,6 @@ def from_integer(self, n):
"""
return self._cache.fetch_int(n)

fetch_int = deprecated_function_alias(33941, from_integer)

def _pari_modulus(self):
"""
Return the modulus of ``self`` in a format for PARI.
Expand Down
3 changes: 0 additions & 3 deletions src/sage/rings/finite_rings/finite_field_ntl_gf2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from sage.rings.finite_rings.finite_field_base import FiniteField
from sage.libs.pari.all import pari
from sage.rings.integer import Integer
from sage.misc.superseded import deprecated_function_alias


def late_import():
Expand Down Expand Up @@ -289,8 +288,6 @@ def from_integer(self, number):
"""
return self._cache.fetch_int(number)

fetch_int = deprecated_function_alias(33941, from_integer)

def _pari_modulus(self):
"""
Return PARI object which is equivalent to the
Expand Down
9 changes: 0 additions & 9 deletions src/sage/schemes/elliptic_curves/ell_curve_isogeny.py
Original file line number Diff line number Diff line change
Expand Up @@ -3580,10 +3580,6 @@ def compute_isogeny_stark(E1, E2, ell):
return qn


from sage.misc.superseded import deprecated_function_alias
compute_isogeny_starks = deprecated_function_alias(34871, compute_isogeny_stark)


def compute_isogeny_kernel_polynomial(E1, E2, ell, algorithm=None):
r"""
Return the kernel polynomial of a cyclic, separable, normalized
Expand Down Expand Up @@ -3650,11 +3646,6 @@ def compute_isogeny_kernel_polynomial(E1, E2, ell, algorithm=None):
sage: poly.factor()
(x + 10) * (x + 12) * (x + 16)
"""
if algorithm == 'starks':
from sage.misc.superseded import deprecation
deprecation(34871, 'The "starks" algorithm is being renamed to "stark".')
algorithm = 'stark'

if algorithm is None:
char = E1.base_ring().characteristic()
if char != 0 and char < 4*ell + 4:
Expand Down
121 changes: 29 additions & 92 deletions src/sage/schemes/elliptic_curves/ell_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2511,121 +2511,58 @@ def multiplication_by_m(self, m, x_only=False):

return mx, my

def multiplication_by_m_isogeny(self, m):
def scalar_multiplication(self, m):
r"""
Return the ``EllipticCurveIsogeny`` object associated to the
multiplication-by-`m` map on this elliptic curve.
The resulting isogeny will
have the associated rational maps (i.e., those returned by
:meth:`multiplication_by_m`) already computed.
NOTE: This function is currently *much* slower than the
result of ``self.multiplication_by_m()``, because
constructing an isogeny precomputes a significant amount
of information. See :issue:`7368` and :issue:`8014` for the
status of improving this situation.
INPUT:
- ``m`` -- nonzero integer
Return the scalar-multiplication map `[m]` on this elliptic
curve as a
:class:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar`
object.
OUTPUT:
EXAMPLES::
- An ``EllipticCurveIsogeny`` object associated to the
multiplication-by-`m` map on this elliptic curve.
sage: E = EllipticCurve('77a1')
sage: m = E.scalar_multiplication(-7); m
Scalar-multiplication endomorphism [-7]
of Elliptic Curve defined by y^2 + y = x^3 + 2*x over Rational Field
sage: m.degree()
49
sage: P = E(2,3)
sage: m(P)
(-26/225 : -2132/3375 : 1)
sage: m.rational_maps() == E.multiplication_by_m(-7)
True
EXAMPLES::
::
sage: E = EllipticCurve('11a1')
sage: E.multiplication_by_m_isogeny(7)
doctest:warning ... DeprecationWarning: ...
Isogeny of degree 49
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 - 10*x - 20
over Rational Field
sage: E.scalar_multiplication(7)
Scalar-multiplication endomorphism [7]
of Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
TESTS:
Tests for :issue:`32490`::
sage: E = EllipticCurve(QQbar, [1,0]) # needs sage.rings.number_field
sage: E.multiplication_by_m_isogeny(1).rational_maps() # needs sage.rings.number_field
sage: E.scalar_multiplication(1).rational_maps() # needs sage.rings.number_field
(x, y)
::
sage: E = EllipticCurve_from_j(GF(31337).random_element()) # needs sage.rings.finite_rings
sage: P = E.random_point() # needs sage.rings.finite_rings
sage: [E.multiplication_by_m_isogeny(m)(P) == m*P for m in (1,2,3,5,7,9)] # needs sage.rings.finite_rings
sage: [E.scalar_multiplication(m)(P) == m*P for m in (1,2,3,5,7,9)] # needs sage.rings.finite_rings
[True, True, True, True, True, True]
::
sage: E = EllipticCurve('99.a1')
sage: E.multiplication_by_m_isogeny(5)
Isogeny of degree 25 from Elliptic Curve defined by y^2 + x*y + y = x^3 - x^2 - 17*x + 30 over Rational Field to Elliptic Curve defined by y^2 + x*y + y = x^3 - x^2 - 17*x + 30 over Rational Field
sage: E.multiplication_by_m_isogeny(2).rational_maps()
((1/4*x^4 + 33/4*x^2 - 121/2*x + 363/4)/(x^3 - 3/4*x^2 - 33/2*x + 121/4),
(-1/256*x^7 + 1/128*x^6*y - 7/256*x^6 - 3/256*x^5*y - 105/256*x^5 - 165/256*x^4*y + 1255/256*x^4 + 605/128*x^3*y - 473/64*x^3 - 1815/128*x^2*y - 10527/256*x^2 + 2541/128*x*y + 4477/32*x - 1331/128*y - 30613/256)/(1/16*x^6 - 3/32*x^5 - 519/256*x^4 + 341/64*x^3 + 1815/128*x^2 - 3993/64*x + 14641/256))
Test for :issue:`34727`::
sage: E = EllipticCurve([5,5])
sage: E.multiplication_by_m_isogeny(-1)
Isogeny of degree 1
from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
to Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
sage: E.multiplication_by_m_isogeny(-2)
Isogeny of degree 4
from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
to Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
sage: E.multiplication_by_m_isogeny(-3)
Isogeny of degree 9
from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
to Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
sage: mu = E.multiplication_by_m_isogeny
sage: all(mu(-m) == -mu(m) for m in (1,2,3,5,7))
True
"""
from sage.misc.superseded import deprecation
deprecation(32826, 'The .multiplication_by_m_isogeny() method is superseded by .scalar_multiplication().')

mx, my = self.multiplication_by_m(m)

torsion_poly = self.torsion_polynomial(abs(m)).monic()
phi = self.isogeny(torsion_poly, codomain=self)
phi._EllipticCurveIsogeny__initialize_rational_maps(precomputed_maps=(mx, my))

# trac 32490: using codomain=self can give a wrong isomorphism
for aut in self.automorphisms():
psi = aut * phi
if psi.rational_maps() == (mx, my):
return psi

assert False, 'bug in multiplication_by_m_isogeny()'

def scalar_multiplication(self, m):
r"""
Return the scalar-multiplication map `[m]` on this elliptic
curve as a
:class:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar`
object.
EXAMPLES::
sage: E = EllipticCurve('77a1')
sage: m = E.scalar_multiplication(-7); m
Scalar-multiplication endomorphism [-7]
of Elliptic Curve defined by y^2 + y = x^3 + 2*x over Rational Field
sage: m.degree()
49
sage: P = E(2,3)
sage: m(P)
(-26/225 : -2132/3375 : 1)
sage: m.rational_maps() == E.multiplication_by_m(-7)
True
sage: E.scalar_multiplication(5)
Scalar-multiplication endomorphism [5]
of Elliptic Curve defined by y^2 + x*y + y = x^3 - x^2 - 17*x + 30 over Rational Field
sage: E.scalar_multiplication(2).rational_maps()
((x^4 + 33*x^2 - 242*x + 363)/(4*x^3 - 3*x^2 - 66*x + 121),
(-4*x^7 + 8*x^6*y - 28*x^6 - 12*x^5*y - 420*x^5 - 660*x^4*y + 5020*x^4 + 4840*x^3*y - 7568*x^3 - 14520*x^2*y - 42108*x^2 + 20328*x*y + 143264*x - 10648*y - 122452)/(64*x^6 - 96*x^5 - 2076*x^4 + 5456*x^3 + 14520*x^2 - 63888*x + 58564))
"""
from sage.schemes.elliptic_curves.hom_scalar import EllipticCurveHom_scalar
return EllipticCurveHom_scalar(self, m)
Expand Down
10 changes: 4 additions & 6 deletions src/sage/schemes/elliptic_curves/hom.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,10 @@ def _richcmp_(self, other, op):
sage: wE = identity_morphism(E)
sage: wF = identity_morphism(F)
sage: mE = E.scalar_multiplication(1)
sage: mF = F.multiplication_by_m_isogeny(1)
doctest:warning ... DeprecationWarning: ...
sage: [mE == wE, mF == wF]
[True, True]
sage: [a == b for a in (wE,mE) for b in (wF,mF)]
[False, False, False, False]
sage: mE == wE
True
sage: [a == wF for a in (wE,mE)]
[False, False]
.. SEEALSO::
Expand Down
3 changes: 1 addition & 2 deletions src/sage/schemes/elliptic_curves/hom_scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ def scaling_factor(self):
sage: u = phi.scaling_factor()
sage: u == phi.formal()[1]
True
sage: u == E.multiplication_by_m_isogeny(5).scaling_factor()
doctest:warning ... DeprecationWarning: ...
sage: u == 5
True
The scaling factor lives in the base ring::
Expand Down

0 comments on commit d2a0ad5

Please sign in to comment.