Function Repository Resource:

GaloisGroup

Source Notebook

Compute the Galois group of an irreducible polynomial

Contributed by: YodeJaphe

ResourceFunction["GaloisGroup"][poly]

gives properties about the Galois group for the polynomial poly up to degree 7.

ResourceFunction["GaloisGroup"][]

gives tabular data of properties for all possible Galois groups for polynomials up to degree 7.

Details

ResourceFunction["GaloisGroup"][poly] returns an Association containing the following keys:
"nTk"k-th transitive subgroup of Sn
"Order"order of a Galois group
"Attributes"attributes of this Galois group
"Name"common name of this Galois group
"PermutationGroupRepresentation"representation as a Wolfram System permutation group
"Generators"generators of this Galois group
The "Attributes" can include "SubgroupAn" for a subgroup of an alternating group and "Nonsolvable".

Examples

Basic Examples (3) 

Calculate the Galois group of a polynomial:

In[1]:=
ResourceFunction["GaloisGroup"][x^5 - 5 x^3 + 5 x - 4]
Out[1]=

Calculate the Galois group of a fourth-order polynomial:

In[2]:=
ResourceFunction["GaloisGroup"][x^4 + 2 x^2 + 2]
Out[2]=

Return all possible Galois groups of degree up to 7:

In[3]:=
ResourceFunction["GaloisGroup"][]
Out[3]=

Scope (1) 

The coefficients of the polynomial can be rational numbers:

In[4]:=
ResourceFunction["GaloisGroup"][x^2/6 + x/3 + 1/10]
Out[4]=
In[5]:=
polys = {x^4 - 2, x^5 - x - 1, x^5 - 2, x^6 - 3 x^3 + 1, x^4 - 10 x^2 + 1, -1 - x + x^7};
Table[{p, ResourceFunction["GaloisGroup"][p]}, {p, polys}]
Out[6]=

Possible Issues (1) 

When a polynomial is reducible in the rational number field, it will return unevaluated:

In[7]:=
poly = -18 - 3 x - 3 x^2 - x^3 + x^4;
IrreduciblePolynomialQ[poly]
Out[8]=
In[9]:=
ResourceFunction["GaloisGroup"][-18 - 3 x - 3 x^2 - x^3 + x^4]
Out[9]=

Publisher

Yude

Version History

  • 1.0.0 – 22 October 2025

Related Resources

Author Notes

In fact, I achieved this through the table lookup method, by considering all possible Galois groups of irreducible polynomials within the 7th degree. However, when the degree is greater than 8, the permutation type of the Galois group is no longer unique (such as 8T10 and 8T11, has exactly the same permutation type). This method is no longer reliable, so it only supports irreducible polynomials with degrees less than 8. I have tried my best to express the abstract groups in the "PermutationGroupRepresentation" field in a named form. If there is no named group available in Mathematica, I will simply use the PermutationGroup as the permutation group. The existing library function "GaloisGroupProperties" for calculating the Galois group of polynomials can only handle polynomials of the highest degree of 4, while my "GaloisGroup" can handle polynomials of the highest degree of 7. Moreover, "StauduharGaloisGroup" has some persistent bugs, which leads to frequent calculation errors(for example, 1 + 3x + x^2 + x^4 + x^5 is calculated as C5, but it is D5). Additionally, "StauduharGaloisGroup" can only handle cases where the leading coefficient is 1, while my "GaloisGroup" has no restrictions on this and even allows coefficients to be rational numbers.

License Information