Skip to content

Commit

Permalink
some details in Galois group as permutation group
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jan 9, 2024
1 parent e249bef commit c67c993
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/sage/groups/galois_group_perm.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
r"""
Galois groups of field extensions as permutation groups
"""

from sage.groups.galois_group import _GaloisMixin, _SubGaloisMixin
from sage.groups.perm_gps.permgroup import PermutationGroup, PermutationGroup_generic, PermutationGroup_subgroup
from sage.groups.perm_gps.permgroup import PermutationGroup_generic, PermutationGroup_subgroup
from sage.misc.abstract_method import abstract_method
from sage.misc.lazy_attribute import lazy_attribute
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
Expand All @@ -27,7 +26,7 @@ class GaloisGroup_perm(_GaloisMixin, PermutationGroup_generic):
@abstract_method
def transitive_number(self, algorithm=None, recompute=False):
"""
The transitive number (as in the GAP and Magma databases of transitive groups)
Return the transitive number (as in the GAP and Magma databases of transitive groups)
for the action on the roots of the defining polynomial of the top field.
EXAMPLES::
Expand All @@ -42,8 +41,10 @@ def transitive_number(self, algorithm=None, recompute=False):
@lazy_attribute
def _gens(self):
"""
The generators of this Galois group as permutations of the roots. It's important that this
be computed lazily, since it's often possible to compute other attributes (such as the order
Return the generators of this Galois group as permutations of the roots.
It is important that this be computed lazily, since it is
often possible to compute other attributes (such as the order
or transitive number) more cheaply.
EXAMPLES::
Expand All @@ -67,7 +68,6 @@ def __init__(self, field, algorithm=None, names=None, gc_numbering=False):
"""
self._field = field
self._default_algorithm = algorithm
self._base = field.base_field()
self._gc_numbering = gc_numbering
if names is None:
# add a c for Galois closure
Expand All @@ -84,7 +84,7 @@ def __init__(self, field, algorithm=None, names=None, gc_numbering=False):
@lazy_attribute
def _deg(self):
r"""
The number of moved points in the permutation representation.
Return the number of moved points in the permutation representation.
This will be the degree of the original number field if `_gc_numbering``
is ``False``, or the degree of the Galois closure otherwise.
Expand All @@ -103,16 +103,16 @@ def _deg(self):
"""
if self._gc_numbering:
return self.order()
else:
try:
return self._field.degree()
except NotImplementedError: # relative number fields don't support degree
return self._field.relative_degree()

try:
return self._field.degree()
except NotImplementedError: # relative number fields don't support degree
return self._field.relative_degree()

Check warning on line 110 in src/sage/groups/galois_group_perm.py

View check run for this annotation

Codecov / codecov/patch

src/sage/groups/galois_group_perm.py#L109-L110

Added lines #L109 - L110 were not covered by tests

@lazy_attribute
def _domain(self):
r"""
The integers labeling the roots on which this Galois group acts.
Return the integers labeling the roots on which this Galois group acts.
EXAMPLES::
Expand All @@ -126,12 +126,12 @@ def _domain(self):
sage: G = K.galois_group(gc_numbering=True); G._domain
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
"""
return FiniteEnumeratedSet(range(1, self._deg+1))
return FiniteEnumeratedSet(range(1, self._deg + 1))

@lazy_attribute
def _domain_to_gap(self):
def _domain_to_gap(self) -> dict:
r"""
Dictionary implementing the identity (used by PermutationGroup_generic).
Return the dictionary implementing the identity (used by PermutationGroup_generic).
EXAMPLES::
Expand All @@ -141,12 +141,12 @@ def _domain_to_gap(self):
sage: G._domain_to_gap[5] # needs sage.rings.number_field
5
"""
return {key: i+1 for i, key in enumerate(self._domain)}
return {key: i + 1 for i, key in enumerate(self._domain)}

@lazy_attribute
def _domain_from_gap(self):
def _domain_from_gap(self) -> dict:
r"""
Dictionary implementing the identity (used by PermutationGroup_generic).
Return the dictionary implementing the identity (used by PermutationGroup_generic).
EXAMPLES::
Expand All @@ -156,11 +156,11 @@ def _domain_from_gap(self):
sage: G._domain_from_gap[20] # needs sage.rings.number_field
20
"""
return {i+1: key for i, key in enumerate(self._domain)}
return {i + 1: key for i, key in enumerate(self._domain)}

def ngens(self):
def ngens(self) -> int:
r"""
Number of generators of this Galois group
Return the number of generators of this Galois group.
EXAMPLES::
Expand Down

0 comments on commit c67c993

Please sign in to comment.