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

Commit

Permalink
Merge branch 'u/tscrim/11187' of trac.sagemath.org:sage into t/11187/…
Browse files Browse the repository at this point in the history
…11187

Conflicts:
	src/sage/categories/complex_reflection_groups.py
  • Loading branch information
nthiery committed Apr 10, 2016
2 parents 32bf1ae + d425669 commit 73276ca
Show file tree
Hide file tree
Showing 10 changed files with 580 additions and 654 deletions.
141 changes: 69 additions & 72 deletions src/sage/categories/complex_reflection_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#*****************************************************************************

from sage.misc.abstract_method import abstract_method
from sage.misc.all import prod
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_import import LazyImport
from sage.categories.category_singleton import Category_singleton
Expand All @@ -31,7 +30,7 @@ class ComplexReflectionGroups(Category_singleton):
A *complex reflection group* is a group `W` that is (isomorphic
to) a subgroup of some general linear group `\operatorname{GL}(V)`
generated by complex reflections.
generated by a distinguished set of complex reflections.
The dimension of `V` is the *rank* of `W`.
Expand Down Expand Up @@ -138,10 +137,10 @@ def index_set(self):
(1, 2, 3)
sage: W = ReflectionGroup((1,1,4), index_set=[1,3,'asdf'])
sage: W.index_set()
[1, 3, 'asdf']
sage: W = ReflectionGroup((1,1,4), index_set={'a':0,'b':1,'c':2})
(1, 3, 'asdf')
sage: W = ReflectionGroup((1,1,4), index_set=('a','b','c'))
sage: W.index_set()
['a', 'b', 'c']
('a', 'b', 'c')
"""

def simple_reflection(self, i):
Expand Down Expand Up @@ -171,13 +170,13 @@ def hyperplane_index_set(self):
sage: W = ReflectionGroup((1,1,4))
sage: W.hyperplane_index_set()
[0, 1, 2, 3, 4, 5]
(1, 2, 3, 4, 5, 6)
sage: W = ReflectionGroup((1,1,4), hyperplane_index_set=[1,3,'asdf',7,9,11])
sage: W.hyperplane_index_set()
[1, 3, 'asdf', 7, 9, 11]
sage: W = ReflectionGroup((1,1,4), hyperplane_index_set={'a':0,'b':1,'c':2,'d':3,'e':4,'f':5})
(1, 3, 'asdf', 7, 9, 11)
sage: W = ReflectionGroup((1,1,4), hyperplane_index_set=('a','b','c','d','e','f'))
sage: W.hyperplane_index_set()
['a', 'b', 'c', 'd', 'e', 'f']
('a', 'b', 'c', 'd', 'e', 'f')
"""

@abstract_method(optional=True)
Expand All @@ -190,7 +189,7 @@ def distinguished_reflection(self, i):
EXAMPLES::
sage: W = ReflectionGroup((1,1,4), hyperplane_index_set={'a':0,'b':1,'c':2,'d':3,'e':4,'f':5})
sage: W = ReflectionGroup((1,1,4), hyperplane_index_set=('a','b','c','d','e','f'))
sage: for i in W.hyperplane_index_set():
....: print('%s %s'%(i, W.distinguished_reflection(i)))
a (1,7)(2,4)(5,6)(8,10)(11,12)
Expand All @@ -210,13 +209,13 @@ def reflection_index_set(self):
sage: W = ReflectionGroup((1,1,4))
sage: W.reflection_index_set()
[0, 1, 2, 3, 4, 5]
(1, 2, 3, 4, 5, 6)
sage: W = ReflectionGroup((1,1,4), reflection_index_set=[1,3,'asdf',7,9,11])
sage: W.reflection_index_set()
[1, 3, 'asdf', 7, 9, 11]
sage: W = ReflectionGroup((1,1,4), reflection_index_set={'a':0,'b':1,'c':2,'d':3,'e':4,'f':5})
(1, 3, 'asdf', 7, 9, 11)
sage: W = ReflectionGroup((1,1,4), reflection_index_set=('a','b','c','d','e','f'))
sage: W.reflection_index_set()
['a', 'b', 'c', 'd', 'e', 'f']
('a', 'b', 'c', 'd', 'e', 'f')
"""

@abstract_method(optional=True)
Expand All @@ -232,12 +231,12 @@ def reflection(self, i):
sage: W = ReflectionGroup((1,1,4))
sage: for i in W.reflection_index_set():
....: print('%s %s'%(i, W.reflection(i)))
0 (1,7)(2,4)(5,6)(8,10)(11,12)
1 (1,4)(2,8)(3,5)(7,10)(9,11)
2 (2,5)(3,9)(4,6)(8,11)(10,12)
3 (1,8)(2,7)(3,6)(4,10)(9,12)
4 (1,6)(2,9)(3,8)(5,11)(7,12)
5 (1,11)(3,10)(4,9)(5,7)(6,12)
1 (1,7)(2,4)(5,6)(8,10)(11,12)
2 (1,4)(2,8)(3,5)(7,10)(9,11)
3 (2,5)(3,9)(4,6)(8,11)(10,12)
4 (1,8)(2,7)(3,6)(4,10)(9,12)
5 (1,6)(2,9)(3,8)(5,11)(7,12)
6 (1,11)(3,10)(4,9)(5,7)(6,12)
"""

# This is a duplicate of GeneralizedCoxeterGroups
Expand Down Expand Up @@ -278,9 +277,9 @@ def distinguished_reflections(self):
sage: distinguished_reflections = W.distinguished_reflections()
sage: for index in sorted(distinguished_reflections.keys()):
....: print('%s %s'%(index, distinguished_reflections[index]))
0 (1,4)(2,3)(5,6)
1 (1,3)(2,5)(4,6)
2 (1,5)(2,4)(3,6)
1 (1,4)(2,3)(5,6)
2 (1,3)(2,5)(4,6)
3 (1,5)(2,4)(3,6)
sage: W = ReflectionGroup((1,1,3),hyperplane_index_set=['a','b','c'])
sage: distinguished_reflections = W.distinguished_reflections()
Expand All @@ -294,20 +293,20 @@ def distinguished_reflections(self):
sage: distinguished_reflections = W.distinguished_reflections()
sage: for index in sorted(distinguished_reflections.keys()):
....: print('%s %s'%(index, distinguished_reflections[index]))
0 (1,2,3)
1 (1,2,3)
sage: W = ReflectionGroup((1,1,3), (3,1,2))
sage: distinguished_reflections = W.distinguished_reflections()
sage: for index in sorted(distinguished_reflections.keys()):
....: print('%s %s'%(index, distinguished_reflections[index]))
0 (1,6)(2,5)(7,8)
1 (1,5)(2,7)(6,8)
2 (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30)
3 (3,11)(4,12)(9,13)(10,14)(15,19)(16,20)(17,21)(18,22)(23,27)(24,28)(25,26)(29,30)
4 (1,7)(2,6)(5,8)
5 (3,19)(4,25)(9,11)(10,17)(12,28)(13,15)(14,30)(16,18)(20,27)(21,29)(22,23)(24,26)
6 (4,21,27)(10,22,28)(11,13,19)(12,14,20)(16,26,30)(17,18,25)(23,24,29)
7 (3,13)(4,24)(9,19)(10,29)(11,15)(12,26)(14,21)(16,23)(17,30)(18,27)(20,22)(25,28)
1 (1,6)(2,5)(7,8)
2 (1,5)(2,7)(6,8)
3 (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30)
4 (3,11)(4,12)(9,13)(10,14)(15,19)(16,20)(17,21)(18,22)(23,27)(24,28)(25,26)(29,30)
5 (1,7)(2,6)(5,8)
6 (3,19)(4,25)(9,11)(10,17)(12,28)(13,15)(14,30)(16,18)(20,27)(21,29)(22,23)(24,26)
7 (4,21,27)(10,22,28)(11,13,19)(12,14,20)(16,26,30)(17,18,25)(23,24,29)
8 (3,13)(4,24)(9,19)(10,29)(11,15)(12,26)(14,21)(16,23)(17,30)(18,27)(20,22)(25,28)
"""
from sage.sets.family import Family
return Family(self.hyperplane_index_set(), self.distinguished_reflection)
Expand All @@ -324,9 +323,9 @@ def reflections(self):
sage: reflections = W.reflections()
sage: for index in sorted(reflections.keys()):
....: print('%s %s'%(index, reflections[index]))
0 (1,4)(2,3)(5,6)
1 (1,3)(2,5)(4,6)
2 (1,5)(2,4)(3,6)
1 (1,4)(2,3)(5,6)
2 (1,3)(2,5)(4,6)
3 (1,5)(2,4)(3,6)
sage: W = ReflectionGroup((1,1,3),reflection_index_set=['a','b','c'])
sage: reflections = W.reflections()
Expand All @@ -340,23 +339,23 @@ def reflections(self):
sage: reflections = W.reflections()
sage: for index in sorted(reflections.keys()):
....: print('%s %s'%(index, reflections[index]))
0 (1,2,3)
1 (1,3,2)
1 (1,2,3)
2 (1,3,2)
sage: W = ReflectionGroup((1,1,3), (3,1,2))
sage: reflections = W.reflections()
sage: for index in sorted(reflections.keys()):
....: print('%s %s'%(index, reflections[index]))
0 (1,6)(2,5)(7,8)
1 (1,5)(2,7)(6,8)
2 (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30)
3 (3,11)(4,12)(9,13)(10,14)(15,19)(16,20)(17,21)(18,22)(23,27)(24,28)(25,26)(29,30)
4 (1,7)(2,6)(5,8)
5 (3,19)(4,25)(9,11)(10,17)(12,28)(13,15)(14,30)(16,18)(20,27)(21,29)(22,23)(24,26)
6 (4,21,27)(10,22,28)(11,13,19)(12,14,20)(16,26,30)(17,18,25)(23,24,29)
7 (3,13)(4,24)(9,19)(10,29)(11,15)(12,26)(14,21)(16,23)(17,30)(18,27)(20,22)(25,28)
8 (3,15,9)(4,16,10)(12,23,17)(14,24,18)(20,29,25)(21,26,22)(27,30,28)
9 (4,27,21)(10,28,22)(11,19,13)(12,20,14)(16,30,26)(17,25,18)(23,29,24)
1 (1,6)(2,5)(7,8)
2 (1,5)(2,7)(6,8)
3 (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30)
4 (3,11)(4,12)(9,13)(10,14)(15,19)(16,20)(17,21)(18,22)(23,27)(24,28)(25,26)(29,30)
5 (1,7)(2,6)(5,8)
6 (3,19)(4,25)(9,11)(10,17)(12,28)(13,15)(14,30)(16,18)(20,27)(21,29)(22,23)(24,26)
7 (4,21,27)(10,22,28)(11,13,19)(12,14,20)(16,26,30)(17,18,25)(23,24,29)
8 (3,13)(4,24)(9,19)(10,29)(11,15)(12,26)(14,21)(16,23)(17,30)(18,27)(20,22)(25,28)
9 (3,15,9)(4,16,10)(12,23,17)(14,24,18)(20,29,25)(21,26,22)(27,30,28)
10 (4,27,21)(10,28,22)(11,19,13)(12,20,14)(16,30,26)(17,25,18)(23,29,24)
"""
from sage.sets.family import Family
return Family(self.reflection_index_set(), self.reflection)
Expand Down Expand Up @@ -390,7 +389,7 @@ def irreducible_components(self):
EXAMPLES::
sage: W = ReflectionGroup([1,1,3],[3,1,3],4)
sage: W = ReflectionGroup([1,1,3], [3,1,3], 4)
sage: W.irreducible_components()
[Irreducible real reflection group of rank 2 and type A2,
Irreducible complex reflection group of rank 3 and type G(3,1,3),
Expand Down Expand Up @@ -462,14 +461,14 @@ def from_word(self, word, word_type='simple'):
[1, 2, 3]
sage: W = ReflectionGroup((1,1,4))
sage: W.from_word([0,1,2], word_type='all').reduced_word()
word: 012
sage: W.from_word([1,2,3], word_type='all').reduced_word()
[1, 2, 3]
sage: W.from_word([0,1,2], word_type='all').reduced_word_in_reflections()
word: 012
sage: W.from_word([1,2,3], word_type='all').reduced_word_in_reflections()
[1, 2, 3]
sage: W.from_word([0,1,2]).reduced_word_in_reflections()
word: 012
sage: W.from_word([1,2,3]).reduced_word_in_reflections()
[1, 2, 3]
"""
if word_type == 'simple':
f = self.one().apply_simple_reflections
Expand Down Expand Up @@ -498,7 +497,7 @@ def group_generators(self):

def is_irreducible(self):
r"""
Return True if ``self`` is irreducible.
Return ``True`` if ``self`` is irreducible.
EXAMPLES::
Expand Down Expand Up @@ -678,7 +677,7 @@ def is_reflection(self):
"""
return self.reflection_length() == 1

def apply_simple_reflections(self, word, side = 'right'):
def apply_simple_reflections(self, word, side='right'):
r"""
Return the result of the (left/right) multiplication of
``word`` to ``self``.
Expand Down Expand Up @@ -714,7 +713,7 @@ def apply_simple_reflections(self, word, side = 'right'):
self = self.apply_simple_reflection(i, side=side)
return self

def apply_distinguished_reflection(self, i, side = 'right'):
def apply_distinguished_reflection(self, i, side='right'):
r"""
Return the result of the (left/right) multiplication of
the ``i``-th distingiushed reflection to ``self``.
Expand All @@ -727,11 +726,11 @@ def apply_distinguished_reflection(self, i, side = 'right'):
EXAMPLES::
sage: W = ReflectionGroup((1,1,3))
sage: W.one().apply_distinguished_reflection(0)
(1,4)(2,3)(5,6)
sage: W.one().apply_distinguished_reflection(1)
(1,3)(2,5)(4,6)
(1,4)(2,3)(5,6)
sage: W.one().apply_distinguished_reflection(2)
(1,3)(2,5)(4,6)
sage: W.one().apply_distinguished_reflection(3)
(1,5)(2,4)(3,6)
sage: W = ReflectionGroup((1,1,3), hyperplane_index_set=['A','B','C']); W
Expand Down Expand Up @@ -765,11 +764,11 @@ def apply_distinguished_reflections(self, word, side='right'):
EXAMPLES::
sage: W = ReflectionGroup((1,1,3))
sage: W.one().apply_distinguished_reflections([0])
(1,4)(2,3)(5,6)
sage: W.one().apply_distinguished_reflections([1])
(1,4)(2,3)(5,6)
sage: W.one().apply_distinguished_reflections([2])
(1,3)(2,5)(4,6)
sage: W.one().apply_distinguished_reflections([1,0])
sage: W.one().apply_distinguished_reflections([2,1])
(1,2,6)(3,4,5)
"""
for i in word:
Expand All @@ -789,11 +788,11 @@ def apply_reflection(self, i, side='right'):
EXAMPLES::
sage: W = ReflectionGroup((1,1,3))
sage: W.one().apply_reflection(0)
(1,4)(2,3)(5,6)
sage: W.one().apply_reflection(1)
(1,3)(2,5)(4,6)
(1,4)(2,3)(5,6)
sage: W.one().apply_reflection(2)
(1,3)(2,5)(4,6)
sage: W.one().apply_reflection(3)
(1,5)(2,4)(3,6)
sage: W = ReflectionGroup((1,1,3), reflection_index_set=['A','B','C']); W
Expand Down Expand Up @@ -826,20 +825,18 @@ def apply_reflections(self, word, side='right'):
EXAMPLES::
sage: W = ReflectionGroup((1,1,3))
sage: W.one().apply_reflections([0])
(1,4)(2,3)(5,6)
sage: W.one().apply_reflections([1])
(1,4)(2,3)(5,6)
sage: W.one().apply_reflections([2])
(1,3)(2,5)(4,6)
sage: W.one().apply_reflections([1,0])
sage: W.one().apply_reflections([2,1])
(1,2,6)(3,4,5)
"""
for i in word:
self = self.apply_reflection(i, side=side)
return self

Finite = LazyImport('sage.categories.finite_complex_reflection_groups', 'FiniteComplexReflectionGroups', as_name='Finite')

class Irreducible(CategoryWithAxiom):
ParentMethods = GeneralizedCoxeterGroups.Irreducible.ParentMethods

Finite = LazyImport('sage.categories.finite_complex_reflection_groups', 'FiniteComplexReflectionGroups', as_name='Finite')

4 changes: 2 additions & 2 deletions src/sage/categories/examples/finite_coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def index_set(self):
sage: D4 = FiniteCoxeterGroups().example(4)
sage: D4.index_set()
[1, 2]
(1, 2)
"""
return [1, 2]
return (1, 2)

def degrees(self):
"""
Expand Down
Loading

0 comments on commit 73276ca

Please sign in to comment.