Function: algpoleval
Section: algebras
C-Name: algpoleval
Prototype: DGGG
Help: algpoleval({al},T,b): T in K[X] evaluate T(b) in al (Hamilton quaternions
 if omitted).
Doc: Given an element $b$ in \var{al} (Hamilton quaternions if omitted) and a
 polynomial $T$ in $K[X]$, computes~$T(b)$ in~\var{al}. Here~$K = \Q$ or $\F_p$
 for a table algebra (output by \tet{algtableinit}) and $K$ is the center of
 \var{al} for a central simple algebra (output by \tet{alginit}).
 Also accepts as input a \typ{VEC}~$[b,mb]$ where~$mb$ is the left
 multiplication table of~$b$.

 \bprog
 ? nf = nfinit(y^2-5);
 ? al = alginit(nf,[y,-1]);
 ? b = [1..8]~;
 ? pol = algcharpoly(al,b,,1); \\absolute characteristic polynomial
 ? algpoleval(al,pol,b)==0
 %5 = 1
 ? mb = algtomatrix(al,b,1);
 ? algpoleval(al,pol,[b,mb])==0
 %7 = 1
 ? pol = algcharpoly(al,b); \\reduced characteristic polynomial
 ? algpoleval(al,pol,b) == 0
 %9 = 1
 ? algpoleval(,polcyclo(8),[1,0,0,1]~/sqrt(2)) \\ Hamilton quaternions
 %10 = [0.E-38, 0, 0, 0.E-38]~
 @eprog
