DeRhamComputation/as_drw/as_witt.sage

60 lines
1.8 KiB
Python
Raw Normal View History

2024-01-13 17:11:29 +01:00
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)
2024-01-22 10:24:12 +01:00
def verschiebung(self, i = 1):
2024-01-13 17:11:29 +01:00
AS = self.curve
2024-01-22 10:24:12 +01:00
return as_witt(i*[0*AS.x] + self.f[i:])
2024-01-13 17:11:29 +01:00
def R(self):
n = self.n
return as_witt(self.f[:n])
2024-01-22 10:24:12 +01:00
def frobenius(self, i = 1):
2024-01-13 17:11:29 +01:00
n= self.n
p = self.curve.base_ring.characteristic()
result = self.f[:n]
2024-01-22 10:24:12 +01:00
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:])