DeRhamComputation/sage/superelliptic_drw/superelliptic_drw_cech.sage

86 lines
3.2 KiB
Python

class superelliptic_drw_cech:
def __init__(self, omega0, f):
self.curve = omega0.curve
self.omega0 = omega0
self.omega8 = omega0 - f.diffn()
self.f = f
def reduce(self):
C = self.curve
fct = self.f
f_first_comp = fct.t
f_second_comp = fct.f
decomp_first_comp = decomposition_g0_g8(f_first_comp)
decomp_second_comp = decomposition_g0_g8(f_second_comp)
new = self
new.omega0 -= decomposition_g0_g8(f_first_comp)[0].teichmuller().diffn()
new.omega0 -= decomposition_g0_g8(f_second_comp)[0].verschiebung().diffn()
new.f = decomposition_g0_g8(f_first_comp)[2].teichmuller() + decomposition_g0_g8(f_second_comp)[2].verschiebung()
new.omega8 = new.omega0 - new.f.diffn()
return new
def __repr__(self):
return("(" + str(self.omega0) + ", "+ str(self.f) + ", " + str(self.omega8) + ")")
def __add__(self, other):
C = self.curve
omega0 = self.omega0
f = self.f
omega0_1 = other.omega0
f_1 = other.f
return superelliptic_drw_cech(omega0 + omega0_1, f + f_1)
def __sub__(self, other):
C = self.curve
omega0 = self.omega0
f = self.f
omega0_1 = other.omega0
f_1 = other.f
return superelliptic_drw_cech(omega0 - omega0_1, f - f_1)
def __neg__(self):
C = self.curve
omega0 = self.omega0
f = self.f
return superelliptic_drw_cech(-omega0, -f)
def __rmul__(self, other):
omega0 = self.omega0
f = self.f
return superelliptic_drw_cech(other*omega0, other*f)
def r(self):
omega0 = self.omega0
f = self.f
C = self.curve
return superelliptic_cech(C, omega0.h1*C.dx, f.t)
def coordinates(self, basis = 0):
C = self.curve
g = C.genus()
coord_mod_p = self.r().coordinates()
print(coord_mod_p)
coord_lifted = [lift(a) for a in coord_mod_p]
if basis == 0:
basis = C.crystalline_cohomology_basis()
aux = self
for i, a in enumerate(basis):
aux -= coord_lifted[i]*a
print('aux before reduce', aux)
#aux = aux.reduce() # Now aux = p*cech class.
# Now aux should be of the form (V(smth), V(smth), V(smth))
print('aux V(smth)', aux)
aux_divided_by_p = superelliptic_cech(C, aux.omega0.omega.cartier(), aux.f.f.pth_root())
print('aux.omega0.omega.cartier()', aux.omega0.omega.cartier())
coord_aux_divided_by_p = aux_divided_by_p.coordinates()
coord_aux_divided_by_p = [ZZ(a) for a in coord_aux_divided_by_p]
coordinates = [ (coord_lifted[i] + p*coord_aux_divided_by_p[i])%p^2 for i in range(2*g)]
return coordinates
def is_regular(self):
print(self.omega0.r().is_regular_on_U0(), self.omega8.r().is_regular_on_Uinfty(), self.omega0.frobenius().is_regular_on_U0(), self.omega8.frobenius().is_regular_on_Uinfty())
eq1 = self.omega0.r().is_regular_on_U0() and self.omega8.r().is_regular_on_Uinfty()
eq2 = self.omega0.frobenius().is_regular_on_U0() and self.omega8.frobenius().is_regular_on_Uinfty()
return eq1 and eq2