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

Commit

Permalink
Merge branch 'public/11187' into u/stumpc5/20402
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpc5 committed Apr 22, 2016
2 parents a1b3d3b + 9b0ef92 commit 87cdde0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
45 changes: 37 additions & 8 deletions src/sage/combinat/root_system/coxeter_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=No
sage: W # optional - gap3
Permutation Group with generators [(1,3)(2,5)(4,6), (1,4)(2,3)(5,6)]
sage: W.category() # optional - gap3
Join of Category of finite permutation groups and Category of finite coxeter groups
Join of Category of finite permutation groups
and Category of finite coxeter groups
and Category of well generated finite irreducible complex reflection groups
sage: W = CoxeterGroup(["A",2], implementation="matrix")
sage: W
Expand Down Expand Up @@ -204,8 +206,8 @@ def __init__(self, cartan_type):
sage: W = CoxeterGroupAsPermutationGroup(CartanType(["H",3])) # optional - gap3
sage: TestSuite(W).run() # optional - gap3
"""
assert cartan_type.is_finite()
assert cartan_type.is_irreducible()
if not (cartan_type.is_finite() and cartan_type.is_irreducible()):
raise ValueError("must be a finite irreducible type")
self._semi_simple_rank = cartan_type.n
from sage.interfaces.gap3 import gap3
gap3._start()
Expand All @@ -218,7 +220,8 @@ def __init__(self, cartan_type):
from sage.categories.finite_permutation_groups import FinitePermutationGroups
from sage.categories.finite_coxeter_groups import FiniteCoxeterGroups
PermutationGroup_generic.__init__(self, gens=generators,
category=(FinitePermutationGroups(), FiniteCoxeterGroups()))
category=(FinitePermutationGroups(),
FiniteCoxeterGroups().Irreducible()))

def _element_class(self):
"""
Expand All @@ -227,8 +230,9 @@ def _element_class(self):
TESTS::
sage: W = CoxeterGroup(["H",3]) # optional - gap3
sage: W._element_class() is W.element_class # optional - gap3
sage: from sage.combinat.root_system.coxeter_group import CoxeterGroupAsPermutationGroup
sage: W = CoxeterGroupAsPermutationGroup("H3") # optional - gap3
sage: W._element_class() is W.element_class # optional - gap3
True
"""
return self.element_class
Expand All @@ -251,12 +255,12 @@ def reflection(self, i):
"""
Returns the `i`-th reflection of ``self``.
For `i` in `1,\dots,n`, this gives the `i`-th simple
For `i` in `1, \ldots, n`, this gives the `i`-th simple
reflection of ``self``.
EXAMPLES::
sage: W = CoxeterGroup(["H",3], implementation = "permutation") # optional - gap3
sage: W = CoxeterGroup(["H",3], implementation="permutation") # optional - gap3
sage: W.simple_reflection(1) # optional - gap3
(1,16)(2,5)(4,7)(6,9)(8,10)(11,13)(12,14)(17,20)(19,22)(21,24)(23,25)(26,28)(27,29)
sage: W.simple_reflection(2) # optional - gap3
Expand All @@ -274,6 +278,30 @@ def reflection(self, i):

simple_reflection = reflection

@cached_method
def degrees(self):
r"""
Return the degrees of ``self`` ordered within each irreducible
component of ``self``.
EXAMPLES::
sage: from sage.combinat.root_system.coxeter_group import CoxeterGroupAsPermutationGroup
sage: W = CoxeterGroupAsPermutationGroup("A3") # optional - gap3
sage: W.degrees() # optional - gap3
(2, 3, 4)
sage: W = CoxeterGroupAsPermutationGroup("H3") # optional - gap3
sage: W.degrees() # optional - gap3
(2, 6, 10)
"""
if self.is_irreducible():
try:
return tuple(sorted(self._gap_group.degrees.sage()))
except AttributeError:
return tuple(sorted(self._gap_group.ReflectionDegrees().sage()))
else:
return sum([comp.degrees() for comp in self.irreducible_components()],tuple())

class Element(PermutationGroupElement):

def has_descent(self, i, side = 'right', positive=False):
Expand Down Expand Up @@ -338,3 +366,4 @@ def __cmp__(self, other):
1
"""
return super(CoxeterGroupAsPermutationGroup.Element, self).__cmp__(other)

2 changes: 1 addition & 1 deletion src/sage/combinat/root_system/reflection_group_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ def degrees(self):
if self.is_irreducible():
try:
return tuple(sorted(self._gap_group.degrees.sage()))
except:
except AttributeError:
return tuple(sorted(self._gap_group.ReflectionDegrees().sage()))
else:
return sum([comp.degrees() for comp in self.irreducible_components()],tuple())
Expand Down
9 changes: 5 additions & 4 deletions src/sage/combinat/root_system/reflection_group_real.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def ReflectionGroup(*args,**kwds):
the complex infinite family `G(r,p,n)` with `p` divides `r`::
sage: W = ReflectionGroup((1,1,4)); W # optional - gap3
Irreducible complex reflection group of rank 3 and type A3
Irreducible real reflection group of rank 3 and type A3
sage: W = ReflectionGroup((2,1,3)); W # optional - gap3
Irreducible complex reflection group of rank 3 and type B3
Irreducible real reflection group of rank 3 and type B3
Chevalley-Shepard-Todd exceptional classification types::
sage: W = ReflectionGroup(23); W # optional - gap3
Irreducible complex reflection group of rank 3 and type H3
Irreducible real reflection group of rank 3 and type H3
Cartan types and matrices::
Expand Down Expand Up @@ -268,7 +268,7 @@ def _repr_(self):
sage: W = ReflectionGroup(['A',3],['B',2],['I',5],['I',6]) # optional - gap3
sage: W._repr_() # optional - gap3
Reducible real reflection group of rank 9 and type A3 x B2 x I2(5) x G2
'Reducible real reflection group of rank 9 and type A3 x B2 x I2(5) x G2'
"""
type_str = ''
for W_type in self._type:
Expand Down Expand Up @@ -615,6 +615,7 @@ def permutahedron(self, point=None):
TESTS::
sage: W = ReflectionGroup(['A',3]) # optional - gap3
sage: W.permutahedron([3,5,8]) # optional - gap3
A 3-dimensional polyhedron in QQ^3 defined as the convex hull
of 24 vertices
Expand Down

0 comments on commit 87cdde0

Please sign in to comment.