DeRhamComputation/sage/superelliptic/superelliptic_function_class.sage

105 lines
2.8 KiB
Python
Raw Normal View History

2022-11-18 15:00:34 +01:00
#Class of rational functions on a superelliptic curve C. g = g(x, y) is a polynomial
#defining the function.
class superelliptic_function:
def __init__(self, C, g):
F = C.base_ring
Rxy.<x, y> = PolynomialRing(F, 2)
Fxy = FractionField(Rxy)
f = C.polynomial
r = f.degree()
m = C.exponent
self.curve = C
g = reduction(C, g)
self.function = g
def __repr__(self):
return str(self.function)
def jth_component(self, j):
g = self.function
C = self.curve
F = C.base_ring
Rx.<x> = PolynomialRing(F)
Fx.<x> = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
g = FxRy(g)
return coff(g, j)
def __add__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 + g2)
return superelliptic_function(C, g)
def __sub__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 - g2)
return superelliptic_function(C, g)
def __mul__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 * g2)
return superelliptic_function(C, g)
def __truediv__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 / g2)
return superelliptic_function(C, g)
def __pow__(self, exp):
C = self.curve
g = self.function
return superelliptic_function(C, g^(exp))
def diffn(self):
C = self.curve
f = C.polynomial
m = C.exponent
F = C.base_ring
g = self.function
Rxy.<x, y> = PolynomialRing(F, 2)
Fxy = FractionField(Rxy)
g = Fxy(g)
A = g.derivative(x)
B = g.derivative(y)*f.derivative(x)/(m*y^(m-1))
return superelliptic_form(C, A+B)
def expansion_at_infty(self, i = 0, prec=10):
C = self.curve
f = C.polynomial
m = C.exponent
F = C.base_ring
Rx.<x> = PolynomialRing(F)
f = Rx(f)
Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
RptW.<W> = PolynomialRing(Rt)
RptWQ = FractionField(RptW)
Rxy.<x, y> = PolynomialRing(F)
RxyQ = FractionField(Rxy)
fct = self.function
fct = RxyQ(fct)
r = f.degree()
delta, a, b = xgcd(m, r)
b = -b
M = m/delta
R = r/delta
while a<0:
a += R
b += M
g = (x^r*f(x = 1/x))
gW = RptWQ(g(x = t^M * W^b)) - W^(delta)
ww = naive_hensel(gW, F, start = root_of_unity(F, delta)^i, prec = prec)
xx = Rt(1/(t^M*ww^b))
yy = 1/(t^R*ww^a)
return Rt(fct(x = Rt(xx), y = Rt(yy)))