Re: How does Eigensystem works ?
- To: mathgroup at smc.vnet.net
- Subject: [mg103095] Re: [mg103073] How does Eigensystem works ?
- From: Leonid Shifrin <lshifr at gmail.com>
- Date: Tue, 8 Sep 2009 05:55:52 -0400 (EDT)
- References: <200909070634.CAA03898@smc.vnet.net>
Hi,
For real symmetric matrices, the eignevalues are real, and eigenvectors
mutually orthogonal
(this is also true for Hermitian matrices). In that case, the inverse of P
equals transpose of P,
which is one way to say that P is orthogonal (or, inverse of P equals its
hermitian conjugate for hermitian initial matrix, in which case P is
unitary).
This will generate a random real symmetric matrix:
Clear[randomRealSymmetricMatrix];
randomRealSymmetricMatrix[range : {min_?NumericQ, max_?NumericQ},
size_Integer?Positive] :=
Module[{testmat = RandomReal[range, {size, size}], i, j},
For[i = 1, i <= size, i++,
For[j = 1, j < i, j++,
testmat[[j, i]] = testmat[[i, j]]]];
testmat];
Now we can test some properties related to your question.
In[1]:=
testmatr = randomRealSymmetricMatrix[{0, 10}, 3]
Out[1]= {{9.07127, 5.23526, 2.97208}, {5.23526, 1.90757,
3.5502}, {2.97208, 3.5502, 9.89953}}
In[2]:= eigs = Eigenvalues[testmatr]
Out[2]=
{15.334, 6.71659, -1.1722}
In[3]:=
p = Eigenvectors[testmatr]
Out[3]=
{{-0.65143, -0.420919, -0.631241}, {-0.640756, -0.140316,
0.754814}, {0.406289, -0.89618, 0.1783}}
In[4]:=
Transpose[p] == Inverse[p]
Out[4]= True
This shows that the vectors are mutually orthogonal:
In[5]:= Chop@Outer[Dot, p, p, 1]
Out[5]= {{1., 0, 0}, {0, 1., 0}, {0, 0, 1.}}
This shows the standard diagonalization formula that you cited:
In[6]:= Inverse[p].DiagonalMatrix[eigs].p == testmatr
Out[6]= True
Or, due to result In[4],
In[7] = Transpose[p].DiagonalMatrix[eigs].p == testmatr
Out[7] = True
Now, if you matrix does not have the above-mentioned symmetry, this is not
going to work any more.
Try generating an arbitrary random matrix and none of the results 4-7 will
any longer hold.
The analog of the decomposition of 6,7 will be the singular value
decomposition (SVD)
M = U.Lambda.V*,
but U and V will no longer relate to eigenvectors of M, and Lambda to
eigenvalues.
Hope this helps.
Regards,
Leonid
On Mon, Sep 7, 2009 at 10:34 AM, guerom00 <guerom00 at gmail.com> wrote:
> Hello everyone,
>
> If I compute the eigenvalues lambda and eigenvectors P of a square
> matrix A, I get the original matrix back by calculating Transpose
> [P].DiagonalMatrix[lambda].Transpose[Inverse[P]] ???
>
> Now, I don't know much in linear algebra but I think I should get the
> origonal matrix back by computing P.DiagonalMatrix[lambda].Inverse
> [P] !
>
> What gives?
>
> Thanks
>
>
- References:
- How does Eigensystem works ?
- From: guerom00 <guerom00@gmail.com>
- How does Eigensystem works ?