Producing a large list of irreducible polynomials of given degree over a specific finite field using a CAS?

189 Views Asked by At

I'm curious if there are computer algebra systems that allows one to easily produce a list of irreducible polynomials of a given degree $n$ in $\mathbb{F}_p[X]$, where $p$ is a specific prime. Does Sage or GAP have any built-in capabilities to return this list? I've been trying to see if either of these can return of a list of polynomials of given degree, and then filtering said list by some built in function or method such as is_irreducible, but can't find anything in the documentation.

I can do it in a round about way constructing $X^{p^n}-X$ over $\mathbb{F}_p$ and factoring, but this does not return very convenient results, and produces many factors of lower degree. For example, I can find the $116$ irreducible polynomials of degree $6$ in $\mathbb{F}_3[X]$ with

sage: R = GF(3)['x']
sage: factor(R(x^(3^6)-x))

and reading off the factors of degree $6$, but it's not in a convenient list form, and also produces all irreducible polynomials of degrees $1,2,3$ as well.

1

There are 1 best solutions below

1
On BEST ANSWER

GAP has a function AllIrreducibleMonicPolynomials(<degree>,<field>) that does exactly what you want. In your example:

gap> l:=AllIrreducibleMonicPolynomials(6,GF(3));
[ x^6+x^5+x^4+Z(3)^0, x^6-x^5+x^4+Z(3)^0, x^6-x^4+Z(3)^0, x^6-x^5+x^3+Z(3)^0,
  x^6+x^4+x^3+Z(3)^0, x^6-x^5-x^4+x^3+Z(3)^0, x^6+x^5-x^3+Z(3)^0,
  [ ... and so on]

The function is used for example in enumerating conjugacy classes of GL.