Path: blob/master/src/sage/schemes/elliptic_curves/jacobian.py
8820 views
"""1Construct Elliptic Curves as Jacobians23An elliptic curve is a genus one curve with a designated point. The4Jacobian of a genus-one curve can be defined as the set of line5bundles on the curve, and is isomorphic to the original genus-one6curve. It is also an elliptic curve with the trivial line bundle as7designated point. The utility of this construction is that we can8construct elliptic curves without having to specify which point we9take as the origin.1011EXAMPLES::1213sage: R.<u,v,w> = QQ[]14sage: Jacobian(u^3+v^3+w^3)15Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field16sage: Jacobian(u^4+v^4+w^2)17Elliptic Curve defined by y^2 = x^3 - 4*x over Rational Field1819sage: C = Curve(u^3+v^3+w^3)20sage: Jacobian(C)21Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field2223sage: P2.<u,v,w> = ProjectiveSpace(2, QQ)24sage: C = P2.subscheme(u^3+v^3+w^3)25sage: Jacobian(C)26Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field2728One can also define Jacobians of varieties that are not genus-one29curves. These are not implemented in this module, but we call the30relevant functionality::3132sage: R.<x> = PolynomialRing(QQ)33sage: f = x**5 + 1184*x**3 + 1846*x**2 + 956*x + 56034sage: C = HyperellipticCurve(f)35sage: Jacobian(C)36Jacobian of Hyperelliptic Curve over Rational Field defined37by y^2 = x^5 + 1184*x^3 + 1846*x^2 + 956*x + 5603839REFERENCES:4041.. [WpJacobianVariety]42http://en.wikipedia.org/wiki/Jacobian_variety43"""4445##############################################################################46# Copyright (C) 2013 Volker Braun <[email protected]>47#48# Distributed under the terms of the GNU General Public License (GPL)49#50# The full text of the GPL is available at:51#52# http://www.gnu.org/licenses/53##############################################################################5455from sage.rings.all import QQ56from sage.schemes.elliptic_curves.constructor import EllipticCurve5758596061def Jacobian(X, **kwds):62"""63Return the Jacobian.6465INPUT:6667- ``X`` -- polynomial, algebraic variety, or anything else that68has a Jacobian elliptic curve.6970- ``kwds`` -- optional keyword arguments.7172The input ``X`` can be one of the following:7374* A polynomial, see :func:`Jacobian_of_equation` for details.7576* A curve, see :func:`Jacobian_of_curve` for details.7778EXAMPLES::7980sage: R.<u,v,w> = QQ[]81sage: Jacobian(u^3+v^3+w^3)82Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field8384sage: C = Curve(u^3+v^3+w^3)85sage: Jacobian(C)86Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field8788sage: P2.<u,v,w> = ProjectiveSpace(2, QQ)89sage: C = P2.subscheme(u^3+v^3+w^3)90sage: Jacobian(C)91Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field9293sage: Jacobian(C, morphism=True)94Scheme morphism:95From: Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:96u^3 + v^3 + w^397To: Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field98Defn: Defined on coordinates by sending (u : v : w) to99(u*v^7*w + u*v^4*w^4 + u*v*w^7 :100v^9 + 3/2*v^6*w^3 - 3/2*v^3*w^6 - w^9 :101-v^6*w^3 - v^3*w^6)102"""103try:104return X.jacobian(**kwds)105except AttributeError:106pass107108morphism = kwds.pop('morphism', False)109from sage.rings.polynomial.multi_polynomial_element import is_MPolynomial110if is_MPolynomial(X):111if morphism:112from sage.schemes.plane_curves.constructor import Curve113return Jacobian_of_equation(X, curve=Curve(X), **kwds)114else:115return Jacobian_of_equation(X, **kwds)116117from sage.schemes.all import is_Scheme118if is_Scheme(X) and X.dimension() == 1:119return Jacobian_of_curve(X, morphism=morphism, **kwds)120121122def Jacobian_of_curve(curve, morphism=False):123"""124Return the Jacobian of a genus-one curve125126INPUT:127128- ``curve`` -- a one-dimensional algebraic variety of genus one.129130OUTPUT:131132Its Jacobian elliptic curve.133134EXAMPLES::135136sage: R.<u,v,w> = QQ[]137sage: C = Curve(u^3+v^3+w^3)138sage: Jacobian(C)139Elliptic Curve defined by y^2 = x^3 - 27/4 over Rational Field140"""141eqn = None142try:143eqn = curve.defining_polynomial()144except AttributeError:145pass146if len(curve.defining_polynomials()) == 1:147eqn = curve.defining_polynomials()[0]148if eqn is not None:149if morphism:150return Jacobian_of_equation(eqn, curve=curve)151else:152return Jacobian_of_equation(eqn)153raise NotImplementedError('Jacobian for this curve is not implemented')154155156def Jacobian_of_equation(polynomial, variables=None, curve=None):157r"""158Construct the Jacobian of a genus-one curve given by a polynomial.159160INPUT:161162- ``F`` -- a polynomial defining a plane curve of genus one. May163be homogeneous or inhomogeneous.164165- ``variables`` -- list of two or three variables or ``None``166(default). The inhomogeneous or homogeneous coordinates. By167default, all variables in the polynomial are used.168169- ``curve`` -- the genus-one curve defined by ``polynomial`` or #170``None`` (default). If specified, suitable morphism from the171jacobian elliptic curve to the curve is returned.172173OUTPUT:174175An elliptic curve in short Weierstrass form isomorphic to the176curve ``polynomial=0``. If the optional argument ``curve`` is177specified, a rational multicover from the Jacobian elliptic curve178to the genus-one curve is returned.179180EXAMPLES::181182sage: R.<a,b,c> = QQ[]183sage: f = a^3+b^3+60*c^3184sage: Jacobian(f)185Elliptic Curve defined by y^2 = x^3 - 24300 over Rational Field186sage: Jacobian(f.subs(c=1))187Elliptic Curve defined by y^2 = x^3 - 24300 over Rational Field188189If we specify the domain curve the birational covering is returned::190191sage: h = Jacobian(f, curve=Curve(f)); h192Scheme morphism:193From: Projective Curve over Rational Field defined by a^3 + b^3 + 60*c^3194To: Elliptic Curve defined by y^2 = x^3 - 24300 over Rational Field195Defn: Defined on coordinates by sending (a : b : c) to196(216000*a*b^7*c + 12960000*a*b^4*c^4 + 777600000*a*b*c^7 :197216000*b^9 + 19440000*b^6*c^3 - 1166400000*b^3*c^6 - 46656000000*c^9 :198-216000*b^6*c^3 - 12960000*b^3*c^6)199sage: h([1,-1,0])200(0 : 1 : 0)201202Plugging in the polynomials defining `h` allows us to verify that203it is indeed a rational morphism to the elliptic curve::204205sage: E = h.codomain()206sage: E.defining_polynomial()(h.defining_polynomials()).factor()207(-10077696000000000) * c^3 * b^3 * (a^3 + b^3 + 60*c^3) * (b^6 + 60*b^3*c^3 + 3600*c^6)^3208209By specifying the variables, we can also construct an elliptic210curve over a polynomial ring::211212sage: R.<u,v,t> = QQ[]213sage: Jacobian(u^3+v^3+t, variables=[u,v])214Elliptic Curve defined by y^2 = x^3 + (-27/4*t^2) over215Multivariate Polynomial Ring in u, v, t over Rational Field216217TESTS::218219sage: from sage.schemes.elliptic_curves.jacobian import Jacobian_of_equation220sage: Jacobian_of_equation(f, variables=[a,b,c])221Elliptic Curve defined by y^2 = x^3 - 24300 over Rational Field222"""223from sage.schemes.toric.weierstrass import WeierstrassForm224f, g = WeierstrassForm(polynomial, variables=variables)225try:226K = polynomial.base_ring()227f = K(f)228g = K(g)229except (TypeError, ValueError):230pass231E = EllipticCurve([f, g])232if curve is None:233return E234X, Y, Z = WeierstrassForm(polynomial, variables=variables, transformation=True)235from sage.schemes.elliptic_curves.weierstrass_transform import WeierstrassTransformation236return WeierstrassTransformation(curve, E, [X*Z, Y, Z**3], 1)237238239240