1
$\begingroup$

I have a matrix

 M = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, b}, {0, 0, -b, 0}}

that I want to diagonalize. So far, I always used the following and it worked, but for

 U = Eigenvectors[M]
 FullSimplify[U.M.Transpose[U]] // MatrixForm

I get $$ \left( \begin{array}{cccc} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 2 i b \\ 0 & 0 & -2 i b & 0 \\ \end{array} \right)$$

In contrast for a different matrix like

M2= {{0, 0, 0, 0}, {0, 0, A, 0}, {0, A, 0, 0}, {0, 0, 0, 0}}

I get from

 U2 = Eigenvectors[M2]
 FullSimplify[U2.M2.Transpose[U2]] // MatrixForm

the result

$$ \left( \begin{array}{cccc} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & -2 A & 0 \\ 0 & 0 & 0 & 2 A \\ \end{array} \right)$$ as it should be.

What's the problem here? Why isn't

 FullSimplify[U.M.Transpose[U]] // MatrixForm

diagonal as it should be?

EDIT: For

 FullSimplify[U.M.Inverse[U]] // MatrixForm

I get a diagonal matrix, but then

 M3=M+M2 
 U3 = Eigenvectors[M3]
 FullSimplify[U3.M3.Inverse[U3]] // MatrixForm

isn't diagonal.

$\endgroup$

closed as off-topic by MarcoB, Bob Hanlon, dr.blochwave, Daniel Lichtblau, Oleksandr R. Jun 30 '15 at 0:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, Bob Hanlon, dr.blochwave, Daniel Lichtblau, Oleksandr R.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ M is not symmetric, so the correct check exploiting the antisymmetry is U.M.ConjugateTranspose[U]. $\endgroup$ – J. M. will be back soon Jun 29 '15 at 12:13
  • $\begingroup$ @J. M. Thanks for your comment. This works for M, but if I define a new matrix as the sum of the two other matrices this does not yield a diagonal matrix. The result is then $$ \left( \begin{array}{cccc} 0 & 0 & -\frac{b^2}{\sqrt{(A-b) (A+b)}} & \frac{b^2}{\sqrt{(A-b) (A+b)}} \\ 0 & 0 & 0 & 0 \\ \frac{2 A^2}{\sqrt{(A-b) (A+b)}} & 0 & -\frac{A^2+b^2}{\sqrt{(A-b) (A+b)}} & 0 \\ -\frac{2 A^2}{\sqrt{(A-b) (A+b)}} & 0 & 0 & \frac{A^2+b^2}{\sqrt{(A-b) (A+b)}} \\ \end{array} \right) $$ $\endgroup$ – jak Jun 29 '15 at 12:17
  • 2
    $\begingroup$ That would be because the eigenvectors are returned as rows. Transpose[] before checking. $\endgroup$ – J. M. will be back soon Jun 29 '15 at 12:22
  • $\begingroup$ @J. M. oh... yes of course. Thank you so much! $\endgroup$ – jak Jun 29 '15 at 12:24
  • $\begingroup$ Okay, read the docs for Eigensystem[], and then try answering your own question. $\endgroup$ – J. M. will be back soon Jun 29 '15 at 12:26
4
$\begingroup$

In general, the relation between an original matrix and the eigenvalue decomposition is the following:

m = RandomReal[1, {5, 5}];
{eval, evec} = Eigensystem[m];
Norm[Transpose[evec].DiagonalMatrix[eval].Inverse@Transpose[evec]-m]

which outputs 0.

So, in order to diagonalize the matrix m, we have to evaluate Inverse[u].m.u with u=Tranpose@Eigenvectors@m.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.