On Wed, Oct 29, 2014 at 5:39 AM, Andrew Nelson wrote:
> I have a 4D array, A, that has the shape (NX, NY, 2, 2). I wish to
> perform matrix multiplication of the 'NY' 2x2 matrices, resulting in the
> matrix B. B would have shape (NX, 2, 2).
What you are looking for is dot.reduce and NumPy doe
On Wed, Oct 29, 2014 at 10:39 AM, Andrew Nelson wrote:
> Dear list,
> I have a 4D array, A, that has the shape (NX, NY, 2, 2). I wish to
> perform matrix multiplication of the 'NY' 2x2 matrices, resulting in the
> matrix B. B would have shape (NX, 2, 2). I believe that np.einsum would
> be up
On Mi, 2014-10-29 at 13:05 +0100, Sebastian Berg wrote:
> On Mi, 2014-10-29 at 20:39 +1100, Andrew Nelson wrote:
> > Dear list,
> > I have a 4D array, A, that has the shape (NX, NY, 2, 2). I wish to
> > perform matrix multiplication of the 'NY' 2x2 matrices, resulting in
> > the matrix B. B would
On Mi, 2014-10-29 at 20:39 +1100, Andrew Nelson wrote:
> Dear list,
> I have a 4D array, A, that has the shape (NX, NY, 2, 2). I wish to
> perform matrix multiplication of the 'NY' 2x2 matrices, resulting in
> the matrix B. B would have shape (NX, 2, 2). I believe that
> np.einsum would be up to
You need to specify your input format. Also, if your output matrix misses
the NY dimension, that implies you wish to contract (sum) over it, which
contradicts your statement that the 2x2 subblocks form the matrices to
multiply with. In general, I think it would help if you give a little more
backgr
Andrew Nelson writes:
>
> Dear list,I have a 4D array, A, that has the shape (NX, NY, 2, 2). I
wish to perform matrix multiplication of the 'NY' 2x2 matrices, resulting
in the matrix B. B would have shape (NX, 2, 2). I believe that np.einsum
would be up to the task, but I'm not quite sure o
Dear list,
I have a 4D array, A, that has the shape (NX, NY, 2, 2). I wish to perform
matrix multiplication of the 'NY' 2x2 matrices, resulting in the matrix B.
B would have shape (NX, 2, 2). I believe that np.einsum would be up to the
task, but I'm not quite sure of the subscripts I would need t