Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

At the end I settled for this solution :

  K=[]
  def FieldM(q, n):
  k.<t> = GF(q^n)
  Frob = k.frobenius_endomorphism()
  for a in k:
        K.append(a)
  for l in divisors(n):
      if l!=n:  
        for a in k:
            if a==power(Frob, l)(a):
               if a in K:
                   K.remove(a)

Where we have the function power defined as such

    def power(func, n):
           def lazy(x, i=n):
               return func(lazy(x, i-1)) if i > 0 else x
           return lazy

At the end I settled for this solution :

  K=[]
  def FieldM(q, n):
  k.<t> = GF(q^n)
  Frob = k.frobenius_endomorphism()
  for a in k:
        K.append(a)
  for l in divisors(n):
      if l!=n:  
        for a in k:
            if a==power(Frob, l)(a):
               if a in K:
                   K.remove(a)

Where we have the function power defined as such

    def power(func, n):
           def lazy(x, pow(x, i=n):
               return func(lazy(x, func(pow(x, i-1)) if i > 0 else x
           return lazy
pow