# Automorphisms

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

For a quantized enveloping algebra $U$ this returns the bar-automorphism of $U$ (Section [Quantized Enveloping Algebras](background.md#quantizeduea)). The map returned by this function has its inverse stored, which can be retrieved using `Inverse`.

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

For a quantized enveloping algebra $U$ this returns the automorphism of $U$ that is denoted by $\omega$ (Section [Quantized Enveloping Algebras](background.md#quantizeduea)). The map returned by this function has its inverse stored, which can be retrieved using `Inverse`.

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

For a quantized enveloping algebra $U$ this returns the anti-automorphism of $U$ that is denoted by $\tau$ (Section [Quantized Enveloping Algebras](background.md#quantizeduea)). The map returned by this function has its inverse stored, which can be retrieved using `Inverse`.

## `AutomorphismTalpha(U, k): AlgQUE, RngIntElt -> Map`

Let $U$ be a quantized enveloping algebra, and let $k$ be an integer between $1$ and the rank of the root datum. Then this function returns the automorphism $T_{\alpha_k}$ of $U$, corresponding to the $k$-th simple root (Section [PBW-type Bases](background.md#pbwbases)). The map returned by this function has its inverse stored, which can be retrieved using `Inverse`.

## `DiagramAutomorphism(U, p): AlgQUE, GrpPermElt -> Map`

## `GraphAutomorphism(U, p): AlgQUE, GrpPermElt -> Map`

Let $U$ be a quantized enveloping algebra, and let $p$ be a permutation of $\{ 1,\ldots, r\}$, where $r$ is the rank of the root datum. Here $p$ must represent a diagram automorphism of the root datum (i.e., it leaves the Dynkin diagram invariant). Then this function returns the corresponding automorphism of $U$ (see Section [Quantized Enveloping Algebras](background.md#quantizeduea)). The map returned by this function has its inverse stored, which can be retrieved using `Inverse`.

## `Example: Q Grp Automs (ex-f34802)`

```magma
> R:= RootDatum("G2");
> U:= QuantizedUEA(R);
> b:= BarAutomorphism(U);
> b(U.3);
(q^10 - q^6 - q^4 + 1)/q^4*F_1^(2)*F_6 + (q^4 - 1)/q^2*F_1*F_5 + F_3

```

A known result states that $T_{\alpha_r}^{-1} = \tau \circ T_{\alpha_r} \circ \tau$. We check that for the quantum group of type $C_3$, and the third simple root.

```magma
> U:= QuantizedUEA(RootDatum("C3"));
> t:= AntiAutomorphismTau(U);
> T:= AutomorphismTalpha(U, 3);
> Ti:= Inverse(T);
> f:= t*T*t;
> &and[ Ti(U.i) eq f(U.i) : i in [1..21] ];
true

```

A diagram automorphism maps the canonical basis into itself. We check that for the set of elements of the canonical basis of the quantized enveloping algebra of type $D_4$ of weight $\alpha_1+3\alpha_2+2\alpha_3+2\alpha_4$. (Here $\alpha_i$ is the $i$-th simple root.) The chosen diagram automorphism maps this weight to $2\alpha_1+3\alpha_2+\alpha_3+2\alpha_4$. Therefore we also compute the elements of the canonical basis of that weight.

```magma
> U:= QuantizedUEA(RootDatum("D4"));
> p:= SymmetricGroup(4)!(1,3,4);
> d:= DiagramAutomorphism(U, p);
> e1:= CanonicalElements(U, [1,3,2,2]);
> e2:= CanonicalElements(U, [2,3,1,2]);
> &and[ d(x) in e2 : x in e1 ];
true

```
