1 | initial version |

One possibility is to use `FiniteDimensionalAlgebra`

. (Or similar "magmatic" constructors.)

For example:

```
F = GF(7)
A = [ Matrix( GL(3,F).random_element().list() )
for _ in range(3) ]
M = FiniteDimensionalAlgebra( F, A, names='s' )
M
s0, s1, s2 = M.gens()
s = s0, s1, s2
for k in (0,1,2):
for n in (0,1,2):
print "%s * %s = %s" % ( s[k], s[n], s[k]*s[n] )
print
for k in (0,1,2):
print "A[%s] is\n%s\n" % ( k, A[k] )
```

Here $F$ is the base field, taken with $7$ elements to make the multiplication constraints simple to follow. The data $A$ is the data of three matrices. (It collects the $\gamma$-constraints from the post.) It is randomly constructed here. (The GL has no structural meaning, it came first into the fingers.)

The above evaluates to:

```
Finite-dimensional algebra of degree 3 over Finite Field of size 7
s0 * s0 = 2*s0 + 5*s1 + 3*s2
s0 * s1 = s0 + 3*s1 + 4*s2
s0 * s2 = 5*s0 + s1 + s2
s1 * s0 = 4*s1 + s2
s1 * s1 = 5*s0 + 6*s1 + 3*s2
s1 * s2 = 4*s0 + 2*s1 + 5*s2
s2 * s0 = 3*s0 + 3*s1 + 2*s2
s2 * s1 = 3*s0 + 5*s2
s2 * s2 = 5*s0 + 3*s1
A[0] is
[2 5 3]
[0 4 1]
[3 3 2]
A[1] is
[1 3 4]
[5 6 3]
[3 0 5]
A[2] is
[5 1 1]
[4 2 5]
[5 3 0]
```

I think it is clear how the entries in the three matrices contribute to the multiplication constraints. I tried also...

```
sage: M.is_associative()
False
sage: M.is_commutative()
False
```

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.