Skip to content
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

remove some old deprecation warnings in elliptic curves #36188

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 2 additions & 62 deletions src/sage/schemes/elliptic_curves/ell_curve_isogeny.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,7 @@ def _isogeny_determine_algorithm(E, kernel):

raise ValueError("invalid parameters to EllipticCurveIsogeny constructor")


from sage.misc.superseded import deprecated_function_alias
isogeny_determine_algorithm = deprecated_function_alias(33619, _isogeny_determine_algorithm)

def isogeny_codomain_from_kernel(E, kernel, degree=None):
def isogeny_codomain_from_kernel(E, kernel):
r"""
Compute the isogeny codomain given a kernel.

Expand Down Expand Up @@ -210,28 +206,13 @@ def isogeny_codomain_from_kernel(E, kernel, degree=None):
Elliptic Curve defined by y^2 + x*y + y = x^3 + 5*x + 2
over Finite Field of size 7

sage: # needs sage.rings.finite_rings
sage: E = EllipticCurve(GF(19), [1,2,3,4,5])
sage: kernel_list = [E((15,10)), E((10,3)), E((6,5))]
sage: isogeny_codomain_from_kernel(E, kernel_list)
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 3*x + 15
over Finite Field of size 19

TESTS:

Test deprecation warning for obsolete argument::

sage: isogeny_codomain_from_kernel(E, kernel_list, degree=4)
doctest:warning
...
DeprecationWarning: The "degree" argument to isogeny_codomain_from_kernel() does nothing and will be removed.
...
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 3*x + 15
over Finite Field of size 19
"""
if degree is not None:
from sage.misc.superseded import deprecation
deprecation(33619, 'The "degree" argument to isogeny_codomain_from_kernel() does nothing and will be removed.')

algorithm = _isogeny_determine_algorithm(E, kernel)

if algorithm == 'velu':
Expand Down Expand Up @@ -3456,47 +3437,6 @@ def compute_isogeny_stark(E1, E2, ell):
from sage.misc.superseded import deprecated_function_alias
compute_isogeny_starks = deprecated_function_alias(34871, compute_isogeny_stark)

def split_kernel_polynomial(poly):
r"""
Obsolete internal helper function formerly used by
:func:`compute_isogeny_kernel_polynomial`.

Use
:meth:`~sage.rings.polynomial.polynomial_element.Polynomial.radical`
instead.

INPUT:

- ``poly`` -- a nonzero univariate polynomial

OUTPUT:

The maximum separable divisor of ``poly``. If the input is a full
kernel polynomial where the roots which are `x`-coordinates of
points of order greater than 2 have multiplicity 1, the output
will be a polynomial with the same roots, all of multiplicity 1.

EXAMPLES:

Check that this behaves identically to ``.radical()``::

sage: # needs sage.rings.finite_rings
sage: from sage.schemes.elliptic_curves.ell_curve_isogeny import split_kernel_polynomial
sage: q = next_prime(randrange(3,10^3))
sage: e = randrange(1,5)
sage: R = GF(q^e,'a')['x']
sage: f = R.random_element(randrange(10,100)).monic()
sage: split_kernel_polynomial(f) == f.radical()
doctest:warning ...
DeprecationWarning: ...
True
"""
from sage.misc.superseded import deprecation
deprecation(33619, 'The split_kernel_polynomial() function is obsolete. '
'Use .radical() instead.')
from sage.misc.misc_c import prod
return prod([p for p,e in poly.squarefree_decomposition()])

def compute_isogeny_kernel_polynomial(E1, E2, ell, algorithm="stark"):
r"""
Return the kernel polynomial of an isogeny of degree ``ell``
Expand Down
16 changes: 1 addition & 15 deletions src/sage/schemes/elliptic_curves/ell_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def isogeny(self, kernel, codomain=None, degree=None, model=None, check=True, al
except AttributeError as e:
raise RuntimeError("Unable to construct isogeny: %s" % e)

def isogeny_codomain(self, kernel, degree=None):
def isogeny_codomain(self, kernel):
r"""
Return the codomain of the isogeny from ``self`` with given kernel.

Expand Down Expand Up @@ -1311,21 +1311,7 @@ def isogeny_codomain(self, kernel, degree=None):
sage: E2 = E.isogeny_codomain(E.lift_x(77347718128277853096420969229987528666))
sage: E2._order
170141183460469231746191640949390434666

Test deprecation warning for obsolete argument::

sage: E.isogeny_codomain(E.lift_x(77347718128277853096420969229987528666), degree=11) # needs sage.rings.finite_rings
doctest:warning
...
DeprecationWarning: The "degree" argument to .isogeny_codomain() does nothing and will be removed.
...
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 20731788786372791581385345584850817122*x + 125200507378516567345719286707201096361
over Finite Field of size 170141183460469231731687303715884105727
"""
if degree is not None:
from sage.misc.superseded import deprecation
deprecation(33619, 'The "degree" argument to .isogeny_codomain() does nothing and will be removed.')

E = isogeny_codomain_from_kernel(self, kernel)
if self.base_field().is_finite():
E._fetch_cached_order(self)
Expand Down
13 changes: 1 addition & 12 deletions src/sage/schemes/elliptic_curves/ell_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -3709,7 +3709,7 @@ def _acted_upon_(self, other, side):

return Q

def discrete_log(self, Q, ord=None):
def discrete_log(self, Q):
r"""
Return the discrete logarithm of `Q` to base `P` = ``self``,
that is, an integer `x` such that `xP = Q`.
Expand Down Expand Up @@ -3780,18 +3780,7 @@ def discrete_log(self, Q, ord=None):
sage: x = P.discrete_log(Q)
sage: x*P == Q
True

Doctest deprecation::

sage: P.discrete_log(Q, ord=P.order()) # needs sage.rings.finite_rings
doctest:warning
...
DeprecationWarning: The "ord" argument to .discrete_log() is obsolete. ...
"""
if ord is not None:
from sage.misc.superseded import deprecation
deprecation(33121, 'The "ord" argument to .discrete_log() is obsolete. Use the .set_order() method instead.')
self.set_order(ord)
if Q not in self.parent():
raise ValueError('not a point on the same curve')
n = self.order()
Expand Down
17 changes: 0 additions & 17 deletions src/sage/schemes/elliptic_curves/hom_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,20 +925,3 @@ def is_injective(self):
True
"""
return all(phi.is_injective() for phi in self._phis)

@staticmethod
def make_default():
r"""
This method does nothing and will be removed.

(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: EllipticCurveHom_composite.make_default()
doctest:warning ...
"""
from sage.misc.superseded import deprecation
deprecation(34410, 'calling EllipticCurveHom_composite.make_default() is no longer necessary')