Consider a block (partitioned) matrix
matrix = ArrayFlatten[{{a, b}, {c, d}}]
where, a
, b
, c
and d
are each matrices themselves. Say, for example,
a = {{a11, a12}, {a21, a22}}
b = {{b11, b12}, {b21, b22}}
c = {{0, 0}, {0, 0}}
d = {{d11, d12}, {d21, d22}}
How can you find the block inverse of this matrix? A desired solution is, using the example above
{{Inverse[a] , -Inverse[a].b.Inverse[d]},{0,Inverse[d]}}
which is easily verified using
Simplify[Inverse[ArrayFlatten[{{a, b}, {c, d}}]] ==
ArrayFlatten[{{Inverse[a], -Inverse[a].b.Inverse[d]}, {0,
Inverse[d]}}]]
which yields True
.
How can you solve the block inverse problem for arbitrary submatrices, and for block matrices of larger sizes (i.e. 3x3, 4x4, etc)?
Answer
Mathematica does not support this directly. You can do things of this sort using an external package called NCAlgebra.
The relevant documentation may be found at
http://math.ucsd.edu/~ncalg/DOWNLOAD2010/DOCUMENTATION/html/NCBIGDOCch4.html#x8-510004.4
In particular have a look at "4.4.8 NCLDUDecomposition[aMatrix, Options]"
Using this package, you would find the block inverse of the example matrix
using:
c=0;
inverse = NCInverse[matrix]
(* Out[] = {{inv[a], -inv[a] ** b ** inv[d]}, {0, inv[d]}} *)
Here inv[a]
represents the general inverse of the a
block of the matrix and the **
represents non-commutative (i.e. matrix) multiplication. This approach works for larger (3x3, 4x4, etc) square block matrices as well.
Comments
Post a Comment