[SciPy-user] Kronecker product kron(a,b)

Alan G Isaac aisaac at american.edu
Thu Aug 5 15:28:50 CDT 2004


On Wed Sep 24 16:52:28 2003 Nils Wagner scipy-user at scipy.net wrote
> There is another useful function which might be interesting for scipy,
> the so-called Kronecker product of two matrices.

> def kron(a,b):
>     if not a.iscontiguous():
>         a = reshape(a, a.shape)
>     if not b.iscontiguous():
>         b = reshape(b, b.shape)
>     o = outerproduct(a,b)
>     o.shape = a.shape + b.shape
>     return concatenate(concatenate(o, axis=1), axis=1)

> It would be great, if this becomes a standard function in scipy.

I agree.
It the meantime, thanks for posting this.
Apparently the numarray folks are thinking
of including a kroneckerproduct function.

Cheers,
Alan Isaac




More information about the SciPy-user mailing list