represents the block diagonal matrix with diagonal blocks di as a structured array.
converts the block diagonal matrix mat to a structured array.
Details and Options
- Block diagonal matrices, when represented as structured arrays, allow for efficient storage and more efficient operations, including Det, Inverse and LinearSolve.
- Block diagonal matrices occur naturally as the adjacency matrices of graphs with multiple connected components, as the tensor product (Kronecker product) of full matrices with diagonal matrices and as the output from Jordan decompositions and core-nilpotent decompositions.
- A block diagonal matrix generalizes a diagonal matrix, where the diagonal elements are themselves matrices.
- The diagonal blocks di must be square matrices.
- The inverse of a block diagonal matrix is also block diagonal.
- The determinant of a block diagonal matrix is the product of the determinants of the diagonal blocks.
- For a BlockDiagonalMatrix sa, the following properties "prop" can be accessed as sa["prop"]:
"Blocks" list of diagonal blocks "RowPermutation" permutation of the rows, represented as a permutation list "ColumnPermutation" permutation of the columns, represented as a permutation list "Properties" list of supported properties "Structure" type of structured array "StructuredData" internal data stored by the structured array "StructuredAlgorithms" list of functions with special methods for the structured array "Summary" summary information, represented as a Dataset
- Normal[BlockDiagonalMatrix[…]] gives the block diagonal matrix as an ordinary matrix.
- BlockDiagonalMatrix[…,TargetStructure->struct] returns the block diagonal matrix in the format specified by struct. Possible settings include:
Automatic automatically choose the representation returned "Dense" represent the matrix as a dense matrix "Sparse" represent the matrix as a sparse array "Structured" represent the matrix as a structured array
- BlockDiagonalMatrix[…,TargetStructureAutomatic] is equivalent to BlockDiagonalMatrix[…,TargetStructure"Structured"].
Examplesopen allclose all
Basic Examples (1)
BlockDiagonalMatrix objects include properties that give information about the matrix:
When appropriate, structured algorithms return another BlockDiagonalMatrix object:
Elements in BlockDiagonalMatrix are coerced to the precision of the nonzero elements of the blocks.
Construct a block diagonal matrix from a SparseArray:
This is equivalent to using ConnectedGraphComponents:
Show that the resulting matrix is equivalent to the result of FourierMatrix:
The result is equivalent to applying Fourier to the vector:
Properties & Relations (4)
If a given matrix cannot be split into diagonal blocks or cannot be transformed into a form with diagonal blocks, BlockDiagonalMatrix returns the matrix itself:
Wolfram Research (2022), BlockDiagonalMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/BlockDiagonalMatrix.html (updated 2023).
Wolfram Language. 2022. "BlockDiagonalMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/BlockDiagonalMatrix.html.
Wolfram Language. (2022). BlockDiagonalMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BlockDiagonalMatrix.html