<div dir="ltr">Hi all,<div>I have a matrix multiplication that I'd like to optimize.</div><div><br></div><div>I have a matrix `a` (dtype=complex) with shape (N, M, 2, 2). I'd like to do the following multiplication:</div><div><br></div><div>a[:, 0] @ a[:, 1] @ ... @ a[:, M-1]</div><div><br></div><div>where the first dimension, N, is element wise (and hopefully vectorisable) and M>=2. So for each row do M-1 matrix multiplications of 2x2 matrices. The output should have shape (N, 2, 2).</div><div><br></div><div>What would be the best way of going about this?</div><div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">_____________________________________<br>Dr. Andrew Nelson<br><br><br>_____________________________________</div>
</div></div>