Skip to content

Commit

Permalink
sagemathgh-37039: some details in Galois group as permutation group
Browse files Browse the repository at this point in the history
    
just a few minor changes in the modified file

removing the unused attribute `_base`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#37039
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed Jan 16, 2024
2 parents c15c4dc + 4c60c29 commit ffc20a0
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 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
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 Down Expand Up @@ -103,11 +103,11 @@ 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()

@lazy_attribute
def _domain(self):
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).
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).
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 ffc20a0

Please sign in to comment.