# Hopf Algebra Structure

In this section we describe the functions for working with the Hopf algebra structure of a quantized universal enveloping algebra (cf. Section [Representations of $U_q(L)$](background.md#qgrpreps)).

## `UseTwistedHopfStructure(U, f, g): AlgQUE, Map, Map`

The Hopf algebra structure that is used by default is the one described in Section [Representations of $U_q(L)$](background.md#qgrpreps). As explained in that same section, it is possible to twist this by an automorphism, or an antiautomorphism.

Given a quantized universal enveloping algebra $U$ and (anti-) automorphisms $f$ and $g$ of $U$ where $g$ is the inverse of $f$ (this is not checked by Magma) set $U$ to use the corresponding twisted Hopf algebra structure.

This command has to be given before using the Hopf algebra structure, otherwise the default structure will be used. This includes creating a tensor product.

For some (anti-) automorphisms we refer to Section [Automorphisms](automorphisms.md#sectalgqeaautoms).

## `HasTwistedHopfStructure(U): AlgQUE -> BoolElt, List`

This function checks whether the quantized enveloping algebra $U$ has been set to use a twisted Hopf structure. If the first value returned by this function is `true`, then the (anti-) automorphism and its inverse are also returned.

## `Counit(U): AlgQUE -> Map`

Returns the counit of the quantized enveloping algebra $U$. It is a map from $U$ into the ground field of $U$.

## `Antipode(U): AlgQUE -> Map`

Returns the antipode of the quantized enveloping algebra $U$. It is an antiautomorphism of $U$.

## `Comultiplication(U, d): AlgQUE, RngIntElt -> UserProgram`

Returns the comultiplication of degree $d$ of the quantized enveloping algebra $U$. This is a map from $U$ into the $d$-fold tensor power of $U$. The comultiplication given in Section [Representations of $U_q(L)$](background.md#qgrpreps) is of degree 2. The comultiplications of higher degree are obtained by repeating this map. So in particular, $d$ has to be at least $2$.

An element of the $d$-fold tensor power of $U$ is represented (rather primitively) by a list of $d$-tuples, each followed by a coefficient. The $d$-tuples are $d$-tuples of basis elements of $U$. The element represented by this list is the sum of the elements obtained by multiplying the $i$-th coefficient and the tensor product of the elements in the $i$-th $d$-tuple.

## `Example: Q Grp Comult (ex-a3845c)`

```magma
> U:= QuantizedUEA(RootDatum("A3"));
> d:= Comultiplication(U, 2);
> d(U.1);
[*
<1, F_1>,
1,
<F_1, K_1>,
1,
<F_1, [ K_1 ; 1 ]>,
(-q^2 + 1)/q
*]

```
