DeRhamComputation/sage/superelliptic_drw/second_patch.sage

30 lines
945 B
Python
Raw Normal View History

2023-03-09 09:45:24 +01:00
def patch(C):
if C.exponent != 2:
raise ValueError("Not implemented yet!")
Fxy, Rxy, x, y = C.fct_field
F = C.base_ring
Rx.<x> = PolynomialRing(F)
f = C.polynomial
g = C.genus()
f_star = Rx(x^(2*g+2)*f(1/x))
return superelliptic(f_star, 2)
def second_patch(argument):
C = argument.curve
C1 = patch(C)
Fxy, Rxy, x, y = C.fct_field
g = C.genus()
if isinstance(argument, superelliptic_function):
fct = Fxy(argument.function)
fct1 = Fxy(fct.subs({x : 1/x, y : y/x^(g+1)}))
return superelliptic_function(C1, fct1)
if isinstance(argument, superelliptic_form):
fct = Fxy(argument.form)
fct1 = Fxy(fct.subs({x : 1/x, y : y/x^(g+1)}))
fct1 *= -x^(-2)
return superelliptic_form(C1, fct1)
def lift_form_to_drw(omega):
A, B = regular_form(omega)
A, B = A.change_ring(QQ), B.change_ring(QQ)
print("%s dx + %s dy"%(A, B))