---
title: "Roots, Coroots, and Reflections"
canonical: "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/root-data-roots.html"
source: "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/root-data-roots.md"
part: "Lie Theory"
chapter: "Coxeter Groups"
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": "Coxeter Groups", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/index-coxeter-groups.md"}
prev: {"title": "Operations on Elements", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/group-elt-op.md"}
next: {"title": "Reflections", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/rootrefl.md"}
intrinsics:
  - {"name": "RootSpace", "signature": "RootSpace(W): GrpPermCox -> ."}
  - {"name": "CorootSpace", "signature": "CorootSpace(W): GrpPermCox -> ."}
  - {"name": "SimpleRoots", "signature": "SimpleRoots(W): GrpPermCox -> Mtrx"}
  - {"name": "SimpleCoroots", "signature": "SimpleCoroots(W): GrpPermCox -> Mtrx"}
  - {"name": "NumberOfPositiveRoots", "signature": "NumberOfPositiveRoots(W): GrpPermCox -> RngIntElt"}
  - {"name": "NumPosRoots", "signature": "NumPosRoots(W): GrpPermCox -> RngIntElt"}
  - {"name": "Roots", "signature": "Roots(W): GrpPermCox -> SetIndx"}
  - {"name": "Coroots", "signature": "Coroots(W): GrpPermCox -> SetIndx"}
  - {"name": "PositiveRoots", "signature": "PositiveRoots(W): GrpPermCox -> SetIndx"}
  - {"name": "PositiveCoroots", "signature": "PositiveCoroots(W): GrpPermCox -> SetIndx"}
  - {"name": "Root", "signature": "Root(W, r): GrpPermCox, RngIntElt -> SetIndx"}
  - {"name": "Coroot", "signature": "Coroot(W, r): GrpPermCox, RngIntElt -> SetIndx"}
  - {"name": "RootPosition", "signature": "RootPosition(W, v): GrpPermCox, . -> SetIndx"}
  - {"name": "CorootPosition", "signature": "CorootPosition(W, v): GrpPermCox, . -> SetIndx"}
  - {"name": "HighestRoot", "signature": "HighestRoot(W): GrpPermCox -> ."}
  - {"name": "HighestLongRoot", "signature": "HighestLongRoot(W): GrpPermCox -> ."}
  - {"name": "HighestShortRoot", "signature": "HighestShortRoot(W): GrpPermCox -> ."}
  - {"name": "CoxeterForm", "signature": "CoxeterForm(W): GrpPermCox -> AlgMatElt"}
  - {"name": "DualCoxeterForm", "signature": "DualCoxeterForm(W): GrpPermCox -> AlgMatElt"}
  - {"name": "AdditiveOrder", "signature": "AdditiveOrder(W): GrpPermCox -> SeqEnum"}
  - {"name": "PapiOrder", "signature": "PapiOrder(W, w): GrpPermCox, GrpPermElt -> SeqEnum"}
  - {"name": "PapiOrder", "signature": "PapiOrder(W, wd): GrpPermCox, SeqEnum[RngIntElt] -> SeqEnum"}
  - {"name": "Sum", "signature": "Sum(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "IsPositive", "signature": "IsPositive(W, r): GrpPermCox, RngIntElt -> BoolElt"}
  - {"name": "IsNegative", "signature": "IsNegative(W, r): GrpPermCox, RngIntElt -> BoolElt"}
  - {"name": "Negative", "signature": "Negative(W, r): GrpPermCox, RngIntElt -> RngIntElt"}
  - {"name": "LeftString", "signature": "LeftString(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "RightString", "signature": "RightString(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "LeftStringLength", "signature": "LeftStringLength(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "RightStringLength", "signature": "RightStringLength(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "RootHeight", "signature": "RootHeight(W, r): GrpPermCox, RngIntElt -> RngIntElt"}
  - {"name": "CorootHeight", "signature": "CorootHeight(W, r): GrpPermCox, RngIntElt -> RngIntElt"}
  - {"name": "RootNorms", "signature": "RootNorms(W): GrpPermCox -> [RngIntElt]"}
  - {"name": "CorootNorms", "signature": "CorootNorms(W): GrpPermCox -> [RngIntElt]"}
  - {"name": "RootNorm", "signature": "RootNorm(W, r): GrpPermCox, RngIntElt -> RngIntElt"}
  - {"name": "CorootNorm", "signature": "CorootNorm(W, r): GrpPermCox, RngIntElt -> RngIntElt"}
  - {"name": "IsLongRoot", "signature": "IsLongRoot(W, r): GrpPermCox, RngIntElt -> BoolElt"}
  - {"name": "IsShortRoot", "signature": "IsShortRoot(W, r): GrpPermCox, RngIntElt -> BoolElt"}
  - {"name": "WeightLattice", "signature": "WeightLattice(W): GrpPermCox -> Lat"}
  - {"name": "CoweightLattice", "signature": "CoweightLattice(W): GrpPermCox -> Lat"}
  - {"name": "FundamentalWeights", "signature": "FundamentalWeights(W): GrpPermCox -> SeqEnum"}
  - {"name": "FundamentalCoweights", "signature": "FundamentalCoweights(W): GrpPermCox -> SeqEnum"}
  - {"name": "IsDominant", "signature": "IsDominant(R, v): RootDtm, . -> ModTupFldElt, GrpFPCoxElt"}
  - {"name": "DominantWeight", "signature": "DominantWeight(W, v): GrpPermCox, . -> ModTupFldElt, GrpFPCoxElt"}
  - {"name": "WeightOrbit", "signature": "WeightOrbit(W, v): GrpPermCox, . -> {@ ModTupFldElt @}, [GrpFPCoxElt]"}
examples:
  - "ex-18ee8e"
  - "ex-adcde8"
  - "ex-3e3fcd"
  - "ex-9ecc9b"
  - "ex-237223"
  - "ex-181d61"
---

<a id="root-data-roots"></a>
<a id="sectgrpcoxrdroots"></a>
# Roots, Coroots, and Reflections

The functions in this section give access to the underlying root system (or datum) of a permutation Coxeter group. These functions do not apply to finitely presented Coxeter groups

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](https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/root-data-roots.md#subsectgrppermcoxrootweight) below).

## Accessing Roots and Coroots

<a id="function-rootspace-grppermcox"></a>
### `RootSpace(W): GrpPermCox -> .`

<a id="function-corootspace-grppermcox"></a>
### `CorootSpace(W): GrpPermCox -> .`

The (co)root space of the Coxeter group $W$. This can be a vector space over a field of characteristic zero (Chapter [Vector Spaces](https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/index-vector-spaces.md#chapvectspace)), or an integer lattice in the crystallographic case (Chapter [Lattices](https://docs.magma-maths.org/v2.30-1/LatticesQuadraticForms/Lattices/index-lattices.md#chaplat)). The (co)reflection group of $W$ acts on the (co)root space.

<a id="function-simpleroots-grppermcox"></a>
### `SimpleRoots(W): GrpPermCox -> Mtrx`

<a id="function-simplecoroots-grppermcox"></a>
### `SimpleCoroots(W): GrpPermCox -> Mtrx`

The simple (co)roots of the Coxeter group $W$ as the rows of a matrix.

<a id="example-ex-18ee8e"></a>
### `Example: Root Space and Coroot Space (ex-18ee8e)`

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

<a id="function-numberofpositiveroots-grppermcox-2"></a>
### `NumberOfPositiveRoots(W): GrpPermCox -> RngIntElt`

<a id="function-numposroots-grppermcox-2"></a>
### `NumPosRoots(W): GrpPermCox -> RngIntElt`

The number of positive roots of the Coxeter group $W$.

<a id="function-roots-grppermcox"></a>
### `Roots(W): GrpPermCox -> SetIndx`

<a id="function-coroots-grppermcox"></a>
### `Coroots(W): GrpPermCox -> SetIndx`

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

An indexed set containing the (co)roots of the Coxeter group $W$.

<a id="function-positiveroots-grppermcox"></a>
### `PositiveRoots(W): GrpPermCox -> SetIndx`

<a id="function-positivecoroots-grppermcox"></a>
### `PositiveCoroots(W): GrpPermCox -> SetIndx`

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

An indexed set containing the positive (co)roots of the Coxeter group $W$.

<a id="function-root-grppermcox-rngintelt"></a>
### `Root(W, r): GrpPermCox, RngIntElt -> SetIndx`

<a id="function-coroot-grppermcox-rngintelt"></a>
### `Coroot(W, r): GrpPermCox, RngIntElt -> SetIndx`

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

The $r$th (co)root of the Coxeter group $W$.

<a id="function-rootposition-grppermcox"></a>
### `RootPosition(W, v): GrpPermCox, . -> SetIndx`

<a id="function-corootposition-grppermcox"></a>
### `CorootPosition(W, v): GrpPermCox, . -> SetIndx`

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

If $v$ is a (co)root of the Coxeter group $W$, this returns its position; otherwise it returns 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-adcde8"></a>
### `Example: Roots and Coroots from Matrices (ex-adcde8)`

```magma
> A := Matrix(2,3, [1,-1,0, -1,1,-1]);
> B := Matrix(2,3, [1,-1,1, 0,1,-1]);
> W := CoxeterGroup(A, B);
> Roots(W);
{@
    (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(W);
{@
    (1 -1  1),
    (0  1 -1),
    (1  2 -2),
    (2  1 -1),
    (1 0 0),
    (1  1 -1)
@}
> #Roots(W) eq 2*NumPosRoots(W);
true
> Root(W, 4);
(1 -1 -1)
> Root(W, 4 : Basis := "Root");
(2 1)
> RootPosition(W, [1,-1,-1]);
4
> RootPosition(W, [2,1] : Basis := "Root");
4
```

<a id="function-highestroot-grppermcox"></a>
### `HighestRoot(W): GrpPermCox -> .`

<a id="function-highestlongroot-grppermcox"></a>
### `HighestLongRoot(W): GrpPermCox -> .`

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

The unique (long) root of greatest height of the irreducible Coxeter group $W$.

<a id="function-highestshortroot-grppermcox"></a>
### `HighestShortRoot(W): GrpPermCox -> .`

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

The unique short root of greatest height of the irreducible Coxeter group $W$.

<a id="example-ex-3e3fcd"></a>
### `Example: Highest Roots of G2 (ex-3e3fcd)`

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

<a id="function-coxeterform-grppermcox"></a>
### `CoxeterForm(W): GrpPermCox -> AlgMatElt`

<a id="function-dualcoxeterform-grppermcox"></a>
### `DualCoxeterForm(W): GrpPermCox -> AlgMatElt`

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

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

<a id="function-additiveorder-grppermcox"></a>
### `AdditiveOrder(W): GrpPermCox -> SeqEnum`

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

<a id="function-papiorder-grppermcox-grppermelt"></a>
### `PapiOrder(W, w): GrpPermCox, GrpPermElt -> SeqEnum`

<a id="function-papiorder-grppermcox-seqenum-rngintelt"></a>
### `PapiOrder(W, wd): GrpPermCox, SeqEnum[RngIntElt] -> SeqEnum`

An additive order for the set of positive roots of the finite Coxeter group $W$ sent negative by $w^{-1}$. The element $w$ can be supplied either as an element of the permutation group $W$ or as a sequence representing a word in its generators.

## Operations and Properties for Root and Coroot Indices

<a id="function-sum-grppermcox-rngintelt-rngintelt"></a>
### `Sum(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt`

The index of the sum of the $r$th and $s$th roots in the Coxeter group $W$, or 0 if the sum is not a root. In other words, if $t = \hbox{\tt Sum(W,r,s)} \ne 0$ then $\alpha_t=\alpha_r+\alpha_s$. The condition $\alpha_r\ne\pm\alpha_s$ must be satisfied. If $W$ is noncrystallographic, an error is flagged.

<a id="function-ispositive-grppermcox-rngintelt"></a>
### `IsPositive(W, r): GrpPermCox, RngIntElt -> BoolElt`

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

<a id="function-isnegative-grppermcox-rngintelt"></a>
### `IsNegative(W, r): GrpPermCox, RngIntElt -> BoolElt`

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

<a id="function-negative-grppermcox-rngintelt"></a>
### `Negative(W, r): GrpPermCox, RngIntElt -> RngIntElt`

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

<a id="function-leftstring-grppermcox-rngintelt-rngintelt"></a>
### `LeftString(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt`

Root indices in the Coxeter group $W$ 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. The condition $\alpha_r\ne\pm\alpha_s$ must be satisfied. If $W$ is noncrystallographic, an error is flagged.

<a id="function-rightstring-grppermcox-rngintelt-rngintelt"></a>
### `RightString(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt`

Root indices of the Coxeter group $W$ 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. The condition $\alpha_r\ne\pm\alpha_s$ must be satisfied. If $W$ is noncrystallographic, an error is flagged.

<a id="function-leftstringlength-grppermcox-rngintelt-rngintelt"></a>
### `LeftStringLength(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt`

The largest $p$ such that $\alpha_s-p\alpha_r$ is a root of the Coxeter group $W$. The condition $\alpha_r\ne\pm\alpha_s$ must be satisfied. If $W$ is noncrystallographic, an error is flagged.

<a id="function-rightstringlength-grppermcox-rngintelt-rngintelt"></a>
### `RightStringLength(W, r, s): GrpPermCox, RngIntElt, RngIntElt -> RngIntElt`

The largest $q$ such that $\alpha_s+q\alpha_r$ is a root of the Coxeter group $W$. The condition $\alpha_r\ne\pm\alpha_s$ must be satisfied. If $W$ is noncrystallographic, an error is flagged.

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

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

<a id="function-rootheight-grppermcox-rngintelt"></a>
### `RootHeight(W, r): GrpPermCox, RngIntElt -> RngIntElt`

<a id="function-corootheight-grppermcox-rngintelt"></a>
### `CorootHeight(W, r): GrpPermCox, RngIntElt -> RngIntElt`

The height of the $r$th (co)root of the Coxeter group $W$, 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-grppermcox"></a>
### `RootNorms(W): GrpPermCox -> [RngIntElt]`

<a id="function-corootnorms-grppermcox"></a>
### `CorootNorms(W): GrpPermCox -> [RngIntElt]`

The sequence of squares of the lengths of the (co)roots of the Coxeter group $W$.

<a id="function-rootnorm-grppermcox-rngintelt"></a>
### `RootNorm(W, r): GrpPermCox, RngIntElt -> RngIntElt`

<a id="function-corootnorm-grppermcox-rngintelt"></a>
### `CorootNorm(W, r): GrpPermCox, RngIntElt -> RngIntElt`

The square of the length of the $r$th (co)root of the Coxeter group $W$.

<a id="function-islongroot-grppermcox-rngintelt"></a>
### `IsLongRoot(W, r): GrpPermCox, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the Coxeter group $W$ is long, i.e. the $r$th coroot is short. An error is flagged unless $W$ is irreducible and crystallographic.

<a id="function-isshortroot-grppermcox-rngintelt"></a>
### `IsShortRoot(W, r): GrpPermCox, RngIntElt -> BoolElt`

Returns `true` if, and only if, the $r$th root of the Coxeter group $W$ is short, i.e. the $r$th coroot is long. An error is flagged unless $W$ is irreducible and crystallographic.

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

```magma
> W := RootDatum("G2");
> RootHeight(W, 5);
4
> F := CoxeterForm(W);
> v := VectorSpace(Rationals(),2) ! Root(W, 5);
> (v*F, v) eq RootNorm(W, 5);
true
> IsLongRoot(W, 5);
true
> LeftString(W, 1, 5);
[ 4, 3, 2 ]
> roots := Roots(W);
> for i in [1..3] do
>   RootPosition(W, roots[5]-i*roots[1]);
> end for;
4
3
2
```

<a id="subsectgrppermcoxrootweight"></a>
<a id="id2"></a>
## Weights

<a id="function-weightlattice-grppermcox"></a>
### `WeightLattice(W): GrpPermCox -> Lat`

<a id="function-coweightlattice-grppermcox"></a>
### `CoweightLattice(W): GrpPermCox -> Lat`

The (co)weight lattice of the Coxeter group $W$. The roots and coroots of $W$ must have integral components.

<a id="function-fundamentalweights-grppermcox"></a>
### `FundamentalWeights(W): GrpPermCox -> SeqEnum`

<a id="function-fundamentalcoweights-grppermcox"></a>
### `FundamentalCoweights(W): GrpPermCox -> SeqEnum`

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

The fundamental (co)weights of the Coxeter group $W$. The roots and coroots of $W$ must have integral components.

<a id="function-isdominant-rootdtm"></a>
### `IsDominant(R, v): RootDtm, . -> ModTupFldElt, GrpFPCoxElt`

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

Returns `true` if, and only if, $v$ is a dominant weight for the root datum $R$, ie, a nonnegative integral linear combination of the fundamental weights.

<a id="function-dominantweight-grppermcox"></a>
### `DominantWeight(W, v): GrpPermCox, . -> ModTupFldElt, GrpFPCoxElt`

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

The unique element in the $W$-orbit of the weight $v$ which lies in the fundamental Weyl chamber, and the word in the generators which sends $v$ to this element. The Coxeter group $W$ must have a root datum. The weight $v$ can be given either as a vector or as a sequence representing the vector and is coerced into the weight lattice first.

<a id="function-weightorbit-grppermcox"></a>
### `WeightOrbit(W, v): GrpPermCox, . -> {@ ModTupFldElt @}, [GrpFPCoxElt]`

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

The orbit of the weight $v$ under the action of $W$. The Coxeter group $W$ must have a root datum. The weight $v$ can be given either as a vector or as a sequence representing the vector and is coerced into the weight lattice first.

<a id="example-ex-181d61"></a>
### `Example: Dominant Weights (ex-181d61)`

```magma
> W := CoxeterGroup("B3");
> DominantWeight(W, [1,-1,0] : Basis:="Weight");
(1 0 0)
[ 2, 3, 2, 1 ]
> #WeightOrbit(W, [1,-1,0] : Basis:="Weight");
6
```
