Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eigs() doesn't work in my computer, but works in another one. (Arpack 0.5.4) #147

Open
AlvaroPY opened this issue Nov 16, 2022 · 12 comments

Comments

@AlvaroPY
Copy link

AlvaroPY commented Nov 16, 2022

Probably this is not related with the package itself, but I would greatly appreciate your help. I have the same code running in two different computers with the same version of Julia (1.7.2) and Arpack (0.5.4). In one computer, everything works well (I have two instances of EVPs, one generalized with dense complex non-Hermitian matrices and the other, generalized with sparse real symmetric positive definite matrices). I've compared to eigen() from LinearAlgebra and ArnoldiMethod and the solutions are ok. But in the other computer, I have constantly the following error:

XYAUPD_Exception: Maximum number of iterations taken. All possible eigenvalues of OP has been found.
│ IPARAM(5) returns the number of wanted converged Ritz values.

Since eigs() from Arpack is faster than ArnoldiMethod, I would like to use it in my computer.

@PetrKryslUCSD
Copy link
Contributor

PetrKryslUCSD commented Nov 16, 2022

Generalized EVP with symmetric positive (semi-)definite sparse matrices. Arpack 0.5.4 fails to converge, 0.5.3 converges. Called as

evals, evecs, convinfo = eigs(Symmetric(K+OmegaShift*M), Symmetric(M); nev=neigvs, which=:SM, explicittransform=:none)

The error is

┌ Error: XYAUPD_Exception: Maximum number of iterations taken. All possible eigenvalues of OP has been found.                                                                                                           
│ IPARAM(5) returns the number of wanted converged Ritz values.                                             
│   info = 1                   

@PetrKryslUCSD
Copy link
Contributor

@AlvaroPY : Could you try 0.5.3 please?

@AlvaroPY
Copy link
Author

AlvaroPY commented Nov 17, 2022

Thank you!! With Arpack 0.5.3, at every first run I have another type of error:

┌ Error: XYEUPD_Exception: The Schur form computed by LAPACK routine lahqr could not be reordered by LAPACK routine trsen.
│ Re-enter subroutine neupd with IPARAM(5)NCV and increase the size of the arrays DR and DI to have dimension 
at least dimension NCV and allocate at least NCV columns for Z.
│ NOTE: Not necessary if Z and V share the same space. Please notify the authors if this error occurs.        
│   info = 1
└ @ Arpack C:\Users\agavilan\.julia\packages\Arpack\pLziT\src\libarpack.jl:89

But at the following runs everything goes well with Arpack 0.5.3, in both of my computers.
Should I close this issue ? Because downgrading solved my problem, but with Arpack 0.5.4 I still have different behaviors in both computers.

@PetrKryslUCSD
Copy link
Contributor

I suspect the reasons for the failure of 0.5.4 to work for :SM are here:
image
and
image
There are also these changes that may be relevant:
image

@maxwellforfun
Copy link

maxwellforfun commented Nov 26, 2022

I've been having the same error but for the :LM option. My sparse matrix will trigger the automatic shift-and-invert (on both 5.3 and 5.4 versions), and I think that could be related to the commit on libarpack shown by @PetrKryslUCSD. The omission of the dot when inverting on the composed dmap function may be causing issues? (Not sure if at that spot it deals with a matrix or a scalar)

@PetrKryslUCSD
Copy link
Contributor

@AlvaroPY Could you rename present issue to reflect that 0.5.4 version is broken. And create a new issue for 0.5.3?

@PetrKryslUCSD
Copy link
Contributor

This repository appears to have lost its maintainers. I would suggest to switch to ArnoldiMethod.jl.

@AlvaroPY
Copy link
Author

AlvaroPY commented Dec 2, 2022

@AlvaroPY Could you rename present issue to reflect that 0.5.4 version is broken. And create a new issue for 0.5.3?

I will do it now! And thanks for the suggestion. Since my last post here I decided to continue on with ArnoldiMethod.jl (KrylovKit.jl having some limitations with non-Hermitian generalized EVP) rather than downgrading to Arpack 0.5.3, despite some efficiency advantage with the latter.

@AlvaroPY AlvaroPY changed the title eigs() doesn't work in my computer, but works in another one. eigs() doesn't work in my computer, but works in another one. (Arpack 0.5.4) Dec 2, 2022
@maxwellforfun
Copy link

I had some free time and tried some tests. Seems that (at least for my case) the culprit was after performing the shift and invert, and switching from LM to SM (to preserve the originally intended eigenvalue search), a new conditional (the second capture from @PetrKryslUCSD ) would also change the whichstring to SM instead of preserving the LM value.

I've created a fork reverting that conditional, and for my case now it works. @AlvaroPY, could you try if the fork works for your case?

@marianoarnaiz
Copy link

Hi. Is 0.5.0 Version around? I need it :(

@jishnub
Copy link
Member

jishnub commented Feb 20, 2023

You should certainly be able to install version v0.5.0 as pkg> add Arpack@0.5.0. However, you might want to switch to ArnoldiMethod.jl unless you specifically require Arpack

@PetrKryslUCSD
Copy link
Contributor

I take it back. ArnoldiMethod apparently does not converge for symmetric, spd pencil. The eigenvectors are bad. JuliaLinearAlgebra/ArnoldiMethod.jl#114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants