DeRhamComputation/sage/superelliptic_drw/decomposition_into_g0_g8.sage
2023-03-09 08:45:24 +00:00

66 lines
2.7 KiB
Python

def decomposition_g0_g8(fct, prec = 50):
'''Writes fct as a difference g0 - g8 + f, with g0 regular on the affine patch and g8 at the points in infinity
and f is combination of basis of H^1(X, OX). Output is (g0, g8, f).'''
C = fct.curve
g = C.genus()
coord = fct.coordinates()
nontrivial_part = 0*C.x
for i, a in enumerate(C.cohomology_of_structure_sheaf_basis()):
nontrivial_part += coord[i]*a
fct -= nontrivial_part
Fxy, Rxy, x, y = C.fct_field
fct = Fxy(fct.function)
num = fct.numerator()
den = fct.denominator()
aux_den = superelliptic_function(C, Rxy(den))
g0 = superelliptic_function(C, 0)
g8 = superelliptic_function(C, 0)
for monomial in num.monomials():
aux = superelliptic_function(C, monomial)
if aux.expansion_at_infty().valuation() >= aux_den.expansion_at_infty().valuation():
g8 -= num.monomial_coefficient(monomial)*aux/aux_den
else:
g0 += num.monomial_coefficient(monomial)*aux/aux_den
return (g0, g8, nontrivial_part)
def decomposition_omega0_omega8(omega, prec=50):
'''Writes omega as a difference omega0 - omega8, with omega0 regular on the affine patch and omega8 at the points in infinity.'''
C = omega.curve
omega.form = reduction(C, omega.form)
F = C.base_ring
delta = C.nb_of_pts_at_infty
m = C.exponent
if sum(omega.residue(place = i, prec = 50) for i in range(delta)) != 0:
raise ValueError(str(omega) + " has non zero residue!")
Fxy, Rxy, x, y = C.fct_field
Rx.<x> = PolynomialRing(F)
Fx = FractionField(Rx)
fct = Fxy(omega.form)
num = fct.numerator()
den = fct.denominator()
aux_den = superelliptic_function(C, Rxy(den))
g0 = superelliptic_function(C, 0)
g8 = superelliptic_function(C, 0)
for j in range(0, m):
component = Fx(omega.jth_component(j))
q, r = component.numerator().quo_rem(component.denominator())
g0 += (C.y)^(-j)*superelliptic_function(C, Rxy(q))
if ((C.y)^(-j)*superelliptic_function(C, Fxy(r/component.denominator()))*C.dx).expansion_at_infty().valuation() < 0:
raise ValueError("Something went wrong for "+str(omega))
g8 -= (C.y)^(-j)*superelliptic_function(C, Fxy(r/component.denominator()))
g0, g8 = g0*C.dx, g8*C.dx
if g0.is_regular_on_U0():
return (g0, g8)
#Rx.<x> = PolynomialRing(F)
#Rx.<x> = PolynomialRing(F)
#aux_fct = (g0.form)*y
else:
raise ValueError("Something went wrong for "+str(omega) +". Result would be "+str(g0)+ " and " + str(g8))
def decomposition_g0_g8_pth_power(fct):
'''Decompose fct as g0 - g8 + A^p, if possible. Output: (g0, g8, A).'''
coor = fct.coordinates()
C = fct.curve
return 0