Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/hyperelliptic_curves/jacobian_constructor.py
4128 views
1
"""
2
Constructor for Jacobian of a hyperelliptic curve
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2006 David Kohel <[email protected]>
7
# Distributed under the terms of the GNU General Public License (GPL)
8
# http://www.gnu.org/licenses/
9
#*****************************************************************************
10
11
from hyperelliptic_generic import is_HyperellipticCurve
12
import jacobian_g2
13
import jacobian_generic
14
15
def Jacobian(C):
16
if not is_HyperellipticCurve(C):
17
raise TypeError, "Argument C (= %s) must be a hyperelliptic curve."
18
if C.genus() == 2:
19
return jacobian_g2.HyperellipticJacobian_g2(C)
20
else:
21
return jacobian_generic.HyperellipticJacobian_generic(C)
22
23