TransWikia.com

How to transform a matrix into a diagonal matrix by Schmidt orthogonalization

Mathematica Asked on June 18, 2021

I want to diagonalize a matrix by orthogonalization, but the following method cannot get the correct result:

A = {{1, 2, -3}, {-1, 4, -3}, {1, -2, 5}};
DiagonalizableMatrixQ[A]
Eigensystem[A]
Q = Orthogonalize@(Eigensystem[A][[2]])

Transpose[Q].DiagonalMatrix[{6, 2, 2}].Q == A
Transpose[Q].A.Q == DiagonalMatrix[{6, 2, 2}]

I think it is probably caused by the difference between function Orthogonalize (Q = Orthogonalize@(Eigensystem[A][[2]])) and Schmidt orthogonalization.

How can I use built-in functions to do Schmidt orthogonalization and diagonalize the matrix?

Oddly enough, the following code returns an empty set, whereas DiagonalizableMatrixQ[A]==True indicates that the matrix can be diagonalized:

Q = Array[x, {3, 3}];
A = {{1, 2, -3}, {-1, 4, -3}, {1, -2, 5}};
FindInstance[
 Q[Transpose].A.Q == DiagonalMatrix[{6, 2, 2}] && 
  Q[Transpose].Q == IdentityMatrix[3], Flatten[Q]]

I hope to find the orthogonal matrix Q by Schmidt orthogonalization and diagonalize the matrix A.

The definition of Schmidt orthogonalization:

$$begin{array}{l}
boldsymbol{b}_{1}=boldsymbol{a}_{1}
boldsymbol{b}_{2}=boldsymbol{a}_{2}-frac{left[boldsymbol{b}_{1}, boldsymbol{a}_{2}right]}{left[boldsymbol{b}_{1}, boldsymbol{b}_{1}right]} boldsymbol{b}_{1}
cdots cdots cdots cdots
boldsymbol{b}_{r}=boldsymbol{a}_{r}-frac{left[boldsymbol{b}_{1}, boldsymbol{a}_{r}right]}{left[boldsymbol{b}_{1}, boldsymbol{b}_{1}right]} boldsymbol{b}_{1}-frac{left[boldsymbol{b}_{2}, boldsymbol{a}_{r}right]}{left[boldsymbol{b}_{2}, boldsymbol{b}_{2}right]} boldsymbol{b}_{2}-cdots-frac{left[boldsymbol{b}_{r-1}, boldsymbol{a}_{r}right]}{left[boldsymbol{b}_{r-1}, boldsymbol{b}_{r-1}right]} boldsymbol{b}_{r-1},
end{array}$$

$$boldsymbol{e}_{1}=frac{1}{left|boldsymbol{b}_{1}right|} boldsymbol{b}_{1}, quad boldsymbol{e}_{2}=frac{1}{left|boldsymbol{b}_{2}right|} boldsymbol{b}_{2}, quad cdots, quad boldsymbol{e}_{r}=frac{1}{left|boldsymbol{b}_{r}right|} boldsymbol{b}_{r}$$

$[x,y]$ is the inner product of vectors x and y.

Other examples for testing:

A = {{-2, 1, 1}, {0, 2, 0}, {-4, 1, 3}};
DiagonalizableMatrixQ[A]
Q = (Eigenvectors[A])
Inverse[Q].A.Q
A.Q

I don’t know why finding eigenvector matrix does not satisfy $boldsymbol{A} boldsymbol{p}_{i}=lambda_{i} boldsymbol{p}_{i} quad(i=1,2, cdots, n)$ or $Q^{-1} A Q=Lambda$.

The eigenvector matrix $boldsymbol{Q}=left(boldsymbol{p}_{1}, boldsymbol{p}_{2}, boldsymbol{p}_{3}right)=left(begin{array}{ccc}
1 & 0 & 1
0 & 1 & 0
1 & -1 & 4
end{array}right)$
obtained in the textbook can satisfy $left(begin{array}{ccc}
1 & 0 & 1
0 & 1 & 0
1 & -1 & 4
end{array}right)^{-1} cdot A cdotleft(begin{array}{ccc}
1 & 0 & 1
0 & 1 & 0
1 & -1 & 4
end{array}right)=left(begin{array}{ccc}
-1 & 0 & 0
0 & 2 & 0
0 & 0 & 2
end{array}right)$
.

One Answer

It should be noted that these matrices are not symmetric matrices. In addition, eigenvector matrices need to be transposed before been used:

A = {{1, 2, -3}, {-1, 4, -3}, {1, -2, 5}};
DiagonalizableMatrixQ[A]
Eigensystem[A]
Q = (Eigensystem[A][[2]])
(*but this matrix is not symmetric,so Transpose is not sufficient*)
Inverse[Q[Transpose]].A.Q[Transpose]


A = {{-2, 1, 1}, {0, 2, 0}, {-4, 1, 3}};
DiagonalizableMatrixQ[A]
Q = (Eigenvectors[A])
Inverse[Q[Transpose]].A.Q[Transpose]

GramSchmidtOrthogonalize[mat_] := 
   Module[{matT = Transpose[mat], 
       n = Length[Transpose[mat]]}, 
     a = matT; b[1] = a[[1]]; b[i_] := 
        a[[i]] - Sum[(b[j] . a[[i]]/b[j] . b[j])*b[j], 
            {j, 1, i - 1}]; Transpose[Table[b[i], 
          {i, 1, n}]]]
GramSchmidtOrthogonalize[{{2, 0, 0}, {1, 2, 0}, 
     {0, 0, -1}}]

I've learned that DiagonalizableMatrixQ[A]==True indicates that A can be diagonalized, but SchurDecomposition[N[{{1, 2, -3}, {-1, 4, -3}, {1, -2, 5}}]] means that A cannot be orthogonal diagonalized:

A = {{1, 2, -3}, {-1, 4, -3}, {1, a, 5}} /. a -> -2 ;
Q = Join[{Eigensystem[A][[2]][[1]]}[Transpose], 
  GramSchmidtOrthogonalize[(Eigensystem[A][[2]][[2 ;; 
        All]])[Transpose]], 2]
Inverse[Q].A.Q

GramSchmidtOrthogonalize[mat_] := 
 Module[{matT = Transpose[mat], n = Length[Transpose[mat]], a, b}, 
     a = matT; b[1] = a[[1]]; 
  b[i_] := a[[i]] - 
    Sum[(b[j] . a[[i]]/b[j] . b[j])*b[j], {j, 1, i - 1}]; 
      Transpose[Table[b[i], {i, 1, n}]]]
A = {{1, 2, -3}, {-1, 4, -3}, {1, a, 5}} /. a -> -2; 
Q = GramSchmidtOrthogonalize[Eigensystem[A][[2]]]; Normalize /@ 
 Transpose[Q]
Orthogonalize[Transpose[Eigenvectors[A]]]

Answered by A little mouse on the pampas on June 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP