# Generic Operations

## Nonassociative Algebras with Involutions

### `IsStarAlgebra(A): AlgGen -> BoolElt`

Decides if algebra has an involution, i.e. a $*$-algebra.

### `Star(A): AlgGen -> Map`

Returns involution of given $*$-algebra.

### `Example: Star Alg (ex-ffb750)`

We demonstrate the functions dealing with involutions of nonassociative algebras.

```magma
> A := OctonionAlgebra(Rationals(),-1,-1,-1);
> IsStarAlgebra(A);
true
>
> s := Star(A);
> A.1; // A.1 is the mult. id.
(1 0 0 0 0 0 0 0)
> A.1 @ s;
(1 0 0 0 0 0 0 0)
>
> A.2;
(0 1 0 0 0 0 0 0)
> A.2 @ s;
( 0 -1  0  0  0  0  0  0)

```

## Operations on Power Associative Algebras

The following operations are defined for nonassociative algebras for which $x*(x*x)=(x*x)*x$.

### `GenericMinimalPolynomial(x): AlgGenElt -> FldElt`

The generic minimum polynomial of an element in a power associative algebra.

### `GenericNorm(x): AlgGenElt -> FldElt`

The generic norm of an element in a power associative algebra.

### `GenericTrace(x): AlgGenElt -> FldElt`

The generic trace of an element in a power associative algebra.

### `GenericTracelessSubspaceBasis(A): AlgGen -> Any`

Given a power associative algebra return a basis for the elements of generic trace 0.

### `Example: Ten Generic (ex-099024)`

The trace $x+\bar{x}$ of a quaternion doubles the rational component, producing degenerate behavior in characteristic $2$. The generic trace avoids this.

```magma
> Q := QuaternionAlgebra(Rationals(), 1,1);
> Trace(Q!1);
2
> GenericTrace(Q!1);
1
> Q := QuaternionAlgebra(GF(2), 1,1);
> Trace(Q!1);
0
> GenericTrace(Q!1);
1

```

The generic minimum polynomial of an element $x$ in power associative algebra need only be a factor of the minimal polynomial of its right regular matrix $yR_x:=x*y$.

```magma
> J := ExceptionalJordanCSA(GF(5));
> p := GenericMinimumPolynomial(J.3+J.12);
> Rx := AsMatrices(Tensor(J), 2,0);     // yR_x = y*x.
> q := MinimalPolynomial(Rx[3]+Rx[12]);
> Degree(p);
3
> Degree(q);
6
> q mod p;
0

```
