.. _SectGrpRflGrpRflOp:

.. _operations:

Operations on Reflection  Groups
================================

See Chapter :ref:`ChapGrpMat` for general functions for matrix
groups. Note that most of the functions in this section only work for real
reflection groups.

.. magma:function:: IsCoxeterIsomorphic(W1, W2)
   :input_types: GrpMat, GrpMat
   :output_types: BoolElt
   :label: IsCoxeterIsomorphic_GrpMat_GrpMat

   Returns ``true`` if and only if the real reflection groups :math:`W_1` and
   :math:`W_2` are isomorphic as Coxeter systems.

.. magma:function:: IsCartanEquivalent(W1, W2)
   :input_types: GrpMat, GrpMat
   :output_types: BoolElt
   :label: IsCartanEquivalent_GrpMat_GrpMat

   Returns ``true`` if and only if the crystallographic real reflection groups
   :math:`W_1` and :math:`W_2` have Cartan equivalent Cartan matrices.

.. magma:example:: Example: Isomorphism
   :label: Isomorphism

   .. code-block:: magma

      > W1 := ReflectionGroup("B3");
      > W2 := ReflectionGroup("C3");
      > IsCoxeterIsomorphic(W1, W2);
      true [ 1, 2, 3 ]
      > IsCartanEquivalent(W1, W2);
      false
      %%a> assert not $1;

.. magma:function:: CartanName(W)
   :input_types: GrpMat
   :output_types: List
   :label: CartanName_GrpMat

   The Cartan name of the finite or affine real reflection group :math:`W`
   (Section :ref:`SectCartanFinAff`).

.. magma:function:: CoxeterDiagram(W)
   :input_types: GrpMat
   :label: CoxeterDiagram_GrpMat

   A display of the Coxeter diagram of the real reflection group :math:`W`
   (Section :ref:`SectCartanFinAff`). If :math:`W` is not affine
   or finite, an error is flagged.

.. magma:function:: DynkinDiagram(W)
   :input_types: GrpMat
   :label: DynkinDiagram_GrpMat

   A display of the Coxeter diagram of the real reflection group :math:`W`
   (Section :ref:`SectCartanFinAff`). If :math:`W` is not affine
   or finite, or if :math:`W` is not crystallographic, an error is flagged.

.. magma:example:: Example: Name And Diagram
   :label: NameAndDiagram

   .. code-block:: magma

      > G := CompleteGraph(3);
      > W := ReflectionGroup(G);
      > CartanName(W);
      A~2
      > CoxeterDiagram(W);
 
      A~2    1 - 2
             |   |
             - 3 -

.. magma:function:: RootSystem(W)
   :input_types: GrpMat
   :output_types: RootDtm
   :label: RootSystem_GrpMat

   The root system of the finite real reflection group :math:`W`
   (Chapter :ref:`ChapRootSys`). If :math:`W` is infinite, an error
   is flagged.

.. magma:function:: RootDatum(W)
   :input_types: GrpMat
   :output_types: RootDtm
   :label: RootDatum_GrpMat

   The root datum of the finite real reflection group :math:`W`
   (Chapter :ref:`ChapRootDtm`). The roots and coroots of :math:`W`
   must have integral components, and :math:`W` must be finite.

.. magma:function:: CoxeterMatrix(W)
   :input_types: GrpMat
   :output_types: AlgMatElt
   :label: CoxeterMatrix_GrpMat

   The Coxeter matrix of the real reflection group :math:`W`
   (Section :ref:`SectCartanCoxMat`).

.. magma:function:: CoxeterGraph(W)
   :input_types: GrpMat
   :output_types: GrphUnd
   :label: CoxeterGraph_GrpMat

   The Coxeter graph of the real reflection group :math:`W`
   (Section :ref:`SectCartanCoxGrph`).

.. magma:function:: CartanMatrix(W)
   :input_types: GrpMat
   :output_types: AlgMatElt
   :label: CartanMatrix_GrpMat

   The Cartan matrix of the real reflection group :math:`W`
   (Section :ref:`SectCartanCarMat`).

.. magma:function:: DynkinDigraph(W)
   :input_types: GrpMat
   :output_types: GrphDir
   :label: DynkinDigraph_GrpMat

   The Dynkin digraph of the real reflection group :math:`W`
   (Section :ref:`SectCartanDynDigrph`).

.. magma:function:: Rank(W)
   :input_types: GrpMat
   :output_types: RngIntElt
   :label: Rank_GrpMat

.. magma:function:: NumberOfGenerators(W)
   :input_types: GrpMat
   :output_types: RngIntElt
   :label: NumberOfGenerators_GrpMat

   The rank of the reflection group :math:`W`.

.. magma:example:: Example: Rank Dimension
   :label: RankDimension

   .. code-block:: magma

      > R := StandardRootSystem("A", 4);
      > W := ReflectionGroup(R);
      > Rank(W);
      4
      %%a> assert $1 eq 4;
      > Dimension(W);
      5
      %%a> assert $1 eq 5;

.. magma:function:: FundamentalGroup(W)
   :input_types: GrpMat
   :output_types: GrpAb
   :label: FundamentalGroup_GrpMat

   The fundamental group of the real reflection group :math:`W`
   (Subsection :ref:`SubsectRDIsogeny`). The roots and coroots
   of :math:`W` must have integral components.

.. magma:function:: IsogenyGroup(W)
   :input_types: GrpMat
   :output_types: GrpAb, Map
   :label: IsogenyGroup_GrpMat

   The isogeny group of the real reflection group :math:`W`, together with the
   injection into the fundamental group
   (Subsection :ref:`SubsectRDIsogeny`). The roots and coroots
   of :math:`W` must have integral components.

.. magma:function:: CoisogenyGroup(W)
   :input_types: GrpMat
   :output_types: GrpAb, Map
   :label: CoisogenyGroup_GrpMat

   The fundamental group of the real reflection group :math:`W` together with the
   projection onto the fundamental group
   (Subsection :ref:`SubsectRDIsogeny`). The roots and coroots
   of :math:`W` must have integral components.

.. magma:function:: BasicDegrees(W)
   :input_types: GrpMat
   :output_types: RngIntElt
   :label: BasicDegrees_GrpMat

   The degrees of the basic invariant polynomials of the reflection group
   :math:`W`. These are computed using the table in
   :raw-latex:`\cite[page 155]{Carter-small}` if the group is real, and using the
   algorithm of :cite:`LehrerTaylor` in other cases. If :math:`W` is
   infinite, an error is flagged.

.. magma:function:: BasicCodegrees(W)
   :input_types: GrpMat
   :output_types: RngIntElt
   :label: BasicCodegrees_GrpMat

   The basic codegrees of the reflection group :math:`W`. These are computed using
   the algorithm of :cite:`LehrerTaylor`. If :math:`W` is infinite, an
   error is flagged.

.. magma:example:: Example: Basic Degrees
   :label: BasicDegrees

   The product of the basic degrees is the order of the Coxeter group; the sum of
   the basic degrees is the sum of the rank and the number of positive roots.

   .. code-block:: magma

      > W := ReflectionGroup("E6");
      > degs := BasicDegrees(W);
      > degs;
      [ 2, 5, 6, 8, 9, 12 ]
      > &*degs eq #W;
      true
      %%a> assert $1;
      > &+degs eq NumPosRoots(W) + Rank(W);
      true
      %%a> assert $1;

.. magma:function:: LongestElement(W)
   :input_types: GrpMat
   :output_types: SeqEnum
   :label: LongestElement_GrpMat

   The unique longest element in the finite real reflection group :math:`W`.

.. magma:function:: CoxeterElement(W)
   :input_types: GrpMat
   :output_types: SeqEnum
   :label: CoxeterElement_GrpMat

   The Coxeter element in the reflection group :math:`W`, ie. the product of the
   generators.

.. magma:function:: CoxeterNumber(W)
   :input_types: GrpMat
   :output_types: SeqEnum
   :label: CoxeterNumber_GrpMat

   The order of the Coxeter element in the real reflection group :math:`W`.

.. magma:example:: Example: Operations
   :label: Operations

   Operations on groups.

   .. code-block:: magma

      > W := ReflectionGroup("A4");
      > LongestElement(W);
      [ 0  0  0 -1]
      [ 0  0 -1  0]
      [ 0 -1  0  0]
      [-1  0  0  0]
      > CoxeterElement(W);
      [-1 -1 -1 -1]
      [ 1  0  0  0]
      [ 0  1  0  0]
      [ 0  0  1  0]

.. magma:function:: LeftDescentSet(W, w)
   :input_types: GrpMat, GrpMatElt
   :output_types: $\{\}$
   :label: LeftDescentSet_GrpMat_GrpMatElt

   The set of indices :math:`r` of simple roots of the finite real reflection group
   :math:`W` such that the length of the product :math:`s_rw` is less than that of
   the element :math:`w`.

.. magma:function:: RightDescentSet(W, w)
   :input_types: GrpMat, GrpMatElt
   :output_types: $\{\}$
   :label: RightDescentSet_GrpMat_GrpMatElt

   The set of indices :math:`r` of simple roots of the finite real reflection group
   :math:`W` such that the length of the product :math:`ws_r` is less than that of
   the element :math:`w`.

.. magma:example:: Example: Descent Sets
   :label: DescentSets

   .. code-block:: magma

      > W := ReflectionGroup("A5");
      > x := W.1*W.2*W.4*W.5;
      > LeftDescentSet(W, x);
      { 1, 4 }
      > RightDescentSet(W, x);
      { 2, 5 }
