DeRhamComputation/as_drw/as_witt.sage

54 lines
1.6 KiB
Python

class as_witt:
def __init__(self, list_of_fcts):
self.f = list_of_fcts
self.n = len(list_of_fcts) - 1
self.curve = list_of_fcts[0].curve
def __repr__(self):
return str(self.f)
def __eq__(self, other):
#not working, because comparing as_fcts not working
return self.f == other.f
def __add__(self, other):
result = []
C = self.curve
n = self.n
for k in range(0, n+1):
aux = WS[k].subs({X[i] : (self.f)[i].function for i in range(0, n+1)} | {Y[i] : (other.f)[i].function for i in range(0, n+1)})
result += [aux]
result = [as_function(C, a) for a in result]
return as_witt(result)
def __neg__(self):
result = [-a for a in self.f]
return as_witt(result)
def __sub__(self, other):
return self + (-other)
def __mul__(self, other):
result = []
C = self.curve
n = self.n
for k in range(0, n+1):
aux = WP[k].subs({X[i] : (self.f)[i].function for i in range(0, n+1)} | {Y[i] : (other.f)[i].function for i in range(0, n+1)})
result += [aux]
result = [as_function(C, a) for a in result]
return as_witt(result)
def verschiebung(self):
AS = self.curve
return as_witt([0*AS.x] + self.f)
def R(self):
n = self.n
return as_witt(self.f[:n])
def frobenius(self):
n= self.n
p = self.curve.base_ring.characteristic()
result = self.f[:n]
result = [a^p for a in result]
return as_witt(result)