Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

some details in Galois group as permutation group #37039

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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