title: Efficient way of kron(A,I) (tensor product or Kronecker product) of sparse matrix A and eye I
body: <p>I am implementing exact-diagonalization codes for spin chains. After I get the low-lying eigenstates, I need to average them on various operators. One type of operator is of the following form </p>
  
  <pre><code>$$I\otimes I\otimes\cdots\otimes I\otimes S_{a}\otimes I\otimes\cdots\otimes I\otimes S_{b}\otimes I\otimes\cdots\otimes I\otimes I$$
  </code></pre>
  
  <p>or rather in plain text</p>
  
  <pre><code>I (X) I (X) ... (X) I (X) Sa (X) I (X) ... (X) I (X) Sb (X) I (X)...(X) I (X) I
  </code></pre>
  
  <p>where <code>(X)</code> represents the tensor product / Kronecker product.</p>
  
  <p>It would be nice if I can get a 10x speed up for the computation of 
  <code>kron(A,eye(I.shape[0]**n)) = A (X) I (X) I (X) ... (X) I # I</code> repeat n times</p>
  
  <p>I came up with simple ideas as reshaping <code>kron(eye(I.shape[0]**n), A)</code>, but reshape of sparse matrix is not well implemented (also not efficient) in scipy.</p>
  
  <p>Has anyone done the same thing before?  </p>