Closed poutine-dejeuner closed 2 years ago
It could be a bit late, however as far as I understand it's because of badly chosen example of L (sorry for that). This Hodge Laplacian matrix has eigenvalues (0.0, 3.0, 3.0), so the largest eigenvalue has multiplicity of two and thus any linear combination of eigenvectors is also an eigenvector. Thus eigsh() just gets any single vector from subspace spanned by two vectors.
Probably would be nice just to add a parameter which eigenvalues to return like in eigsh documentation: ‘LM’ : Largest (in magnitude) eigenvalues. ‘SM’ : Smallest (in magnitude) eigenvalues. ‘LA’ : Largest (algebraic) eigenvalues. ‘SA’ : Smallest (algebraic) eigenvalues. ‘BE’ : Half (k/2) from each end of the spectrum.
could this be due to the sparse scipy eigenvalues/vectors algorithm ?
Randomness due to algorithm initialization also exists in some cases.
The code returns different eigenvectors for each run, for example
returns [ 0.18589262 -0.78148313 0.59559051] and on a second run [ 0.14594447 -0.7686914 0.62274693]
could this be due to the sparse scipy eigenvalues/vectors algorithm ?