AUTHORS:
TESTS:
Standard test of pickleability:
sage: G = NumberField(x^3 + 2, 'alpha').galois_group(type="pari"); G
Galois group PARI group [6, -1, 2, "S3"] of degree 3 of the Number Field in alpha with defining polynomial x^3 + 2
sage: G == loads(dumps(G))
True
sage: G = NumberField(x^3 + 2, 'alpha').galois_group(names='beta'); G
Galois group of Galois closure in beta of Number Field in alpha with defining polynomial x^3 + 2
sage: G == loads(dumps(G))
True
An element of a Galois group. This is stored as a permutation, but may also be made to act on elements of the field (generally returning elements of its Galois closure).
EXAMPLE:
sage: K.<w> = QuadraticField(-7); G = K.galois_group()
sage: G[1]
(1,2)
sage: G[1](w + 2)
-w + 2
sage: L.<v> = NumberField(x^3 - 2); G = L.galois_group(names='y')
sage: G[1]
(1,2)(3,4)(5,6)
sage: G[1](v)
1/84*y^4 + 13/42*y
sage: G[1]( G[1](v) )
-1/252*y^4 - 55/126*y
Return the action of self on an element x in the number field of self (or its Galois closure).
EXAMPLE:
sage: K.<w> = QuadraticField(-7)
sage: f = K.galois_group()[1]
sage: f(w)
-w
Compare self to other. For some bizarre reason, if you just let it inherit the cmp routine from PermutationGroupElement, cmp(x, y) works but sorting lists doesn’t.
TEST:
sage: K.<a> = NumberField(x^6 + 40*x^3 + 1372);G = K.galois_group()
sage: sorted([G.artin_symbol(Q) for Q in K.primes_above(5)])
[(1,2)(3,4)(5,6), (1,3)(2,6)(4,5), (1,5)(2,4)(3,6)]
Return the homomorphism L -> L corresponding to self, where L is the Galois closure of the ambient number field.
EXAMPLE:
sage: G = QuadraticField(-7,'w').galois_group()
sage: G[1].as_hom()
Ring endomorphism of Number Field in w with defining polynomial x^2 + 7
Defn: w |--> -w
Return the greatest value of v such that s acts trivially modulo P^v. Should only be used if P is prime and s is in the decomposition group of P.
EXAMPLE:
sage: K.<b> = NumberField(x^3 - 3,'a').galois_closure()
sage: G=K.galois_group()
sage: P = K.primes_above(3)[0]
sage: s = hom(K, K, 1/54*b^4 + 1/18*b)
sage: G(s).ramification_degree(P)
4
A subgroup of a Galois group, as returned by functions such as decomposition_group.
Create a subgroup of a Galois group with the given elements. It is generally better to use the subgroup() method of the parent group.
EXAMPLE:
sage: from sage.rings.number_field.galois_group import GaloisGroup_subgroup
sage: G = NumberField(x^3 - x - 1,'a').galois_closure('b').galois_group()
sage: GaloisGroup_subgroup( G, [ G(1), G([(1,5,2),(3,4,6)]), G([(1,2,5),(3,6,4)])])
Subgroup [(), (1,5,2)(3,4,6), (1,2,5)(3,6,4)] of Galois group of Number Field in b with defining polynomial x^6 - 14*x^4 + 20*x^3 + 49*x^2 - 140*x + 307
String representation of self.
EXAMPLE:
sage: G = NumberField(x^3 - x - 1,'a').galois_closure('b').galois_group()
sage: H = G.subgroup([ G(1), G([(1,5,2),(3,4,6)]), G([(1,2,5),(3,6,4)])])
sage: H._repr_()
'Subgroup [(), (1,5,2)(3,4,6), (1,2,5)(3,6,4)] of Galois group of Number Field in b with defining polynomial x^6 - 14*x^4 + 20*x^3 + 49*x^2 - 140*x + 307'
Return the fixed field of this subgroup (as a subfield of the Galois closure of the number field associated to the ambient Galois group).
EXAMPLE:
sage: L.<a> = NumberField(x^4 + 1)
sage: G = L.galois_group()
sage: H = G.decomposition_group(L.primes_above(3)[0])
sage: H.fixed_field()
(Number Field in a0 with defining polynomial x^2 + 2, Ring morphism:
From: Number Field in a0 with defining polynomial x^2 + 2
To: Number Field in a with defining polynomial x^4 + 1
Defn: a0 |--> a^3 + a)
A wrapper around a class representing an abstract transitive group.
This is just a fairly minimal object at present. To get the underlying group, do G.group(), and to get the corresponding number field do G.number_field(). For a more sophisticated interface use the type=None option.
EXAMPLES:
sage: K = QQ[2^(1/3)]
sage: G = K.galois_group(type="pari"); G
Galois group PARI group [6, -1, 2, "S3"] of degree 3 of the Number Field in a with defining polynomial x^3 - 2
sage: G.order()
6
sage: G.group()
PARI group [6, -1, 2, "S3"] of degree 3
sage: G.number_field()
Number Field in a with defining polynomial x^3 - 2
Compare two number field Galois groups. First the number fields are compared, then the Galois groups if the number fields are equal. (Of course, if the number fields are the same, the Galois groups are automatically equal.)
EXAMPLES:
sage: G = NumberField(x^3 + 2, 'alpha').galois_group(type="pari")
sage: H = QQ[sqrt(2)].galois_group(type="pari")
sage: cmp(G,H)
-1
sage: H == H
True
sage: G == G
True
Create a Galois group.
EXAMPLES:
sage: NumberField([x^2 + 1, x^2 + 2],'a').galois_group(type="pari")
Galois group PARI group [4, 1, 2, "E(4) = 2[x]2"] of degree 4 of the Number Field in a0 with defining polynomial x^2 + 1 over its base field
Display print representation of a Galois group.
EXAMPLES:
sage: G = NumberField(x^4 + 2*x + 2, 'a').galois_group(type="pari")
sage: G.__repr__()
'Galois group PARI group [24, -1, 5, "S4"] of degree 4 of the Number Field in a with defining polynomial x^4 + 2*x + 2'
Return the underlying abstract group.
EXAMPLES:
sage: G = NumberField(x^3 + 2*x + 2, 'theta').galois_group(type="pari")
sage: H = G.group(); H
PARI group [6, -1, 2, "S3"] of degree 3
sage: P = H.permutation_group(); P # optional -- requires Gap optional databases
Transitive group number 2 of degree 3
sage: list(P) # optional
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)]
Return the number field of which this is the Galois group.
EXAMPLES:
sage: G = NumberField(x^6 + 2, 't').galois_group(type="pari"); G
Galois group PARI group [12, -1, 3, "D(6) = S(3)[x]2"] of degree 6 of the Number Field in t with defining polynomial x^6 + 2
sage: G.number_field()
Number Field in t with defining polynomial x^6 + 2
Return the order of this Galois group.
EXAMPLES:
sage: G = NumberField(x^5 + 2, 'theta_1').galois_group(type="pari"); G
Galois group PARI group [20, -1, 3, "F(5) = 5:4"] of degree 5 of the Number Field in theta_1 with defining polynomial x^5 + 2
sage: G.order()
20
The Galois group of an (absolute) number field.
Note
We define the Galois group of a non-normal field K to be the Galois group of its Galois closure L, and elements are stored as permutations of the roots of the defining polynomial of L, not as permutations of the roots (in L) of the defining polynomial of K. The latter would probably be preferable, but is harder to implement. Thus the permutation group that is returned is always simply-transitive.
The ‘arithmetical’ features (decomposition and ramification groups, Artin symbols etc) are only available for Galois fields.
Create an element of self from x. Here x had better be one of: – the integer 1, denoting the identity of G – an element of G – a permutation of the right length which defines an element of G, or anything that
coerces into a permutation of the right length
– an abstract automorphism of the underlying number field.
EXAMPLES:
sage: K.<a> = QuadraticField(-23)
sage: G = K.galois_group()
sage: G(1)
()
sage: G(G.gens()[0])
(1,2)
sage: G([(1,2)])
(1,2)
sage: G(K.hom(-a, K))
(1,2)
Create a Galois group.
EXAMPLES:
sage: QuadraticField(-23,'a').galois_group()
Galois group of Number Field in a with defining polynomial x^2 + 23
sage: NumberField(x^3 - 2, 'b').galois_group()
...
TypeError: You must specify the name of the generator.
sage: NumberField(x^3 - 2, 'b').galois_group(names="c")
Galois group of Galois closure in c of Number Field in b with defining polynomial x^3 - 2
Return the class to be used for creating elements of this group, which is GaloisGroupElement.
EXAMPLE:
sage: F.<z> = CyclotomicField(7)
sage: G = F.galois_group()
sage: G._element_class()
<class 'sage.rings.number_field.galois_group.GaloisGroupElement'>
We test that a method inherited from PermutationGroup_generic returns the right type of element (see trac #133):
sage: phi = G.random_element()
sage: type(phi)
<class 'sage.rings.number_field.galois_group.GaloisGroupElement'>
sage: phi(z) # random
z^3
String representation of self.
EXAMPLE:
sage: G = QuadraticField(-23, 'a').galois_group()
sage: G._repr_()
'Galois group of Number Field in a with defining polynomial x^2 + 23'
sage: G = NumberField(x^3 - 2, 'a').galois_group(names='b')
sage: G._repr_()
'Galois group of Galois closure in b of Number Field in a with defining polynomial x^3 - 2'
Return the Artin symbol , where K is the number field of self,
and
is an unramified prime ideal. This is the unique
element s of the decomposition group of
such that
, where p is the residue characteristic of
.
EXAMPLES:
sage: K.<b> = NumberField(x^4 - 2*x^2 + 2, 'a').galois_closure()
sage: G = K.galois_group()
sage: [G.artin_symbol(P) for P in K.primes_above(7)]
[(1,4)(2,3)(5,8)(6,7), (1,4)(2,3)(5,8)(6,7), (1,5)(2,6)(3,7)(4,8), (1,5)(2,6)(3,7)(4,8)]
sage: G.artin_symbol(17)
...
ValueError: Fractional ideal (17) is not prime
sage: QuadraticField(-7,'c').galois_group().artin_symbol(13)
(1,2)
sage: G.artin_symbol(K.primes_above(2)[0])
...
ValueError: Fractional ideal (...) is ramified
Decomposition group of a prime ideal P, i.e. the subgroup of elements that map P to itself. This is the same as the Galois group of the extension of local fields obtained by completing at P.
This function will raise an error if P is not prime or the given number field is not Galois.
EXAMPLE:
sage: K.<a> = NumberField(x^4 - 2*x^2 + 2,'b').galois_closure()
sage: P = K.ideal([17, a^2])
sage: G = K.galois_group()
sage: G.decomposition_group(P)
Subgroup [(), (1,8)(2,7)(3,6)(4,5)] of Galois group of Number Field in a with defining polynomial x^8 - 20*x^6 + 104*x^4 - 40*x^2 + 1156
sage: G.decomposition_group(P^2)
...
ValueError: Fractional ideal (...) is not prime
sage: G.decomposition_group(17)
...
ValueError: Fractional ideal (17) is not prime
Return the inertia group of the prime P, i.e. the group of elements acting trivially modulo P. This is just the 0th ramification group of P.
EXAMPLE:
sage: K.<b> = NumberField(x^2 - 3,'a')
sage: G = K.galois_group()
sage: G.inertia_group(K.primes_above(2)[0])
Galois group of Number Field in b with defining polynomial x^2 - 3
sage: G.inertia_group(K.primes_above(5)[0])
Subgroup [()] of Galois group of Number Field in b with defining polynomial x^2 - 3
Return True if the underlying number field of self is actually Galois.
EXAMPLE:
sage: NumberField(x^3 - x + 1,'a').galois_group(names='b').is_galois()
False
sage: NumberField(x^2 - x + 1,'a').galois_group().is_galois()
True
List of the elements of self.
EXAMPLE:
sage: NumberField(x^3 - 3*x + 1,'a').galois_group().list()
[(), (1,2,3), (1,3,2)]
Number of generators of self.
EXAMPLE:
sage: QuadraticField(-23, 'a').galois_group().ngens()
1
The ambient number field.
EXAMPLE:
sage: K = NumberField(x^3 - x + 1, 'a')
sage: K.galois_group(names='b').number_field() is K
True
Return the set of ramification breaks of the prime ideal P, i.e. the
set of indices i such that the ramification group .
This is only defined for Galois fields.
EXAMPLE:
sage: K.<b> = NumberField(x^8 - 20*x^6 + 104*x^4 - 40*x^2 + 1156)
sage: G = K.galois_group()
sage: P = K.primes_above(2)[0]
sage: G.ramification_breaks(P)
{1, 3, 5}
sage: min( [ G.ramification_group(P, i).order() / G.ramification_group(P, i+1).order() for i in G.ramification_breaks(P)] )
2
Return the vth ramification group of self for the prime P, i.e. the set of elements s of self such that s acts trivially modulo P^(v+1). This is only defined for Galois fields.
EXAMPLE:
sage: K.<b> = NumberField(x^3 - 3,'a').galois_closure()
sage: G=K.galois_group()
sage: P = K.primes_above(3)[0]
sage: G.ramification_group(P, 3)
Subgroup [(), (1,3,6)(2,4,5), (1,6,3)(2,5,4)] of Galois group of Number Field in b with defining polynomial x^6 + 60*x^3 + 3087
sage: G.ramification_group(P, 5)
Subgroup [()] of Galois group of Number Field in b with defining polynomial x^6 + 60*x^3 + 3087
The Galois closure of the ambient number field.
EXAMPLE:
sage: K = NumberField(x^3 - x + 1, 'a')
sage: K.galois_group(names='b').splitting_field()
Number Field in b with defining polynomial x^6 - 14*x^4 - 20*x^3 + 49*x^2 + 140*x + 307
sage: L = QuadraticField(-23, 'c'); L.galois_group().splitting_field() is L
True
Return the subgroup of self with the given elements. Mostly for internal use.
EXAMPLE:
sage: G = NumberField(x^3 - x - 1,'a').galois_closure('b').galois_group()
sage: G.subgroup([ G(1), G([(1,5,2),(3,4,6)]), G([(1,2,5),(3,6,4)])])
Subgroup [(), (1,5,2)(3,4,6), (1,2,5)(3,6,4)] of Galois group of Number Field in b with defining polynomial x^6 - 14*x^4 + 20*x^3 + 49*x^2 - 140*x + 307