Error with eigenvalues of unitary matrix

3 visualizaciones (últimos 30 días)
marnovaes
marnovaes el 18 de Ag. de 2017
Comentada: Christine Tobler el 21 de Ag. de 2017
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
Michelangelo Ricciulli
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
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.

Iniciar sesión para comentar.

Respuesta aceptada

Christine Tobler
Christine Tobler el 21 de Ag. de 2017
As mentioned in the comments above, if you are intending to compute all eigenvalues, it's best to call EIG, not EIGS. In fact, even if you only need a subset, for a matrix of size 100 it's probably cheaper to just call EIG.
Now why is EIGS having a hard time with this specific matrix? This is a well-conditioned problem, as you say, but in fact, it's computing a subset that is making it hard for EIGS.
The algorithm used by eigs(A) is based on an iteration that moves a set of 20 vectors closer to the eigenvectors with eigenvalues of largest magnitude. The problem is that for matrix U, all eigenvalues have the same magnitude:
plot(eig(U), 'x')
Because of this, the algorithm gets locked up trying to decide which are the 6 largest eigenvalues of this matrix, and unable to commit to any one set.
For a small dense matrix, you should definitely just compute all eigenvalues with EIG. If you have a larger matrix, the best thing is probably to rethink what subset of eigenvalues you are looking for. For example, searching for the 6 eigenvalues closest to 1 converges easily:
eigs(U, 6, 1)

Más respuestas (0)

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by