In[]:=
Fri 9 Aug 2024 15:49:35
Reason for eigenvalues
Reason for eigenvalues
Where do eigenvalues come from?There are many explanation for singular values, but not for eigenvalues. A generic matrix (ie, any matrix corrupted by tiny amount of numeric noise) has complex valued eigenvalues, which don’t have a nice geometric intepretation. However, they have a nice complex analytic interpretation.You can think of eigenvalues are a tool that lets you compute functions of matrices.Suppose we want to compute square root of matrix =To compute the square root, first write the matrix using eigenvalue decomposition
9 | 5 |
0 | 4 |
3 | 1 |
0 | 2 |
3 | 1 |
0 | 2 |
Out[]=
=
.
.
9 | 5 |
0 | 4 |
1 | -1 |
0 | 1 |
9 | 0 |
0 | 4 |
1 | 1 |
0 | 1 |
Now, take square root of the diagonal entries of middle matrix (eigenvalues), and multiply things out again
Out[]=
=
.
.
3 | 1 |
0 | 2 |
1 | -1 |
0 | 1 |
3 | 0 |
0 | 2 |
1 | 1 |
0 | 1 |
Note that using singular values in place of eigenvalues gives the wrong result in this caseWhere does this decomposition come from?It follows from the matrix version of Cauchy integral formula to express function of matrix in terms of (matrix-valued) contour integralApplying matrix version of the Cauchy residue theorem tells us how to compute this expression in terms of sum ..Here lambda_1 and lambda_2 are eigenvalues of the matrix, and the two co
f(A)dzf(z)
1
2Πi
-1
(zI-A)
f(A)f()+f()
λ
1
λ
2
In[]:=
SF=StringForm;B={{3,1},{-1,1}};B={{3,1},{0,2}};A=B.B;SF["A=``",A//MatrixForm]On[Assert];{evals,evecs}=Eigensystem[A];U=evecs;Assert[A==U.DiagonalMatrix[evals].Inverse[U]//Reduce];Assert[B==U.DiagonalMatrix[Sqrt@evals].Inverse[U]//Reduce];SF["``=``.``.``",MatrixForm@A,MatrixForm@U,MatrixForm@DiagonalMatrix[evals],MatrixForm@Inverse[U]]SF["``=``.``.``",MatrixForm@B,MatrixForm@U,MatrixForm@DiagonalMatrix[Sqrt@evals],MatrixForm@Inverse[U]]
Out[]=
A=
9 | 5 |
0 | 4 |
Out[]=
=
.
.
9 | 5 |
0 | 4 |
1 | -1 |
0 | 1 |
9 | 0 |
0 | 4 |
1 | 1 |
0 | 1 |
Out[]=
=
.
.
3 | 1 |
0 | 2 |
1 | -1 |
0 | 1 |
3 | 0 |
0 | 2 |
1 | 1 |
0 | 1 |
In[]:=
{MatrixForm@A,MatrixForm@U,MatrixForm@DiagonalMatrix[evals],MatrixForm@Inverse[U]}{MatrixForm@B,MatrixForm@U,MatrixForm@DiagonalMatrix[Sqrt@evals],MatrixForm@Inverse[U]}
Out[]=
,
,
,
9 | 5 |
0 | 4 |
1 | -1 |
0 | 1 |
9 | 0 |
0 | 4 |
1 | 1 |
0 | 1 |
Out[]=
,
,
,
3 | 1 |
0 | 2 |
1 | -1 |
0 | 1 |
3 | 0 |
0 | 2 |
1 | 1 |
0 | 1 |
Find matrices with nice square roots
Find matrices with nice square roots
Verify residues
Verify residues
In[]:=
A={{9,5},{0,4}};eigs=Eigenvalues[A];f[x_]:=Sqrt[x];res[s_]:=Inverse[sIdentityMatrix@Length@A-A];res$[eig_]:=Simplify[(s-eig)res[s]]/.s->eig;B=Total[f[#]res$[#]&/@eigs];Assert[Norm[MatrixPower[A,1/2]-B]==0]Print["Auxiliary matrices: ",MatrixForm/@(res$/@eigs)]MatrixForm/@(res$/@eigs)
Auxiliary matrices:
,
1 | 1 |
0 | 0 |
0 | -1 |
0 | 1 |
Out[]=
,
1 | 1 |
0 | 0 |
0 | -1 |
0 | 1 |
In[]:=
eigs//N
Out[]=
{9.,4.}
In[]:=
MatrixPower[A,1/2]
Out[]=
{{3,1},{0,2}}
Out[]=
,
1 | 1 |
0 | 0 |
0 | -1 |
0 | 1 |
In[]:=
MatrixForm/@({#}.{#}&/@Eigenvectors[A])
Out[]=
,
1 | 0 |
0 | 0 |
1 | -1 |
-1 | 1 |
In[]:=
Eigenvectors[A]
Out[]=
{{1,0},{-1,1}}