MathGroup Archive 1999

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

Search the Archive

Re: Solving Eigenvalue Problems

  • To: mathgroup at
  • Subject: [mg17220] Re: Solving Eigenvalue Problems
  • From: sidles at (John A. Sidles)
  • Date: Mon, 26 Apr 1999 01:20:52 -0400
  • Organization: University of Washington, Seattle
  • References: <7fp6c7$>
  • Sender: owner-wri-mathgroup at

Richard Bowman  <rbowman at> wrote:
>I am sure that I have seen packages or articles dealing
>with the matrix diagonalization method of finding
>eigenvalues and eigenvectors in quantum mechanics. I have
>searched MathSource but have not located what we need.  Any
>help will be appreciated.

The routine "Eigensystem[]" does what you want.
But beware!  You must read the Eigensystem[]'s
documentation with the same scrupulous care that 
you bring to a presidential legal deposition.

For example, if you pass Eigensystem[] a matrix
that is real and symmetric, with one or more
degenerate eigenvalues (which is a very common 
case in quantum mechanics), then the following 
statements are *all* true and legal:

(1) It is always possible to choose eigenvectors
    that are real and orthonormal.

(2) Eigensystem[] will almost always return real 
    orthonormal eigenvectors.

(3) But it is *legal* (i.e., fully consistent with 
    the documentation) for Eigensystem[] to return
    eigenvectors that are either (a) non-orthonormal
    or (b) complex or (c) both.  The only guaranteed 
    property is linear independence.

(4) Sporadically (about one time in a thousand), 
    Mathematica will exercise this option, and return
    sets of complex, non-orthogonal eigenvectors.

It is prudent to advise students of this feature, because
if they write code which assumes real eigenvectors, it
will sporadically break, and most students will have a
very tough time figuring out why.

At least in Mathematica 3.0, the behavior is sensitive to
least-significant bits in the input matrix, so the simple
fix is to test whether any of the returned eigenvectors
are complex, and if so, randomly perturb some least-
significant-bits of the input matrix, retaining the
properties of reality and symmetry, and try again.
This fix is admittedly not elegant, but it works.

In fact, AFAIK this is the *only* ready fix -- there is
no well-posed way to instruct Mathematica's GramSchmidt[] 
routine to turn complex eigenvectors into real ones.

It seems kinda crazy, but I'll issue it as a challenge:
can anyone give elegant code for reliably calculating
in Mathematica the real, orthonormal eigenvectors
of a real, symmetric matrix?  Here "elegant" means
five lines or less, and "reliable" means the built-in 
routines work as documented -- no more, no less.

By the way, I think Mathematica is a great product, and
you folks on the help staff are particularly great -- 
so what can we users do to persuade Wolfram Research
to document its software better?

Best wishes ... John Sidles

PS: Hey, is this behavior of Eigensystem[] still present
in Version 4.0?  I know of several other physics
researchers who have been "bit" by this -- we hope you
can at least tell us that it's now mentioned in the
Version 4.0 documentation.

  • Prev by Date: Re: Solving Eigenvalue Problems
  • Next by Date: Re: Basic Solid Modelling in Mathematica
  • Previous by thread: Re: Solving Eigenvalue Problems
  • Next by thread: Re: Solving Eigenvalue Problems