title: (Python) Efficient way of extract diagonal block part of (AB) without doing matrix multiplication AB
body: <p>Suppose A is 1000x50 matrix and B is a 50x100 matrix. Then AB is a matrix of size 1000x100. I'm doing a task which tries to get the diagonal block (actually column vectors on the diagonal) of AB. Specifically, I'd like to extract A[0:10,0],A[10:20,1],A[20:30,2],...,A[990:1000,99].</p>
  <p>However, I would like to avoid calculating AB. I tried &quot;for loop&quot; in columns of AB but it is very slow. Is there any other efficient way to implement this?</p>