title: Diagonalization of symmetric matrices in julia yields strange results
body: <p>I would like to understand what is going on with my program in julia. The issue is the following: I have a symmetric non-negative matrix which I diagonalize using </p>
  
  <pre><code>egvals, egvecs = eig(H_mat)
  </code></pre>
  
  <p>By a theorem, my matrix should have a maximum eigenvalue which is associated a non-negative eigenvector. The H_mat has a further trick, its first column and row has an entry filled with zeros.</p>
  
  <p>Diagonalization yields a maximum positive eigenvalue E_max, in fact it is the last eigenvalue because julia arranges the eigenvalues in order up to the biggest, but my eigenvector associated with E_max does not have all its entries zero or positive (i.e. they have negative entries)</p>
  
  <pre><code>egvecs[:,end] # Some or several components ii, egvecs[ii,end]&lt;0
  </code></pre>
  
  <p>This is the matrix from I don't get proper results, for instance:</p>
  
  <pre><code>[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 0.0 0.0 0.0
   0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
   0.0 0.0 2.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
  0.0 0.0 0.0 3.0 0.0 0.0 1.7320508075688774 0.0 0.0 0.0 0.0 0.0 1.7320508075688774 0.0 0.0 0.0 0.0 0.0 0.0 0.0
  0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
  0.0 0.0 1.414213562373095 0.0 0.0 2.0 0.0 1.414213562373095 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
  0.0 0.0 0.0 1.7320508075688774 0.0 0.0 3.0 0.0 2.0 0.0 0.0 0.0 1.0 0.0 1.414213562373095 0.0 0.0 0.0 0.0 0.0
  0.0 0.0 0.0 0.0 0.0 1.414213562373095 0.0 2.0 0.0 0.0 0.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0 0.0 0.0 0.0
  0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 3.0 1.7320508075688774 0.0 0.0 0.0 0.0 1.414213562373095 1.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.7320508075688774 3.0 0.0 0.0 0.0 0.0 0.0 1.7320508075688774 0.0 0.0 0.0 0.0
  0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
  0.0 0.0 1.414213562373095 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 1.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0
  0.0 0.0 0.0 1.7320508075688774 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 3.0 0.0 1.414213562373095 0.0 0.0 2.0 0.0 0.0
  0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.414213562373095 0.0 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0
  0.0 0.0 0.0 0.0 0.0 0.0 1.414213562373095 0.0 1.414213562373095 0.0 0.0 0.0 1.414213562373095 0.0 3.0 1.414213562373095 0.0 1.414213562373095 1.414213562373095 0.0
  0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.7320508075688774 0.0 0.0 0.0 0.0 1.414213562373095 3.0 0.0 0.0 2.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.414213562373095 0.0 1.414213562373095 0.0 0.0 2.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 2.0 0.0 1.414213562373095 0.0 0.0 3.0 1.0 1.7320508075688774
  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.414213562373095 2.0 0.0 1.0 3.0 1.7320508075688774
  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.7320508075688774 1.7320508075688774 3.0]
  </code></pre>
  
  <p>(Should be a 20X20 matrix)</p>