DeRhamComputation/as_covers/as_cech_class.sage

97 lines
3.8 KiB
Python

class as_cech:
def __init__(self, C, omega, f):
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.omega0 = omega
self.f = f
self.omega8 = self.omega0 - self.f.diffn()
if self.omega0.form not in Rxyz or self.omega8.valuation() < 0:
raise ValueError('cech cocycle not regular')
def __repr__(self):
return "( " + str(self.omega0)+", " + str(self.f) + " )"
def __add__(self, other):
C = self.curve
omega = self.omega0
f = self.f
omega1 = other.omega0
f1 = other.f
return as_cech(C, omega + omega1, f+f1)
def __sub__(self, other):
C = self.curve
omega = self.omega0
f = self.f
omega1 = other.omega0
f1 = other.f
return as_cech(C, omega - omega1, f - f1)
def __rmul__(self, constant):
C = self.curve
omega = self.omega0
f = self.f
return as_cech(C, constant*omega, constant*f)
def coordinates(self, threshold=10, basis = 0):
'''Find coordinates of self in the de Rham cohomology basis. Threshold is an argument passed to AS.de_rham_basis().'''
AS = self.curve
C = AS.quotient
m = C.exponent
r = C.polynomial.degree()
n = AS.height
RxyzQ, Rxyz, x, y, z = AS.fct_field
if basis == 0:
basis = [AS.holomorphic_differentials_basis(), AS.cohomology_of_structure_sheaf_basis(), AS.de_rham_basis(threshold=threshold)]
holo_diffs = basis[0]
coh_basis = basis[1]
dR = basis[2]
F = AS.base_ring
f_products = []
for f in coh_basis:
f_products += [[omega.serre_duality_pairing(f) for omega in holo_diffs]]
product_of_fct_and_omegas = []
fct = self.f
product_of_fct_and_omegas = [omega.serre_duality_pairing(fct) for omega in holo_diffs]
V = (F^(AS.genus())).span_of_basis([vector(a) for a in f_products])
coh_coordinates = V.coordinates(product_of_fct_and_omegas) #coeficients of self in the basis elts coming from cohomology of OX
for i in range(AS.genus()):
self -= coh_coordinates[i]*dR[i+AS.genus()]
coh_coordinates = AS.genus()*[0] + list(coh_coordinates)
if self.f.function not in Rxyz:
#We remove now from f the summands which are obviously regular at infty
pr = [list(GF(p)) for _ in range(n)]
S = []
from itertools import product
for i in range(0, threshold*r):
for j in range(0, m):
for k in product(*pr):
g = (AS.x)^i*prod((AS.z[i1])^(k[i1]) for i1 in range(n))*(AS.y)^j
S += [(g, g.expansion_at_infty())]
S += [(self.f, self.f.expansion_at_infty())]
fcts = holomorphic_combinations_fcts(S, 0)
for g in fcts:
if g.function not in Rxyz:
for a in F:
if (self.f.function - a*g.function in Rxyz):
self.f.function = self.f.function - a*g.function
return vector(coh_coordinates)+vector(self.coordinates(threshold=threshold, basis = basis))
else:
self.omega0 -= self.f.diffn()
return vector(coh_coordinates) + vector(list(self.omega0.coordinates())+AS.genus()*[0])
raise ValueError("Increase threshold.")
def group_action(self, g):
AS = self.curve
omega = self.omega0
f = self.f
return as_cech(self.curve, omega.group_action(g), f.group_action(g))