.. _SectGrpCoxConvert:

.. _construct:

Converting Between Types of  Coxeter Group
==========================================

In this section, we describe functions for converting between the various
descriptions of Coxeter groups available in Magma.

A Coxeter group :math:`W` of type ``GrpMat`` (a reflection group),
``GrpPermCox`` (a permutation group) or ``GrpFPCox`` (a finitely presented
group) can be converted to a group :math:`W'` of type ``GrpMat``,
``GrpPermCox``, ``GrpPerm``, ``GrpFPCox`` or ``GrpFP``. Groups of types
``GrpPerm`` and ``GrpFP`` are respectively permutation and finitely presented
groups without any attribute that identifies them as Coxeter groups. In most
cases the second return value of the conversion function is an isomorphism
:math:`W\to W'`.

Since a finitely presented Coxeter group :math:`W` does not come with a built-in
reflection representation, the optional parameters :math:`A`, :math:`B`, and
:math:`C` can be used to specify the representation. They are respectively the
matrix whose rows are the simple roots, the matrix whose rows are the simple
coroots, and the Cartan matrix. These must have the following properties:

1. :math:`A` and :math:`B` must have same number of rows and the same number of
columns; they must be defined over the same field, which must be the rational
field, a number field, or a cyclotomic field; the entries must be real;

2. the number of columns must be at least the number of rows; and

3. :math:`C=AB^t` must be a Cartan matrix for :math:`W`.

It is not necessary to specify all three matrices, since any two of them will
determine the third. If these matrices are not given, the default is to take
:math:`A` to be the identity and to take :math:`C` to be the standard Cartan
matrix described in Section :ref:`SectCartanCarMat`.

.. magma:function:: CoxeterGroup(grpcat, W)
   :input_types: Cat, Grp
   :output_types: grpcat, Map
   :label: CoxeterGroup_Cat_Grp
   :parameters: A : Mtrx : ; B : Mtrx : ; C : Mtrx : 

   The Coxeter group :math:`W` converted to its representation in category
   ``grpcat``. The type (i.e., category) of :math:`W` can be ``GrpMat``,
   ``GrpPermCox`` or ``GrpFPCox``. The target type can be ``GrpMat``,
   ``GrpPermCox``, ``GrpPerm``, ``GrpFPCox`` or ``GrpFP``. The second return value
   is the isomorphism from :math:`W` to the converted group (when available).

   The parameters :math:`A`, :math:`B` and :math:`C` are only applicable when
   :math:`W` is of type ``GrpFPCox``.

.. magma:example:: Example: Construct By Group
   :label: ConstructByGroup

   .. code-block:: magma

      > W<a,b> := CoxeterGroup(GrpFPCox, "G2");
      > Wp, h := CoxeterGroup(GrpPermCox, W);
      > a*b;
      a * b
      > h(a*b);
      (1, 11, 12, 7, 5, 6)(2, 4, 3, 8, 10, 9)

.. magma:function:: ReflectionGroup(W)
   :input_types: GrpFPCox
   :output_types: GrpMat, Map
   :label: ReflectionGroup_GrpFPCox
   :parameters: A : Mtrx : ; B : Mtrx : ; C : Mtrx : 

   A reflection representation :math:`W'` of the Coxeter group :math:`W` (of type
   ``GrpFPCox``) together with the isomorphism :math:`W\to W'`.

.. magma:function:: ReflectionGroup(W)
   :input_types: GrpPermCox
   :output_types: GrpMat, Map
   :label: ReflectionGroup_GrpPermCox

A reflection representation :math:`W'` of the Coxeter group :math:`W` (of type
``GrpPermCox``) together with the isomorphism :math:`W\to W'`.

Every permutation Coxeter group has a root system, and this determines the
reflection representation.

.. magma:example:: Example: Reflection Group Conversion
   :label: ReflectionGroupConversion

   .. code-block:: magma

      > W<a,b,c> := CoxeterGroup(GrpFPCox, "B3");
      > G, h := CoxeterGroup(GrpMat, W);
      > a*b; h(a*b);
      a * b
      [-1 -1  0]
      [ 1  0  0]
      [ 0  1  1]
