Error with eigenvalues of unitary matrix
Mostrar comentarios más antiguos
I am trying to diagonalize a unitary matrix, but am getting an error message:
"flag = processEUPDinfo(nargout<3);"
This is surprising, as unitary matrices are very well behaved.
The code is quite simple:
A=randn(100);
B=randn(100);
Z=A+B*1i;
[U,S,V]=svd(Z);
eigs(U)
What is the matter??
8 comentarios
Walter Roberson
el 18 de Ag. de 2017
Are you getting an error message, or are you getting a warning? I get a warning:
Warning: Only 0 of the 6 requested eigenvalues converged.
> In eigs>CallARPACK/processEUPDinfo (line 1111)
In eigs>CallARPACK (line 1054)
In eigs (line 113)
I get that warning if I ask for 'LR' or 'SR', but if I ask for 'LI' or 'SI' then I get non-nan outputs.
marnovaes
el 18 de Ag. de 2017
marnovaes
el 18 de Ag. de 2017
Walter Roberson
el 18 de Ag. de 2017
Which MATLAB version are you using? R2017a does not have 1280 lines in eigs.m; if it were to generate an error it would be line 1106 in R2017a.
marnovaes
el 18 de Ag. de 2017
Walter Roberson
el 18 de Ag. de 2017
In R2017a you can request all 100.
Michelangelo Ricciulli
el 19 de Ag. de 2017
Hi, I know it is not an answer, but why are you using eigs() instead of eig() if you need all the eigenvalues? In my understanding eigs is optimized for sparse matrices and it is used to obtain only a subset of the eigenvalues.
Christine Tobler
el 21 de Ag. de 2017
marnovaes: It doesn't make much sense to call EIGS asking for all eigenvalues, since the algorithm is only efficient when called for a small subset of eigenvalues. Because of this, the ARPACK library (which is called by EIGS) does not allow asking for more than N-2 eigenvalues.
In R2017a, EIGS now just calls eig(full(A)) for this case - so the call will work, but it still makes more sense to call EIG directly if you know in advance that you will want all eigenvalues.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
