11r"""
22Galois groups of field extensions as permutation groups
33"""
4-
54from 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
76from sage .misc .abstract_method import abstract_method
87from sage .misc .lazy_attribute import lazy_attribute
98from sage .sets .finite_enumerated_set import FiniteEnumeratedSet
@@ -27,7 +26,7 @@ class GaloisGroup_perm(_GaloisMixin, PermutationGroup_generic):
2726 @abstract_method
2827 def transitive_number (self , algorithm = None , recompute = False ):
2928 """
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)
3130 for the action on the roots of the defining polynomial of the top field.
3231
3332 EXAMPLES::
@@ -42,8 +41,10 @@ def transitive_number(self, algorithm=None, recompute=False):
4241 @lazy_attribute
4342 def _gens (self ):
4443 """
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
4748 or transitive number) more cheaply.
4849
4950 EXAMPLES::
@@ -67,7 +68,6 @@ def __init__(self, field, algorithm=None, names=None, gc_numbering=False):
6768 """
6869 self ._field = field
6970 self ._default_algorithm = algorithm
70- self ._base = field .base_field ()
7171 self ._gc_numbering = gc_numbering
7272 if names is None :
7373 # add a c for Galois closure
@@ -103,11 +103,11 @@ def _deg(self):
103103 """
104104 if self ._gc_numbering :
105105 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 ()
111111
112112 @lazy_attribute
113113 def _domain (self ):
@@ -126,12 +126,12 @@ def _domain(self):
126126 sage: G = K.galois_group(gc_numbering=True); G._domain
127127 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
128128 """
129- return FiniteEnumeratedSet (range (1 , self ._deg + 1 ))
129+ return FiniteEnumeratedSet (range (1 , self ._deg + 1 ))
130130
131131 @lazy_attribute
132- def _domain_to_gap (self ):
132+ def _domain_to_gap (self ) -> dict :
133133 r"""
134- Dictionary implementing the identity (used by PermutationGroup_generic).
134+ The dictionary implementing the identity (used by PermutationGroup_generic).
135135
136136 EXAMPLES::
137137
@@ -141,12 +141,12 @@ def _domain_to_gap(self):
141141 sage: G._domain_to_gap[5] # needs sage.rings.number_field
142142 5
143143 """
144- return {key : i + 1 for i , key in enumerate (self ._domain )}
144+ return {key : i + 1 for i , key in enumerate (self ._domain )}
145145
146146 @lazy_attribute
147- def _domain_from_gap (self ):
147+ def _domain_from_gap (self ) -> dict :
148148 r"""
149- Dictionary implementing the identity (used by PermutationGroup_generic).
149+ The dictionary implementing the identity (used by PermutationGroup_generic).
150150
151151 EXAMPLES::
152152
@@ -156,11 +156,11 @@ def _domain_from_gap(self):
156156 sage: G._domain_from_gap[20] # needs sage.rings.number_field
157157 20
158158 """
159- return {i + 1 : key for i , key in enumerate (self ._domain )}
159+ return {i + 1 : key for i , key in enumerate (self ._domain )}
160160
161- def ngens (self ):
161+ def ngens (self ) -> int :
162162 r"""
163- Number of generators of this Galois group
163+ Return the number of generators of this Galois group.
164164
165165 EXAMPLES::
166166
0 commit comments