Coxeter Groups As Matrix Groups - Groups

Skip to content
Back to top
View this page
Edit this page

# Coxeter Groups As Matrix Groups

This implements a general Coxeter group as a matrix group by using the reflection representation.

AUTHORS:

- Travis Scrimshaw (2013-08-28): Initial version

class sage.groups.matrix_gps.coxeter_group.CoxeterMatrixGroup(coxeter_matrix, base_ring, index_set)

  Bases: `UniqueRepresentation`, `FinitelyGeneratedMatrixGroup_generic`

  A Coxeter group represented as a matrix group.

  Let \((W, S)\) be a Coxeter system. We construct a vector space \(V\) over \(\RR\) with a basis of \(\{ \alpha_s \}_{s \in S}\) and inner product

  \[B(\alpha_s, \alpha_t) = -\cos\left( \frac{\pi}{m_{st}} \right)\]

  where we have \(B(\alpha_s, \alpha_t) = -1\) if \(m_{st} = \infty\). Next we define a representation \(\sigma_s : V \to V\) by

  \[\sigma_s \lambda = \lambda - 2 B(\alpha_s, \lambda) \alpha_s.\]

  This representation is faithful so we can represent the Coxeter group \(W\) by the set of matrices \(\sigma_s\) acting on \(V\).

  INPUT:

  - `data` – a Coxeter matrix or graph or a Cartan type

  - `base_ring` – (default: the universal cyclotomic field or a number field) the base ring which contains all values \(\cos(\pi/m_{ij})\) where \((m_{ij})_{ij}\) is the Coxeter matrix

  - `index_set` – (optional) an indexing set for the generators

  For finite Coxeter groups, the default base ring is taken to be \(\QQ\) or a quadratic number field when possible.

  For more on creating Coxeter groups, see `CoxeterGroup()`.

  Todo

  Currently the label \(\infty\) is implemented as \(-1\) in the Coxeter matrix.

  EXAMPLES:

  We can create Coxeter groups from Coxeter matrices:

  Sage

      sage: # needs sage.libs.gap sage.rings.number_field
      sage: W = CoxeterGroup([[1, 6, 3], [6, 1, 10], [3, 10, 1]]); W
      Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
      [ 1  6  3]
      [ 6  1 10]
      [ 3 10  1]
      sage: W.gens()
      (
      [                 -1 -E(12)^7 + E(12)^11                   1]
      [                  0                   1                   0]
      [                  0                   0                   1],

      [                  1                   0                   0]
      [-E(12)^7 + E(12)^11                  -1     E(20) - E(20)^9]
      [                  0                   0                   1],

      [              1               0               0]
      [              0               1               0]
      [              1 E(20) - E(20)^9              -1]
      )

      sage: m = matrix([[1,3,3,3], [3,1,3,2], [3,3,1,2], [3,2,2,1]])
      sage: W = CoxeterGroup(m)
      sage: W.gens()
      (
      [-1  1  1  1]  [ 1  0  0  0]  [ 1  0  0  0]  [ 1  0  0  0]
      [ 0  1  0  0]  [ 1 -1  1  0]  [ 0  1  0  0]  [ 0  1  0  0]
      [ 0  0  1  0]  [ 0  0  1  0]  [ 1  1 -1  0]  [ 0  0  1  0]
      [ 0  0  0  1], [ 0  0  0  1], [ 0  0  0  1], [ 1  0  0 -1]
      )
      sage: a,b,c,d = W.gens()
      sage: (a*b*c)^3
      [ 5  1 -5  7]
      [ 5  0 -4  5]
      [ 4  1 -4  4]
      [ 0  0  0  1]
      sage: (a*b)^3
      [1 0 0 0]
      [0 1 0 0]
      [0 0 1 0]
      [0 0 0 1]
      sage: b*d == d*b
      True
      sage: a*c*a == c*a*c
      True

  Python

      >>> from sage.all import *
      >>> # needs sage.libs.gap sage.rings.number_field
      >>> W = CoxeterGroup([[Integer(1), Integer(6), Integer(3)], [Integer(6), Integer(1), Integer(10)], [Integer(3), Integer(10), Integer(1)]]); W
      Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
      [ 1  6  3]
      [ 6  1 10]
      [ 3 10  1]
      >>> W.gens()
      (
      [                 -1 -E(12)^7 + E(12)^11                   1]
      [                  0                   1                   0]
      [                  0                   0                   1],
      <BLANKLINE>
      [                  1                   0                   0]
      [-E(12)^7 + E(12)^11                  -1     E(20) - E(20)^9]
      [                  0                   0                   1],
      <BLANKLINE>
      [              1               0               0]
      [              0               1               0]
      [              1 E(20) - E(20)^9              -1]
      )

      >>> m = matrix([[Integer(1),Integer(3),Integer(3),Integer(3)], [Integer(3),Integer(1),Integer(3),Integer(2)], [Integer(3),Integer(3),Integer(1),Integer(2)], [Integer(3),Integer(2),Integer(2),Integer(1)]])
      >>> W = CoxeterGroup(m)
      >>> W.gens()
      (
      [-1  1  1  1]  [ 1  0  0  0]  [ 1  0  0  0]  [ 1  0  0  0]
      [ 0  1  0  0]  [ 1 -1  1  0]  [ 0  1  0  0]  [ 0  1  0  0]
      [ 0  0  1  0]  [ 0  0  1  0]  [ 1  1 -1  0]  [ 0  0  1  0]
      [ 0  0  0  1], [ 0  0  0  1], [ 0  0  0  1], [ 1  0  0 -1]
      )
      >>> a,b,c,d = W.gens()
      >>> (a*b*c)**Integer(3)
      [ 5  1 -5  7]
      [ 5  0 -4  5]
      [ 4  1 -4  4]
      [ 0  0  0  1]
      >>> (a*b)**Integer(3)
      [1 0 0 0]
      [0 1 0 0]
      [0 0 1 0]
      [0 0 0 1]
      >>> b*d == d*b
      True
      >>> a*c*a == c*a*c
      True

  We can create the matrix representation over different base rings and with different index sets. Note that the base ring must contain all \(2*\cos(\pi/m_{ij})\) where \((m_{ij})_{ij}\) is the Coxeter matrix:

  Sage

      sage: W = CoxeterGroup(m, base_ring=RR, index_set=['a','b','c','d'])
      sage: W.base_ring()
      Real Field with 53 bits of precision
      sage: W.index_set()
      ('a', 'b', 'c', 'd')

      sage: CoxeterGroup(m, base_ring=ZZ)
      Coxeter group over Integer Ring with Coxeter matrix:
      [1 3 3 3]
      [3 1 3 2]
      [3 3 1 2]
      [3 2 2 1]
      sage: CoxeterGroup([[1,4],[4,1]], base_ring=QQ)                                 # needs sage.symbolic
      Traceback (most recent call last):
      ...
      TypeError: unable to convert sqrt(2) to a rational

  [Python]

      >>> from sage.all import *
      >>> W = CoxeterGroup(m, base_ring=RR, index_set=['a','b','c','d'])
      >>> W.base_ring()
      Real Field with 53 bits of precision
      >>> W.index_set()
      ('a', 'b', 'c', 'd')

      >>> CoxeterGroup(m, base_ring=ZZ)
      Coxeter group over Integer Ring with Coxeter matrix:
      [1 3 3 3]
      [3 1 3 2]
      [3 3 1 2]
      [3 2 2 1]
      >>> CoxeterGroup([[Integer(1),Integer(4)],[Integer(4),Integer(1)]], base_ring=QQ)                                 # needs sage.symbolic
      Traceback (most recent call last):
      ...
      TypeError: unable to convert sqrt(2) to a rational

  Using the well-known conversion between Coxeter matrices and Coxeter graphs, we can input a Coxeter graph. Following the standard convention, edges with no label (i.e. labelled by `None`) are treated as 3:

  Sage

      sage: # needs sage.libs.gap sage.rings.number_field
      sage: G = Graph([(0,3,None), (1,3,15), (2,3,7), (0,1,3)])
      sage: W = CoxeterGroup(G); W
      Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
      [ 1  3  2  3]
      [ 3  1  2 15]
      [ 2  2  1  7]
      [ 3 15  7  1]
      sage: G2 = W.coxeter_diagram()
      sage: CoxeterGroup(G2) is W
      True

  Python

      >>> from sage.all import *
      >>> # needs sage.libs.gap sage.rings.number_field
      >>> G = Graph([(Integer(0),Integer(3),None), (Integer(1),Integer(3),Integer(15)), (Integer(2),Integer(3),Integer(7)), (Integer(0),Integer(1),Integer(3))])
      >>> W = CoxeterGroup(G); W
      Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
      [ 1  3  2  3]
      [ 3  1  2 15]
      [ 2  2  1  7]
      [ 3 15  7  1]
      >>> G2 = W.coxeter_diagram()
      >>> CoxeterGroup(G2) is W
      True

  Because there currently is no class for \(\ZZ \cup \{ \infty \}\), labels of \(\infty\) are given by \(-1\) in the Coxeter matrix:

  Sage

      sage: # needs sage.libs.gap sage.rings.number_field
      sage: G = Graph([(0,1,None), (1,2,4), (0,2,oo)])
      sage: W = CoxeterGroup(G)
      sage: W.coxeter_matrix()
      [ 1  3 -1]
      [ 3  1  4]
      [-1  4  1]

  [Python]

      >>> from sage.all import *
      >>> # needs sage.libs.gap sage.rings.number_field
      >>> G = Graph([(Integer(0),Integer(1),None), (Integer(1),Integer(2),Integer(4)), (Integer(0),Integer(2),oo)])
      >>> W = CoxeterGroup(G)
      >>> W.coxeter_matrix()
      [ 1  3 -1]
      [ 3  1  4]
      [-1  4  1]

  We can also create Coxeter groups from Cartan types using the `implementation` keyword:

  Sage

      sage: W = CoxeterGroup(['D',5], implementation='reflection'); W
      Finite Coxeter group over Integer Ring with Coxeter matrix:
      [1 3 2 2 2]
      [3 1 3 2 2]
      [2 3 1 3 3]
      [2 2 3 1 2]
      [2 2 3 2 1]
      sage: W = CoxeterGroup(['H',3], implementation='reflection'); W                 # needs sage.libs.gap sage.rings.number_field
      Finite Coxeter group over
       Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?
       with Coxeter matrix:
       [1 3 2]
       [3 1 5]
       [2 5 1]

  Python

      >>> from sage.all import *
      >>> W = CoxeterGroup(['D',Integer(5)], implementation='reflection'); W
      Finite Coxeter group over Integer Ring with Coxeter matrix:
      [1 3 2 2 2]
      [3 1 3 2 2]
      [2 3 1 3 3]
      [2 2 3 1 2]
      [2 2 3 2 1]
      >>> W = CoxeterGroup(['H',Integer(3)], implementation='reflection'); W                 # needs sage.libs.gap sage.rings.number_field
      Finite Coxeter group over
       Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?
       with Coxeter matrix:
       [1 3 2]
       [3 1 5]
       [2 5 1]

  class Element

    Bases: `MatrixGroupElement_generic`

    A Coxeter group element.

    action_on_root_indices(i, side='left')

      Return the action on the set of roots.

      The roots are ordered as in the output of the method `roots()`.

      EXAMPLES:

      Sage

          sage: W = CoxeterGroup(['A',3], implementation='reflection')
          sage: w = W.w0
          sage: w.action_on_root_indices(0)
          11

      Python

          >>> from sage.all import *
          >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
          >>> w = W.w0
          >>> w.action_on_root_indices(Integer(0))
          11

    canonical_matrix()

      Return the matrix of `self` in the canonical faithful representation, which is `self` as a matrix.

      EXAMPLES:

      Sage

          sage: W = CoxeterGroup(['A',3], implementation='reflection')
          sage: a,b,c = W.gens()
          sage: elt = a*b*c
          sage: elt.canonical_matrix()
          [ 0  0 -1]
          [ 1  0 -1]
          [ 0  1 -1]

      Python

          >>> from sage.all import *
          >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
          >>> a,b,c = W.gens()
          >>> elt = a*b*c
          >>> elt.canonical_matrix()
          [ 0  0 -1]
          [ 1  0 -1]
          [ 0  1 -1]

    descents(side='right', index_set=None, positive=False)

      Return the descents of `self`, as a list of elements of the `index_set`.

      INPUT:

      - `index_set` – (default: all of them) a subset (as a list or iterable) of the nodes of the Dynkin diagram

      - `side` – (default: `'right'`) `'left'` or `'right'`

      - `positive` – boolean (default: `False`)

      EXAMPLES:

      Sage

          sage: W = CoxeterGroup(['A',3], implementation='reflection')
          sage: a,b,c = W.gens()
          sage: elt = b*a*c
          sage: elt.descents()
          [1, 3]
          sage: elt.descents(positive=True)
          [2]
          sage: elt.descents(index_set=[1,2])
          [1]
          sage: elt.descents(side='left')
          [2]

      Python

          >>> from sage.all import *
          >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
          >>> a,b,c = W.gens()
          >>> elt = b*a*c
          >>> elt.descents()
          [1, 3]
          >>> elt.descents(positive=True)
          [2]
          >>> elt.descents(index_set=[Integer(1),Integer(2)])
          [1]
          >>> elt.descents(side='left')
          [2]

    first_descent(side='right', index_set=None, positive=False)

      Return the first left (resp. right) descent of `self`, as an element of `index_set`, or `None` if there is none.

      See `descents()` for a description of the options.

      EXAMPLES:

      Sage

          sage: W = CoxeterGroup(['A',3], implementation='reflection')
          sage: a,b,c = W.gens()
          sage: elt = b*a*c
          sage: elt.first_descent()
          1
          sage: elt.first_descent(side='left')
          2

      Python

          >>> from sage.all import *
          >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
          >>> a,b,c = W.gens()
          >>> elt = b*a*c
          >>> elt.first_descent()
          1
          >>> elt.first_descent(side='left')
          2

    has_right_descent(i)

      Return whether `i` is a right descent of `self`.

      A Coxeter system \((W, S)\) has a root system defined as \(\{ w(\alpha_s) \}_{w \in W}\) and we define the positive (resp. negative) roots \(\alpha = \sum_{s \in S} c_s \alpha_s\) by all \(c_s \geq 0\) (resp. \(c_s \leq 0\)). In particular, we note that if \(\ell(w s) > \ell(w)\) then \(w(\alpha_s) > 0\) and if \(\ell(ws) < \ell(w)\) then \(w(\alpha_s) < 0\). Thus \(i \in I\) is a right descent if \(w(\alpha_{s_i}) < 0\) or equivalently if the matrix representing \(w\) has all entries of the \(i\)-th column being nonpositive.

      INPUT:

      - `i` – an element in the index set

      EXAMPLES:

      Sage

          sage: W = CoxeterGroup(['A',3], implementation='reflection')
          sage: a,b,c = W.gens()
          sage: elt = b*a*c
          sage: [elt.has_right_descent(i) for i in [1, 2, 3]]
          [True, False, True]

      Python

          >>> from sage.all import *
          >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
          >>> a,b,c = W.gens()
          >>> elt = b*a*c
          >>> [elt.has_right_descent(i) for i in [Integer(1), Integer(2), Integer(3)]]
          [True, False, True]

  bilinear_form()

    Return the bilinear form associated to `self`.

    Given a Coxeter group \(G\) with Coxeter matrix \(M = (m_{ij})_{ij}\), the associated bilinear form \(A = (a_{ij})_{ij}\) is given by

    \[a_{ij} = -\cos\left( \frac{\pi}{m_{ij}} \right).\]

    If \(A\) is positive definite, then \(G\) is of finite type (and so the associated Coxeter group is a finite group). If \(A\) is positive semidefinite, then \(G\) is affine type.

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['D',4])
        sage: W.bilinear_form()                                                     # needs sage.symbolic
        [   1 -1/2    0    0]
        [-1/2    1 -1/2 -1/2]
        [   0 -1/2    1    0]
        [   0 -1/2    0    1]

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['D',Integer(4)])
        >>> W.bilinear_form()                                                     # needs sage.symbolic
        [   1 -1/2    0    0]
        [-1/2    1 -1/2 -1/2]
        [   0 -1/2    1    0]
        [   0 -1/2    0    1]

  canonical_representation()

    Return the canonical faithful representation of `self`, which is `self`.

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup([[1,3],[3,1]])
        sage: W.canonical_representation() is W
        True

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup([[Integer(1),Integer(3)],[Integer(3),Integer(1)]])
        >>> W.canonical_representation() is W
        True

  coxeter_matrix()

    Return the Coxeter matrix of `self`.

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup([[1,3],[3,1]])
        sage: W.coxeter_matrix()
        [1 3]
        [3 1]
        sage: W = CoxeterGroup(['H',3])                                             # needs sage.libs.gap sage.rings.number_field
        sage: W.coxeter_matrix()                                                    # needs sage.libs.gap sage.rings.number_field
        [1 3 2]
        [3 1 5]
        [2 5 1]

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup([[Integer(1),Integer(3)],[Integer(3),Integer(1)]])
        >>> W.coxeter_matrix()
        [1 3]
        [3 1]
        >>> W = CoxeterGroup(['H',Integer(3)])                                             # needs sage.libs.gap sage.rings.number_field
        >>> W.coxeter_matrix()                                                    # needs sage.libs.gap sage.rings.number_field
        [1 3 2]
        [3 1 5]
        [2 5 1]

  fundamental_weight(i)

    Return the fundamental weight with index `i`.

    See also

    `fundamental_weights()`

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',3], implementation='reflection')
        sage: W.fundamental_weight(1)                                               # needs sage.symbolic
        (3/2, 1, 1/2)

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
        >>> W.fundamental_weight(Integer(1))                                               # needs sage.symbolic
        (3/2, 1, 1/2)

  fundamental_weights()

    Return the fundamental weights for `self`.

    This is the dual basis to the basis of simple roots.

    The base ring must be a field.

    See also

    `fundamental_weight()`

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',3], implementation='reflection')
        sage: W.fundamental_weights()                                               # needs sage.symbolic
        Finite family {1: (3/2, 1, 1/2), 2: (1, 2, 1), 3: (1/2, 1, 3/2)}

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
        >>> W.fundamental_weights()                                               # needs sage.symbolic
        Finite family {1: (3/2, 1, 1/2), 2: (1, 2, 1), 3: (1/2, 1, 3/2)}

  is_commutative()

    Return whether `self` is commutative.

    EXAMPLES:

    Sage

        sage: CoxeterGroup(['A', 2]).is_commutative()
        False
        sage: W = CoxeterGroup(['I',2])
        sage: W.is_commutative()
        True

    Python

        >>> from sage.all import *
        >>> CoxeterGroup(['A', Integer(2)]).is_commutative()
        False
        >>> W = CoxeterGroup(['I',Integer(2)])
        >>> W.is_commutative()
        True

  is_finite()

    Return `True` if this group is finite.

    EXAMPLES:

    Sage

        sage: # needs sage.libs.gap sage.rings.number_field
        sage: [l for l in range(2, 9) if
        ....:  CoxeterGroup([[1,3,2],[3,1,l],[2,l,1]]).is_finite()]
        [2, 3, 4, 5]
        sage: [l for l in range(2, 9) if
        ....:  CoxeterGroup([[1,3,2,2],[3,1,l,2],[2,l,1,3],[2,2,3,1]]).is_finite()]
        [2, 3, 4]
        sage: [l for l in range(2, 9) if
        ....:  CoxeterGroup([[1,3,2,2,2], [3,1,3,3,2], [2,3,1,2,2],
        ....:                [2,3,2,1,l], [2,2,2,l,1]]).is_finite()]
        [2, 3]
        sage: [l for l in range(2, 9) if
        ....:  CoxeterGroup([[1,3,2,2,2], [3,1,2,3,3], [2,2,1,l,2],
        ....:                [2,3,l,1,2], [2,3,2,2,1]]).is_finite()]
        [2, 3]
        sage: [l for l in range(2, 9) if
        ....:  CoxeterGroup([[1,3,2,2,2,2], [3,1,l,2,2,2], [2,l,1,3,l,2],
        ....:                [2,2,3,1,2,2], [2,2,l,2,1,3], [2,2,2,2,3,1]]).is_finite()]
        [2, 3]

    Python

        >>> from sage.all import *
        >>> # needs sage.libs.gap sage.rings.number_field
        >>> [l for l in range(Integer(2), Integer(9)) if
        ...  CoxeterGroup([[Integer(1),Integer(3),Integer(2)],[Integer(3),Integer(1),l],[Integer(2),l,Integer(1)]]).is_finite()]
        [2, 3, 4, 5]
        >>> [l for l in range(Integer(2), Integer(9)) if
        ...  CoxeterGroup([[Integer(1),Integer(3),Integer(2),Integer(2)],[Integer(3),Integer(1),l,Integer(2)],[Integer(2),l,Integer(1),Integer(3)],[Integer(2),Integer(2),Integer(3),Integer(1)]]).is_finite()]
        [2, 3, 4]
        >>> [l for l in range(Integer(2), Integer(9)) if
        ...  CoxeterGroup([[Integer(1),Integer(3),Integer(2),Integer(2),Integer(2)], [Integer(3),Integer(1),Integer(3),Integer(3),Integer(2)], [Integer(2),Integer(3),Integer(1),Integer(2),Integer(2)],
        ...                [Integer(2),Integer(3),Integer(2),Integer(1),l], [Integer(2),Integer(2),Integer(2),l,Integer(1)]]).is_finite()]
        [2, 3]
        >>> [l for l in range(Integer(2), Integer(9)) if
        ...  CoxeterGroup([[Integer(1),Integer(3),Integer(2),Integer(2),Integer(2)], [Integer(3),Integer(1),Integer(2),Integer(3),Integer(3)], [Integer(2),Integer(2),Integer(1),l,Integer(2)],
        ...                [Integer(2),Integer(3),l,Integer(1),Integer(2)], [Integer(2),Integer(3),Integer(2),Integer(2),Integer(1)]]).is_finite()]
        [2, 3]
        >>> [l for l in range(Integer(2), Integer(9)) if
        ...  CoxeterGroup([[Integer(1),Integer(3),Integer(2),Integer(2),Integer(2),Integer(2)], [Integer(3),Integer(1),l,Integer(2),Integer(2),Integer(2)], [Integer(2),l,Integer(1),Integer(3),l,Integer(2)],
        ...                [Integer(2),Integer(2),Integer(3),Integer(1),Integer(2),Integer(2)], [Integer(2),Integer(2),l,Integer(2),Integer(1),Integer(3)], [Integer(2),Integer(2),Integer(2),Integer(2),Integer(3),Integer(1)]]).is_finite()]
        [2, 3]

  order()

    Return the order of `self`.

    If the Coxeter group is finite, this uses an iterator.

    EXAMPLES:

    Sage

        sage: # needs sage.rings.number_field
        sage: W = CoxeterGroup([[1,3],[3,1]])
        sage: W.order()
        6
        sage: W = CoxeterGroup([[1,-1],[-1,1]])                                     # needs sage.libs.gap
        sage: W.order()                                                             # needs sage.libs.gap
        +Infinity

    Python

        >>> from sage.all import *
        >>> # needs sage.rings.number_field
        >>> W = CoxeterGroup([[Integer(1),Integer(3)],[Integer(3),Integer(1)]])
        >>> W.order()
        6
        >>> W = CoxeterGroup([[Integer(1),-Integer(1)],[-Integer(1),Integer(1)]])                                     # needs sage.libs.gap
        >>> W.order()                                                             # needs sage.libs.gap
        +Infinity

  positive_roots()

    Return the positive roots.

    These are roots in the Coxeter sense, that all have the same norm. They are given by their coefficients in the base of simple roots, also taken to have all the same norm.

    See also

    `reflections()`

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',3], implementation='reflection')
        sage: W.positive_roots()
        ((1, 0, 0), (1, 1, 0), (0, 1, 0), (1, 1, 1), (0, 1, 1), (0, 0, 1))

        sage: # needs sage.libs.gap sage.rings.number_field
        sage: W = CoxeterGroup(['I',5], implementation='reflection')
        sage: W.positive_roots()
        ((1, 0),
         (-E(5)^2 - E(5)^3, 1),
         (-E(5)^2 - E(5)^3, -E(5)^2 - E(5)^3),
         (1, -E(5)^2 - E(5)^3),
         (0, 1))

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
        >>> W.positive_roots()
        ((1, 0, 0), (1, 1, 0), (0, 1, 0), (1, 1, 1), (0, 1, 1), (0, 0, 1))

        >>> # needs sage.libs.gap sage.rings.number_field
        >>> W = CoxeterGroup(['I',Integer(5)], implementation='reflection')
        >>> W.positive_roots()
        ((1, 0),
         (-E(5)^2 - E(5)^3, 1),
         (-E(5)^2 - E(5)^3, -E(5)^2 - E(5)^3),
         (1, -E(5)^2 - E(5)^3),
         (0, 1))

  reflections()

    Return the set of reflections.

    The order is the one given by `positive_roots()`.

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',2], implementation='reflection')
        sage: list(W.reflections())
        [
        [-1  1]  [ 0 -1]  [ 1  0]
        [ 0  1], [-1  0], [ 1 -1]
        ]

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(2)], implementation='reflection')
        >>> list(W.reflections())
        [
        [-1  1]  [ 0 -1]  [ 1  0]
        [ 0  1], [-1  0], [ 1 -1]
        ]

  roots()

    Return the roots.

    These are roots in the Coxeter sense, that all have the same norm. They are given by their coefficients in the base of simple roots, also taken to have all the same norm.

    The positive roots are listed first, then the negative roots in the same order. The order is the one given by `roots()`.

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',3], implementation='reflection')
        sage: W.roots()
        ((1, 0, 0),
         (1, 1, 0),
         (0, 1, 0),
         (1, 1, 1),
         (0, 1, 1),
         (0, 0, 1),
         (-1, 0, 0),
         (-1, -1, 0),
         (0, -1, 0),
         (-1, -1, -1),
         (0, -1, -1),
         (0, 0, -1))

        sage: # needs sage.libs.gap sage.rings.number_field
        sage: W = CoxeterGroup(['I',5], implementation='reflection')
        sage: len(W.roots())
        10

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
        >>> W.roots()
        ((1, 0, 0),
         (1, 1, 0),
         (0, 1, 0),
         (1, 1, 1),
         (0, 1, 1),
         (0, 0, 1),
         (-1, 0, 0),
         (-1, -1, 0),
         (0, -1, 0),
         (-1, -1, -1),
         (0, -1, -1),
         (0, 0, -1))

        >>> # needs sage.libs.gap sage.rings.number_field
        >>> W = CoxeterGroup(['I',Integer(5)], implementation='reflection')
        >>> len(W.roots())
        10

  simple_reflection(i)

    Return the simple reflection \(s_i\).

    INPUT:

    - `i` – an element from the index set

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',3], implementation='reflection')
        sage: W.simple_reflection(1)
        [-1  1  0]
        [ 0  1  0]
        [ 0  0  1]
        sage: W.simple_reflection(2)
        [ 1  0  0]
        [ 1 -1  1]
        [ 0  0  1]
        sage: W.simple_reflection(3)
        [ 1  0  0]
        [ 0  1  0]
        [ 0  1 -1]

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
        >>> W.simple_reflection(Integer(1))
        [-1  1  0]
        [ 0  1  0]
        [ 0  0  1]
        >>> W.simple_reflection(Integer(2))
        [ 1  0  0]
        [ 1 -1  1]
        [ 0  0  1]
        >>> W.simple_reflection(Integer(3))
        [ 1  0  0]
        [ 0  1  0]
        [ 0  1 -1]

  simple_root_index(i)

    Return the index of the simple root \(\alpha_i\).

    This is the position of \(\alpha_i\) in the list of all roots as given be `roots()`.

    EXAMPLES:

    Sage

        sage: W = CoxeterGroup(['A',3], implementation='reflection')
        sage: [W.simple_root_index(i) for i in W.index_set()]
        [0, 2, 5]

    Python

        >>> from sage.all import *
        >>> W = CoxeterGroup(['A',Integer(3)], implementation='reflection')
        >>> [W.simple_root_index(i) for i in W.index_set()]
        [0, 2, 5]