       Re: Re: different eigenvectors

• To: mathgroup at smc.vnet.net
• Subject: [mg83945] Re: [mg83910] Re: different eigenvectors
• From: "Jean-Marc Gulliet" <jeanmarc.gulliet at gmail.com>
• Date: Wed, 5 Dec 2007 07:10:41 -0500 (EST)
• References: <fj0rjv\$per\$1@smc.vnet.net> <200712040924.EAA17600@smc.vnet.net>

```On Dec 4, 2007 3:42 PM,  <jackgold at umich.edu> wrote:
> Hi,
>
> Isn't the issue far more complicated when the eigenvalues are repeated?
>   To take an extreme example, any n linearly independent vectors are an
> "eigenset" for the Identity Matrix.  Maybe I missed the point of all
> this :-)
>
> Quoting Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>:
>
> > vicky Al Aisa wrote:
> >
> >> I am using Eigenvectors function to calculate eigenvectors in
> >> mathematica 5.2.
> >> while comparing the results with the eigenvectors (of same matrix)
> >> computed in another system, i found that both the results are bit different
> >> with some values having opposite sign and coloumns rearranged.
> >
> > Note sure what the question, but something tells me that you are unclear
> >
> > Second, for a given eigenvalue you can find infinitely many
> > eigenvectors. Indeed, any non-zero scalar multiple of an eigenvector is
> > also an eigenvector (for the corresponding eigenvalue of course).
> >
> > Second, for a given matrix, different CAS may produce the eigenvalues in
> > different order, so the corresponding eigenvectors may be in different
> > order from one system to another.
> >
> > Third, for a given matrix, different CAS may compute the eigenvectors in
> > different ways. One may look for orthonormal (perpendicular and unitary)
> > eigenvectors, while another system may satisfy with just orthogonal
> > (perpendicular) eigenvectors.
> >
> > So, if you want to check the results from one CAS against the results
> > from another CAS, first, you must check that the eigenvalues returned by
> > both systems are the same (whatever their order) and that the
> > corresponding eigenvectors returned by both system are scalar multiple.
> >
> > Here is an example with a 2 by 2 reflection matrix that illustrates the
> > usage of the *Eigensystem* function, which returns the eigenvalues
> > followed by the eigenvectors.
> >
> > In:= m = {{0, 1}, {1, 0}}
> >
> > Out= {{0, 1}, {1, 0}}
> >
> > In:= Eigensystem@m
> >
> > Out= {{-1, 1}, {{-1, 1}, {1, 1}}}
> >
> >
> > Out= {{-1, {-1, 1}}, {1, {1, 1}}}
> >
> > In:= (m.Last@# == First@#*Last@#) & /@ %
> >
> > Out= {True, True}
> >
> > In:= m.{1, -1} == (-1)*{1, -1}
> >
> > Out= True
> >
> > In:= m.(c*{1, -1}) == (-1)*(c*{1, -1})
> >
> > Out= True
> >
> > In:= {-1, 1}.{1, 1}
> >
> > Out= 0
> >
> > In:= Normalize /@ {{-1, 1}, {1, 1}}
> >
> > Out= {{-(1/Sqrt), 1/Sqrt}, {1/Sqrt, 1/Sqrt}}

Oh, sure; I agree that many other things could have been told (though
I am not sure about what issues you are talking about since from
Mathematica's point of view there is no issue); but since the OP did
neither ask --- explicitly --- any question nor give any example, it
is somehow hard to find where to stop ideally!

Speaking about Mathematica and repeated eigenvalues, the documentation
center tells us that, "All the non-zero eigenvectors given are
independent. If the number of eigenvectors is equal to the number of
non-zero eigenvalues, then corresponding eigenvalues and eigenvectors
are given in corresponding positions in their respective lists. "
Moreover, "If there are more eigenvalues than independent
eigenvectors, then each extra eigenvalue is paired with a vector of
zeros."

Therefore, as one can see below, the "method" I indicated in my
previous reply, works well in such cases.

The following matrix has two repeated eigenvalues but independent
eigenvectors, while the next one has only two independent
eigenvectors.

m = {{2, 0, 0}, {0, 2, 0}, {0, 0, 1}};
{vals, vecs} = Eigensystem[m]
m.Transpose@vecs == Transpose at vecs.DiagonalMatrix@vals

Out= {{2, 2, 1}, {{0, 1, 0}, {1, 0, 0}, {0, 0, 1}}}

Out= True

m = {{2, 1, 0}, {0, 2, 0}, {0, 0, 1}};
{vals, vecs} = Eigensystem[m]
m.Transpose@vecs == Transpose at vecs.DiagonalMatrix@vals

Out= {{2, 2, 1}, {{1, 0, 0}, {0, 0, 0}, {0, 0, 1}}}

Out= True

Note that other systems may return the eigenvectors in a different
fashion. For instance, on another system, although the eigenvalues are
given in the same order than Mathematica, the eigenvectors are in a
different order for the first matrix, and for the second matrix two
non-zero linearly-dependent eigenvectors are returned for the repeated
eigenvalues.

>> m = [2 0 0; 0 2 0; 0 0 1]
m =
2     0     0
0     2     0
0     0     1
>> [V, D] = eigs(m)
V =
1     0     0
0     1     0
0     0     1
D =
2     0     0
0     2     0
0     0     1
>> m = [2 1 0; 0 2 0; 0 0 1]
m =
2     1     0
0     2     0
0     0     1
>> [V, D] = eigs(m)
V =
-1.0000    1.0000         0
0.0000         0         0
0         0    1.0000
D =
2     0     0
0     2     0
0     0     1

Regards,
--
Jean-Marc

```

• Prev by Date: Re: slot argument weirdness
• Next by Date: Re: The integrand has evaluated to non-numerical values for all
• Previous by thread: Re: different eigenvectors
• Next by thread: Re: TwoAxisListPlot for V6?