# Operations on Elements

The generators of a quantized enveloping algebra $U$ can be constructed by using the dot operator, e.g., `U.5`. More general elements can then be constructed using the operations of scalar multiplication, addition, and multiplication.

Note that for the generators denoted $F_k$ and $E_k$ we use divided powers instead of normal powers. This means for instance that $F_k^s = [s]!F_k^{(s)}$, i.e., exponentiation causes multiplication by a scalar factor.

## `x + y: AlgQUEElt, AlgQUEElt -> AlgQUEElt`

## `x - y: AlgQUEElt, AlgQUEElt -> AlgQUEElt`

## `x * y: AlgQUEElt, AlgQUEElt -> AlgQUEElt`

## `c * x: RngElt, AlgQUEElt -> AlgQUEElt`

## `x * c: AlgQUEElt, RngElt -> AlgQUEElt`

## `x ^ n: AlgQUEElt, RngIntElt -> AlgQUEElt`

## `U ! 0: AlgQUE, RngIntElt -> AlgQUEElt`

## `Zero(U): AlgQUE -> AlgQUEElt`

The zero element of the quantized enveloping algebra $U$.

## `U ! 1: AlgQUE, RngIntElt -> AlgQUEElt`

## `One(U): AlgQUE -> AlgQUEElt`

The identity element of the quantized enveloping algebra $U$.

## `U . i: AlgQUE, RngIntElt -> AlgQUEElt`

The $i$-th generator of the quantized enveloping algebra $U$. Let the root datum have $s$ positive roots and rank $r$. If $1\leq i\leq s$ then `U.i` is $F_i$. If $s+1\leq i\leq s+r$, then `U.i` is $K_j$ where $j= i-s$. If $s+r+1\leq i\leq 2s+r$ then `U.i` is $E_j$, where $j=i-s-r$.

## `U ! r: AlgQUE, Any -> AlgQUEElt`

Returns $r$ as an element of the quantized universal enveloping algebra $U$ where $r$ may be anything coercible into the coefficient ring of $U$ or an element of another quantized enveloping algebra whose coefficients may be coerced into the coefficient ring of $U$.

## `KBinomial(U, i, s): AlgQUE, RngIntElt, RngIntElt -> AlgQUEElt`

## `KBinomial(K, s): AlgQUEElt, RngIntElt -> AlgQUEElt`

Given a quantized enveloping algebra $U$ corresponding to a root datum of rank $r$, an integer $i$ between $1$ and $r$, and a positive integer $s$, return the element $[ K_i ; s ]$. This can be used to construct general elements in the subalgebra $U^0$ (cf. Section [PBW-type Bases](background.md#pbwbases)).

Or given an element $K = K_i$, i.e., equal to `U.(n+i)`, where $n$ is the number of positive roots of the root datum, return $[ K ; s ]$.

## `Monomials(u): AlgQUEElt -> SeqEnum`

Given an element $u$ of a quantized enveloping algebra, returns the sequence consisting of the monomials of $u$. This sequence corresponds exactly to the one returned by `Coefficients(u)`.

## `Coefficients(u): AlgQUEElt -> SeqEnum`

Given an element $u$ of a quantized enveloping algebra, returns the sequence consisting of the coefficients of the monomials that occur in $u$. This sequence corresponds exactly to the one returned by `Monomials(u)`.

## `K ^ -1: AlgQUEElt, RngIntElt -> AlgQUEElt`

Given a generator $K$ of a quantized enveloping algebra $U$ of the form $K_i$, i.e., it is equal to `U.k`, for some $n+1 \leq k \leq n+r$ where $U$ corresponds to a root datum of rank $r$ with $n$ positive roots, return the inverse of $K$.

## `Degree(u, i): AlgQUEElt, RngIntElt -> RngIntElt`

Given an element $u$ of a quantized enveloping algebra $U$ and an integer $1 \le i \le n$ or $n + r + 1 \le i \le 2n + r$, where the root datum corresponding to $U$ has $n$ positive roots and rank $r$ (i.e., `U.i` is equal to $F_i$ or to $E_k$, where $k=i-n-r$), return the degree of $u$ in the generator $F_i$ if $1\leq i\leq n$, otherwise return the degree of $u$ in the generator $E_k$, where $k=i-n-r$.

## `KDegree(m, i): AlgQUEElt, RngIntElt -> Tup`

Given a single monomial $m$ in a quantized enveloping algebra and an integer $1 \le i \le r$, where $r$ is the rank of the corresponding root datum return a tuple of $2$ integers, where the first is $0$ or $1$, and the second is non-negative. Denote this tuple by $\langle d, k \rangle$. If $d=0$ then the factor $[ K_i ; k ]$ occurs in the monomial $m$. If $d=1$, then the factor $K_i[ K_i ; k ]$ occurs in the monomial $m$.

## `Example: Q Grp Elt Ops (ex-a73ba4)`

```magma
> R:= RootDatum("G2");
> U:= QuantizedUEA(R);
> u:= U.10*U.7^3*U.1;
> m:= Monomials(u); m;
[
    F_1*K_1[ K_1 ; 2 ]*E_2,
    F_1*[ K_1 ; 1 ]*E_2,
    F_1*K_1*E_2,
    K_1[ K_1 ; 1 ]*E_3,
    E_3
]
> Coefficients(u);
[
    (q^6 - q^4 - q^2 + 1)/q^17,
    (q^2 - 1)/q^14,
    1/q^15,
    (-q^2 + 1)/q^9,
    -1/q^8
]
> Degree(m[1], 1);
1
> Degree(m[1], 9);
0
> Degree(m[1], 10);
1
> KDegree(m[1], 1);
<1, 2>
> U.7^-1;
(-q^2 + 1)/q*[ K_1 ; 1 ] + K_1
> U.7*U.7^-1;
1

```
