class superelliptic_form: def __init__(self, C, g): F = C.base_ring Rxy. = 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) def cartier(self): C = self.curve m = C.exponent p = C.characteristic f = C.polynomial F = C.base_ring Rx. = PolynomialRing(F) Fx = FractionField(Rx) FxRy. = 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. = PolynomialRing(F) Fx = FractionField(Rx) FxRy. = 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. = PolynomialRing(F) Fx = FractionField(Rx) FxRy. = PolynomialRing(Fx) Fxy = FractionField(FxRy) Ryinv. = 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. = 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, i = 0, prec=10): g = self.form C = self.curve g = superelliptic_function(C, g) g = g.expansion_at_infty(i = i, prec=prec) x_series = superelliptic_function(C, x).expansion_at_infty(i = i, prec=prec) dx_series = x_series.derivative() return g*dx_series