I thought I would be able to generate the sixteen matrices kronecker_product(S[i], S[j]) using outermap. Oops:
(%i36) S : [matrix([1,0],[0,1]), matrix([0,1],[1,0]), matrix([0,-%i],[%i,0]),matrix([1,0],[0,-1])]$
(%i37) outermap(kronecker_product,S,S);
The "first" argument of the function "kronecker_product" must be a matrix
The outermap function maps down the the matrix elements. I don't think the user documentation for outermap is
clear about this. Also, I didn't expect outermap to work this way.
There are plenty of workarounds, for example genmatrix(lambda([a,b], kronecker_product(part(S,a), part(S,b))),4,4).
--Barton (who was testing his memory of QM).