title: How to make the eigenvalues and eigenvectors stay real instead of complex?
body: <p>I try to diagonalize a <code>n*100*100</code> 3d matrix <code>K</code> by <code>numpy.linalg.eig</code> and get the eigenvalues <code>w</code> and eigenvectors <code>v</code>. The matrix is <code>100*100</code>, but I wanna do it with broadcasting, and that's the number <code>n</code> I set up. And the matrix is not hermitian.</p>
  
  <pre><code>w,v=np.linalg.eig(K)
  </code></pre>
  
  <p>At first, I tried <code>n=1000</code>, I get real eigenvalues and eigenvectors, i.e. <code>xxxxxxxxxe+xx</code>, but when I tried <code>n=2000</code>, the elements of <code>w</code> and <code>v</code> shows <code>xxxxxxxxxe+xx+0.j</code>. Due to <code>+0.j</code>, it gave complex numbers when using <code>w</code> and <code>v</code> do further calculation.</p>
  
  <ol>
  <li>I thought it's because of the algorithm error for float number calculation but why? </li>
  <li>Does numpy.linalg use LAPACK? Is that possible the error from LAPACK?</li>
  <li>How can I get rid of <code>+0.j</code>?</li>
  </ol>