# Roots, Coroots and Weights

The roots are stored as an indexed set

$$
\{@\; \alpha_1,\dots,\alpha_N,\alpha_{N+1},\dots,\alpha_{2N} \; @\},
$$

where $\alpha_1,\dots,\alpha_N$ are the positive roots in an order compatible with height; and $\alpha_{N+1},\dots,\alpha_{2N}$ are the corresponding negative roots (i.e. $\alpha_{i+N}=-\alpha_i$). The simple roots are $\alpha_1,\dots,\alpha_n$ where $n$ is the rank.

Many of these functions have an optional argument `Basis` which may take one of the following values

1. `"Standard"`: the standard basis for the (co)root space. This is the default.

2. `"Root"`: the basis of simple (co)roots.

3. `"Weight"`: the basis of fundamental (co)weights (see Subsection [Weights](#subsectgrplierootweight) below).

## Accessing Roots and Coroots

### `RootSpace(G): GrpLie -> Lat`

### `CorootSpace(G): GrpLie -> Lat`

The lattice containing the (co)roots of the group of Lie type $G$.

### `SimpleRoots(G): GrpLie -> Mtrx`

### `SimpleCoroots(G): GrpLie -> Mtrx`

The simple (co)roots of the group of Lie type $G$ as the rows of a matrix.

### `NumberOfPositiveRoots(G): GrpLie -> RngIntElt`

### `NumPosRoots(G): GrpLie -> RngIntElt`

The number of positive roots of the group of Lie type $G$.

### `Roots(G): GrpLie -> SetIndx`

### `Coroots(G): GrpLie -> SetIndx`

```magma
Basis: MonStgElt                    Default: "Standard"
```

An indexed set containing the (co)roots of the group of Lie type $G$.

### `PositiveRoots(G): GrpLie -> SetIndx`

### `PositiveCoroots(G): GrpLie -> SetIndx`

```magma
Basis: MonStgElt                    Default: "Standard"
```

An indexed set containing the positive (co)roots of the group of Lie type $G$.

### `Root(G, r): GrpLie, RngIntElt -> SetIndx`

### `Coroot(G, r): GrpLie, RngIntElt -> SetIndx`

```magma
Basis: MonStgElt                    Default: "Standard"
```

The $r$th (co)root of the group of Lie type $G$.

### `RootPosition(G, v): GrpLie, . -> SetIndx`

### `CorootPosition(G, v): GrpLie, . -> SetIndx`

```magma
Basis: MonStgElt                    Default: "Standard"
```

If $v$ is a (co)root of the group of Lie type $G$, this returns its position; otherwise it returns 0.

### `Example: Roots Coroots (ex-ac3db4)`

```magma
> G := GroupOfLieType("A3", 25 : Isogeny := 2);
> Roots(G);
{@
    (1 0 0),
    (0 1 0),
    (1 0 2),
    (1 1 0),
    (1 1 2),
    (2 1 2),
    (-1  0  0),
    (0 -1  0),
    (-1  0 -2),
    (-1 -1  0),
    (-1 -1 -2),
    (-2 -1 -2)
@}
> PositiveCoroots(G);
{@
    (2 -1 -1),
    (-1  2  0),
    (0 -1  1),
    (1  1 -1),
    (-1  1  1),
    (1 0 0)
@}
> #Roots(G) eq 2*NumPosRoots(G);
true
> Coroot(G, 4);
(1  1 -1)
> Coroot(G, 4 : Basis := "Root");
(1 1 0)
> CorootPosition(G, [1,1,-1]);
4
> CorootPosition(G, [1,1,0] : Basis := "Root");
4

```

### `HighestRoot(G): GrpLie -> LatElt`

### `HighestLongRoot(G): GrpLie -> LatElt`

```magma
Basis: MonStgElt                    Default: "Standard"
```

The unique (long) root of greatest height in the root datum of the group of Lie type $G$.

### `HighestShortRoot(G): GrpLie -> LatElt`

```magma
Basis: MonStgElt                    Default: "Standard"
```

The unique short root of greatest height in the root datum of the group of Lie type $G$.

### `Example: Heighest Roots (ex-69e0c7)`

```magma
> G := GroupOfLieType("G2", RealField());
> HighestRoot(G);
(3 2)
> HighestLongRoot(G);
(3 2)
> HighestShortRoot(G);
(2 1)

```

## Reflections

The reflections in the Weyl group have representatives in the group of Lie type.

### `Reflections(G): GrpLie -> GrpLieElt`

The sequence of representatives of reflections in the group of Lie type $G$.

### `Reflection(G, r): GrpLie, RngIntElt -> GrpLieElt`

The representative of the reflections in the $r$th root in the group of Lie type $G$.

### `Example: Reflections (ex-ff84ed)`

```magma
> G := GroupOfLieType("A2", Rationals());
> Reflections(G);
[ n1 , n2 , n1 n2 n1  ]

```

## Operations and Properties for Root and Coroot Indices

### `RootHeight(G, r): GrpLie, RngIntElt -> RngIntElt`

### `CorootHeight(G, r): GrpLie, RngIntElt -> RngIntElt`

The height of the $r$th (co)root of the group of Lie type $G$, i.e. the sum of the coefficients of $\alpha_r$ (resp. $\alpha_r^\star$) with respect to the simple (co)roots.

### `RootNorms(G): GrpLie -> [RngIntElt]`

### `CorootNorms(G): GrpLie -> [RngIntElt]`

The sequence of squares of the lengths of the (co)roots of the group of Lie type $G$.

### `RootNorm(G, r): GrpLie, RngIntElt -> RngIntElt`

### `CorootNorm(G, r): GrpLie, RngIntElt -> RngIntElt`

The square of the length of the $r$th (co)root of the group of Lie type $G$.

### `IsLongRoot(G, r): GrpLie, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the group of Lie type $G$ is long, i.e. the $r$th coroot is short.

### `IsShortRoot(G, r): GrpLie, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the group of Lie type $G$ is short, i.e. the $r$th coroot is long.

### `AdditiveOrder(G): GrpLie -> SeqEnum`

The additive order on the positive roots of the group of Lie type $G$ equal to the Papi order of the longest word $w_0$ of the Weyl group of $G$; it corresponds to the order of roots in a reduced expression for $w_0$. If $\alpha_r$, $\alpha_s$ and $\alpha_t$ are positive roots and $\alpha_r+\alpha_s=\alpha_t$, then $t$ lies between $r$ and $s$. It is computed using the techniques of [[Papi, 1994](../../references.md#cite-papi)].

### `Example: Additive Order (ex-dabc7d)`

```magma
> G := GroupOfLieType("A5", GF(3));
> a := AdditiveOrder(G);
> Position(a, 2);
6
> Position(a, 3);
10

```

## Weights

### `WeightLattice(G): GrpLie -> Lat`

### `CoweightLattice(G): GrpLie -> Lat`

The (co)weight lattice of the group of Lie type $G$.

### `FundamentalWeights(G): GrpLie -> Mtrx`

### `FundamentalCoweights(G): GrpLie -> Mtrx`

```magma
Basis: MonStgElt                    Default: "Standard"
```

The fundamental (co)weights of the group of Lie type $G$ as the rows of a matrix.

### `DominantWeight(G, v): GrpLie, . -> ModTupFldElt, GrpFPCoxElt`

```magma
Basis: MonStgElt                    Default: "Standard"
```

The unique dominant weight in the same $W$-orbit as $v$, where $W$ is the Weyl group of $G$ and $v$ is a weight given as a vector or a sequence representing a vector. The second value returned is a Weyl group element taking $v$ to the dominant weight.
