MathGroup Archive 2010

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

Search the Archive

Re: Alternatives to ARPACK?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108043] Re: Alternatives to ARPACK?
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sun, 7 Mar 2010 04:03:28 -0500 (EST)
  • References: <hmo27i$qap$1@smc.vnet.net>

Matin Inck wrote:
> Hi guys
> 
> My system is currently described by a dense 2500x2500 matrix, which
> contains many zero entries. Diagonalizing this matrix using
> Eigensystem takes about 2 minutes, which seems like a long time, and I
> assume it has got something to do with the fact that the eigenvalues
> are degenerate. In order to investigate my system further, I need to
> generate a larger matrix (say 3600x3600), but my computer runs out of
> memory when I try to diagonalize it in this case (Mathematica
> complaints about no memory).
> 
> I have two questions.
> 
> 1) If I want the full spectrum of the matrix, what options do I have?
> 
> 2) It might be possible that I can do with only a small part of the
> spectrum of my matrix. In this case what I would use is following
> piece of code, where =E2=80=9CHamiltonian=E2=80=9D is the name of the matrix:
> 
> Eigensystem[SparseArray[Hamiltonian], 50, Method=EF=82=AE{"Arnoldi",
> "Shift"=EF=82=AE0.25}]
> 
> Just to be absolutely sure: Does this give me the 50 eigenvalues (and
> corresponding eigenvectors) closest to 0.25? Also, I believe I read
> somewhere that for each time an eigenvector/value is found using this
> method, there is a loss of precision. Can you confirm this?
> 
> Any help would be much appreciated.
> 
> Best,
> Matin.
> 
Numeric vectors and (non-sparse) matrices in Mathematica can be stored 
in two distinct formats. The function Developer`PackedArrayQ can be used 
to test which format an array is using.

The packed array format is preferable if possible because it is more 
compact - requiring only 8-bytes per Real element - and much faster to 
process. Since your array doesn't sound that big, it may well be that it 
is not packed. The function Developer`ToPackedArray will pack an array 
if possible, but if you have mixed integer/real entries, this will not 
work (packed arrays must be uniform), code such as:

arr=Developer`ToPackedArray[N[arr]]

will do the job in this case, by producing a uniform real array.

You may find this solves your problem, or you may find that some sort of 
algorithm change will do the trick, as you suggest. However, if you do 
decide you need more memory get a 64-bit machine, and load a 64-bit 
operating system (e.g. 64-bit Windows XP). The Windows version of 
Mathematica comes with an installer that will install the 64-bit version 
of the code on a 64-bit operating system. After all this work, you will 
be able to use a much larger amount of memory - depending on how much 
you have on your machine.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: removing non-numeric elements from the table
  • Next by Date: Re: Re: Write an expression in a specific form
  • Previous by thread: Alternatives to ARPACK?
  • Next by thread: Re: Alternatives to ARPACK?