Lay Chapter 7,
Spectral Decomposition

Consider the symmetric matrix a
(Lay 7.1, Example 4)

In[1]:=

Clear[a] ; 

a = ( {{7, 2}, {2, 4}} ) ; 

a  Transpose[a]

Out[3]=

True

Calculate the eigenvalues and eigenvectors of a.

In[4]:=

{evals, evecs} = Eigensystem[a]

Out[4]=

{{8, 3}, {{2, 1}, {-1, 2}}}

Construct the orthogonal diagonalization of a.

In[5]:=

p = Table[evecs[[k]]/Norm[evecs[[k]]],  {k, 1, 2}]//Transpose ;

%//MatrixForm

invp = Inverse[p] ; 

diagλ = DiagonalMatrix[evals] ;

%//MatrixForm

ap . diagλ . invp

Out[6]//MatrixForm=

( {{2/5^(1/2), -1/5^(1/2)}, {1/5^(1/2), 2/5^(1/2)}} )

Out[9]//MatrixForm=

( {{8, 0}, {0, 3}} )

Out[10]=

True

Construct a spectral decomposition of a.

In[11]:=

<<LinearAlgebra`MatrixManipulation`

In[12]:=

u1 = TakeColumns[p, {1, 1}] ;

%//MatrixForm

u2 = TakeColumns[p, {2, 2}] ;

%//MatrixForm

Out[13]//MatrixForm=

( {{2/5^(1/2)}, {1/5^(1/2)}} )

Out[15]//MatrixForm=

( {{-1/5^(1/2)}, {2/5^(1/2)}} )

In[16]:=

blocks = {u1 . Transpose[u1], u2 . Transpose[u2]} ;

Map[MatrixForm, %]

Out[17]=

{( {{4/5, 2/5}, {2/5, 1/5}} ), ( {{1/5, -2/5}, {-2/5, 4/5}} )}

In[18]:=

Print[a//MatrixForm, "", evals[[1]], blocks[[1]]//MatrixForm, "+", evals[[2]], blocks[[2]]//MatrixForm] ; 

spectralDecomposition = Underoverscript[∑, k = 1, arg3] evals[[k]] blocks[[k]] ;

a == spectralDecomposition

( {{7, 2}, {2, 4}} ) 8 ( {{4/5, 2/5}, {2/5, 1/5}} )  + 3 ( {{1/5, -2/5}, {-2/5, 4/5}} )

Out[20]=

True


Created by Mathematica  (March 30, 2005) Valid XHTML 1.1!