Function: algtomatrix
Section: algebras
C-Name: algtomatrix
Prototype: DGGD0,L,
Help: algtomatrix({al},x,{abs=0}): left multiplication table of x (table algebra
 or abs=1) or image of x under a splitting of al (CSA and abs=0).
Doc: Given an element \var{x} in \var{al} (Hamilton quaternions if omitted),
 returns the image of \var{x} under a homomorphism to a matrix algebra. If
 \var{al} is a table algebra output by \kbd{algtableinit} or if~$abs=1$, returns
 the left multiplication table on the integral basis; if \var{al} is a central
 simple algebra and~$abs=0$, returns~$\phi(x)$ where~$\phi : A\otimes_{K} L \to
 M_{d}(L)$ (where $d$ is the degree of the algebra and $L$ is an extension of $L$
 with~$[L:K]=d$) is an isomorphism stored in~\var{al}. Also accepts a square
 matrix with coefficients in~\var{al}.

 \bprog
 ? A = alginit(nfinit(y), [-1,-1]);
 ? algtomatrix(A,[0,0,0,2]~)
 %2 =
 [Mod(x + 1, x^2 + 1) Mod(Mod(1, y)*x + Mod(-1, y), x^2 + 1)]

 [Mod(x + 1, x^2 + 1)                   Mod(-x + 1, x^2 + 1)]
 ? algtomatrix(A,[0,1,0,0]~,1)
 %2 =
 [0 -1  1  0]

 [1  0  1  1]

 [0  0  1  1]

 [0  0 -2 -1]
 ? algtomatrix(A,[0,x]~,1)
 %3 =
 [-1  0 0 -1]

 [-1  0 1  0]

 [-1 -1 0 -1]

 [ 2  0 0  1]
 ? algtomatrix(,[1,2,3,4]~) \\ Hamilton quaternions
 %4 =
 [1 + 2*I -3 - 4*I]

 [3 - 4*I  1 - 2*I]
 ? algtomatrix(,I,1)
 %5 =
 [0 -1 0  0]

 [1  0 0  0]

 [0  0 0 -1]

 [0  0 1  0]
 @eprog

 Also accepts matrices with coefficients in \var{al}.
