MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Eigenvalues of sparse arrays

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102199] Re: [mg102154] Eigenvalues of sparse arrays
  • From: Mark McClure <mcmcclur at unca.edu>
  • Date: Sat, 1 Aug 2009 03:59:18 -0400 (EDT)
  • References: <200907310952.FAA19221@smc.vnet.net>

On Fri, Jul 31, 2009 at 5:52 AM, gopher <gophergoon 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



  • Prev by Date: Re: bvdae error when using NDSolve for initial value problem
  • Next by Date: Re: Finding the Position of Elements in a List that Contain
  • Previous by thread: Re: bvdae error when using NDSolve for initial value problem
  • Next by thread: Re: Eigenvalues of sparse arrays