Re: Eigenvalues of sparse arrays

*To*: mathgroup at smc.vnet.net*Subject*: [mg102238] Re: Eigenvalues of sparse arrays*From*: gopher <gophergoon at gmail.com>*Date*: Sun, 2 Aug 2009 05:59:50 -0400 (EDT)*References*: <200907310952.FAA19221@smc.vnet.net> <h50sjj$6pl$1@smc.vnet.net>

On Aug 1, 2:58 am, Mark McClure <mcmcc... at unca.edu> wrote: > On Fri, Jul 31, 2009 at 5:52 AM, gopher <gopherg... at gmail.com> wrote: > > I am computing the eigenvalues of a matrix 's' > > In[165]:= Eigenvalues[s, -6] // Chop > > Out[165]= {0.382326, -0.382326, 0.350062, -0.350062, 0, 0} > > > In[166]:= Eigenvalues[SparseArray[s], -6] // Chop > > Out[166]= {0.38245, -0.352447, 0.351011, 1.26736*10^-7, 0, 0} > > > Why are the two results different? > > You should read up on the topic of numerical linear algebra. > The documentation center has a nice tutorial on the subject, > as implemented in Mathematica, that you can find by typing > "tutorial/LinearAlgebraInMathematicaOverview". This page is > listed as deprecated in V7 but I can't find anything else with > as much detail on the subject that has replaced it. > > I think that the short answer to your question is that > different algorithms are used in the two cases. If, given a > SparseArray and less than 1/5 of the eigenvalues are > requested, then Eigenvalues will use the Arnoldi method. > When given a full matrix, one of the LAPACK routines will be > used. A few experiments show that these results will > typically differ slightly. The reason for relatively large > difference that you are getting is hard to say without > looking at the matrix, but it is certainly possible that > your matrix is ill-conditioned with respect to one technique > more than the other. > > Mark McClure Thanks for your reply. I read those docs but IMO they are somewhat misleading. They state that the Arnoldi method may not converge but not that it may converge and still give spurious eigenvalues. Also, Mathematica doesn't allow one to explicitly chose the LAPACK routine - only "Automatic" which in this case picks Arnoldi for a sparse array anyway. This seems like a bug. The matrix I was using is here (it is only 156x156): https://netfiles.uiuc.edu:443/aroy2/www/sparse%20array/bugmatrix.dat Is there a way to tell that it is ill-conditioned? As you can see, I am very new to numerical methods. Thanks, Abhishek