---
title: "Roots and Coroots"
canonical: "https://docs.magma-maths.org/v2.30-1/LieTheory/RootSystems/roots-coroots-weights.html"
source: "https://docs.magma-maths.org/v2.30-1/LieTheory/RootSystems/roots-coroots-weights.md"
part: "Lie Theory"
chapter: "Root Systems"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Lie Theory", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/index-lie-theory.md"}
  - {"title": "Root Systems", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/RootSystems/index-root-systems.md"}
prev: {"title": "Properties of Root Systems", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/RootSystems/properties-root-system.md"}
next: {"title": "Building Root Systems", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/RootSystems/create-new-root-system.md"}
intrinsics:
  - {"name": "RootSpace", "signature": "RootSpace(R): RootSys -> ModTupFld"}
  - {"name": "CorootSpace", "signature": "CorootSpace(R): RootSys -> ModTupFld"}
  - {"name": "SimpleRoots", "signature": "SimpleRoots(R): RootSys -> Mtrx"}
  - {"name": "SimpleCoroots", "signature": "SimpleCoroots(R): RootSys -> Mtrx"}
  - {"name": "NumberOfPositiveRoots", "signature": "NumberOfPositiveRoots(R): RootSys -> RngIntElt"}
  - {"name": "NumPosRoots", "signature": "NumPosRoots(R): RootSys -> RngIntElt"}
  - {"name": "Roots", "signature": "Roots(R): RootSys -> SetIndx"}
  - {"name": "Coroots", "signature": "Coroots(R): RootSys -> SetIndx"}
  - {"name": "PositiveRoots", "signature": "PositiveRoots(R): RootSys -> SetIndx"}
  - {"name": "PositiveCoroots", "signature": "PositiveCoroots(R): RootSys -> SetIndx"}
  - {"name": "Root", "signature": "Root(R, r): RootSys, RngIntElt -> SetIndx"}
  - {"name": "Coroot", "signature": "Coroot(R, r): RootSys, RngIntElt -> SetIndx"}
  - {"name": "RootPosition", "signature": "RootPosition(R, v): RootSys, . -> SetIndx"}
  - {"name": "CorootPosition", "signature": "CorootPosition(R, v): RootSys, . -> SetIndx"}
  - {"name": "HighestRoot", "signature": "HighestRoot(R): RootSys -> ."}
  - {"name": "HighestCoroot", "signature": "HighestCoroot(R): RootSys -> ."}
  - {"name": "HighestLongRoot", "signature": "HighestLongRoot(R): RootSys -> ."}
  - {"name": "HighestLongCoroot", "signature": "HighestLongCoroot(R): RootSys -> ."}
  - {"name": "HighestShortRoot", "signature": "HighestShortRoot(R): RootSys -> ."}
  - {"name": "HighestShortCoroot", "signature": "HighestShortCoroot(R): RootSys -> ."}
  - {"name": "CoxeterForm", "signature": "CoxeterForm(R): RootSys -> AlgMatElt"}
  - {"name": "DualCoxeterForm", "signature": "DualCoxeterForm(R): RootSys -> AlgMatElt"}
  - {"name": "SimpleReflectionMatrices", "signature": "SimpleReflectionMatrices(R): RootSys -> []"}
  - {"name": "SimpleCoreflectionMatrices", "signature": "SimpleCoreflectionMatrices(R): RootSys -> []"}
  - {"name": "ReflectionMatrices", "signature": "ReflectionMatrices(R): RootSys -> []"}
  - {"name": "CoreflectionMatrices", "signature": "CoreflectionMatrices(R): RootSys -> []"}
  - {"name": "ReflectionMatrix", "signature": "ReflectionMatrix(R, r): RootSys, RngIntElt -> []"}
  - {"name": "CoreflectionMatrix", "signature": "CoreflectionMatrix(R, r): RootSys, RngIntElt -> []"}
  - {"name": "SimpleReflectionPermutations", "signature": "SimpleReflectionPermutations(R): RootSys -> []"}
  - {"name": "ReflectionPermutations", "signature": "ReflectionPermutations(R): RootSys -> []"}
  - {"name": "ReflectionPermutation", "signature": "ReflectionPermutation(R, r): RootSys, RngIntElt -> []"}
  - {"name": "ReflectionWords", "signature": "ReflectionWords(R): RootSys -> []"}
  - {"name": "ReflectionWord", "signature": "ReflectionWord(R, r): RootSys, RngIntElt -> []"}
  - {"name": "Sum", "signature": "Sum(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "IsPositive", "signature": "IsPositive(R, r): RootSys, RngIntElt -> BoolElt"}
  - {"name": "IsNegative", "signature": "IsNegative(R, r): RootSys, RngIntElt -> BoolElt"}
  - {"name": "Negative", "signature": "Negative(R, r): RootSys, RngIntElt -> RngIntElt"}
  - {"name": "RootHeight", "signature": "RootHeight(R, r): RootSys, RngIntElt -> RngIntElt"}
  - {"name": "CorootHeight", "signature": "CorootHeight(R, r): RootSys, RngIntElt -> RngIntElt"}
  - {"name": "RootNorms", "signature": "RootNorms(R): RootSys -> [RngIntElt]"}
  - {"name": "CorootNorms", "signature": "CorootNorms(R): RootSys -> [RngIntElt]"}
  - {"name": "RootNorm", "signature": "RootNorm(R, r): RootSys, RngIntElt -> RngIntElt"}
  - {"name": "CorootNorm", "signature": "CorootNorm(R, r): RootSys, RngIntElt -> RngIntElt"}
  - {"name": "IsLongRoot", "signature": "IsLongRoot(R, r): RootSys, RngIntElt -> BoolElt"}
  - {"name": "IsShortRoot", "signature": "IsShortRoot(R, r): RootSys, RngIntElt -> BoolElt"}
  - {"name": "IsIndivisibleRoot", "signature": "IsIndivisibleRoot(R, r): RootSys, RngIntElt -> BoolElt"}
  - {"name": "LeftString", "signature": "LeftString(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "RightString", "signature": "RightString(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "LeftStringLength", "signature": "LeftStringLength(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "RightStringLength", "signature": "RightStringLength(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "AdditiveOrder", "signature": "AdditiveOrder(R): RootSys -> SeqEnum"}
  - {"name": "IsAdditiveOrder", "signature": "IsAdditiveOrder(R, Q): RootSys, [RngIntElt] -> BoolElt"}
examples:
  - "ex-fe8350"
  - "ex-89c0a9"
  - "ex-77bd29"
  - "ex-a58034"
  - "ex-8a578c"
  - "ex-e2515b"
  - "ex-20f94b"
---

<a id="roots-coroots-weights"></a>
<a id="sectrsroot"></a>
# Roots and Coroots

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); or
2. `"Root"`: the basis of simple (co)roots.

<a id="access"></a>
<a id="subsectrsrootaccess"></a>
## Accessing Roots and Coroots

<a id="function-rootspace-rootsys"></a>
### `RootSpace(R): RootSys -> ModTupFld`

<a id="function-corootspace-rootsys"></a>
### `CorootSpace(R): RootSys -> ModTupFld`

The vector space containing the (co)roots of the root system $R$, i.e. $X$ (respectively, $Y$).

<a id="function-simpleroots-rootsys"></a>
### `SimpleRoots(R): RootSys -> Mtrx`

<a id="function-simplecoroots-rootsys"></a>
### `SimpleCoroots(R): RootSys -> Mtrx`

The simple (co)roots of the root system $R$ as the rows of a matrix, i.e. $A$ (respectively, $B$).

<a id="example-ex-fe8350"></a>
### `Example: Root and Coroot Spaces (ex-fe8350)`

```magma
> R := RootSystem("G2");
> RootSpace(R);
Full Vector space of degree 2 over Rational Field
> CorootSpace(R);
Full Vector space of degree 2 over Rational Field
> SimpleRoots(R);
[1 0]
[0 1]
> SimpleCoroots(R);
[ 2 -3]
[-1  2]
> CartanMatrix(R);
[ 2 -1]
[-3  2]
```

<a id="function-numberofpositiveroots-rootsys"></a>
### `NumberOfPositiveRoots(R): RootSys -> RngIntElt`

<a id="function-numposroots-rootsys"></a>
### `NumPosRoots(R): RootSys -> RngIntElt`

The number of positive roots of the root system $R$. This is also the number of positive coroots. The total number of (co)roots is twice the number of positive (co)roots.

<a id="function-roots-rootsys"></a>
### `Roots(R): RootSys -> SetIndx`

<a id="function-coroots-rootsys"></a>
### `Coroots(R): RootSys -> SetIndx`

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

The indexed set of (co)roots of the root system $R$, i.e. $\{@\,\alpha_1,\dots\alpha_{2N}\,@\}$ (respectively, $\{@\,\alpha_1^\star,\dots\alpha_{2N}^\star\,@\}$).

<a id="function-positiveroots-rootsys"></a>
### `PositiveRoots(R): RootSys -> SetIndx`

<a id="function-positivecoroots-rootsys"></a>
### `PositiveCoroots(R): RootSys -> SetIndx`

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

The indexed set of positive (co)roots of the root system $R$, i.e. $\{@\,\alpha_1,\dots\alpha_N\,@\}$ (respectively, $\{@\,\alpha_1^\star,\dots\alpha_N^\star\,@\}$).

<a id="function-root-rootsys-rngintelt"></a>
### `Root(R, r): RootSys, RngIntElt -> SetIndx`

<a id="function-coroot-rootsys-rngintelt"></a>
### `Coroot(R, r): RootSys, RngIntElt -> SetIndx`

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

The $r$th (co)root $\alpha_r$ (respectively, $\alpha_r^\star$) of the root system $R$.

<a id="function-rootposition-rootsys"></a>
### `RootPosition(R, v): RootSys, . -> SetIndx`

<a id="function-corootposition-rootsys"></a>
### `CorootPosition(R, v): RootSys, . -> SetIndx`

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

If $v$ is a (co)root in the root system $R$, return its index; otherwise return 0. These functions will try to coerce $v$, which can be a vector or a sequence representing a vector, into the appropriate vector space; $v$ should be written with respect to the basis specified by the parameter `Basis`.

<a id="example-ex-89c0a9"></a>
### `Example: Roots and Coroots of a Root System (ex-89c0a9)`

```magma
> A := Matrix(2,3, [1,-1,0, -1,1,-1]);
> B := Matrix(2,3, [1,-1,1, 0,1,-1]);
> R := RootSystem(A, B);
> Roots(R);
{@
    (1 -1  0),
    (-1  1 -1),
    (0  0 -1),
    (1 -1 -1),
    (2 -2 -1),
    (1 -1 -2),
    (-1  1  0),
    (1 -1  1),
    (0 0 1),
    (-1  1  1),
    (-2  2  1),
    (-1  1  2)
@}
> PositiveCoroots(R);
{@
    (1 -1  1),
    (0  1 -1),
    (1  2 -2),
    (2  1 -1),
    (1 0 0),
    (1  1 -1)
@}
> #Roots(R) eq 2*NumPosRoots(R);
true
> Root(R, 4);
(1 -1 -1)
> Root(R, 4 : Basis := "Root");
(2 1)
> RootPosition(R, [1,-1,-1]);
4
> RootPosition(R, [2,1] : Basis := "Root");
4
```

<a id="function-highestroot-rootsys"></a>
### `HighestRoot(R): RootSys -> .`

<a id="function-highestcoroot-rootsys"></a>
### `HighestCoroot(R): RootSys -> .`

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

The unique (co)root of greatest height in the irreducible root system $R$.

<a id="function-highestlongroot-rootsys"></a>
### `HighestLongRoot(R): RootSys -> .`

<a id="function-highestlongcoroot-rootsys"></a>
### `HighestLongCoroot(R): RootSys -> .`

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

The unique long (co)root of greatest height in the irreducible root system $R$.

<a id="function-highestshortroot-rootsys"></a>
### `HighestShortRoot(R): RootSys -> .`

<a id="function-highestshortcoroot-rootsys"></a>
### `HighestShortCoroot(R): RootSys -> .`

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

The unique short (co)root of greatest height in the irreducible root system $R$.

<a id="example-ex-77bd29"></a>
### `Example: Highest Roots (ex-77bd29)`

```magma
> R := RootSystem("G2");
> HighestRoot(R);
(3 2)
> HighestLongRoot(R);
(3 2)
> HighestShortRoot(R);
(2 1)
```

<a id="function-coxeterform-rootsys"></a>
### `CoxeterForm(R): RootSys -> AlgMatElt`

<a id="function-dualcoxeterform-rootsys"></a>
### `DualCoxeterForm(R): RootSys -> AlgMatElt`

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

The matrix of an inner product on the (co)root space of the root system $R$ which is invariant under the action of the (co)roots. This inner product is uniquely determined up to a constant on each irreducible component of $R$. The inner product is normalised so that the short roots in each crystallographic component have length one.

<a id="rootrefl"></a>
<a id="subsectrsrootaction"></a>
## Reflections

The root $\alpha$ acts on the root space via the reflection $s_\alpha$; the coroot $\alpha^\star$ acts on the coroot space via the coreflection $s_\alpha^\star$.

<a id="function-simplereflectionmatrices-rootsys"></a>
### `SimpleReflectionMatrices(R): RootSys -> []`

<a id="function-simplecoreflectionmatrices-rootsys"></a>
### `SimpleCoreflectionMatrices(R): RootSys -> []`

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

The sequence of matrices giving the action of the simple (co)roots of the root system $R$ on the (co)root space, i.e. the matrices of $s_{\alpha_1},\dots,s_{\alpha_n}$ (respectively, $s_{\alpha_1}^\star,\dots,s_{\alpha_n}^\star$).

<a id="function-reflectionmatrices-rootsys"></a>
### `ReflectionMatrices(R): RootSys -> []`

<a id="function-coreflectionmatrices-rootsys"></a>
### `CoreflectionMatrices(R): RootSys -> []`

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

The sequence of matrices giving the action of the (co)roots of the root system $R$ on the (co)root space, i.e. the matrices of $s_{\alpha_1},\dots,s_{\alpha_{2N}}$ (respectively, $s_{\alpha_1}^\star,\dots,s_{\alpha_{2N}}^\star$).

<a id="function-reflectionmatrix-rootsys-rngintelt"></a>
### `ReflectionMatrix(R, r): RootSys, RngIntElt -> []`

<a id="function-coreflectionmatrix-rootsys-rngintelt"></a>
### `CoreflectionMatrix(R, r): RootSys, RngIntElt -> []`

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

The matrix giving the action of the $r$th (co)root of the root system $R$ on the (co)root space, i.e. the matrix of $s_{\alpha_r}$ (respectively, $s_{\alpha_r}^\star$).

<a id="function-simplereflectionpermutations-rootsys"></a>
### `SimpleReflectionPermutations(R): RootSys -> []`

The sequence of permutations giving the action of the simple (co)roots of the root system $R$ on the (co)roots. This action is the same for roots and coroots.

<a id="function-reflectionpermutations-rootsys"></a>
### `ReflectionPermutations(R): RootSys -> []`

The sequence of permutations giving the action of the (co)roots of the root system $R$ on the (co)roots. This action is the same for roots and coroots.

<a id="function-reflectionpermutation-rootsys-rngintelt"></a>
### `ReflectionPermutation(R, r): RootSys, RngIntElt -> []`

The permutation giving the action of the $r$th (co)root of the root system $R$ on the (co)roots. This action is the same for roots and coroots.

<a id="function-reflectionwords-rootsys"></a>
### `ReflectionWords(R): RootSys -> []`

The sequence of words in the simple reflections for all the reflections of the root system $R$. These words are given as sequences of integers. In other words, if $[a_1,\dots,a_l] = \hbox{\tt ReflectionWords(R)[r]}$, then $s_{\alpha_r} = s_{\alpha_{a_1}} \cdots s_{\alpha_{a_l}}$.

<a id="function-reflectionword-rootsys-rngintelt"></a>
### `ReflectionWord(R, r): RootSys, RngIntElt -> []`

The word in the simple reflections for the $r$th reflection of the root system $R$. The word is given as a sequence of integers. In other words, if $[a_1,\dots,a_l] = \hbox{\tt ReflectionWord(R,r)}$, then $s_{\alpha_r} = s_{\alpha_{a_1}} \cdots s_{\alpha_{a_l}}$.

<a id="example-ex-a58034"></a>
### `Example: Reflection Matrices, Permutations, and Words (ex-a58034)`

```magma
> R := RootSystem("B3");
> mx := ReflectionMatrix(R, 4);
> perm := ReflectionPermutation(R, 4);
> wd := ReflectionWord(R, 4);
> RootPosition(R, Root(R,2) * mx) eq 2^perm;
true
> perm eq &*[ ReflectionPermutation(R, r) : r in wd ];
true
>
> mx := CoreflectionMatrix(R, 4);
> CorootPosition(R, Coroot(R,2) * mx) eq 2^perm;
true
```

<a id="ops-root-coroot"></a>
<a id="subsectrsrootop"></a>
## Operations and Properties for Roots and Coroot Indices

<a id="function-sum-rootsys-rngintelt-rngintelt"></a>
### `Sum(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt`

The index of the sum of the $r$th and $s$th roots in the crystallographic root system $R$, or 0 if the sum is not a root. In other words, if $t = \hbox{\tt Sum(R,r,s)} \ne 0$ then $\alpha_t=\alpha_r+\alpha_s$. We require $\alpha_r\ne\pm\alpha_s$.

<a id="function-ispositive-rootsys-rngintelt"></a>
### `IsPositive(R, r): RootSys, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th (co)root of the root system $R$ is a positive root.

<a id="function-isnegative-rootsys-rngintelt"></a>
### `IsNegative(R, r): RootSys, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th (co)root of the root system $R$ is a negative root.

<a id="function-negative-rootsys-rngintelt"></a>
### `Negative(R, r): RootSys, RngIntElt -> RngIntElt`

The index of the negative of the $r$th (co)root of the root system $R$. In other words, if $s = \hbox{\tt Negative(R,r)}$ then $\alpha_s=-\alpha_r$.

<a id="example-ex-8a578c"></a>
### `Example: Arithmetic with Root Indices (ex-8a578c)`

```magma
> R := RootSystem("G2");
> Sum(R, 1, Negative(R,5));
10
> IsPositive(R, 10);
false
> Negative(R, 10);
4
> P := PositiveRoots(R);
> P[1] - P[5] eq -P[4];
true
```

<a id="function-rootheight-rootsys-rngintelt"></a>
### `RootHeight(R, r): RootSys, RngIntElt -> RngIntElt`

<a id="function-corootheight-rootsys-rngintelt"></a>
### `CorootHeight(R, r): RootSys, RngIntElt -> RngIntElt`

The height of the $r$th (co)root of the root system $R$, i.e. the sum of the coefficients of $\alpha_r$ (respectively, $\alpha_r^\star$) with respect to the simple (co)roots.

<a id="function-rootnorms-rootsys"></a>
### `RootNorms(R): RootSys -> [RngIntElt]`

<a id="function-corootnorms-rootsys"></a>
### `CorootNorms(R): RootSys -> [RngIntElt]`

The sequence of squares of the lengths of the (co)roots of the root system $R$.

<a id="function-rootnorm-rootsys-rngintelt"></a>
### `RootNorm(R, r): RootSys, RngIntElt -> RngIntElt`

<a id="function-corootnorm-rootsys-rngintelt"></a>
### `CorootNorm(R, r): RootSys, RngIntElt -> RngIntElt`

The square of the length of the $r$th (co)root of the root system $R$.

<a id="function-islongroot-rootsys-rngintelt"></a>
### `IsLongRoot(R, r): RootSys, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the root system $R$ is long. This only makes sense for irreducible crystallographic root systems. Note that for non-reduced root systems, the roots which are not indivisible are actually longer than the long ones.

<a id="function-isshortroot-rootsys-rngintelt"></a>
### `IsShortRoot(R, r): RootSys, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the root system $R$ is short. This only makes sense for irreducible crystallographic root systems.

<a id="function-isindivisibleroot-rootsys-rngintelt"></a>
### `IsIndivisibleRoot(R, r): RootSys, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the root system $R$ is indivisible, ie, $\alpha_r/2$ is not a root.

<a id="function-leftstring-rootsys-rngintelt-rngintelt"></a>
### `LeftString(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt`

Indices in the crystallographic root system $R$ of the left string through $\alpha_s$ in the direction of $\alpha_r$, i.e. the indices of $\alpha_s-\alpha_r,\alpha_s-2\alpha_r,\dots,\alpha_s-p\alpha_r$. In other words, this returns the sequence $[r_1,\dots,r_p]$ where $\alpha_{r_i}=\alpha_s-i\alpha_r$ and $\alpha_s-(p+1)\alpha_r$ is not a root. We require that $\alpha_r\ne\pm\alpha_s$.

<a id="function-rightstring-rootsys-rngintelt-rngintelt"></a>
### `RightString(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt`

Indices in the crystallographic root system $R$ of the left string through $\alpha_s$ in the direction of $\alpha_r$, i.e. the indices of $\alpha_s+\alpha_r,\alpha_s+2\alpha_r,\dots,\alpha_s+q\alpha_r$. In other words, this returns the sequence $[r_1,\dots,r_q]$ where $\alpha_{r_i}=\alpha_s+i\alpha_r$ and $\alpha_s+(q+1)\alpha_r$ is not a root. We require that $\alpha_r\ne\pm\alpha_s$.

<a id="function-leftstringlength-rootsys-rngintelt-rngintelt"></a>
### `LeftStringLength(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt`

The largest $p$ such that $\alpha_s-p\alpha_r$ is a root. We require that the root system $R$ be crystallographic and $\alpha_s\ne\pm\alpha_r$.

<a id="function-rightstringlength-rootsys-rngintelt-rngintelt"></a>
### `RightStringLength(R, r, s): RootSys, RngIntElt, RngIntElt -> RngIntElt`

The largest $q$ such that $\alpha_s+q\alpha_r$ is a root. We require that the root system $R$ be crystallographic and $\alpha_s\ne\pm\alpha_r$.

<a id="example-ex-e2515b"></a>
### `Example: Heights, Norms, and Root Strings (ex-e2515b)`

```magma
> R := RootSystem("G2");
> RootHeight(R, 5);
4
> F := CoxeterForm(R);
> v := Root(R, 5);
> (v*F, v) eq RootNorm(R, 5);
true
> IsLongRoot(R, 5);
true
> LeftString(R, 1, 5);
[ 4, 3, 2 ]
> roots := Roots(R);
> for i in [1..3] do
>   RootPosition(R, roots[5]-i*roots[1]);
> end for;
4
3
2
> R := RootSystem("BC2");
> Root(R,2), IsIndivisibleRoot(R,2);
(0 1) true
> Root(R,4), IsIndivisibleRoot(R,4);
(0 2) false
```

<a id="function-additiveorder-rootsys"></a>
### `AdditiveOrder(R): RootSys -> SeqEnum`

An additive order on the positive roots of the root system $R$, i.e. a sequence containing the numbers $1,\dots,N$ in some order so that $\alpha_r+\alpha_s=\alpha_t$ implies $t$ is between $r$ and $s$. This is computed using the techniques of [[Pap94](https://docs.magma-maths.org/v2.30-1/references.md#cite-papi)].

<a id="function-isadditiveorder-rootsys-rngintelt"></a>
### `IsAdditiveOrder(R, Q): RootSys, [RngIntElt] -> BoolElt`

Returns `true` if, and only if, the sequence $Q$ gives an additive order on a set of positive roots of the root system $R$. $Q$ must be a sequence of integers in the range $[1..N]$, where $N$ is the number of positive roots of $R$, with no gaps or repeats.

<a id="example-ex-20f94b"></a>
### `Example: Additive Order on Positive Roots (ex-20f94b)`

```magma
> R := RootSystem("A5");
> a := AdditiveOrder(R);
> Position(a, 2);
6
> Position(a, 3);
10
> Position(a, Sum(R, 2, 3));
7
```
