Combining Matrices?

120 Views Asked by At

Let’s say there are two matrices $A$ and $B$ where $$A=\begin{bmatrix}a&b\\b&a\end{bmatrix}$$ $$B=\begin{bmatrix}c&d\\d&c\end{bmatrix}$$

$A$ and $B$ together make up a third matrix $C$ where $$C=\begin{bmatrix}A&B\\B&A\end{bmatrix}=\begin{bmatrix}\begin{bmatrix}a&b\\b&a\end{bmatrix}&\begin{bmatrix}c&d\\d&c\end{bmatrix}\\\begin{bmatrix}c&d\\d&c\end{bmatrix}&\begin{bmatrix}a&b\\b&a\end{bmatrix}\end{bmatrix}$$

My question is of syntax. Specifically, did I define $C$ using $A$ and $B$ properly? It seems ambiguous to me in the sense of $C$ being a matrix of matrices and not of $A$ and $B$ ‘s elements; when I in fact want $C$ to be a matrix of the elements and not of the matrices.

Edit: it looks like I have described a block matrix.

1

There are 1 best solutions below

3
On BEST ANSWER

Let $R$ be a ring.

Let $M=\mathcal M_{2\times 2}(R)$ be the ring of $2\times 2$ matrices over $R$.

Let $A,B$ be in $M$. Then we can associate and write both follwing matrices. (The person writing the matrices has to give the one or the other sense.)

  • The matrix $$\begin{bmatrix}A & B \\ B & A\end{bmatrix}\in\mathcal M_{2\times 2}(M)\ .$$

  • The block matrix $$\left[\begin{array}{c|c}A & B \\\hline B & A\end{array}\right]\in\mathcal M_{4\times 4}(R)\ .$$

(There are obvious ring homomorphisms between the two spaces of matrices. Using this, the "multiplication of block matrices" is possible.)


Later edit:

I decided to insert some explicit examples after the discussion in the comments. In my oppinion, the usage of block matrix multiplication is underestimated, it should be a standard tool in the school. Here, to have an easy game of inserting examples, i will use sage. Here is my dialog with sage.

sage: A = matrix( ZZ, 2, 2, [1,5,4,7] )
sage: B = matrix( ZZ, 2, 2, [1,8,4,9] )
sage: C = matrix( ZZ, 2, 2, [0,1,8,2] )
sage: D = matrix( ZZ, 2, 2, [0,7,7,2] )
sage: M = block_matrix( 2, 2, [A,B,C,D] )
sage: M
[1 5|1 8]
[4 7|4 9]
[---+---]
[0 1|0 7]
[8 2|7 2]
sage: A, B, C, D
(
[1 5]  [1 8]  [0 1]  [0 7]
[4 7], [4 9], [8 2], [7 2]
)

Now to the above $2\times 2$ block matrix named $M$ we associate a plain matrix named $X$.

sage: X = M.matrix_from_rows_and_columns( [0,1,2,3], [0,1,2,3] )
sage: X
[1 5 1 8]
[4 7 4 9]
[0 1 0 7]
[8 2 7 2]

The question in the comment has now the following answer.

The $(1,1)$ entry in $M$ is the $2\times 2$ matrix $A$.

The $(1,2)$ entry in $M$ is the $2\times 2$ matrix $B$.

The $(1,1)$ entry in $X$ is the number $1$.

The $(1,2)$ entry in $X$ is the number $5$.

We want now to see the utility of block matrices. For this note that we can multiply the blocks "as if" they were numbers. (Well, here, they are indeed "numbers" in a ring, the ring of $2\times 2$ matrices over $\Bbb Z$. But also more general patterns of block matrices are allowed / make sense. Let us understand but the present situation.)

We have formally $$M = \left[\begin{array}{c|c}A & B \\\hline C & D\end{array}\right]\in\mathcal M_{2\times 2}\ .$$ Then we can for instance compute $$ M^2 = \left[\begin{array}{c|c}A & B \\\hline C & D\end{array}\right] \left[\begin{array}{c|c}A & B \\\hline C & D\end{array}\right] = \left[\begin{array}{c|c}AA+BC & AC+BD \\\hline CA+DC & CB+DD\end{array}\right] \ . $$ In our example:

sage: M
[1 5|1 8]
[4 7|4 9]
[---+---]
[0 1|0 7]
[8 2|7 2]
sage: M^2
[ 85  57  77  76]
[104  91  95 141]
[ 60  21  53  23]
[ 32  65  30 135]
sage: A*A + B*C, A*C + B*D
(
[ 85  57]  [ 96  34]
[104  91], [119  64]
)
sage: C*A + D*C, C*B + D*D
(
[60 21]  [ 53  23]
[32 65], [ 30 135]
)
sage: 

Sage has a rather mathematically oriented thinking, so i hope the above can be easily digested.