DeRhamComputation/sage/superelliptic/superelliptic_form_class.sage

130 lines
3.9 KiB
Python
Raw Normal View History

2022-11-18 15:00:34 +01:00
class superelliptic_form:
def __init__(self, C, g):
F = C.base_ring
Rxy.<x, y> = PolynomialRing(F, 2)
Fxy = FractionField(Rxy)
g = Fxy(reduction_form(C, g))
self.form = g
self.curve = C
def __add__(self, other):
C = self.curve
g1 = self.form
g2 = other.form
g = reduction(C, g1 + g2)
return superelliptic_form(C, g)
def __sub__(self, other):
C = self.curve
g1 = self.form
g2 = other.form
g = reduction(C, g1 - g2)
return superelliptic_form(C, g)
def __repr__(self):
g = self.form
if len(str(g)) == 1:
return str(g) + ' dx'
return '('+str(g) + ') dx'
def __rmul__(self, constant):
C = self.curve
omega = self.form
return superelliptic_form(C, constant*omega)
2022-11-18 15:00:34 +01:00
def cartier(self):
C = self.curve
m = C.exponent
p = C.characteristic
f = C.polynomial
F = C.base_ring
Rx.<x> = PolynomialRing(F)
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
Fxy = FractionField(FxRy)
result = superelliptic_form(C, FxRy(0))
mult_order = Integers(m)(p).multiplicative_order()
M = Integer((p^(mult_order)-1)/m)
for j in range(1, m):
fct_j = self.jth_component(j)
h = Rx(fct_j*f^(M*j))
j1 = (p^(mult_order-1)*j)%m
B = floor(p^(mult_order-1)*j/m)
result += superelliptic_form(C, polynomial_part(p, h)/(f^B*y^(j1)))
return result
def coordinates(self):
C = self.curve
F = C.base_ring
m = C.exponent
Rx.<x> = PolynomialRing(F)
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
g = C.genus()
degrees_holo = C.degrees_holomorphic_differentials()
degrees_holo_inv = {b:a for a, b in degrees_holo.items()}
basis = C.holomorphic_differentials_basis()
for j in range(1, m):
omega_j = Fx(self.jth_component(j))
if omega_j != Fx(0):
d = degree_of_rational_fctn(omega_j, F)
index = degrees_holo_inv[(d, j)]
a = coeff_of_rational_fctn(omega_j, F)
a1 = coeff_of_rational_fctn(basis[index].jth_component(j), F)
elt = self - (a/a1)*basis[index]
return elt.coordinates() + a/a1*vector([F(i == index) for i in range(0, g)])
return vector(g*[0])
def jth_component(self, j):
g = self.form
C = self.curve
F = C.base_ring
Rx.<x> = PolynomialRing(F)
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
Fxy = FractionField(FxRy)
Ryinv.<y_inv> = PolynomialRing(Fx)
g = Fxy(g)
g = g(y = 1/y_inv)
g = Ryinv(g)
return coff(g, j)
def is_regular_on_U0(self):
C = self.curve
F = C.base_ring
m = C.exponent
Rx.<x> = PolynomialRing(F)
for j in range(1, m):
if self.jth_component(j) not in Rx:
return 0
return 1
def is_regular_on_Uinfty(self):
C = self.curve
F = C.base_ring
m = C.exponent
f = C.polynomial
r = f.degree()
delta = GCD(m, r)
M = m/delta
R = r/delta
for j in range(1, m):
A = self.jth_component(j)
d = degree_of_rational_fctn(A, F)
if(-d*M + j*R -(M+1)<0):
return 0
return 1
def expansion_at_infty(self, place = 0, prec=10):
2022-11-18 15:00:34 +01:00
g = self.form
C = self.curve
g = superelliptic_function(C, g)
g = g.expansion_at_infty(place = place, prec=prec)
x_series = superelliptic_function(C, x).expansion_at_infty(place = place, prec=prec)
2022-11-18 15:00:34 +01:00
dx_series = x_series.derivative()
return g*dx_series