[Numpy-discussion] funny matrix product calculation

Fabrice Silva silva@lma.cnrs-mrs...
Sun Sep 14 16:17:56 CDT 2008

Le dimanche 14 septembre 2008 à 18:01 +0100, Robin a écrit :
> Hi,
> I am trying to compute the following (with summation convention):
> A_{ij} B_{jm} x_{j}
> where A and B are non-square arrays (in fact B=A^T) and x is a vector.
> I'm actually not sure if it's valid to have 3 summation indices as
> above - but I'm pretty sure that's what I want... So it's kind of
> matric multiplication, but I want another vector dot'ed into the sum.

What about considering a square diagonal matrix having vector x on its
main diagonal ?
Calling X such a matrix:
X = numpy.matrix(numpy.diag(x, k=0))

it seems that computing matrix multiplication A*X*B produces the
requirements, doesn't it?
Fabrice Silva

More information about the Numpy-discussion mailing list