75 lines
2.6 KiB
Python
75 lines
2.6 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
|
|
|
|
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
|
|
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 i, f in enumerate(coh_basis):
|
|
f_products += [[]]
|
|
for omega in holo_diffs:
|
|
f_products[i] += [sum((f*omega).residue(place = _) for _ in range(AS.nb_of_pts_at_infty))]
|
|
|
|
product_of_fct_and_omegas = []
|
|
fct = self.f
|
|
for omega in holo_diffs:
|
|
product_of_fct_and_omegas += [sum((fct*omega).residue(place = _) for _ in range(AS.nb_of_pts_at_infty))]
|
|
|
|
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()]
|
|
|
|
hol_form = self.omega0 + self.f.diffn() #now this should be a holomorphic form
|
|
hol_form = hol_form
|
|
print(hol_form)
|
|
return hol_form.coordinates() + coh_coordinates
|
|
|
|
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)) |