2023-03-09 09:45:24 +01:00
|
|
|
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()
|
2023-03-23 18:45:28 +01:00
|
|
|
coord = fct.coordinates(prec=prec)
|
2023-03-09 09:45:24 +01:00
|
|
|
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()
|
2023-03-23 18:45:28 +01:00
|
|
|
integral_part, num = num.quo_rem(den)
|
2023-03-09 09:45:24 +01:00
|
|
|
aux_den = superelliptic_function(C, Rxy(den))
|
2023-03-23 18:45:28 +01:00
|
|
|
g0 = superelliptic_function(C, integral_part)
|
2023-03-09 09:45:24 +01:00
|
|
|
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
|
2023-03-23 18:45:28 +01:00
|
|
|
if sum(omega.residue(place = i, prec = prec) for i in range(delta)) != 0:
|
2023-03-09 09:45:24 +01:00
|
|
|
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:
|
2023-03-24 12:27:05 +01:00
|
|
|
raise ValueError("Something went wrong for "+str(omega) +". Result would be "+str(g0)+ " and " + str(g8))
|