1
1
r"""
2
2
Galois groups of field extensions as permutation groups
3
3
"""
4
-
5
4
from sage .groups .galois_group import _GaloisMixin , _SubGaloisMixin
6
- from sage .groups .perm_gps .permgroup import PermutationGroup , PermutationGroup_generic , PermutationGroup_subgroup
5
+ from sage .groups .perm_gps .permgroup import PermutationGroup_generic , PermutationGroup_subgroup
7
6
from sage .misc .abstract_method import abstract_method
8
7
from sage .misc .lazy_attribute import lazy_attribute
9
8
from sage .sets .finite_enumerated_set import FiniteEnumeratedSet
@@ -27,7 +26,7 @@ class GaloisGroup_perm(_GaloisMixin, PermutationGroup_generic):
27
26
@abstract_method
28
27
def transitive_number (self , algorithm = None , recompute = False ):
29
28
"""
30
- The transitive number (as in the GAP and Magma databases of transitive groups)
29
+ Return the transitive number (as in the GAP and Magma databases of transitive groups)
31
30
for the action on the roots of the defining polynomial of the top field.
32
31
33
32
EXAMPLES::
@@ -42,8 +41,10 @@ def transitive_number(self, algorithm=None, recompute=False):
42
41
@lazy_attribute
43
42
def _gens (self ):
44
43
"""
45
- The generators of this Galois group as permutations of the roots. It's important that this
46
- be computed lazily, since it's often possible to compute other attributes (such as the order
44
+ The generators of this Galois group as permutations of the roots.
45
+
46
+ It is important that this be computed lazily, since it is
47
+ often possible to compute other attributes (such as the order
47
48
or transitive number) more cheaply.
48
49
49
50
EXAMPLES::
@@ -67,7 +68,6 @@ def __init__(self, field, algorithm=None, names=None, gc_numbering=False):
67
68
"""
68
69
self ._field = field
69
70
self ._default_algorithm = algorithm
70
- self ._base = field .base_field ()
71
71
self ._gc_numbering = gc_numbering
72
72
if names is None :
73
73
# add a c for Galois closure
@@ -103,11 +103,11 @@ def _deg(self):
103
103
"""
104
104
if self ._gc_numbering :
105
105
return self .order ()
106
- else :
107
- try :
108
- return self ._field .degree ()
109
- except NotImplementedError : # relative number fields don't support degree
110
- return self ._field .relative_degree ()
106
+
107
+ try :
108
+ return self ._field .degree ()
109
+ except NotImplementedError : # relative number fields don't support degree
110
+ return self ._field .relative_degree ()
111
111
112
112
@lazy_attribute
113
113
def _domain (self ):
@@ -126,12 +126,12 @@ def _domain(self):
126
126
sage: G = K.galois_group(gc_numbering=True); G._domain
127
127
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
128
128
"""
129
- return FiniteEnumeratedSet (range (1 , self ._deg + 1 ))
129
+ return FiniteEnumeratedSet (range (1 , self ._deg + 1 ))
130
130
131
131
@lazy_attribute
132
- def _domain_to_gap (self ):
132
+ def _domain_to_gap (self ) -> dict :
133
133
r"""
134
- Dictionary implementing the identity (used by PermutationGroup_generic).
134
+ The dictionary implementing the identity (used by PermutationGroup_generic).
135
135
136
136
EXAMPLES::
137
137
@@ -141,12 +141,12 @@ def _domain_to_gap(self):
141
141
sage: G._domain_to_gap[5] # needs sage.rings.number_field
142
142
5
143
143
"""
144
- return {key : i + 1 for i , key in enumerate (self ._domain )}
144
+ return {key : i + 1 for i , key in enumerate (self ._domain )}
145
145
146
146
@lazy_attribute
147
- def _domain_from_gap (self ):
147
+ def _domain_from_gap (self ) -> dict :
148
148
r"""
149
- Dictionary implementing the identity (used by PermutationGroup_generic).
149
+ The dictionary implementing the identity (used by PermutationGroup_generic).
150
150
151
151
EXAMPLES::
152
152
@@ -156,11 +156,11 @@ def _domain_from_gap(self):
156
156
sage: G._domain_from_gap[20] # needs sage.rings.number_field
157
157
20
158
158
"""
159
- return {i + 1 : key for i , key in enumerate (self ._domain )}
159
+ return {i + 1 : key for i , key in enumerate (self ._domain )}
160
160
161
- def ngens (self ):
161
+ def ngens (self ) -> int :
162
162
r"""
163
- Number of generators of this Galois group
163
+ Return the number of generators of this Galois group.
164
164
165
165
EXAMPLES::
166
166
0 commit comments