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 G = AS.group 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): elt = (zmag.group_action(G[i])*zmag.group_action(G[j])).trace().function elt = Rxyz(elt.numerator())/Rxyz(elt.denominator()) M[i, j] = RxyzQ(elt) 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^n)]) fi = Mprim.determinant()/main_det zvee += as_function(AS, fi*(zmag.group_action(G[i]).function)) return zvee