Re: Solving Eigenvalue Problems
- To: mathgroup at smc.vnet.net
- Subject: [mg17388] Re: Solving Eigenvalue Problems
- From: sidles at u.washington.edu (John A. Sidles)
- Date: Thu, 6 May 1999 02:44:09 -0400
- Organization: University of Washington, Seattle
- References: <7fp6c7$3e9@smc.vnet.net> <7g0rmk$dtd@smc.vnet.net> <7gbj5v$ku5@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <7gbj5v$ku5 at smc.vnet.net>, Richard Bowman <rbowman at bridgewater.edu> wrote: >Thanks to Jens-Peer Kuska and others who responded to my question about >matrix diagonalization of quantum mechanical problems in Mathematica. > >My problem was that my eyesight is not very good, but still I had no >excuse for not finding Eigen...[] in the Mathematica 3.0 book the first time I >looked. I did find it later. Now all I am wondering about is why the >solutions go from the largest to the smallest eigenvalue. The answer is, the list of eigenvalues is usually returned in sorted order, but this property is *not* guaranteed, and in fact Eigensystem[] will sporadically return an unsorted list of unnormalized eigenvectors. To obtain reliable results, particularly for publication or for use by students, you must program very carefully. Here is a version of Eigensystem[] that *does* reliably return a sorted list of normalized eigenvectors. Caveat: the returned eigenvectors are *not* guaranteed to be orthogonal, even when the input matrix is Hermitian. Further processing is needed to ensure orthogonality, as discussed earlier in this thread. SortedEigensystem[m_] := Block[{eValues,n}, eValues = Eigensystem[m]; n=Length[m]; Do[PrependTo[eValues[[2,i]],eValues[[1,i]]],{i,1,n}]; { Sort[eValues[[1]]], Map[(#/Sqrt[Re[#.Conjugate[#]]])&, Map[Rest[#]&, Sort[eValues[[2]], OrderedQ[{#1[[1]],#2[[1]]}]&]]] } ] Obviously, it would be better for Mathematica users if Eigensystem[] had documented options like Integrate[], e.g. Eigensystem[matrix, Assumptions->{Real,Hermitian}, Options->{Sorted,Normalized,Orthogonal}] In the case above, Eigensystem[] would coerce the input matrix to be of the form specified by the list of Assumptions (e.g, real and Hermitian in the case above), and then return a list of eigenvalues and eigenvectors with the properties specified by the list of Options. Such a package would be much more useful and reliable than the present Eigensystem[] package. Maybe some student out there in Mathematica user-land would be willing to write, document, and validate such a package? This would make a great undergraduate project!