title: SymPy could not compute the eigenvalues of this matrix
body: <p>I want to compute the second eigenvalue of a Laplacian matrix to check if the corresponding graph is connected or not, but when I try to use SymPy's <code>eigenvals</code>, a lot of times it happens that it throws an error </p>
  
  <pre><code>MatrixError: Could not compute eigenvalues for 
  Matrix([[1.00000000000000, 0.0, 0.0, 0.0, -1.00000000000000, 0.0, 0.0, 0.0, 0.0, 0.0], 
          [0.0, 1.00000000000000, 0.0, 0.0, 0.0, -1.00000000000000, 0.0, 0.0, 0.0, 0.0], 
          [0.0, 0.0, 1.00000000000000, 0.0, 0.0, 0.0, 0.0, 0.0, -1.00000000000000, 0.0], 
          [0.0, 0.0, 0.0, 1.00000000000000, 0.0, 0.0, 0.0, 0.0, -1.00000000000000, 0.0], 
          [-1.00000000000000, 0.0, 0.0, 0.0, 1.00000000000000, 0.0, 0.0, 0.0, 0.0, 0.0], 
          [0.0, -1.00000000000000, 0.0, 0.0, 0.0, 3.00000000000000, 0.0, 0.0, -1.00000000000000, -1.00000000000000], 
          [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 
          [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.00000000000000, 0.0, -1.00000000000000], 
          [0.0, 0.0, -1.00000000000000, -1.00000000000000, 0.0, -1.00000000000000, 0.0, 0.0, 3.00000000000000, 0.0], 
          [0.0, 0.0, 0.0, 0.0, 0.0, -1.00000000000000, 0.0, -1.00000000000000, 0.0, 2.00000000000000]])
  </code></pre>
  
  <p>Looking around I found out that since SymPy does symbolic computation, floating points can be a problem for it. So I tried: </p>
  
  <ol>
  <li>To reduce the precision of the floating point <code>Float(tmp[i][j], 3)</code>, but it didn't help.</li>
  <li>I have tried to convert floats to Rational <code>list(map(nsimplify, tmp[i]))</code>, but it didn't help.</li>
  <li>I have tried to convert floats to int <code>list(map(int, tmp[i]))</code>, but it didn't help neither.</li>
  </ol>
  
  <p>I really can't understand why it doesn't work out, even if I convert every element to <code>int</code>.</p>