2022-11-18 15:00:34 +01:00
|
|
|
class as_form:
|
|
|
|
def __init__(self, C, g):
|
|
|
|
self.curve = C
|
|
|
|
n = C.height
|
|
|
|
F = C.base_ring
|
|
|
|
variable_names = 'x, y'
|
|
|
|
for i in range(n):
|
|
|
|
variable_names += ', z' + str(i)
|
|
|
|
Rxyz = PolynomialRing(F, n+2, variable_names)
|
|
|
|
x, y = Rxyz.gens()[:2]
|
|
|
|
z = Rxyz.gens()[2:]
|
|
|
|
RxyzQ = FractionField(Rxyz)
|
|
|
|
self.form = RxyzQ(g)
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return "(" + str(self.form)+") * dx"
|
|
|
|
|
2023-03-07 13:41:20 +01:00
|
|
|
def expansion_at_infty(self, place = 0):
|
2022-11-18 15:00:34 +01:00
|
|
|
C = self.curve
|
|
|
|
delta = C.nb_of_pts_at_infty
|
|
|
|
F = C.base_ring
|
2023-03-07 13:41:20 +01:00
|
|
|
x_series = C.x_series[place]
|
|
|
|
y_series = C.y_series[place]
|
|
|
|
z_series = C.z_series[place]
|
|
|
|
dx_series = C.dx_series[place]
|
2022-11-18 15:00:34 +01:00
|
|
|
n = C.height
|
|
|
|
variable_names = 'x, y'
|
|
|
|
for j in range(n):
|
|
|
|
variable_names += ', z' + str(j)
|
|
|
|
Rxyz = PolynomialRing(F, n+2, variable_names)
|
|
|
|
x, y = Rxyz.gens()[:2]
|
|
|
|
z = Rxyz.gens()[2:]
|
|
|
|
RxyzQ = FractionField(Rxyz)
|
|
|
|
prec = C.prec
|
|
|
|
Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
|
|
|
|
g = self.form
|
|
|
|
sub_list = {x : x_series, y : y_series} | {z[j] : z_series[j] for j in range(n)}
|
|
|
|
return g.substitute(sub_list)*dx_series
|
|
|
|
|
2023-03-08 14:54:07 +01:00
|
|
|
def expansion(self, pt = 0):
|
|
|
|
'''Same code as expansion_at_infty.'''
|
|
|
|
C = self.curve
|
|
|
|
F = C.base_ring
|
|
|
|
x_series = C.x_series[pt]
|
|
|
|
y_series = C.y_series[pt]
|
|
|
|
z_series = C.z_series[pt]
|
|
|
|
dx_series = C.dx_series[pt]
|
|
|
|
n = C.height
|
|
|
|
variable_names = 'x, y'
|
|
|
|
for j in range(n):
|
|
|
|
variable_names += ', z' + str(j)
|
|
|
|
Rxyz = PolynomialRing(F, n+2, variable_names)
|
|
|
|
x, y = Rxyz.gens()[:2]
|
|
|
|
z = Rxyz.gens()[2:]
|
|
|
|
RxyzQ = FractionField(Rxyz)
|
|
|
|
prec = C.prec
|
|
|
|
Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
|
|
|
|
g = self.form
|
|
|
|
sub_list = {x : x_series, y : y_series} | {z[j] : z_series[j] for j in range(n)}
|
|
|
|
return g.substitute(sub_list)*dx_series
|
|
|
|
|
2022-11-18 15:00:34 +01:00
|
|
|
def __add__(self, other):
|
|
|
|
C = self.curve
|
|
|
|
g1 = self.form
|
|
|
|
g2 = other.form
|
|
|
|
return as_form(C, g1 + g2)
|
|
|
|
|
|
|
|
def __sub__(self, other):
|
|
|
|
C = self.curve
|
|
|
|
g1 = self.form
|
|
|
|
g2 = other.form
|
|
|
|
return as_form(C, g1 - g2)
|
|
|
|
|
2023-11-29 09:50:29 +01:00
|
|
|
def __neg__(self):
|
|
|
|
C = self.curve
|
|
|
|
g = self.form
|
|
|
|
return as_form(C, -g)
|
|
|
|
|
2022-11-18 15:00:34 +01:00
|
|
|
def __rmul__(self, constant):
|
|
|
|
C = self.curve
|
|
|
|
omega = self.form
|
|
|
|
return as_form(C, constant*omega)
|
|
|
|
|
|
|
|
def group_action(self, ZN_tuple):
|
|
|
|
C = self.curve
|
|
|
|
n = C.height
|
2022-12-23 13:52:17 +01:00
|
|
|
RxyzQ, Rxyz, x, y, z = C.fct_field
|
2022-11-18 15:00:34 +01:00
|
|
|
sub_list = {x : x, y : y} | {z[j] : z[j]+ZN_tuple[j] for j in range(n)}
|
|
|
|
g = self.form
|
|
|
|
return as_form(C, g.substitute(sub_list))
|
|
|
|
|
2022-12-22 14:44:57 +01:00
|
|
|
def coordinates(self, basis = 0):
|
|
|
|
"""Find coordinates of the given holomorphic form self in terms of the basis forms in a list holo."""
|
2022-11-18 15:00:34 +01:00
|
|
|
C = self.curve
|
2022-12-22 14:44:57 +01:00
|
|
|
if basis == 0:
|
|
|
|
basis = C.holomorphic_differentials_basis()
|
|
|
|
RxyzQ, Rxyz, x, y, z = C.fct_field
|
|
|
|
# We need to have only polynomials to use monomial_coefficients in linear_representation_polynomials,
|
|
|
|
# and sometimes basis elements have denominators. Thus we multiply by them.
|
|
|
|
denom = LCM([denominator(omega.form) for omega in basis])
|
|
|
|
basis = [denom*omega for omega in basis]
|
|
|
|
self_with_no_denominator = denom*self
|
|
|
|
return linear_representation_polynomials(Rxyz(self_with_no_denominator.form), [Rxyz(omega.form) for omega in basis])
|
2022-11-18 15:00:34 +01:00
|
|
|
|
|
|
|
def trace(self):
|
|
|
|
C = self.curve
|
|
|
|
C_super = C.quotient
|
|
|
|
n = C.height
|
|
|
|
F = C.base_ring
|
|
|
|
variable_names = 'x, y'
|
|
|
|
for j in range(n):
|
|
|
|
variable_names += ', z' + str(j)
|
|
|
|
Rxyz = PolynomialRing(F, n+2, variable_names)
|
|
|
|
x, y = Rxyz.gens()[:2]
|
|
|
|
z = Rxyz.gens()[2:]
|
|
|
|
RxyzQ = FractionField(Rxyz)
|
|
|
|
result = as_form(C, 0)
|
2022-11-24 18:59:07 +01:00
|
|
|
G = C.group
|
|
|
|
for a in G:
|
|
|
|
result += self.group_action(a)
|
2022-11-18 15:00:34 +01:00
|
|
|
result = result.form
|
|
|
|
Rxy.<x, y> = PolynomialRing(F, 2)
|
|
|
|
Qxy = FractionField(Rxy)
|
2022-12-19 14:37:14 +01:00
|
|
|
result = as_reduction(AS, result)
|
2022-11-18 15:00:34 +01:00
|
|
|
return superelliptic_form(C_super, Qxy(result))
|
2022-12-19 15:19:50 +01:00
|
|
|
|
2022-12-19 14:37:14 +01:00
|
|
|
def residue(self, place=0):
|
2023-03-07 13:41:20 +01:00
|
|
|
return self.expansion_at_infty(place = place).residue()
|
2022-11-18 15:00:34 +01:00
|
|
|
|
2022-12-19 15:19:50 +01:00
|
|
|
def valuation(self, place=0):
|
2023-03-07 13:41:20 +01:00
|
|
|
return self.expansion_at_infty(place = place).valuation()
|
2022-12-19 15:19:50 +01:00
|
|
|
|
2022-12-23 13:52:17 +01:00
|
|
|
def serre_duality_pairing(self, fct):
|
|
|
|
AS = self.curve
|
|
|
|
return sum((fct*self).residue(place = _) for _ in range(AS.nb_of_pts_at_infty))
|
2023-02-23 12:26:25 +01:00
|
|
|
|
|
|
|
def cartier(self):
|
|
|
|
C = self.curve
|
|
|
|
F = C.base_ring
|
|
|
|
n = C.height
|
|
|
|
ff = C.functions
|
|
|
|
p = F.characteristic()
|
|
|
|
C_super = C.quotient
|
|
|
|
(RxyzQ, Rxyz, x, y, z) = C.fct_field
|
|
|
|
fct = self.form
|
|
|
|
Rxy.<x, y> = PolynomialRing(F, 2)
|
|
|
|
RxyQ = FractionField(Rxy)
|
|
|
|
x, y = Rxyz.gens()[0], Rxyz.gens()[1]
|
|
|
|
z = Rxyz.gens()[2:]
|
|
|
|
num = Rxyz(fct.numerator())
|
|
|
|
den = Rxyz(fct.denominator())
|
|
|
|
result = RxyzQ(0)
|
|
|
|
#return (num, den, z, fct)
|
|
|
|
if den in Rxy:
|
|
|
|
sub_list = {x : x, y : y} | {z[j] : (z[j]^p - RxyzQ(ff[j].function)) for j in range(n)}
|
|
|
|
num = RxyzQ(num.substitute(sub_list))
|
|
|
|
den1 = Rxyz(num.denominator())
|
|
|
|
num = Rxyz(num*den1^p)
|
|
|
|
for monomial in Rxyz(num).monomials():
|
|
|
|
degrees = [monomial.degree(z[i]) for i in range(n)]
|
|
|
|
product_of_z = prod(z[i]^(degrees[i]) for i in range(n))
|
|
|
|
monomial_divided_by_z = monomial/product_of_z
|
|
|
|
product_of_z_no_p = prod(z[i]^(degrees[i]/p) for i in range(n))
|
|
|
|
aux_form = superelliptic_form(C_super, RxyQ(monomial_divided_by_z/den))
|
|
|
|
aux_form = aux_form.cartier()
|
|
|
|
result += product_of_z_no_p * Rxyz(num).monomial_coefficient(monomial) * aux_form.form/den1
|
|
|
|
return as_form(C, result)
|
|
|
|
raise ValueError("Please present first your form as sum z^i omega_i, where omega_i are forms on quotient curve.")
|
2024-01-10 18:05:29 +01:00
|
|
|
|
|
|
|
def is_regular_on_U0(self):
|
|
|
|
AS = self.curve
|
|
|
|
C = AS.quotient
|
|
|
|
m = C.exponent
|
|
|
|
RxyzQ, Rxyz, x, y, z = AS.fct_field
|
|
|
|
if y^(m-1)*self.form in Rxyz:
|
|
|
|
return True
|
|
|
|
return False
|
2022-11-18 15:00:34 +01:00
|
|
|
|
|
|
|
def are_forms_linearly_dependent(set_of_forms):
|
|
|
|
from sage.rings.polynomial.toy_variety import is_linearly_dependent
|
|
|
|
C = set_of_forms[0].curve
|
|
|
|
F = C.base_ring
|
|
|
|
n = C.height
|
|
|
|
variable_names = 'x, y'
|
|
|
|
for i in range(n):
|
|
|
|
variable_names += ', z' + str(i)
|
|
|
|
Rxyz = PolynomialRing(F, n+2, variable_names)
|
|
|
|
denominators = prod(denominator(omega.form) for omega in set_of_forms)
|
|
|
|
return is_linearly_dependent([Rxyz(denominators*omega.form) for omega in set_of_forms])
|
|
|
|
|
|
|
|
def only_log_forms(C_AS):
|
|
|
|
list1 = AS.at_most_poles_forms(0)
|
|
|
|
list2 = AS.at_most_poles_forms(1)
|
|
|
|
result = []
|
|
|
|
for a in list2:
|
|
|
|
if not(are_forms_linearly_dependent(list1 + result + [a])):
|
|
|
|
result += [a]
|
|
|
|
return result
|