# Constructing Root Systems

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

```magma
RealInjection: Any                    Default: 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 $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 $C$ (see more in Section [Cartan Matrices](../CoxeterSystems/cartanmat.md#sectcartancarmat)).

```magma
Nonreduced: SetEnum                    Default: {}
```

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

```magma
Symmetric: BoolElt                    Default: false
```

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

```magma
BaseField: MonStgElt                    Default: "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 [Number Fields](../../GlobalFields/NumberFields/index-number-fields.md#fldnum-main).

2. `"Cyclotomic"` or `"SparseCyclotomic"`: A cyclotomic field with the sparse representation for elements. See Chapter [Cyclotomic Fields](../../GlobalFields/CyclotomicFields/index-cyclotomic-fields.md#chapfldcyc).

3. `"DenseCyclotomic"`: A cyclotomic field with the dense representation for elements. See Chapter [Cyclotomic Fields](../../GlobalFields/CyclotomicFields/index-cyclotomic-fields.md#chapfldcyc).

## `RootSystem(N): MonStgElt -> RootSys`

```magma
Symmetric: BoolElt                      Default: false
BaseField: MonStgElt                    Default: "NumberField"
```

The root system with Cartan name given by the string $N$. In addition to the Cartan names in Section [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff), we allow `"BCn"` for the irreducible nonreduced system, and `"Tn"` for the $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

## `Example: Creating Root Systems Name (ex-ff0977)`

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

```

## `RootSystem(M): AlgMatElt -> RootSys`

## `RootSystem(G): GrphUnd -> RootSys`

```magma
Nonreduced: SetEnum                      Default: {}
Symmetric : BoolElt                      Default: false
BaseField : MonStgElt                    Default: "NumberField"
```

The semisimple root system with Coxeter matrix $M$ or Coxeter graph $G$ (see Chapter [Coxeter Systems](../CoxeterSystems/index-coxeter-systems.md#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.

## `RootSystem(C): AlgMatElt -> RootSys`

```magma
RealInjection: Any                        Default: false
Nonreduced   : SetEnum                    Default: {}
```

The semisimple root system with Cartan matrix $C$ (see Chapter [Coxeter Systems](../CoxeterSystems/index-coxeter-systems.md#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.

## `RootSystem(D): GrphDir -> RootSys`

```magma
Nonreduced: SetEnum                    Default: {}
```

The semisimple crystallographic root system with Cartan matrix $C$, or Dynkin diagram $D$ (see Chapter [Coxeter Systems](../CoxeterSystems/index-coxeter-systems.md#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.

## `Example: Creating Root Systems Matrix (ex-4f54b6)`

```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 ]

```

## `RootSystem(A, B): Mtrx, Mtrx -> RootSys`

```magma
RealInjection: Any                        Default: false
Nonreduced   : SetEnum                    Default: {}
```

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

1. $A$ and $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. $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.

## `Example: G2Root System (ex-ad34e4)`

The following code creates a nonsemisimple root system of type $G_2$.

```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

```

## `IrreducibleRootSystem(X, n): MonStgElt, RngIntElt -> RootSys`

```magma
Symmetric: BoolElt                      Default: false
BaseField: MonStgElt                    Default: "NumberField"
```

The irreducible root system with Cartan name $X_n$ (or $I_2(n)$ if $X=``I"$) given by the string $X$ and integer $n$. In addition to the Cartan names in Section [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff), we allow `"BCn"` for the irreducible nonreduced system. For descriptions of the parameters `Symmetric` and `BaseField` see the beginning of this section.

## `StandardRootSystem(X, n): MonStgElt, RngIntElt -> RootSys`

The standard root system with Cartan name $X_n$ (or $I_2(n)$ if $X=``I"$) given by the string $X$ and integer $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 [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff), we allow `"BCn"` for the irreducible nonreduced system. For type $A_n$, the standard root system is not semisimple.

## `Example: Irreducible Root System (ex-28a4fc)`

```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)
}

```

## `ToralRootSystem(n): RngIntElt -> RootSys`

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

## `TrivialRootSystem() -> RootSys`

The trivial root system of dimension $0$.
