Omni Calculator logo

If you have just stumbled upon this bizarre matrix operation called matrix tensor product or Kronecker product of matrices, look for help no further — Omni's tensor product calculator is here to teach you all you need to know about:

  • What the Kronecker product is;
  • What the main properties of Kronecker product are;
  • How to calculate tensor product of 2x2 matrices by hand; and
  • What the most general Kronecker product formula looks like.

As a bonus, we'll explain the relationship between the abstract tensor product vs the Kronecker product of two matrices!

⚠️ The Kronecker product is not the same as the usual matrix multiplication! If you're interested in the latter, visit Omni's matrix multiplication calculator. To discover even more matrix products, try our most general matrix calculator.

What is the tensor product of matrices?

Matrix tensor product, also known as Kronecker product or matrix direct product, is an operation that takes two matrices of arbitrary size and outputs another matrix, which is most often much bigger than either of the input matrices.

Let's say the input matrices are:

  • AA with rAr_A rows and cAc_A columns, and
  • BB with rBr_B rows and cBc_B columns.

The resulting matrix then has rArBr_A \cdot r_B rows and cAcBc_A \cdot c_B columns.

🔎 In particular, we can take matrices with one row or one column, i.e., vectors (whether they are a column or a row in shape). In this case, we call this operation the vector tensor product.

How to calculate the Kronecker product?

Once we have a rough idea of what the tensor product of matrices is, let's discuss in more detail how to compute it. The Kronecker product is defined as the following block matrix:

AB=[a11Ba1cABarA1BarAcAB]\footnotesize A \otimes B = \! \begin{bmatrix} a_{11} {B} & \cdots & a_{1c_A} {B} \\ \vdots &\ddots &\vdots \\a_{r_A1}{B} &\cdots &a_{r_Ac_A}{B} \end{bmatrix}

Hence, calculating the Kronecker product of two matrices boils down to performing a number-by-matrix multiplication many times. As you surely remember, the idea is to multiply each term of the matrix by this number while keeping the matrix shape intact:

aijB=[aijb11aijb1cBaijbrB1aijbrBcB]\footnotesize a_{ij} B =\! \begin{bmatrix} a_{ij} b_{11} & \cdots & a_{ij} b_{1c_B} \\ \vdots &\ddots &\vdots \\a_{ij}b_{r_B1} &\cdots &a_{ij} b_{r_Bc_B} \end{bmatrix}

Tensor product of 2x2 matrices

Let's discuss what the Kronecker product is in the case of 2x2 matrices to make sure we really understand everything perfectly. Suppose that

A=[a11a12a21a22], B=[b11b12b21b22]\footnotesize A = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}\!,\ B = \begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix}

As we saw above, we have:

AB=[a11Ba12Ba21Ba22B]\footnotesize A \otimes B = \begin{bmatrix} a_{11} {B} & a_{12} {B} \\a_{21}{B} &a_{22}{B} \end{bmatrix}

Writing the terms of BB explicitly, we obtain:

AB=[a11[b11b12b21b22]a12[b11b12b21b22]a21[b11b12b21b22]a22[b11b12b21b22]]\footnotesize A \otimes B = \\ \begin{bmatrix} a_{11} \begin{bmatrix} b_{11} & b_{12} \\b_{21} &b_{22} \end{bmatrix} & a_{12}\begin{bmatrix} b_{11} & b_{12} \\b_{21} &b_{22} \end{bmatrix} \\a_{21}\begin{bmatrix} b_{11} & b_{12} \\b_{21} &b_{22} \end{bmatrix} &a_{22}\begin{bmatrix} b_{11} & b_{12} \\b_{21} &b_{22} \end{bmatrix} \end{bmatrix}

Performing the number-by-matrix multiplication, we arrive at the final result:

AB=[a11b11a11b12a12b11a12b12a11b21a11b22a12b21a12b22a21b11a21b12a22b11a22b12a21b21a21b22a22b21a22b22]\footnotesize A \otimes B = \\ \begin{bmatrix} a_{11} b_{11} & a_{11}b_{12} & a_{12} b_{11} & a_{12} b_{12} \\ a_{11}b_{21} & a_{11}b_{22} & a_{12}b_{21} & a_{12}b_{22} \\ a_{21} b_{11} & a_{21}b_{12} & a_{22} b_{11} & a_{22} b_{12} \\ a_{21}b_{21} & a_{21}b_{22} & a_{22} b_{21} & a_{22} b_{22} \end{bmatrix}

Hence, the tensor product of 2x2 matrices is a 4x4 matrix. It is not hard at all, is it? But you can surely imagine how messy it'd be to explicitly write down the tensor product of much bigger matrices! Fortunately, there's a concise formula for the matrix tensor product — let's discuss it!

What is the formula for the Kronecker matrix product?

We can compute the element (AB)ij(A\otimes B)_{ij} of the Kronecker product as:

ai/rB,j/cBb((i1)%rB+1),((j1)%cB+1)\footnotesize a_{\lceil i/r_B\rceil ,\lceil j/c_B\rceil } \cdot b_{\left((i-1)\% r_B+1\right),\left((j-1)\% c_B+1\right)}

where x\lceil x \rceil is the ceiling function (i.e., it's the smallest integer that is greater than xx) and %\% denotes the modulo operation. Recall also that rBr_B and cBc_B stand for the number of rows and columns of BB, respectively.

We have discussed two methods of computing tensor matrix product. There's a third method, and it is our favorite one — just use Omni's tensor product calculator!

How to use this tensor product calculator?

To compute the Kronecker product of two matrices with the help of our tool, just pick the sizes of your matrices and enter the coefficients in the respective fields.

🙋 Oops, you've messed up the order of matrices? No worries — our tensor product calculator allows you to choose whether you want to multiply ABA \otimes B or BAB \otimes A. Enjoy!

Properties of the Kronecker product

Associativity

Tensor matrix product is associative, i.e., for every A,B,CA, B, C we have

(AB)C=A(BC)\footnotesize ({A} \otimes {B} )\otimes {C} ={A} \otimes ({B} \otimes {C})

Bilinearity

Tensor matrix product is also bilinear, i.e., it is linear in each argument separately:

(A+B)C=AC+BC,(xA)B=x(AB)\footnotesize (A + B)\otimes C =A \otimes C +B \otimes C, \\[0.5em] (x{A}) \otimes {B} = x({A} \otimes {B} )

and

A(B+C)=AB+AC,A(xB)=x(AB)\footnotesize {A} \otimes ({B} +{C} ) ={A} \otimes {B} +{A} \otimes {C}, \\[0.5em] {A} \otimes (x{B} )= x({A} \otimes {B} )

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

(Conjugate) transposition

The transposition of the Kronecker product coincides with the Kronecker products of transposed matrices:

(AB)T=ATBT.\footnotesize (A\otimes B)^{T}=A^{T}\otimes B^{T}.

The same is true for the conjugate transposition (i.e., adjoint matrices):

(AB)=AB.\footnotesize (A\otimes B)^{*}=A^{*}\otimes B^{*}.

Singular values and rank

💡 Don't worry if you're not yet familiar with the concept of singular values - feel free to skip this section or go to the singular values calculator.

If σ1,,σpA\sigma_1, \ldots, \sigma_{p_A} are non-zero singular values of AA and s1,,spBs_1, \ldots, s_{p_B} are non-zero singular values of BB, then the non-zero singular values of ABA \otimes B are σisj\sigma_{i}s_j with i=1,,pAi=1, \ldots, p_{A} and j=1,,pBj=1, \ldots, p_{B}.

Recall that the number of non-zero singular values of a matrix is equal to the rank of this matrix. In consequence, we obtain the rank formula:

rank(AB)=rank(A)rank(B)\footnotesize \operatorname{rank}(A \otimes B) = \operatorname{rank}(A) \cdot \operatorname{rank}(B)

Inverse of tensor product

For the rest of this section, we assume that AA and BB are square matrices of size mm and nn, respectively.

If AA and BB are both invertible, then ABA\otimes B is invertible as well and

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

Eigenvalues, trace, determinant

💡 Finding eigenvalues is yet another advanced topic. If you need a refresher, visit our eigenvalue and eigenvector calculator.

If α1,,αm\alpha_1, \ldots, \alpha_m and β1,,βn\beta_1, \ldots, \beta_n are the eigenvalues of AA and BB (listed with multiplicities) respectively, then the eigenvalues of ABA \otimes B are of the form
αiβj\alpha_{i}\beta_{j} with i=1,,mi=1,\ldots ,m and j=1,,nj=1,\ldots ,n.

Since the determinant corresponds to the product of eigenvalues and the trace to their sum, we have just derived the following relationships:

det(AB)=det(A)ndet(B)m\footnotesize \det(A \otimes B) = \det(A)^n \det (B)^m
trace(AB)=trace(A)trace(B)\footnotesize \operatorname{trace}(A \otimes B) = \operatorname{trace}(A) \operatorname{trace}(B)

FAQ

Is the Kronecker product associative?

Yes, the Kronecker matrix product is associative: (A ⊗ B) ⊗ C = A ⊗ (B ⊗ C) for all matrices A, B, C.

Is the Kronecker product commutative?

No, the Kronecker matrix product is not commutative: A ⊗ B ≠ B ⊗ A for some matrices A, B.

Is tensor product the same as Kronecker product?

The tensor product is a more general notion, but if we deal with finite-dimensional linear spaces, the matrix of the tensor product of two linear operators (with respect to the basis which is the tensor product of the initial bases) is given exactly by the Kronecker product of the matrices of these operators with respect to the initial bases.

How do I find the size of matrix tensor product?

To determine the size of tensor product of two matrices:

  1. Compute the product of the numbers of rows of the input matrices.
  2. Compute product of the numbers of columns of the input matrices.
  3. The output matrix will have as many rows as you got in Step 1, and as many columns as you got in Step 2.
  4. In particular, if you have matrices of the same size, the output matrix has its dimensions equal to the original dimensions squared.
Anna Szczepanek, PhD
Choose matrix sizes and enter the coeffients into the appropriate fields. Blanks are interpreted as zeros.
Matrix A
Number of rows
2
Number of columns
2
A=
a1a2
b1b2
a₁
a₂
b₁
b₂
Matrix B
Number of rows
2
Number of columns
2
B=
x1x2
y1y2
x₁
x₂
y₁
y₂
Tensor product
A ⊗ B
0000
|0000|
|0000|
0000
Check out 35 similar linear algebra calculators 🔢
Adjoint matrixCharacteristic polynomialCholesky decomposition… 32 more
People also viewed…

Area of obtuse triangle

The area of an obtuse triangle calculator contains the formulas to count the area of that type of triangle and does it automatically for you.

Car heat

The hot car calculator shows how fast a car's interior heats up during a summer day.

Flat vs. round Earth

Omni's not-flat Earth calculator helps you perform three experiments that prove the world is round.

Percentage change

The percentage change calculator determines the value difference and the percent change from the original value to the new value.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service