.. _SectRDConstr:

.. _create-root-datum:

Constructing Root Data
======================

We first describe some optional parameters that are common to many functions
described below.

Isogeny : Any : “Ad"

The optional parameter ``Isogeny`` specifies the isomorphism class of the root
datum within the Cartan equivalence class (see
Subsection :ref:`SubsectRDIsogeny`). For irreducible Cartan
names, ``Isogeny`` can be one of the following:

1. A string: ``"Ad"`` for adjoint or ``"SC"`` for simply connected.

2. An integer giving the size of the isogeny subgroup within the fundamental
group. The root datum must be absolutely irreducible. This does not work in type
:math:`D_n` with :math:`n` even and :math:`\hbox{\tt Isogeny}=2`, since in this
case there are three distinct isomorphism classes (see the example below to
create these data).

3. An injection of an abelian group into the fundamental group.

For compound Cartan names, ``Isogeny`` can be a string (``"Ad"`` or ``"SC"``);
an injection into the fundamental group; or a list of strings, integers and
injections (one for each direct summand).

Signs : Any : 1

Many of the constants associated with root data depend on the choice of the sign
:math:`\epsilon_{rs}` for each extraspecial pair :math:`(r,s)`. This parameter
allows the user to fix these signs for the root datum :math:`R` by giving a
sequence :math:`s` of length ``NumExtraspecialPairs(R)`` consisting of integers
:math:`1` or :math:`-1`. It is also possible to set ``Signs`` to :math:`1`
instead of a sequence of all :math:`1` and to :math:`-1` instead of a sequence
of all :math:`-1`.

Twist : Any : 1

This optional parameter defines a :math:`\Gamma`-action of an extended root
datum and will accept the following values:

1. a homomorphism from :math:`\Gamma` into ``Sym(2*N)``, where :math:`N` is the
number of positive roots, specifying the action of :math:`\Gamma` on the
(co)roots. (Only for semisimple root data).

2. an integer :math:`i` giving the order of :math:`\Gamma`, e.g.,
:math:`1,2,3,6` for :math:`{}^1D_4`, :math:`{}^2D_4`, :math:`{}^3D_4`,
:math:`{}^6D_4` (only if :math:`i = 1` or the root datum is irreducible).

3. :math:`\langle D,i \rangle`, where :math:`D` is a set of distinguished orbits
as sets of integers and :math:`i` (integer) is the order of the Dynkin diagram
symmetry involved (only for irreducible root data).

4. :math:`\langle \Gamma,ims \rangle`, where :math:`\Gamma` is the acting group
and :math:`ims` define images either as permutations of the simple roots or as
permutation of all roots (only for semisimple root data).

5. :math:`\langle \Gamma, imsR, imsC \rangle`, where :math:`\Gamma` is the
acting group and :math:`imsR` (:math:`imsC`) is a sequence of matrices defining
the action of :math:`\Gamma` on the root space (coroot space).

Nonreduced : SetEnum : {}

The optional argument ``Nonreduced`` is used to give the set of indices of the
nonreduced simple roots. Note that a root datum cannot be both twisted and
nonreduced.

(N) : MonStgElt -> RootDtm

Isogeny : Any : “Ad"

Signs : Any : 1

Twist : Any : 1

A root datum with Cartan name given by the string :math:`N` (see
Section :ref:`SectCartanFinAff`). In addition to the possible
Cartan names described in Section :ref:`SectCartanFinAff`,
this function will also accept ``"Tn"`` as a component of the Cartan name, which
stands for an :math:`n`-dimensional toral subdatum. Note, however, that this
addition is for input only and will not appear in the string returned by
``CartanName`` when applied to the resulting root datum (see example below).

If the optional parameter ``Isogeny`` is a list, its length should be equal to
the total number of components. Entries of this list corresponding to toral
components will be ignored.

If the corresponding Coxeter group is infinite affine, an error is flagged.

Examples of adjoint and simply connected irreducible root data. >
RootDatum("E6"); Adjoint root datum of type E6 > RootDatum("E6" : Isogeny :=
"SC"); Simply connected root datum of type E6 With nonirreducible root data the
isogeny can be given as a list. > R := RootDatum("A5 B3" : Isogeny := [\* 3,
"Ad" \*]); > R : Maximal; Root datum of type A5 B3 with simple roots [1 0 0 0 0
0 0 0] [0 1 0 0 0 0 0 0] [0 0 1 0 0 0 0 0] [0 0 0 1 0 0 0 0] [1 2 0 1 3 0 0 0]
[0 0 0 0 0 1 0 0] [0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 1] and simple coroots [ 2 -1
0 0 0 0 0 0] [-1 2 -1 0 -1 0 0 0] [ 0 -1 2 -1 1 0 0 0] [ 0 0 -1 2 -1 0 0 0] [ 0
0 0 -1 1 0 0 0] [ 0 0 0 0 0 2 -1 0] [ 0 0 0 0 0 -1 2 -1] [ 0 0 0 0 0 0 -2 2] > >
RootDatum("E6 A3 B4" : Isogeny := "SC"); Simply connected root datum of type E6
A3 B4 Nonsemisimple root data can be constructed by specifying a central torus.
> R := RootDatum("B3 T2 A2" : Isogeny := [\* "SC", 0, "Ad" \*]); > R; R: Root
datum of type B3 A2 > Dimension(R), Rank(R); 7 5 > SimpleCoroots(R); [ 1 0 0 0 0
0 0] [ 0 1 0 0 0 0 0] [ 0 0 1 0 0 0 0] [ 0 0 0 0 0 2 -1] [ 0 0 0 0 0 -1 2] The
following code creates the three root data of type :math:`D_6` with isogeny
groups of size 2 using injections into the fundamental group. > G< a, b > :=
FundamentalGroup("D6"); > G; Abelian Group isomorphic to Z/2 + Z/2 Defined on 2
generators Relations: 2*a = 0 2*b = 0 > \_, inj1 := sub< G \| a >; > R1 :=
RootDatum("D6" : Isogeny := inj1); > \_, inj2 := sub< G \| b >; > R2 :=
RootDatum("D6" : Isogeny := inj2); > \_, inj3 := sub< G \| a*b >; > R3 :=
RootDatum("D6" : Isogeny := inj3);

Examples of extended root data: > R := RootDatum("A5" : Twist := 2 ); R; R:
Twisted adjoint root datum of type 2A5,3 > R eq RootDatum("A5" : Twist := <
Sym(2), [Sym(5)|(1,5)(2,4)] > ); true > R eq RootDatum("A5" : Twist := <
1,5,2,4,3, 2 > ); true > RootDatum("D4" : Twist := 1); Adjoint root datum of
type D4 > RootDatum("D4" : Twist := 2); Twisted adjoint root datum of type 2D4,3
> RootDatum("D4" : Twist := 3); Twisted adjoint root datum of type 3D4,2 >
RootDatum("D4" : Twist := 6); Twisted adjoint root datum of type 6D4,2 > > R :=
RootDatum("A2"); > TwistedRootDatum(R : Twist := 2); Twisted adjoint root datum
of type 2A2,1

RootDatum(C) : AlgMatElt -> RootDtm

Isogeny : Any : “Ad"

Signs : Any : 1

Twist : Any : 1

Nonreduced : SetEnum : {}

A semisimple root datum with crystallographic Cartan matrix :math:`C`. If the
corresponding Coxeter group is infinite, an error is flagged.

RootDatum(D) : GrphDir -> RootDtm

Isogeny : Any : “Ad"

Signs : Any : 1

Twist : Any : 1

Nonreduced : SetEnum : {}

A semisimple root datum with Dynkin digraph :math:`D`. If the corresponding
Coxeter group is infinite, an error is flagged.

RootDatum(A, B) : Mtrx, Mtrx -> RootDtm

Signs : Any : 1

Twist : Any : 1

Nonreduced : SetEnum : {}

The root datum 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 be integral matrices with the same number of
rows and the same number of columns;

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.

An example of a nonsemisimple root system of type :math:`G_2`: > A :=
Matrix(2,3, [1,-1,0, -1,1,-1]); > B := Matrix(2,3, [1,-1,1, 0,1,-1]); >
RootDatum(A, B); Root datum of type G2 An example of a non-reduced root datum
and usage of ``Nonreduced`` argument: > C := CoxeterMatrix("B2B2"); >
RootDatum(C); Adjoint root datum of type B2 B2 > RootDatum(C : Nonreduced:=2);
Adjoint root datum of type BC2 B2 > RootDatum(C : Nonreduced:=4); Adjoint root
datum of type B2 BC2 > RootDatum(C : Nonreduced:=2,4); Adjoint root datum of
type BC2 BC2

IrreducibleRootDatum(X, n) : MonStgElt, RngIntElt -> RootDtm

Signs : Any : 1

Twist : Any : 1

The irreducible root datum with Cartan name :math:`X_n`.

(X, n) : MonStgElt, RngIntElt -> RootDtm

Signs : Any : 1

Twist : Any : 1

The standard root datum with Cartan name :math:`X_n`, i.e. the root datum with
the standard inner product equal to the Coxeter form up to a constant. For
technical reasons, this is only possible for the classical types, i.e. :math:`X`
must be ``"A"``, ``"B"``, ``"C"``, or ``"D"``. Note that the standard root datum
is not semisimple for type :math:`A_n`.

These functions are useful in loops. > for X in ["A","B","G"] do > print
NumPosRoots(IrreducibleRootDatum(X, 2)); > end for; 3 4 6

ToralRootDatum(n) : RngIntElt -> RootDtm

Twist : Any : 1

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

Toral root datum of dimension 3 and a twisted version of it: >
ToralRootDatum(3); Toral root datum of dimension 3 > M :=
Matrix(Rationals(),3,3,[0,1,0,1,0,0,0,0,1]);M; [0 1 0] [1 0 0] [0 0 1] >
ToralRootDatum(3 : Twist := <Sym(2),[M],[M]>); Twisted toral root datum of
dimension 3

TrivialRootDatum() : -> RootDat

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

sparse-root-data-create
-----------------------

Constructing Sparse Root Data.

Sparse root data differ from the usual root data only in the internal
representation of the objects. The internal representation is less memory
expensive and requires less time for creation. Sparse root data have type
``RootDtmSprs``, which is a subcategory of ``RootDtm``.

There are some limitation on the root data which can have sparse representation.
First, sparse representation only makes sense for classical root data, that is
of types :math:`A`, :math:`B`, :math:`C` and :math:`D`. At the moment only root
data with a connected Coxeter diagram may have sparse representation and no
twisted sparse root data can be constructed.

.. magma:function:: SparseRootDatum(N)
   :input_types: MonStgElt
   :output_types: RootDtmSprs
   :label: SparseRootDatum_MonStgElt

.. magma:function:: SparseRootDatum(N)
   :input_types: MonStgElt
   :output_types: RootDtmSprs
   :label: SparseRootDatum_MonStgElt_2

.. magma:function:: SparseRootDatum(C)
   :input_types: AlgMatElt
   :output_types: RootDtmSprs
   :label: SparseRootDatum_AlgMatElt

.. magma:function:: SparseRootDatum(D)
   :input_types: GrphDir
   :output_types: RootDtmSprs
   :label: SparseRootDatum_GrphDir

.. magma:function:: SparseRootDatum(R)
   :input_types: RootSys
   :output_types: RootDtmSprs
   :label: SparseRootDatum_RootSys

.. magma:function:: SparseRootDatum(A, B)
   :input_types: Mtrx, Mtrx
   :output_types: RootDtmSprs
   :label: SparseRootDatum_Mtrx_Mtrx

.. magma:function:: SparseIrreducibleRootDatum(X, n)
   :input_types: MonStgElt, RngIntElt
   :output_types: RootDtmSprs
   :label: SparseIrreducibleRootDatum_MonStgElt_RngIntElt

.. magma:function:: SparseStandardRootDatum(X, n)
   :input_types: MonStgElt, RngIntElt
   :output_types: RootDtmSprs
   :label: SparseStandardRootDatum_MonStgElt_RngIntElt

   These functions have the same syntax as their counterparts without the
   “``Sparse``” in the name (see Section :ref:`SectRDConstr`). The
   root datum returned has sparse representation. See
   :cite:`ComputUnipGrps` for the algorithms used to construct sparse
   root data.

.. magma:example:: Example: Sprs RD
   :label: SprsRD

   .. code-block:: magma

      > SparseRootDatum("A2");
      Sparse adjoint root datum of dimension 2 of type A2
      > SparseStandardRootDatum("A", 2);
      Sparse root datum of dimension 3 of type A2
      > SparseRootDatum("A2") eq RootDatum("A2");
      true
      %%a> assert $1;

.. magma:function:: SparseRootDatum(R)
   :input_types: RootDtm
   :output_types: RootDtmSprs
   :label: SparseRootDatum_RootDtm

   Return a sparse root datum equal to the root datum :math:`R`.

.. magma:function:: RootDatum(R)
   :input_types: RootDtmSprs
   :output_types: RootDtm
   :label: RootDatum_RootDtmSprs

   Return a non-sparse root datum equal to the root datum :math:`R`.

.. magma:example:: Example: Sprs R Dsumsub
   :label: SprsRDsumsub

   Due to the restrictions mentioned above, some operations that create new root
   data, will return a non-sparse root datum even though the input was sparse.

   .. code-block:: magma

      > R := SparseRootDatum("A2");
      > T := ToralRootDatum(3);
      > R+T;
      Sparse root datum of dimension 5 of type A2
      > R+R;
      Adjoint root datum of dimension 4 of type A2 A2
