# Construction of Associative Algebras

## Construction of an Associative Structure Constant Algebra

The construction of an associative structure constant algebra is identical to that of a general structure constant algebra, with the exception that an additional parameter is provided which may be used to avoid checking that the algebra is associative.

### `AssociativeAlgebra< R, n | Q : parameters >: Rng, RngIntElt, SeqEnum -> AlgAss`

### `AssociativeAlgebra< M | Q : parameters >: ModTupRng, SeqEnum -> AlgAss`

```magma
Check: BoolElt                      Default: true
Rep  : MonStgElt                    Default: "Dense"
```

This function creates the associative structure constant algebra $A$ over the free module $M = R^n$, with standard basis ${e_1, e_2, \ldots, e_n}$, and with the structure constants $a_{ij}^k$ being given by the sequence $Q$. The sequence $Q$ can be of any of the following three forms. Note that in all cases the actual ordering of the structure constants is the same: it is only their division that varies.

**(i)**
A sequence of $n$ sequences of $n$ sequences of length $n$. The $j$-th element of the $i$-th sequence is the sequence $[ a_{ij}^1, \ldots, a_{ij}^n ]$, or the element $(a_{ij}^1, \ldots, a_{ij}^n)$ of $M$, giving the coefficients of the product $e_i * e_j$.

**(ii)**
A sequence of $n^2$ sequences of length $n$, or $n^2$ elements of $M$. Here the coefficients of $e_i * e_j$ are given by position $(i - 1)*n + j$ of $Q$.

**(iii)**
A sequence of $n^3$ elements of the ring $R$. Here the sequence elements are the structure constants themselves, $a_{11}^1, a_{11}^2, \ldots, a_{11}^n, a_{12}^1, a_{12}^2, \ldots, a_{nn}^n$. So $a_{ij}^k$ lies in position $(i - 1)*n^2 + (j - 1)*n + k$ of $Q$.

By default the algebra is checked to be associative; this can be overruled by setting the parameter `Check` to `false`.

The optional parameter `Rep` can be used to select the internal representation of the structure constants. The possible values for `Rep` are `"Dense"`, `"Sparse"` and `"Partial"`, with the default being `"Dense"`. In the dense format, the $n^3$ structure constants are stored as $n^2$ vectors of length $n$, similarly to (ii) above. This is the best representation if most of the structure constants are non-zero. The sparse format, intended for use when most structure constants are zero, stores the positions and values of the non-zero structure constants. The partial format stores the vectors, but records for efficiency the positions of the non-zero structure constants.

### `AssociativeAlgebra< R, n | T : parameters >: Rng, RngIntElt, SeqEnum -> AlgAss`

```magma
Check: BoolElt                      Default: true
Rep  : MonStgElt                    Default: "Sparse"
```

This function creates the associative structure constant algebra $A$ with standard basis ${e_1, e_2, \ldots, e_n}$ over $R$. The sequence $T$ contains quadruples $< i, j, k, a_{ij}^k>$ giving the non-zero structure constants. All other structure constants are defined to be 0.

The optional parameters are as above.

### `AssociativeAlgebra(A): AlgGen -> AlgAss`

Given a structure constant algebra $A$ of type `AlgGen`, construct an isomorphic associative structure constant algebra of type `AlgAss`. If it is not known whether or not $A$ is associative, this will be checked and an error occurs if it is not. The elements of the resulting algebra can be coerced into $A$ and vice versa.

### `ChangeBasis(A, B): AlgAss, {[AlgAssElt]} -> AlgAss`

### `ChangeBasis(A, B): AlgAss, {[ModTupFldElt]} -> AlgAss`

### `ChangeBasis(A, B): AlgAss, Mtrx -> AlgAss`

```magma
Rep: MonStgElt                    Default: "Dense"
```

Create a new associative structure constant algebra $A'$, isomorphic to $A$, by recomputing the structure constants with respect to the basis $B$. The basis $B$ can be specified as a set or sequence of elements of $A$, a set or sequence of vectors, or a matrix. The second returned value is the isomorphism from $A$ to $A'$.

As above, the optional parameter `Rep` can be used to select the internal representation of the structure constants. Note that the default is dense representation, regardless of the representation used by $A$.

## Associative Structure Constant Algebras from other Algebras

### `Algebra(A): AlgGrp -> AlgAss, Map`

If $A$ is either a group algebra of type `AlgGrp` given in vector representation or a matrix algebra of type `AlgMat`, construct the associative structure constant algebra $B$ isomorphic to $A$ together with the isomorphism $A \rightarrow B$.

### `Algebra(F, E): FldFin, FldFin -> AlgAss, Map;`

### `Algebra(F, E): FldNum, FldNum -> AlgAss, Map;`

Let $E$ and $F$ be either finite fields or algebraic number fields such that $E$ is a subfield of $F$. This function returns the associative algebra $A$ of dimension $[F:E]$ over $E$ which is isomorphic to $F$, together with the isomorphism from $F$ to $A$ such that the $(i-1)$-th power of the generator of $F$ over $E$ is mapped to the $i$-th basis vector of $A$.

### `AlgebraOverCenter(A): Alg -> AlgAss, Map;`

Given a simple algebra $A$ of type `AlgMat` or `AlgAss` with center $K$, this function returns a $K$-algebra $B$ which is $K$-isomorphic to $A$ as well as an isomorphism from $A$ to $B$.
