I agree that it would be nice for Maple to include Kronecker product natively. In the meantime, the following might do.
KroneckerProd:= proc(A::Matrix, B::Matrix)
local a, b, C, Catenate, i;
description "Returns the Kronecker product of A and B";
Catenate:= (d, A, B)-> `if`(LinearAlgebra:-Dimension(A)[d]=0, B, ArrayTools:-Concatenate(d, A, B));
a:= Dimension(A); b:= Dimension(B);
C:= map(curry(ScalarMultiply,B), A);
foldl(curry(Catenate,1), Matrix(0,a*b), seq(foldl(curry(Catenate,2), Matrix(b,0), op(convert(C[i,1..-1], list))), i=1..a))
The local function
should not be needed; it is used only because there is a bug in
, when the dimension is zero.