DeRhamComputation/as_covers/template.sage

37 lines
1.2 KiB
Python
Raw Normal View History

2024-06-10 21:08:42 +02:00
class template:
'''Template of a p-group cover'''
def __init__(self, height, field, group, fcts, gp_action):
self.height = height
self.group = group
self.fcts = fcts #RHSs of the Artin-Schreier equations
self.gp_action = gp_action #action of the generators of the group on z[i]'s
self.field = field
n = height
variable_names = ''
for i in range(n):
variable_names += 'z'+str(i)+','
for i in range(n):
variable_names += 'f'+str(i)
if i!=n-1:
variable_names += ','
R = PolynomialRing(field, 2*n, variable_names)
z = R.gens()[:n]
f = R.gens()[n:]
def elementary_template(p, n):
group = elementary_gp(p, n)
field = GF(p)
variable_names = ''
for i in range(n):
variable_names += 'z'+str(i)+','
for i in range(n):
variable_names += 'f'+str(i)
if i!=n-1:
variable_names += ','
R = PolynomialRing(field, 2*n, variable_names)
z = R.gens()[:n]
f = R.gens()[n:]
height = n
fcts = [f[i] for i in range(n)]
gp_action = [[z[j] + (i == j) for j in range(n)] for i in range(n)]
return template(height, field, group, fcts, gp_action)