# How to put a matrix in its block diagonal form (Mathematica)

• Mathematica
• mvww

#### mvww

Hello.
I got a 10x10 matrix that I know that has a block diagonal form. How can I put it in that form, using Mathematica?

Regards,
Marcus.

Bill Simpson said:

Thank you very much. :)

## 1. How do I create a matrix in Mathematica?

In Mathematica, matrices can be created by using the command "Array" or by typing the elements directly into a list and using the "MatrixForm" command to display it. For example, to create a 3x3 matrix with the elements 1, 2, 3, 4, 5, 6, 7, 8, 9, you can use either of the following commands:

MatrixForm[Array[{1, 2, 3, 4, 5, 6, 7, 8, 9}, {3, 3}]] or MatrixForm[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]

## 2. How do I put a matrix in block diagonal form?

To put a matrix in block diagonal form, you can use the "JordanDecomposition" command in Mathematica. This command will return a list of matrices that represent the block diagonal form of the original matrix. For example, if you have a matrix A, you can use the command "JordanDecomposition[A]" to obtain the block diagonal form of A.

## 3. Can I put a matrix in block diagonal form without using the "JordanDecomposition" command?

Yes, you can also put a matrix in block diagonal form by using the "DiagonalMatrix" command. This command creates a diagonal matrix from a list of elements. To put a matrix A in block diagonal form, you can use the command "DiagonalMatrix[Eigenvalues[A]]". This will create a diagonal matrix with the eigenvalues of A on the diagonal, which will result in the block diagonal form of A.

## 4. Can I visualize the block diagonal form of a matrix in Mathematica?

Yes, you can use the "MatrixPlot" command in Mathematica to visualize the block diagonal form of a matrix. This command creates a plot of the matrix elements, with different colors representing different values. To use this command, you can simply input the block diagonal matrix obtained from the "JordanDecomposition" or "DiagonalMatrix" commands.

## 5. How do I convert a block diagonal matrix back to its original form?

To convert a block diagonal matrix back to its original form, you can use the "KroneckerProduct" command in Mathematica. This command computes the Kronecker product of two matrices. To convert a block diagonal matrix A to its original form, you can use the command "KroneckerProduct[P, Q]" where P is the matrix obtained from the "JordanDecomposition" or "DiagonalMatrix" commands, and Q is the inverse of P. This will result in the original matrix A.