Find eigenvalues of Complex valued matrix in python
<p>I need to find the eigenvvalues of of this matrix, and similar such matrices (spaces denote separators):</p>

<pre><code>[[1.0000 -0.7071*I 0 -0.7071*I 0 0 0 0 0]    
 [0.7071*I 0.5000 -0.7071*I 0 -0.70710*I 0 0 0 0]    
 [0 0.7071*I 1.0000 0 0 -0.7071*I 0 0 0]   
 [0.7071*I 0 0 0.5000 -0.7071*I 0 -0.7071*I 0 0]    
 [0 0.7071*I 0 0.7071*I 0 -0.7071*I 0 -0.7071*I 0]    
 [0 0 0.7071*I 0 0.7071*I 0.5000 0 0 -0.7071*I]    
 [0 0 0 0.7071*I 0 0 1.0000 -0.7071*I 0]    
 [0 0 0 0 0.7071*I 0 0.7071*I 0.5000 -0.7071*I]    
 [0 0 0 0 0 0.7071*I 0 0.7071*I 1.000]]
</code></pre>

<p><strong>Error:</strong>
<code>numpy.linalg.eigvalsh()</code> gives error "can't convert complex to float".</p>

<p>What could be the reason, and how do I find eigenvalues?</p>

<p>As more than one commenter has explained, your matrix works fine with <code>eigvalsh</code>.</p>

<pre><code>import numpy as np
from numpy.linalg import eigvalsh

I = 1j
arr = np.array([[1.0000, -0.7071*I, 0, -0.7071*I, 0, 0, 0, 0, 0],
    [0.7071*I, 0.5000, -0.7071*I, 0, -0.70710*I, 0, 0, 0, 0],
    [0, 0.7071*I, 1.0000, 0, 0, -0.7071*I, 0, 0, 0],
    [0.7071*I, 0, 0, 0.5000, -0.7071*I, 0, -0.7071*I, 0, 0],
    [0, 0.7071*I, 0, 0.7071*I, 0, -0.7071*I, 0, -0.7071*I, 0],
    [0, 0, 0.7071*I, 0, 0.7071*I, 0.5000, 0, 0, -0.7071*I],
    [0, 0, 0, 0.7071*I, 0, 0, 1.0000, -0.7071*I, 0],
    [0, 0, 0, 0, 0.7071*I, 0, 0.7071*I, 0.5000, -0.7071*I],
    [0, 0, 0, 0, 0, 0.7071*I, 0, 0.7071*I, 1.000]])

# Ensure hermitian
assert(np.all(0 == (arr - np.conj(arr.T))))

print(eigvalsh(arr))
# outputs:
# [-1.56153421 -0.2807671  -0.2807671   0.5         0.5         1.          1.7807671  1.7807671   2.56153421]
</code></pre>

python numpy matrix linear-algebra eigenvalue