The product of two matrices and is defined as
(1)
|
where is summed over for all possible values of and and the notation above uses the Einstein summation convention. The implied summation over repeated indices without the presence of an explicit sum sign is called Einstein summation, and is commonly used in both matrix and tensor analysis. Therefore, in order for matrix multiplication to be defined, the dimensions of the matrices must satisfy
(2)
|
where denotes a matrix with rows and columns. Writing out the product explicitly,
(3)
|
where
(4)
| |||
(5)
| |||
(6)
| |||
(7)
| |||
(8)
| |||
(9)
| |||
(10)
| |||
(11)
| |||
(12)
|
Matrix multiplication is associative, as can be seen by taking
(13)
|
where Einstein summation is again used. Now, since , , and are scalars, use the associativity of scalar multiplication to write
(14)
|
Since this is true for all and , it must be true that
(15)
|
That is, matrix multiplication is associative. Equation (13) can therefore be written
(16)
|
without ambiguity. Due to associativity, matrices form a semigroup under multiplication.
Matrix multiplication is also distributive. If and are matrices and and are matrices, then
(17)
| |||
(18)
|
Since matrices form an Abelian group under addition, matrices form a ring.
However, matrix multiplication is not, in general, commutative (although it is commutative if and are diagonal and of the same dimension).
The product of two block matrices is given by multiplying each block
(19)
|