Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
27302: further corrections according to patchbot hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Oehms committed Apr 1, 2019
1 parent 3402ba7 commit 4b96740
Showing 1 changed file with 62 additions and 4 deletions.
66 changes: 62 additions & 4 deletions src/sage/groups/cubic_braid.py
Expand Up @@ -423,14 +423,14 @@ def find_root(domain):
root_bur = find_root(domain)
domain = root_bur.parent()

else: # domain != None
else: # domain is not None
if characteristic is None:
characteristic = domain.characteristic()
elif characteristic != domain.characteristic():
raise ValueError('characteristic of domain does not match given characteristic')
root_bur = find_root(domain)

else: # root_bur != None
else: # root_bur is not!= None
if domain is None:
domain = root_bur.parent()
if characteristic is None:
Expand Down Expand Up @@ -649,6 +649,13 @@ def _repr_(self):
OUTPUT:
String describing ``self``.
EXAMPLES::
sage: CubicBraidGroup(2)
Cubic Braid group on 2 strands
sage: AssionGroupU(2)
Assion group on 2 strands of type U
"""
if self._cbg_type == CubicBraidGroupType.Coxeter:
return "Cubic Braid group on %s strands"%(self.strands())
Expand All @@ -669,6 +676,13 @@ def _internal_test_attached_group(self, attached_group, tester):
INPUT:
- ``attached_group`` -- attached group to be tested as specified above.
EXAMPLES::
sage: CBG2 = CubicBraidGroup(2)
sage: tester = CBG2._tester()
sage: CBG2M = CBG2.as_matrix_group()
sage: CBG2._internal_test_attached_group(CBG2M, tester)
"""
elem = self.an_element()
att_grp_elem = attached_group(elem)
Expand All @@ -685,6 +699,11 @@ def _test_classical_group(self, **options):
The following is checked:
- construction of classical group was faithfull.
- coercion maps to and from classical group exist and are inverse to each other.
EXAMPLES::
sage: CBG2 = CubicBraidGroup(2)
sage: CBG2._test_classical_group()
"""
tester = self._tester(**options)
classic_grp = self.as_classical_group()
Expand All @@ -700,6 +719,11 @@ def _test_permutation_group(self, **options):
The following is checked:
- construction of permutation group was faithfull.
- coercion maps to and from permutation group exist and are inverse to each other.
EXAMPLES::
sage: CBG2 = CubicBraidGroup(2)
sage: CBG2._test_permutation_group()
"""
if self.is_finite():
tester = self._tester(**options)
Expand All @@ -715,6 +739,11 @@ def _test_matrix_group(self, **options):
The following is checked:
- construction of matrix group was faithfull in several cases.
- coercion maps to and from matrix group exist.
EXAMPLES::
sage: CBG2 = CubicBraidGroup(2)
sage: CBG2._test_matrix_group()
"""
tester = self._tester(**options)
F3 = GF(3); r63 = F3(2); F4 = GF(4); r64 = F4.gen()
Expand Down Expand Up @@ -745,6 +774,11 @@ def _test_reflection_group(self, **options):
The following is checked:
- construction of reflection group was faithfull.
- coercion maps to and from reflection group exist and are inverse to each other.
EXAMPLES::
sage: CBG2 = CubicBraidGroup(2)
sage: CBG2._test_reflection_group()
"""
if self._cbg_type == CubicBraidGroupType.Coxeter and self.is_finite() and self.strands() > 2:
from sage.combinat.root_system.reflection_group_real import is_chevie_available
Expand Down Expand Up @@ -772,6 +806,23 @@ def _create_classical_realization(self, just_embedded=False):
- self._centralizing_matrix for AssionGroup: element in classical base group commuting with self.
- self._centralizing_element image under natural map of the former one in the projective classical group.
- self._classical_embedding as subgroup of classical base group (if different from classical group).
EXAMPLES::
sage: AU2 = AssionGroupU(2)
sage: AU2._classical_group is None
True
sage: AU2._classical_embedding is None
True
sage: AU2._classical_invariant_form is None
True
sage: AU2._create_classical_realization()
sage: AU2._classical_group
General Unitary Group of degree 1 over Finite Field in a of size 2^2
sage: AU2._classical_embedding is AU2._classical_group
True
sage: AU2._classical_invariant_form
[1]
"""

# -------------------------------------------------------------------------------
Expand Down Expand Up @@ -821,6 +872,7 @@ def set_classical_realization(self, base_group, proj_group, centralizing_matrix,
classical_group = base_group
hom_to_classic = self.hom(im_gens, check=check)
classical_group.register_conversion(hom_to_classic)
embedding = classical_group
else:
if embedding is None:
im_gens.pop()
Expand Down Expand Up @@ -881,7 +933,6 @@ def create_sympl_realization(self, m):

bform = base_group.invariant_form()
bas = bform.column_space().basis()
F = bform.base_ring()

if m % 2 == 0:
mhalf = m/2
Expand Down Expand Up @@ -1071,7 +1122,7 @@ def _element_constructor_(self, x, **kwds):
-- constructing element from an element of the attached permutation group
-- constructing element from an element of the attached refelction group
INPUT::
INPUT:
- ``x`` -- can be one of the following:
-- an instance of the element class of ``self`` (but possible to a different parent).
Expand Down Expand Up @@ -1729,6 +1780,13 @@ def order(self):
def is_finite(self):
r"""
Method from :class:`GroupMixinLibGAP` overwriten because of performance reason.
EXAMPLES::
sage: CubicBraidGroup(6).is_finite()
False
sage: AssionGroupS(6).is_finite()
True
"""
from sage.rings.infinity import infinity
return not self.order() is infinity
Expand Down

0 comments on commit 4b96740

Please sign in to comment.