.. _SectRSConstr:

.. _construct-root-system:

Constructing Root Systems
=========================

We first describe some optional parameters that are common to many functions
described in this section.

RealInjection : Any : ``false``

Number field elements and cyclotomic field elements do not have a natural
identification with real numbers. The ``RealInjection`` flag allows the user to
provide one. If the base field of the Cartan matrix :math:`C` is a number field,
the flag should be an injection into the real field; if the base field is
cyclotomic, the flag should be an injection into the complex field taking real
values on the entries of :math:`C` (see more in
Section :ref:`SectCartanCarMat`).

Nonreduced : SetEnum : {}

The optional argument ``Nonreduced`` is used to distinguish the reducedness of a
root system in case the input doesn’t uniquely determine it.

Symmetric : BoolElt : ``false``

If the ``Symmetric`` flag is set ``true``, the symmetric Cartan matrix is used.
For types :math:`I_2(m)`, :math:`H_3`, :math:`H_4` the symmetric Cartan matrix
is *always* used, since the root system is nonreduced otherwise.

BaseField : MonStgElt : “NumberField"

The ``BaseField`` flag determines the field over which the Cartan matrix is
defined. The possible values are:

1. ``"NumberField"``: An algebraic number field. This is the default. See
Chapter :ref:`FldNum:main`.

2. ``"Cyclotomic"`` or ``"SparseCyclotomic"``: A cyclotomic field with the
sparse representation for elements. See Chapter :ref:`ChapFldCyc`.

3. ``"DenseCyclotomic"``: A cyclotomic field with the dense representation for
elements. See Chapter :ref:`ChapFldCyc`.

.. magma:function:: \name{IntrRootSystemN}{RootSystem}(N)
   :input_types: MonStgElt
   :output_types: RootSys
   :parameters: Symmetric : BoolElt : \texttt{false}; BaseField : MonStgElt : ``NumberField"

   The root system with Cartan name given by the string :math:`N`. In addition to
   the Cartan names in Section :ref:`SectCartanFinAff`, we allow
   ``"BCn"`` for the irreducible nonreduced system, and ``"Tn"`` for the
   :math:`n`-dimensional toral subsystem. Note that ``"Tn"`` is used for input only
   and does not appear in the string returned by ``CartanName`` when applied to the
   resulting root system (see example below). For descriptions of the parameters
   ``Symmetric`` and ``BaseField`` see the beginning of this section

.. magma:example:: Example: Creating Root Systems Name
   :label: CreatingRootSystemsName

   .. code-block:: magma

      > RootSystem("H3 E6");
      Root system of type H3 E6
      > RootSystem("A2 T1 I2(5)");
      Root system of type A2 I2(5)

.. magma:function:: RootSystem(M)
   :input_types: AlgMatElt
   :output_types: RootSys
   :label: RootSystem_AlgMatElt

.. magma:function:: RootSystem(G)
   :input_types: GrphUnd
   :output_types: RootSys
   :label: RootSystem_GrphUnd
   :parameters: Nonreduced : SetEnum : \{\}; Symmetric : BoolElt : \texttt{false}; BaseField : MonStgElt : ``NumberField"

   The semisimple root system with Coxeter matrix :math:`M` or Coxeter graph
   :math:`G` (see Chapter :ref:`ChapCartan`). If the corresponding
   Coxeter group is infinite, an error is flagged. For descriptions of the
   parameters ``Nonreduced``, ``Symmetric``, and ``BaseField`` see the beginning of
   this section.

.. magma:function:: RootSystem(C)
   :input_types: AlgMatElt
   :output_types: RootSys
   :label: RootSystem_AlgMatElt_2
   :parameters: RealInjection : Any : \texttt{false}; Nonreduced : SetEnum : \{\}

   The semisimple root system with Cartan matrix :math:`C` (see
   Chapter :ref:`ChapCartan`). If the corresponding Coxeter group is
   infinite, an error is flagged. For descriptions of the parameters
   ``RealInjection`` and ``Nonreduced`` see the beginning of this section.

.. magma:function:: RootSystem(D)
   :input_types: GrphDir
   :output_types: RootSys
   :label: RootSystem_GrphDir
   :parameters: Nonreduced : SetEnum : \{\}

   The semisimple crystallographic root system with Cartan matrix :math:`C`, or
   Dynkin diagram :math:`D` (see Chapter :ref:`ChapCartan`). If the
   corresponding Coxeter group is infinite, an error is flagged. For a description
   of the parameter ``Nonreduced`` see the beginning of this section.

.. magma:example:: Example: Creating Root Systems Matrix
   :label: CreatingRootSystemsMatrix

   .. code-block:: magma

      > M := SymmetricMatrix([1, 3,1, 2,3,1]);
      > RootSystem(M);
      Root system of type A3
      > M := SymmetricMatrix([1, 3,1, 3,3,1]);
      \<RootSystem(M);
 
      >> RootSystem(M);
                   ^
      Runtime error in 'RootSystem': Not a finite root system in rows/columns  
      [ 1, 2, 3 ]

.. magma:function:: RootSystem(A, B)
   :input_types: Mtrx, Mtrx
   :output_types: RootSys
   :label: RootSystem_Mtrx_Mtrx
   :parameters: RealInjection : Any : \texttt{false}; Nonreduced : SetEnum : \{\}

   The root system with simple roots given by the rows of the matrix :math:`A` and
   simple coroots given by the rows of the matrix :math:`B`. The matrices :math:`A`
   and :math:`B` must have the following properties:

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

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

   3. :math:`AB^t` must be the Cartan matrix of a finite Coxeter group.

   For descriptions of the parameters ``RealInjection`` and ``Nonreduced`` see the
   beginning of this section.

.. magma:example:: Example: G2Root System
   :label: G2RootSystem

   The following code creates a nonsemisimple root system of type :math:`G_2`.

   .. code-block:: magma

      > A := Matrix(2,3, [1,-1,0, -1,1,-1]);
      > B := Matrix(2,3, [1,-1,1, 0,1,-1]);
      > RootSystem(A, B);
      Root system of type G2

.. magma:function:: IrreducibleRootSystem(X, n)
   :input_types: MonStgElt, RngIntElt
   :output_types: RootSys
   :label: IrreducibleRootSystem_MonStgElt_RngIntElt
   :parameters: Symmetric : BoolElt : \texttt{false}; BaseField : MonStgElt : ``NumberField"

   The irreducible root system with Cartan name :math:`X_n` (or :math:`I_2(n)` if
   :math:`X=``I"`) given by the string :math:`X` and integer :math:`n`. In addition
   to the Cartan names in Section :ref:`SectCartanFinAff`, we
   allow ``"BCn"`` for the irreducible nonreduced system. For descriptions of the
   parameters ``Symmetric`` and ``BaseField`` see the beginning of this section.

.. magma:function:: \name{IntrStandardRootSystem}{StandardRootSystem}(X, n)
   :input_types: MonStgElt, RngIntElt
   :output_types: RootSys

   The standard root system with Cartan name :math:`X_n` (or :math:`I_2(n)` if
   :math:`X=``I"`) given by the string :math:`X` and integer :math:`n`, i.e. the
   root system whose Coxeter form is the same as the standard inner product. In
   addition to the Cartan names in
   Section :ref:`SectCartanFinAff`, we allow ``"BCn"`` for the
   irreducible nonreduced system. For type :math:`A_n`, the standard root system is
   not semisimple.

.. magma:example:: Example: Irreducible Root System
   :label: IrreducibleRootSystem

   .. code-block:: magma

      > Rs := { IrreducibleRootSystem("I", n) : n in [3..20] };           
      > { R : R in Rs | IsCrystallographic(R) };
      {
          Root system of type I2(3) ,
          Root system of type I2(4) ,
          Root system of type I2(6)
      }

.. magma:function:: ToralRootSystem(n)
   :input_types: RngIntElt
   :output_types: RootSys
   :label: ToralRootSystem_RngIntElt

The toral root system of dimension :math:`n`, i.e., the :math:`n`-dimensional
root system with no roots or coroots.

.. magma:function:: TrivialRootSystem()
   :output_types: RootSys
   :label: TrivialRootSystem

The trivial root system of dimension :math:`0`.
