Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

listing desired polynomials of given degree

asked 1 year ago

jacop gravatar image

updated 0 years ago

FrédéricC gravatar image

I want to write a program such that it takes values a and b where a is for the degree of the polynomial and b is for the field. After that I wanted to list all reducible and irrecucible polynomials of degree a in Fb. Can you help me to write it using sagemath ?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 1 year ago

dan_fulea gravatar image

Here is a first brute force solution. I will use q instead of b. Let F=Fq=GF(q) be the field with q elements. One can use itertools.product (the pythonic way) or the sagemath specific cartesian_product to have a loop over (the tuples of) monic polynomials. We will collect only the irreducible ones of degree a in F[t]=Fq[t].

q, a = 9, 5    
# feel free to use other values, 
# or arrange for a function to use an adapted code working in the following manner.

F = GF(q, names='w')
R.<t> = PolynomialRing(F)

all_polynomials = [
    t^a + sum([coeff*t^c for (c, coeff) in enumerate(my_tuple)])
    for my_tuple in cartesian_product([F for counter in range(a)])
]

irreducible_polynomials = [pol for pol in all_polynomials if pol.is_irreducible()]

And we obtain after some time the wanted list irreducible_polynomials. How many polynomials are in there?

sage: len(irreducible_polynomials)
11808

And which is the number we expect? Well, every polynomial in the list has a=5 roots which are not elements of a proper subfield of F95. There is only one proper subfield of F95, which is F9. (In general, we have all Fqd for da a divisor of a. These fields may have common elements, and the divisibility graph of a mimic the intersection scheme of these fields.) So there are exactly 959 elements of degree 5 over F=F9, and collecting them in conjugacy groups (irreducible polynomials) we obtain (959)/5=11808 such groups.

We may also use this counting scheme to have an other way to generate the irreducible polynomials.


The above can be shortened to generate all monic irreducible polynomials by using instead the loop over the iterator R.polynomials(...):

q, a = 9, 5
F = GF(q, names='w')
R.<t> = PolynomialRing(F)

irreducible_polynomials = [
    t^a + pol 
    for pol in R.polynomials(max_degree=a - 1)
    if (t^a + pol).is_irreducible()
]

If the monic assumption is not needed, then all the irreducible polynomials of degree a are alternatively given by:

q, a = 9, 5
F = GF(q, names='w')
R.<t> = PolynomialRing(F)

all_irreducible_polynomials = [
    pol 
    for pol in R.polynomials(of_degree=a)
    if pol.is_irreducible()
]

And we expect of course (91) times 11808 such polynomials, and producing them takes a lot of time. Indeed:

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 1 year ago

Seen: 244 times

Last updated: Jan 04 '24