[Numpy-discussion] Toward release 1.0 of NumPy

Charles R Harris charlesr.harris at gmail.com
Thu Apr 13 14:19:01 EDT 2006


Tim,

In particular:

def kron(a,b):
    n = shape(a)[1]*shape(b)[1]
    c = transpose(product.outer(a,b), axis=(0,2,1,3)).reshape(-1,n)
    # wrap c as a matrix.


On 4/13/06, Charles R Harris <charlesr.harris at gmail.com> wrote:
>
> Tim,
>
> On 4/13/06, Tim Hochberg < tim.hochberg at cox.net> wrote:
> >
> > Alan G Isaac wrote:
> >
> > >On Thu, 13 Apr 2006, Charles R Harris apparently wrote:
> > >
> > >
> > >>The Kronecker product (aka Tensor product) of two
> > >>matrices isn't a matrix.
> > >>
> > >>
> > >
> > >That is an unusual way to describe things in
> > >the world of econometrics.  Here is a more
> > >common way:
> > > http://planetmath.org/encyclopedia/KroneckerProduct.html
> > >I share Sven's expectation.
> > >
> > >
> > mathworld also agrees with you. As does the documentation (as best as I
> > can tell) and the actual output of kron. I think Charles must be
> > thinking of the tensor product instead.
>
>
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060413/af62a554/attachment-0001.html>


More information about the NumPy-Discussion mailing list