Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
scalar-multiplication endomorphisms
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyx4 committed Nov 5, 2021
1 parent 72ab0b8 commit 64865d2
Show file tree
Hide file tree
Showing 5 changed files with 582 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/doc/en/reference/arithmetic_curves/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Maps between them
sage/schemes/elliptic_curves/ell_curve_isogeny
sage/schemes/elliptic_curves/isogeny_small_degree
sage/schemes/elliptic_curves/hom_composite
sage/schemes/elliptic_curves/hom_scalar


Elliptic curves over number fields
Expand Down
29 changes: 29 additions & 0 deletions src/sage/schemes/elliptic_curves/ell_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,35 @@ def multiplication_by_m_isogeny(self, m):

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.
.. WARNING::
This method is currently experimental. It is intended to
eventually supersede :meth:`multiplication_by_m_isogeny`.
EXAMPLES::
sage: E = EllipticCurve('77a1')
sage: m = E.scalar_multiplication(-7); m
doctest:warning ...
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
"""
from sage.schemes.elliptic_curves.hom_scalar import EllipticCurveHom_scalar
return EllipticCurveHom_scalar(self, m)

def isomorphism_to(self, other):
"""
Given another weierstrass model ``other`` of self, return an
Expand Down
8 changes: 6 additions & 2 deletions src/sage/schemes/elliptic_curves/hom.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def degree(self):
- :meth:`EllipticCurveIsogeny.degree`
- :meth:`sage.schemes.elliptic_curves.weierstrass_morphism.WeierstrassIsomorphism.degree`
- :meth:`sage.schemes.elliptic_curves.hom_composite.EllipticCurveHom_composite.degree`
- :meth:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar.degree`
TESTS::
Expand All @@ -189,6 +190,7 @@ def kernel_polynomial(self):
- :meth:`EllipticCurveIsogeny.kernel_polynomial`
- :meth:`sage.schemes.elliptic_curves.weierstrass_morphism.WeierstrassIsomorphism.kernel_polynomial`
- :meth:`sage.schemes.elliptic_curves.hom_composite.EllipticCurveHom_composite.kernel_polynomial`
- :meth:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar.kernel_polynomial`
TESTS::
Expand All @@ -209,6 +211,7 @@ def dual(self):
- :meth:`EllipticCurveIsogeny.dual`
- :meth:`sage.schemes.elliptic_curves.weierstrass_morphism.WeierstrassIsomorphism.dual`
- :meth:`sage.schemes.elliptic_curves.hom_composite.EllipticCurveHom_composite.dual`
- :meth:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar.dual`
TESTS::
Expand All @@ -231,6 +234,7 @@ def rational_maps(self):
- :meth:`EllipticCurveIsogeny.rational_maps`
- :meth:`sage.schemes.elliptic_curves.weierstrass_morphism.WeierstrassIsomorphism.rational_maps`
- :meth:`sage.schemes.elliptic_curves.hom_composite.EllipticCurveHom_composite.rational_maps`
- :meth:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar.rational_maps`
TESTS::
Expand All @@ -252,6 +256,7 @@ def x_rational_map(self):
- :meth:`EllipticCurveIsogeny.x_rational_map`
- :meth:`sage.schemes.elliptic_curves.weierstrass_morphism.WeierstrassIsomorphism.x_rational_map`
- :meth:`sage.schemes.elliptic_curves.hom_composite.EllipticCurveHom_composite.x_rational_map`
- :meth:`sage.schemes.elliptic_curves.hom_scalar.EllipticCurveHom_scalar.x_rational_map`
TESTS::
Expand Down Expand Up @@ -529,8 +534,7 @@ def __neg__(self):
sage: psi.rational_maps() == (f, -g)
True
"""
a1,_,a3,_,_ = self.codomain().a_invariants()
return wm.WeierstrassIsomorphism(self.codomain(), (-1,0,-a1,-a3)) * self
return wm.negation_morphism(self.codomain()) * self

@cached_method
def __hash__(self):
Expand Down
Loading

0 comments on commit 64865d2

Please sign in to comment.