User:StevenDH/Kronecker product temp

From Wikipedia, the free encyclopedia

In mathematics, the Kronecker product, denoted by \otimes, is an operation on two matrices of arbitrary size resulting in a block matrix. It is a special case of a tensor product. The Kronecker product should not be confused with the usual matrix multiplication, which is an entirely different operation. It is named after German mathematician Leopold Kronecker.

Contents

[edit] Definition

If A is an m-by-n matrix and B is a p-by-q matrix, then the Kronecker product A \otimes B is the mp-by-nq block matrix

 A \otimes B = \begin{bmatrix} a_{11} B & \cdots & a_{1n}B \\ \vdots & \ddots & \vdots \\ a_{m1} B & \cdots & a_{mn} B \end{bmatrix}.

More explicitly, we have

 A \otimes B = \begin{bmatrix}
   a_{11} b_{11} & a_{11} b_{12} & \cdots & a_{11} b_{1q} & 
                   \cdots & \cdots & a_{1n} b_{11} & a_{1n} b_{12} & \cdots & a_{1n} b_{1q} \\
   a_{11} b_{21} & a_{11} b_{22} & \cdots & a_{11} b_{2q} & 
                   \cdots & \cdots & a_{1n} b_{21} & a_{1n} b_{22} & \cdots & a_{1n} b_{2q} \\
   \vdots & \vdots & \ddots & \vdots & & & \vdots & \vdots & \ddots & \vdots \\
   a_{11} b_{p1} & a_{11} b_{p2} & \cdots & a_{11} b_{pq} & 
                   \cdots & \cdots & a_{1n} b_{p1} & a_{1n} b_{p2} & \cdots & a_{1n} b_{pq} \\
   \vdots & \vdots & & \vdots & \ddots & & \vdots & \vdots & & \vdots \\
   \vdots & \vdots & & \vdots & & \ddots & \vdots & \vdots & & \vdots \\
   a_{m1} b_{11} & a_{m1} b_{12} & \cdots & a_{m1} b_{1q} & 
                   \cdots & \cdots & a_{mn} b_{11} & a_{mn} b_{12} & \cdots & a_{mn} b_{1q} \\
   a_{m1} b_{21} & a_{m1} b_{22} & \cdots & a_{m1} b_{2q} & 
                   \cdots & \cdots & a_{mn} b_{21} & a_{mn} b_{22} & \cdots & a_{mn} b_{2q} \\
   \vdots & \vdots & \ddots & \vdots & & & \vdots & \vdots & \ddots & \vdots \\
   a_{m1} b_{p1} & a_{m1} b_{p2} & \cdots & a_{m1} b_{pq} & 
                   \cdots & \cdots & a_{mn} b_{p1} & a_{mn} b_{p2} & \cdots & a_{mn} b_{pq} 
\end{bmatrix}.

[edit] Examples


  \begin{bmatrix} 
    1 & 2 \\ 
    3 & 4 \\ 
  \end{bmatrix}
\otimes
  \begin{bmatrix} 
    0 & 5 \\ 
    6 & 7 \\ 
  \end{bmatrix}
=
  \begin{bmatrix} 
    1\cdot 0 & 1\cdot 5 & 2\cdot 0 & 2\cdot 5 \\ 
    1\cdot 6 & 1\cdot 7 & 2\cdot 6 & 2\cdot 7 \\ 
    3\cdot 0 & 3\cdot 5 & 4\cdot 0 & 4\cdot 5 \\ 
    3\cdot 6 & 3\cdot 7 & 4\cdot 6 & 4\cdot 7 \\ 
  \end{bmatrix}

=
  \begin{bmatrix} 
    0 & 5 & 0 & 10 \\ 
    6 & 7 & 12 & 14 \\
    0 & 15 & 0 & 20 \\
    18 & 21 & 24 & 28
  \end{bmatrix}
.

\begin{bmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22} \\
a_{31} & a_{32}
\end{bmatrix}
\otimes
\begin{bmatrix}
b_{11} & b_{12} & b_{13} \\
b_{21} & b_{22} & b_{23}
\end{bmatrix}
=
\begin{bmatrix}
a_{11} b_{11} & a_{11} b_{12} & a_{11} b_{13} & a_{12} b_{11} & a_{12} b_{12} & a_{12} b_{13} \\
a_{11} b_{21} & a_{11} b_{22} & a_{11} b_{23} & a_{12} b_{21} & a_{12} b_{22} & a_{12} b_{23} \\
a_{21} b_{11} & a_{21} b_{12} & a_{21} b_{13} & a_{22} b_{11} & a_{22} b_{12} & a_{22} b_{13} \\
a_{21} b_{21} & a_{21} b_{22} & a_{21} b_{23} & a_{22} b_{21} & a_{22} b_{22} & a_{22} b_{23} \\
a_{31} b_{11} & a_{31} b_{12} & a_{31} b_{13} & a_{32} b_{11} & a_{32} b_{12} & a_{32} b_{13} \\
a_{31} b_{21} & a_{31} b_{22} & a_{31} b_{23} & a_{32} b_{21} & a_{32} b_{22} & a_{32} b_{23}
\end{bmatrix}
.

[edit] Properties

[edit] Bilinearity and associativity

The Kronecker product is a special case of the tensor product, so it is bilinear and associative:

 A \otimes (B+C) = A \otimes B + A \otimes C \qquad,
 (A+B) \otimes C = A \otimes C + B \otimes C \qquad,
 (kA) \otimes B = A \otimes (kB) = k(A \otimes B),
 (A \otimes B) \otimes C = A \otimes (B \otimes C),

where A, B and C are matrices and k is a scalar.

The Kronecker product is not commutative: in general, A \otimes B and B \otimes A are different matrices. However, A \otimes B and B \otimes A are permutation equivalent, meaning that there exist permutation matrices P and Q such that

 A \otimes B = P \, (B \otimes A) \, Q.

If A and B are square matrices, then A \otimes B and B \otimes A are even permutation similar, meaning that we can take P = QT.

[edit] The mixed-product property

If A, B, C and D are matrices of such size that one can form the matrix products AC and BD, then

 (A \otimes B)(C \otimes D) = AC \otimes BD.

This is called the mixed-product property, because it mixes the ordinary matrix product and the Kronecker product. It follows that A \otimes B is invertible if and only if A and B are invertible, in which case the inverse is given by

 (A \otimes B)^{-1} = A^{-1} \otimes B^{-1}.

[edit] Kronecker sum and exponentiation

If A is n-by-n, B is m-by-m and Ik denotes the k-by-k identity matrix then we can define the Kronecker sum, \oplus, by

 A \oplus B = A \otimes I_m + I_n \otimes B.

We have the following formula for the matrix exponential which is useful in the numerical evaluation of certain continuous-time Markov processes,

 e^{A \oplus B} = e^A \otimes e^B.

[edit] Spectrum

Suppose that A and B are square matrices of size n and q respectively. Let λ1, ..., λn be the eigenvalues of A and μ1, ..., μq be those of B (listed according to multiplicity). Then the eigenvalues of A \otimes B are

 \lambda_i \mu_j, \qquad i=1,\ldots,n ,\, j=1,\ldots,q.

It follows that the trace and determinant of a Kronecker product are given by

 \operatorname{tr}(A \otimes B) = \operatorname{tr} A \, \operatorname{tr} B \quad\mbox{and}\quad \det(A \otimes B) = (\det A)^q (\det B)^n.

[edit] Singular values

If A and B are rectangular matrices, then one can consider their singular values. Suppose that A has rA nonzero singular values, namely

 \sigma_{A,i}, \qquad i = 1, \ldots, r_A.

Similarly, denote the nonzero singular values of B by

 \sigma_{B,i}, \qquad i = 1, \ldots, r_B.

Then the Kronecker product A \otimes B has rArB nonzero singular values, namely

 \sigma_{A,i} \sigma_{B,j}, \qquad i=1,\ldots,r_A ,\, j=1,\ldots,r_B.

Since the rank of a matrix equals the number of nonzero singular values, we find that

 \operatorname{rank}(A \otimes B) = \operatorname{rank} A \, \operatorname{rank} B.

[edit] Relation to the abstract tensor product

The Kronecker product of matrices corresponds to the abstract tensor product of linear maps. Specifically, if the matrices A and B represent linear transformations V1W1 and V2W2, respectively, then the matrix A \otimes B represents the tensor product of the two maps, V1 \otimes V2W1 \otimes W2.

[edit] Relation to products of graphs

The Kronecker product of the adjacency matrices of two graphs is the adjacency matrix of the tensor product graph. The Kronecker sum of the adjacency matrices of two graphs is the adjacency matrix of the Cartesian product graph. See [1], answer to Exercise 96.

[edit] Transpose

The operation of transposition is distributive over the Kronecker product:

(A\otimes B)^T = A^T \otimes B^T.

[edit] Matrix equations

The Kronecker product can be used to get a convenient representation for some matrix equations. Consider for instance the equation AXB = C, where A, B and C are given matrices and the matrix X is the unknown. We can rewrite this equation as

 (B^\top \otimes A) \, \operatorname{vec}(X) = \operatorname{vec}(AXB) = \operatorname{vec}(C).

It now follows from the properties of the Kronecker product that the equation AXB = C has a unique solution if and only if A and B are nonsingular (Horn & Johnson 1991, Lemma 4.3.1).

Here, vec(X) denotes the vectorization of the matrix X formed by stacking the columns of X into a single column vector.

If X is row-ordered into the column vector x then AXB can be also be written as  (A \otimes B^\top)x (Jain 1989, 2.8 block Matrices and Kronecker Products)

[edit] History

The Kronecker product is named after Leopold Kronecker, even though there is little evidence that he was the first to define and use it. Indeed, in the past the Kronecker product was sometimes called the Zehfuss matrix, after Johann Georg Zehfuss.

[edit] Related matrix operators

Two related matrix operators are the Tracy-Singh and Khatri-Rao products which operate on partitioned matrices. Let the m-by-n matrix A be partitioned into the mi-by-nj blocks Aij and p-by-q matrix B into the pk-by-ql blocks Bkl with of course Σimi = m, Σjnj = n, Σkpk = p and Σlql = q. We then define the Tracy-Singh product to be

 A \circ B = (A_{ij}\circ B)_{ij} = ((A_{ij} \otimes B_{kl})_{kl})_{ij}

which means that the (ij)th subblock of the mp-by-nq product  A\circ B is the mip-by-njq matrix A_{ij} \circ B, of wich the (kl)th subblock equals the mipk-by-njql matrix A_{ij} \otimes B_{kl}. For example, if A and B both are 2-by-2 partitioned matrices e.g.:

 A = 
\left[
\begin{array} {c | c}
A_{11} & A_{12} \\
\hline
A_{21} & A_{22}
\end{array}
\right]
= 
\left[
\begin{array} {c c | c}
1 & 2 & 3 \\
4 & 5 & 6 \\
\hline
7 & 8 & 9 
\end{array}
\right]
,\quad
B = 
\left[
\begin{array} {c | c}
B_{11} & B_{12} \\
\hline
B_{21} & B_{22}
\end{array}
\right]
= 
\left[
\begin{array} {c | c c}
1 & 4 & 7 \\
\hline
2 & 5 & 8 \\
3 & 6 & 9 
\end{array}
\right]
,

we get:


A \circ B = 
\left[
\begin{array} {c | c}
A_{11} \circ B & A_{12} \circ B \\
\hline
A_{21} \circ B & A_{22} \circ B 
\end{array}
\right]
=
\left[
\begin{array} {c | c | c | c }
A_{11} \otimes B_{11} & A_{11} \otimes B_{12} & A_{12} \otimes B_{11} & A_{12} \otimes B_{12} \\
\hline
A_{11} \otimes B_{21} & A_{11} \otimes B_{22} & A_{12} \otimes B_{21} & A_{12} \otimes B_{22} \\
\hline
A_{21} \otimes B_{11} & A_{21} \otimes B_{12} & A_{22} \otimes B_{11} & A_{22} \otimes B_{12} \\
\hline
A_{21} \otimes B_{21} & A_{21} \otimes B_{22} & A_{22} \otimes B_{21} & A_{22} \otimes B_{22}
\end{array}
\right]

=
\left[
\begin{array} {c c | c c c c | c | c c}
1 & 2 & 4 & 7 & 8 & 14 & 3 & 12 & 21 \\
4 & 5 & 16 & 28 & 20 & 35 & 6 & 24 & 42 \\
\hline
2 & 4 & 5 & 8 & 10 & 16 & 6 & 15 & 24 \\
3 & 6 & 6 & 9 & 12 & 18 & 9 & 18 & 27 \\
8 & 10 & 20 & 32 & 25 & 40 & 12 & 30 & 48 \\
12 & 15 & 24 & 36 & 30 & 45 & 18 & 36 & 54 \\
\hline
7 & 8 & 28 & 49 & 32 & 56 & 9 & 36 & 63 \\
\hline
14 & 16 & 35 & 56 & 40 & 64 & 18 & 45 & 72 \\
21 & 24 & 42 & 63 & 48 & 72 & 27 & 54 & 81
\end{array}
\right]

The Khatri-Rao product is defined as

 A \ast B = (A_{ij}\otimes B_{ij})_{ij}

in which the (ij)th block is the mipi-by-njqj-sized Kronecker product of the corresponding blocks of A and B, assuming that the 'horizontal' and 'vertical' number of subblocks of both matrices is equal. The size of the product is then Σimipi-by-Σjnjqj. Proceeding with the same matrices as the previous example we obtain:


A \ast B = 
\left[
\begin{array} {c | c}
A_{11} \otimes B_{11} & A_{12} \otimes B_{12} \\
\hline
A_{21} \otimes B_{21} & A_{22} \otimes B_{22} 
\end{array}
\right]
=
\left[
\begin{array} {c c | c c}
1 & 2 & 12 & 21 \\
4 & 5 & 24 & 42 \\
\hline
14 & 16 & 45 & 72 \\
21 & 24 & 54 & 81
\end{array}
\right]

A column-wise Kronecker product,also called the Khatri-Rao product of two matrices assumes the partitions of the matrices as their columns. In this case m1 = m, p1 = p, n = q and \forall j: n_j=p_j=1. The resulting product is a mp-by-n matrix of which each column is the Kronecker product of the corresponding columns of A and B. We can only use the matrices from the previous examples if we change the partitions:


C = 
\left[
\begin{array} { c | c | c}
C_1 & C_2 & C_3
\end{array}
\right]
= 
\left[
\begin{array} {c | c | c}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 
\end{array}
\right]
,\quad
D = 
\left[
\begin{array} { c | c | c }
D_1 & D_2 & D_3
\end{array}
\right]
= 
\left[
\begin{array} { c | c | c }
1 & 4 & 7 \\
2 & 5 & 8 \\
3 & 6 & 9 
\end{array}
\right]
,

so that:


C \ast D 
= 
\left[
\begin{array} { c | c | c }
C_1 \otimes D_1 & C_2 \otimes D_2 & C_3 \otimes D_3
\end{array}
\right]
=
\left[
\begin{array} { c | c | c }
1 & 8 & 21 \\
2 & 10 & 24 \\
3 & 12 & 27 \\
4 & 20 & 42 \\
8 & 25 & 48 \\
12 & 30 & 54 \\
7 & 32 & 63 \\
14 & 40 & 72 \\
21 & 48 & 81
\end{array}
\right]

[edit] References

  1. ^ D. E. Knuth: "Pre-Fascicle 0a: Introduction to Combinatorial Algorithms", zeroth printing (revision 2), to appear as part of D.E. Knuth: The Art of Computer Programming Vol. 4A
  • Horn, Roger A. & Johnson, Charles R. (1991), Topics in Matrix Analysis, Cambridge University Press, ISBN 0-521-46713-6 .
  • Jain, Anil K. (1989), Fundamentals of Digital Image Processing, Prentice Hall, ISBN 0-13-336165-9 .

[edit] External links