# Can I diagonalize a 512 by 512 matrix? [closed]

...with Mathematica? Or is this going to be impossible? I don't want to start work if it is hopeless. I've already solved the problem on a smaller scale, which involved an 8x8 matrix. Unfortunately, because of the nature of this problem, the next length scale up jumps to 512x512. Crazy.

• Numerical or symbolical matrix? Have you tried Eigensystem? Jul 27, 2019 at 4:43
• matrix consists of 1's,0's,-1's, and fractions like 1/3,1/9,-1/3,-1/9. A numerical result is fine. Jul 27, 2019 at 19:22
• If it’s finite precision numerical there’s no issue. 512 x 512 is chump change for Eigensystem if you want the exact result (I.e. get back fractions not decimals) that could be memory intensive. Jul 29, 2019 at 5:34

This should relatively easy to find out.

Make a random Matrix, find out if it's even possible to diagonalize it.

matA = RandomInteger[{-5, 5}, {10, 10}];
DiagonalizableMatrixQ[matA]

*True*


Calculate the Eigenvectors of the matrix to use for further calculations.

$$A_{\text{diag}}={T^{-1}} .A.T$$

matB = Transpose[Eigenvectors[matA]]
matD = Inverse[matB].matA.matB;
DiagonalMatrixQ[matD]
*True*


Assuming your matrix is diagonalisable to begin with, this should give you the solution you're looking for

• Good point. I can do a simple test. I'm afraid it might overload my desktop mac. So I'll close all the other programs and I'll be ready to turn the power off if it gets stuck. Jul 27, 2019 at 19:20
• Finding the solution of the matrix is diagonalizable or not with a 512x512 matrix only took me a second or two, however i couldnt generate one randomly that was to test with. If you have one already it shouldnt take tooooo much time. Jul 27, 2019 at 19:27
• I would think that generating the random 512x512 matrix would be the easy part. Jul 27, 2019 at 19:31
• Generating a random one yes...one that is diagonalisable right away no so quick... Jul 27, 2019 at 19:33
• @Chris, if your matrix is e.g. Hermitian or normal, then it is guaranteed to be diagonalizable. As you have not mentioned where your matrix came from, we are only able to speculate. Jul 28, 2019 at 2:42