DeRhamComputation/sage/as_covers/dual_element.sage

24 lines
932 B
Python

def dual_elt(AS, zmag):
'''Find the trace dual of a given elt zmag in the function field of an Artin-Schreier cover AS.'''
p = AS.characteristic
n = AS.height
group_elts = [(i, j) for i in range(p) for j in range(p)]
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)
M = matrix(RxyzQ, p^n, p^n)
for i in range(p^n):
for j in range(p^n):
M[i, j] = (zmag.group_action(group_elts[i])*zmag.group_action(group_elts[j])).trace2()
main_det = M.determinant()
zvee = as_function(AS, 0)
for i in range(p^n):
Mprim = matrix(RxyzQ, M)
Mprim[:, i] = vector([(j == 0) for j in range(p^2)])
fi = Mprim.determinant()/main_det
zvee += fi*zmag.group_action(group_elts[i])
return zvee