# Coxeter Groups¶

sage.combinat.root_system.coxeter_group.CoxeterGroup(data, implementation='reflection', base_ring=None, index_set=None)

Return an implementation of the Coxeter group given by data.

INPUT:

• data – a Cartan type (or coercible into; see CartanType) or a Coxeter matrix or graph
• implementation – (default: 'reflection') can be one of the following:
• 'permutation' - as a permutation representation
• 'matrix' - as a Weyl group (as a matrix group acting on the root space); if this is not implemented, this uses the “reflection” implementation
• 'coxeter3' - using the coxeter3 package
• 'reflection' - as elements in the reflection representation; see CoxeterMatrixGroup
• base_ring – (optional) the base ring for the 'reflection' implementation
• index_set – (optional) the index set for the 'reflection' implementation

EXAMPLES:

Now assume that data represents a Cartan type. If implementation is not specified, the reflection representation is returned:

sage: W = CoxeterGroup(["A",2])
sage: W
Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3]
[3 1]

sage: W = CoxeterGroup(["A",3,1]); W
Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2 3]
[3 1 3 2]
[2 3 1 3]
[3 2 3 1]

sage: W = CoxeterGroup(['H',3]); W
Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]


We now use the implementation option:

sage: W = CoxeterGroup(["A",2], implementation = "permutation") # optional - chevie
sage: W                                                         # optional - chevie
Permutation Group with generators [(1,3)(2,5)(4,6), (1,4)(2,3)(5,6)]
sage: W.category()                       # optional - chevie
Join of Category of finite permutation groups and Category of finite coxeter groups

sage: W = CoxeterGroup(["A",2], implementation="matrix")
sage: W
Weyl Group of type ['A', 2] (as a matrix group acting on the ambient space)

sage: W = CoxeterGroup(["H",3], implementation="matrix")
sage: W
Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]

sage: W = CoxeterGroup(["H",3], implementation="reflection")
sage: W
Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]

sage: W = CoxeterGroup(["A",4,1], implementation="permutation")
Traceback (most recent call last):
...
NotImplementedError: Coxeter group of type ['A', 4, 1] as permutation group not implemented


We use the different options for the “reflection” implementation:

sage: W = CoxeterGroup(["H",3], implementation="reflection", base_ring=RR)
sage: W
Coxeter group over Real Field with 53 bits of precision with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]
sage: W = CoxeterGroup([[1,10],[10,1]], implementation="reflection", index_set=['a','b'], base_ring=SR)
sage: W
Coxeter group over Symbolic Ring with Coxeter matrix:
[ 1 10]
[10  1]


TESTS:

sage: W = groups.misc.CoxeterGroup(["H",3])

class sage.combinat.root_system.coxeter_group.CoxeterGroupAsPermutationGroup(cartan_type)

Construct this Coxeter group as a Sage permutation group, by fetching the permutation representation of the generators from Chevie’s database.

TESTS:

sage: from sage.combinat.root_system.coxeter_group import CoxeterGroupAsPermutationGroup
sage: W = CoxeterGroupAsPermutationGroup(CartanType(["H",3])) # optional - chevie
sage: TestSuite(W).run()             # optional - chevie

class Element

Create element of a permutation group.

There are several ways to define a permutation group element:

• Define a permutation group $$G$$, then use G.gens() and multiplication * to construct elements.
• Define a permutation group $$G$$, then use e.g., G([(1,2),(3,4,5)]) to construct an element of the group. You could also use G('(1,2)(3,4,5)')
• Use e.g., PermutationGroupElement([(1,2),(3,4,5)]) or PermutationGroupElement('(1,2)(3,4,5)') to make a permutation group element with parent $$S_5$$.

INPUT:

• g - defines element
• parent (optional) - defines parent group (g must be in parent if specified, or a TypeError is raised).
• check - bool (default: True), if False assumes g is a gap element in parent (if specified).

EXAMPLES: We illustrate construction of permutation using several different methods.

First we construct elements by multiplying together generators for a group.

sage: G = PermutationGroup(['(1,2)(3,4)', '(3,4,5,6)'], canonicalize=False)
sage: s = G.gens()
sage: s[0]
(1,2)(3,4)
sage: s[1]
(3,4,5,6)
sage: s[0]*s[1]
(1,2)(3,5,6)
sage: (s[0]*s[1]).parent()
Permutation Group with generators [(1,2)(3,4), (3,4,5,6)]


Next we illustrate creation of a permutation using coercion into an already-created group.

sage: g = G([(1,2),(3,5,6)])
sage: g
(1,2)(3,5,6)
sage: g.parent()
Permutation Group with generators [(1,2)(3,4), (3,4,5,6)]
sage: g == s[0]*s[1]
True


We can also use a string instead of a list to specify the permutation.

sage: h = G('(1,2)(3,5,6)')
sage: g == h
True


We can also make a permutation group element directly using the PermutationGroupElement command. Note that the parent is then the full symmetric group $$S_n$$, where $$n$$ is the largest integer that is moved by the permutation.

sage: k = PermutationGroupElement('(1,2)(3,5,6)')
sage: k
(1,2)(3,5,6)
sage: k.parent()
Symmetric group of order 6! as a permutation group


Note the comparison of permutations doesn’t require that the parent groups are the same.

sage: k == g
True


Arithmetic with permutations having different parents is also defined:

sage: k*g
(3,6,5)
sage: (k*g).parent()
Symmetric group of order 6! as a permutation group

sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
True


EXAMPLES:

sage: k = PermutationGroupElement('(1,2)(3,5,6)')
sage: k._gap_()
(1,2)(3,5,6)
sage: k._gap_().parent()
Gap


List notation:

sage: PermutationGroupElement([1,2,4,3,5])
(3,4)


TESTS:

sage: PermutationGroupElement(())
()
sage: PermutationGroupElement([()])
()


We check that trac ticket #16678 is fixed:

sage: Permutations.global_options(display='cycle')
sage: p = Permutation((1,2))
sage: PermutationGroupElement(p)
(1,2)

has_descent(i, side='right', positive=False)

Returns whether $$i$$ is a (left/right) descent of self.

See sage.categories.coxeter_groups.CoxeterGroups.ElementMethods.descents() for a description of the options.

EXAMPLES:

sage: W = CoxeterGroup(["A",3])
sage: s = W.simple_reflections()
sage: w = s[1] * s[2] * s[3]
sage: w.has_descent(3)
True
sage: [ w.has_descent(i)                  for i in [1,2,3] ]
[False, False, True]
sage: [ w.has_descent(i, side = 'left')   for i in [1,2,3] ]
[True, False, False]
sage: [ w.has_descent(i, positive = True) for i in [1,2,3] ]
[True, True, False]


This implementation is a plain copy of that of CoxeterGroups. It is there as a workaround since $$PermutationGroupElement$$ currently redefines abusively has_descent() as if the group was the full symmetric group.

has_left_descent(i)

Returns whether i is a descent of self by testing whether i is mapped to a negative root.

EXAMPLES:

sage: W = CoxeterGroup(["A",3], implementation = "permutation") # optional - chevie
sage: s = W.simple_reflections() # optional - chevie
sage: (s[1]*s[2]).has_left_descent(1) # optional - chevie
True
sage: (s[1]*s[2]).has_left_descent(2) # optional - chevie
False

CoxeterGroupAsPermutationGroup.index_set()

Returns the index set of this Coxeter group

EXAMPLES:

sage: W = CoxeterGroup(["H",3], implementation = "permutation")  # optional - chevie
sage: W.index_set() # optional - chevie
[1, 2, 3]

CoxeterGroupAsPermutationGroup.reflection(i)

Returns the $$i$$-th reflection of self.

For $$i$$ in $$1,\dots,n$$, this gives the $$i$$-th simple reflection of self.

EXAMPLES:

sage: W = CoxeterGroup(["H",3], implementation = "permutation") # optional - chevie
sage: W.simple_reflection(1) # optional - chevie
(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 - chevie
(1,4)(2,17)(3,6)(5,7)(9,11)(10,12)(14,15)(16,19)(18,21)(20,22)(24,26)(25,27)(29,30)
sage: W.simple_reflection(3) # optional - chevie
(2,6)(3,18)(4,8)(5,9)(7,10)(11,12)(13,14)(17,21)(19,23)(20,24)(22,25)(26,27)(28,29)
sage: W.reflection(4)        # optional - chevie
(1,5)(2,22)(3,11)(4,19)(7,17)(8,12)(9,13)(10,15)(16,20)(18,26)(23,27)(24,28)(25,30)
sage: W.reflection(5)        # optional - chevie
(1,22)(2,4)(3,9)(5,20)(6,13)(7,16)(8,14)(12,15)(17,19)(18,24)(21,28)(23,29)(27,30)
sage: W.reflection(6)        # optional - chevie
(1,8)(2,18)(3,17)(5,12)(6,21)(7,11)(9,10)(13,15)(16,23)(20,27)(22,26)(24,25)(28,30)

CoxeterGroupAsPermutationGroup.simple_reflection(i)

Returns the $$i$$-th reflection of self.

For $$i$$ in $$1,\dots,n$$, this gives the $$i$$-th simple reflection of self.

EXAMPLES:

sage: W = CoxeterGroup(["H",3], implementation = "permutation") # optional - chevie
sage: W.simple_reflection(1) # optional - chevie
(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 - chevie
(1,4)(2,17)(3,6)(5,7)(9,11)(10,12)(14,15)(16,19)(18,21)(20,22)(24,26)(25,27)(29,30)
sage: W.simple_reflection(3) # optional - chevie
(2,6)(3,18)(4,8)(5,9)(7,10)(11,12)(13,14)(17,21)(19,23)(20,24)(22,25)(26,27)(28,29)
sage: W.reflection(4)        # optional - chevie
(1,5)(2,22)(3,11)(4,19)(7,17)(8,12)(9,13)(10,15)(16,20)(18,26)(23,27)(24,28)(25,30)
sage: W.reflection(5)        # optional - chevie
(1,22)(2,4)(3,9)(5,20)(6,13)(7,16)(8,14)(12,15)(17,19)(18,24)(21,28)(23,29)(27,30)
sage: W.reflection(6)        # optional - chevie
(1,8)(2,18)(3,17)(5,12)(6,21)(7,11)(9,10)(13,15)(16,23)(20,27)(22,26)(24,25)(28,30)

sage.combinat.root_system.coxeter_group.is_chevie_available()

Tests whether the GAP3 Chevie package is available

EXAMPLES:

sage: from sage.combinat.root_system.coxeter_group import is_chevie_available
sage: is_chevie_available() # random
False
sage: is_chevie_available() in [True, False]
True


#### Previous topic

Ambient lattices and ambient spaces

Weyl Groups