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

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
annasomoza committed Jul 31, 2017
1 parent 38f662f commit b5cec8d
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sage/schemes/hyperelliptic_curves/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
clebsch_invariants)
from .mestre import (Mestre_conic, HyperellipticCurve_from_invariants)
from . import monsky_washnitzer
from .fromshiodas import HyperellipticPolynomialsFromShiodaInvariants


12 changes: 12 additions & 0 deletions src/sage/schemes/hyperelliptic_curves/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
from .hyperelliptic_g2_finite_field import HyperellipticCurve_g2_finite_field
from .hyperelliptic_g2_rational_field import HyperellipticCurve_g2_rational_field
from .hyperelliptic_g2_padic_field import HyperellipticCurve_g2_padic_field
from .hyperelliptic_g3_generic import HyperellipticCurve_g3_generic
from .hyperelliptic_g3_finite_field import HyperellipticCurve_g3_finite_field
from .hyperelliptic_g3_rational_field import HyperellipticCurve_g3_rational_field
from .hyperelliptic_g3_padic_field import HyperellipticCurve_g3_padic_field

from sage.rings.padics.all import is_pAdicField

Expand Down Expand Up @@ -224,20 +228,28 @@ def HyperellipticCurve(f, h=0, names=None, PP=None, check_squarefree=True):
if is_FiniteField(R):
if g == 2:
return HyperellipticCurve_g2_finite_field(PP, f, h, names=names, genus=g)
elif g == 3:
return HyperellipticCurve_g3_finite_field(PP, f, h, names=names, genus=g)
else:
return HyperellipticCurve_finite_field(PP, f, h, names=names, genus=g)
elif is_RationalField(R):
if g == 2:
return HyperellipticCurve_g2_rational_field(PP, f, h, names=names, genus=g)
elif g == 3:
return HyperellipticCurve_g3_rational_field(PP, f, h, names=names, genus=g)
else:
return HyperellipticCurve_rational_field(PP, f, h, names=names, genus=g)
elif is_pAdicField(R):
if g == 2:
return HyperellipticCurve_g2_padic_field(PP, f, h, names=names, genus=g)
elif g == 3:
return HyperellipticCurve_g3_padic_field(PP, f, h, names=names, genus=g)
else:
return HyperellipticCurve_padic_field(PP, f, h, names=names, genus=g)
else:
if g == 2:
return HyperellipticCurve_g2_generic(PP, f, h, names=names, genus=g)
elif g == 3:
return HyperellipticCurve_g3_generic(PP, f, h, names=names, genus=g)
else:
return HyperellipticCurve_generic(PP, f, h, names=names, genus=g)
174 changes: 174 additions & 0 deletions src/sage/schemes/hyperelliptic_curves/fromshiodas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
from sage.rings.all import ZZ
from sage.rings.all import PolynomialRing


#Case C2 x S4 y^2 = x^8 + 14*x^4 + 1 in char > 7 see [MaShShVo2002].
def G3ModelsInCharFF_G48_48(J_i):

FF=J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
f = x**8 + 14*x**4 + 1
return [f]


#Case V8 y^2 = x^8 - 1 in char > 7 see [MaShShVo2002].
def G3ModelsInCharFF_G32_9(J_i):

FF=J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
f=x**8 - 1
return [f]


# Case U6 y^2 = x (x^6 - 1) in char > 7, see [MaShShVo2002].
def G3ModelsInCharFF_G24_5(J_i):

FF=J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
f=x*(x**6 - 1)
return [f]

#Case C14 y^2 = x^7 - 1 in char > 7, see [MaShShVo2002].
def G3ModelsInCharFF_C14(J_i):

FF=J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
f=x**7-1
return [f]

#Case C2xD8 y^2 = x^8 + a4*x^4 + a0 in char > 7
def G3ModelsInCharFF_G16_11(J_i):

FF=J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
J2, J3, J4, J5, J6, J7, J8= J_i

if -30*J3**2+J2**3==0:
a4=35/2*(J5*J2+6*J4*J3)/(-30*J3**2+J2**3)
elif J4!=0:
a4=35/3*J5/J4
elif J5!=0 :
a4 = 7/3*(6*J4*J2+30*J3**2-J2**3)/J5
else:
print "[G3Twists] G48_48 case trapped in G3ModelsInCharFF_G16_11 by error at JI = "
a0 = -1/140*a4**2+1/2*J2

f = x**8 + a4*x**4 + a0
return [f]


#Case D12 y^2 = x * (x^6 + a4*x^3 + a1) in char > 7
def G3ModelsInCharFF_D12(J_i):

FF =J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
J2, J3, J4, J5, J6, J7, J8 = J_i

if 30*J3**2-J2**3!=0:
a4 = 280*(-J5*J2+4*J4*J3)/(30*J3**2-J2**3)
elif J4!=0:
a4 = 35/3*J5/J4
elif J5!=0:
a4 = 7/108*(96*J4*J2+30*J3**2-J2**3)/J5
else:
print "[G3Twists] : G48_48 group trapped in G3ModelsInCharFF_D12()"
a1 = 2/35*a4**2-4*J2
f = x * (x**6 + a4*x**3 + a1)
return [f]


# Case C2xC4 y^2 = a^2*Z^8+2*a^2*Z^6+8*a*Z^2-16; in char > 7,
def G3ModelsInCharFF_C2xC4(J_i):

FF =J_i[0].parent()
R, (x,) = PolynomialRing(FF, 1,'x').objgens()
J2, J3, J4, J5, J6, J7, J8 = J_i

if 6*J4-J2**2==0:
a = FF(196/3)
elif 96*J4-J2**2==0:
a = FF(-196)
elif 147*J4-2*J2**2==0:
if J6-2/3087*J2**3==0:
return [x*(x-1)*(x+1)*(x**2+1)**2]

a = FF(-84)
else:

a = 98/9*(36288*J4**2-3906*J4*J2**2+14400*J6*J2+43*J2**4)/(96*J4-J2**2)/(147*J4-2*J2**2)
f = a**2*x**8+2*a**2*x**6+8*a*x**2-16
return [f]


def G3Models(J_i):

J2, J3, J4, J5, J6, J7, J8, J9, J10 = J_i;
p=J_i[0].parent().characteristic()

if p in [2,3,5,7]:
print "[G3Twists] currently, the algorithm is not implemented for finite fields of char. 2,3,5,7"


# C2 x S4 : y**2 = x**8 + 14*x**4 + 1
if J2**3-30*J3**2==0 and J4==0 and J5==0 and J6==0 and J7==0 and J8==0 and J9==0 and J10==0:
print "Automorphism group C2 x S4, curve y^2 = x^8 + 14*x^4 + 1\n"
aut="C2 x S4"
twists=G3ModelsInCharFF_G48_48(J_i)
return twists, aut

#V8 : y**2 = x**8 - 1
if J3==0 and J2**2-6*J4==0 and J5==0 and J2**3+36*J6==0 and J7==0 and J2**4+420*J8==0 and J9==0 and 2520*J10 - J2**5==0:
print "Automorphism group V8, curve y^2 = x^8 - 1\n"
aut ="V8"
twists=G3ModelsInCharFF_G32_9(J_i)
return twists,aut

#U6 : y^2 = x (x^6 - 1)
if J3==0 and J2**2-96*J4==0 and J5==0 and J2**3+2304*J6==0 and J7==0 and J2**4-17920*J8==0 and J9==0 and 430080*J10+J2**5==0:
aut="U6"
twists=G3ModelsInCharFF_G24_5(J_i)
return twists,aut


#C14 : y^2 = x^7 - 1 */
if J2==0 and J3==0 and J4==0 and J5==0 and J6==0 and J8==0 and J9==0 and J10==0:
print "Automorphism group C14, curve y^2 = x^7 - 1\n"
aut="C14"
twists=G3ModelsInCharFF_C14(J_i)
return twists,aut

#C2 x D8 : y^2 = x^8 + a*x^4 + 1 or a*x^8 + a*x^4 + b
if J4^3 - 3/2*J4**2*J2**2 - 20*J4*J3**2*J2 + 2/3*J4*J2**4 - 200/3*J3**4 + 40/9*J3**2*J2**3 - 2/27*J2**6==0 and J5*J3 + 3/10*J4**2 - 1/4*J4*J2**2 - J3**2*J2 + 1/30*J2**4==0 and J5*J4 - 2/3*J5*J2**2 + 5*J4*J3*J2 + 20*J3**3 - 2/3*J3*J2**3==0 and J5**2 - 6/5*J4**2*J2 - 6*J4*J3**2 + 1/5*J4*J2**3==0 and J6 -1/2*J4*J2 - 10/3*J3**2 + 1/9*J2**3==0 and J7 - 1/3*J5*J2 + J4*J3==0 and J8 - 1/70*J4**2 - 1/20*J4*J2**2 - 1/3*J3**2*J2 + 1/90*J2**4==0 and J9 - 1/9*J5*J2**2 + 5/6*J4*J3*J2 + 10/3*J3**3 - 1/9*J3*J2**3==0 and J10 - 1/42*J4**2*J2 - 1/21*J4*J3**2 + 1/630*J4*J2**3==0:
print "Automorphism group C2xD8, curve y^2 = x^8 + a*x^4 + 1\n"
aut ="C2xD8"
twists = G3ModelsInCharFF_G16_11(J_i)
return twists, aut



#D12 : y^2 = x * (x^6+a*x^3+1)
if J4**3 - 3/32*J4**2*J2**2 - 5/64*J4*J3**2*J2 + 1/384*J4*J2**4 - 25/1536*J3**4+5/4608*J3**2*J2**3 - 1/55296*J2**6==0 and J5*J3 - 16/5*J4**2 + 1/6*J4*J2**2 + 1/24*J3**2*J2 - 1/720*J2**4==0 and J5*J4 - 1/24*J5*J2**2 - 5/24*J4*J3*J2 - 5/96*J3**3 + 1/576*J3*J2**3==0 and J5**2 - 8/15*J4**2*J2 - 1/6*J4*J3**2 + 1/180*J4*J2**3==0 and J6 - 1/8*J4*J2 - 5/96*J3**2 + 1/576*J2**3==0 and J7 - 1/12*J5*J2 - 1/6*J4*J3==0 and J8 - 26/105*J4**2 + 1/120*J4*J2**2 + 1/288*J3**2*J2 - 1/8640*J2**4==0 and J10 - 5/252*J4**2*J2 - 13/1008*J4*J3**2 + 13/30240*J4*J2**3==0 and J9 - 1/144*J5*J2**2 - 5/144*J4*J3*J2 - 5/576*J3**3 + 1/3456*J3*J2**3==0:
print "Automorphism group D12, curve y^2 * (x^6 + a*x^3 + 1)\n"
aut="D12"
twists=G3ModelsInCharFF_D12(J_i)
return twists, aut

#C2 x C4 : y^2 = x * (x^2 - 1) * (x^4 + a * x^2 + 1)
if J3==0 and J5==0 and J7==0 and J6**2 - 11/20*J6*J4*J2 + 19/2880*J6*J2**3 - 162/125*J4**3 + 929/8000*J4**2*J2**2 -161/72000*J4*J2**4 + 1/81000*J2**6==0 and J8 + 22/135*J6*J2 + 78/175*J4**2 - 47/1350*J4*J2**2 + 2/6075*J2**4==0 and J9==0 and J10 + 173/630*J6*J4 + 7/6480*J6*J2**2 + 173/3600*J4**2*J2 - 89/32400*J4*J2**3 + 1/36450*J2**5==0:
print "Automorphism group C2xC4, curve y^2 = x * (x^2 - 1) * (x^4 + a * x^2 + 1)\n"
aut="C2xC4"
twists=G3ModelsInCharFF_C2xC4(J_i)
return twists, aut


return []," "






def HyperellipticPolynomialsFromShiodaInvariants(J_i):
#computes the Shiodas from the nine Shioda invariants

return G3Models(J_i)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Hyperelliptic curves of genus 3 over a finite field
"""
from __future__ import absolute_import

#*****************************************************************************
# Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu>
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************

from . import hyperelliptic_finite_field, hyperelliptic_g3_generic

class HyperellipticCurve_g3_finite_field(
hyperelliptic_g3_generic.HyperellipticCurve_g3_generic,
hyperelliptic_finite_field.HyperellipticCurve_finite_field):
pass

36 changes: 36 additions & 0 deletions src/sage/schemes/hyperelliptic_curves/hyperelliptic_g3_generic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Hyperelliptic curves of genus 3 over a general ring
"""
from __future__ import absolute_import
#*****************************************************************************
# Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu>
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************

from . import hyperelliptic_generic
#from . import jacobian_g3(?)
from . import invariants
#from .g3_reconstruction import fromshiodas as reconstruct


class HyperellipticCurve_g3_generic(hyperelliptic_generic.HyperellipticCurve_generic):
def shioda_invariants(self):
r"""
Return the Shioda invariants `(J2, J3, J4, J5, J6, J7, J8, J9)` of Shioda, [Sh]_.
.. SEEALSO::
:meth:`sage.schemes.hyperelliptic_curves.invariants`
EXAMPLES::
sage: R.<x> = QQ[]
sage: f = x^7 - x^4 + 3
TESTS::
"""
f, h = self.hyperelliptic_polynomials()
assert h == 0, 'Argument must be a simplified model of genus 3.'
return invariants.shioda_invariants(f)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Hyperelliptic curves of genus 3 over a p-adic field
"""
from __future__ import absolute_import

#*****************************************************************************
# Copyright (C) 2007 Robert Bradshaw <robertwb@math.washington.edu>
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************

from . import hyperelliptic_g3_generic, hyperelliptic_padic_field

class HyperellipticCurve_g3_padic_field(
hyperelliptic_g3_generic.HyperellipticCurve_g3_generic,
hyperelliptic_padic_field.HyperellipticCurve_padic_field):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Hyperelliptic curves of genus 3 over the rationals
"""
from __future__ import absolute_import

#*****************************************************************************
# Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu>
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************

from . import hyperelliptic_g3_generic, hyperelliptic_rational_field

class HyperellipticCurve_g3_rational_field(
hyperelliptic_g3_generic.HyperellipticCurve_g3_generic,
hyperelliptic_rational_field.HyperellipticCurve_rational_field):
pass
30 changes: 30 additions & 0 deletions src/sage/schemes/hyperelliptic_curves/invariants.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,33 @@ def absolute_igusa_invariants_kohel(f):
i2 = I2**3*I4/I10
i3 = I2**2*I6/I10
return (i1, i2, i3)

def shioda_invariants(f):
if f.parent().ngens() == 1:
f = PolynomialRing(f.parent().base_ring(), 1, f.parent().variable_name())(f)
x1, x2 = f.homogenize().parent().gens()
F = sum([ f[i]*x1**i*x2**(8-i) for i in range(9) ])
#P.<x,y> = PolynomialRing(f.parent().base_ring(),2)
#F = f(x/y).numerator()
#if F.degree(x) == 7:
# F = F*y
# The Ueberschiebung operator is the classical transvectant
H = Ueberschiebung(F,F,2)
g = Ueberschiebung(F,F,4)
k = Ueberschiebung(F,F,6)
h = Ueberschiebung(k,k,2)
m = Ueberschiebung(F,k,4)
n = Ueberschiebung(F,h,4)
p = Ueberschiebung(g,k,4)
q = Ueberschiebung(g,h,4)
# Invariants
J2 = Ueberschiebung(F,F,8)
J3 = Ueberschiebung(F,g,8)
J4 = Ueberschiebung(k,k,4)
J5 = Ueberschiebung(m,k,4)
J6 = Ueberschiebung(k,h,4)
J7 = Ueberschiebung(m,h,4)
J8 = Ueberschiebung(p,h,4)
J9 = Ueberschiebung(n,h,4)
J10 = Ueberschiebung(q,h,4)
return [J2,J3,J4,J5,J6,J7,J8,J9,J10]

0 comments on commit b5cec8d

Please sign in to comment.