60 lines
1.8 KiB
Python
60 lines
1.8 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, i = 1):
|
|
AS = self.curve
|
|
return as_witt(i*[0*AS.x] + self.f[i:])
|
|
|
|
def R(self):
|
|
n = self.n
|
|
return as_witt(self.f[:n])
|
|
|
|
def frobenius(self, i = 1):
|
|
n= self.n
|
|
p = self.curve.base_ring.characteristic()
|
|
result = self.f[:n]
|
|
result = [a^(p^i) for a in result]
|
|
return as_witt(result)
|
|
|
|
def diffn(self):
|
|
n = self.n
|
|
AS = self.curve
|
|
f0 = self.f[0]
|
|
return f[0].witt_diffn(n) + as_witt_form((n+1)*[0*AS.x], [0*AS.x] + self.f[1:]) |