# The Path Model

In this section we describe functions for working with Littelmann’s path model (cf. Section [The Path Model](background.md#pathmodel)). A special role is played by the zero path. The path operators cannot be applied to the zero path. However, on some occasions they do produce the zero path.

## `DominantLSPath(R, hw): RootDtm, SeqEnum -> PathLS`

Given a root datum $R$ and a sequence $hw$ of non-negative integers returns the path that is the straight line from the origin to $hw$.

## `Falpha(p, i): PathLS, RngIntElt -> PathLS`

Given a (non-zero) path $p$ and an integer $i$ between $1$ and the rank of the root datum returns the result of applying the path operator $f_{\alpha_i}$ to $p$ (where $\alpha_i$ is the $i$-th simple root).

## `Ealpha(p, i): PathLS, RngIntElt -> PathLS`

Given a (non-zero) path $p$ and an integer $i$ between $1$ and the rank of the root datum returns the result of applying the path operator $e_{\alpha_i}$ to $p$ (where $\alpha_i$ is the $i$-th simple root).

## `WeightSequence(p): PathLS -> SeqEnum`

For a path $p$ this returns the sequence of weights that, along with the sequence of rational numbers, defines the path (cf. Section [The Path Model](background.md#pathmodel)).

## `RationalSequence(p): PathLS -> SeqEnum`

For a path $p$ this returns the sequence of rational numbers that, along with the sequence of weights, defines the path (cf. Section [The Path Model](background.md#pathmodel)).

## `EndpointWeight(p): PathLS -> ModTupRngElt`

Returns the weight which is the end point of the path $p$.

## `Shape(p): PathLS -> ModTupRngElt`

Returns the weight which is the shape of the path $p$.

## `WeylWord(p): PathLS -> SeqEnum`

Returns a reduced expression for the element $\sigma$ of the Weyl group, of shortest length such that $\sigma(\lambda) = \nu_1$, where $\lambda$ is the shape of the path $p$, and $\nu_1$ is the first weight in the sequence `WeightSequence(p)`. The reduced expression is represented as a sequence of integers between $1$ and the rank of the root datum. In this sequence the index $i$ represents the $i$-th simple reflection.

## `IsZero(p): PathLS -> BoolElt`

Returns `true` if the path $p$ is the zero path, `false` otherwise.

## `p1 eq p2: PathLS, PathLS -> BoolElt`

Returns `true` if the paths $p1$ and $p2$ are equal, `false` otherwise.

## `Example: LS Paths (ex-cccc8c)`

```magma
> R:= RootDatum("B2");
> p:= DominantLSPath(R, [ 2, 3 ]);
> p;
LS-path of shape (2 3) ending in (2 3)

> Falpha(p, 1);
LS-path of shape (2 3) ending in (0 5)

> Ealpha(Falpha(p, 1), 1);
LS-path of shape (2 3) ending in (2 3)

> p1:= Falpha(Falpha(Falpha(p, 1), 2), 1);
> p1;
LS-path of shape (2 3) ending in (-1  5)

> WeightSequence(p1);
[
    (5 -7),
    (-2  7)
]
> RationalSequence(p1);
[ 0, 1/7, 1 ]
> WeylWord(p1);
[ 2, 1 ]

```

So $s_2s_1(2,3) = (5,-7)$.

## `CrystalGraph(R, hw): RootDtm, SeqEnum -> GrphDir, SeqEnum`

For a root datum $R$ and a sequence of non-negative integers $hw$ (of length equal to the rank of the root datum), this function returns the corresponding crystal graph $G$, along with a sequence of paths. The graph $G$ is a directed labelled graph. The labels on the edges are integers between $1$ and the rank of the root system. If there is an edge from $i$ to $j$ with label $s$, then $f_{\alpha_s}(p_i) = p_j$, where $p_i,p_j$ are the $i$-th and $j$-th elements of the sequence of paths returned by this function (and $f_{\alpha_s}$ is the root operator corresponding to the $s$-th simple root). In other words, the $i$-th path is the $i$-th point of the graph $G$.

## `Example: Cryst Grph (ex-3f9751)`

```magma
> R:= RootDatum("G2");
> G, pp:= CrystalGraph(R, [0,1]);
> G;
Digraph
Vertex  Neighbours

1       2 ;
2       3 ;
3       4 ;
4       5 6 ;
5       7 ;
6       8 ;
7       9 ;
8       10 ;
9       11 ;
10      11 ;
11      12 ;
12      13 ;
13      14 ;
14      ;

> e:= Edges(G);
> e[10];
[9, 11]
> Label(e[10]);
1
> Falpha(pp[9], 1) eq pp[11];
true

```
