Tensor Product Calculator
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:
- with rows and columns, and
- with rows and columns.
The resulting matrix then has rows and 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:
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:
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
As we saw above, we have:
Writing the terms of explicitly, we obtain:
Performing the number-by-matrix multiplication, we arrive at the final result:
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 of the Kronecker product as:
where is the ceiling function (i.e., it's the smallest integer that is greater than ) and denotes the modulo operation. Recall also that and stand for the number of rows and columns of , 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 or . Enjoy!
Properties of the Kronecker product
Associativity
Tensor matrix product is associative, i.e., for every we have
Bilinearity
Tensor matrix product is also bilinear, i.e., it is linear in each argument separately:
and
where are matrices and is a scalar.
(Conjugate) transposition
The transposition of the Kronecker product coincides with the Kronecker products of transposed matrices:
The same is true for the conjugate transposition (i.e., adjoint matrices):
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 are non-zero singular values of and are non-zero singular values of , then the non-zero singular values of are with and .
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:
Inverse of tensor product
For the rest of this section, we assume that and are square matrices of size and , respectively.
If and are both invertible, then is invertible as well and
Eigenvalues, trace, determinant
💡 Finding eigenvalues is yet another advanced topic. If you need a refresher, visit our eigenvalue and eigenvector calculator.
If and are the eigenvalues of and (listed with multiplicities) respectively, then the eigenvalues of are of the form
with and .
Since the determinant corresponds to the product of eigenvalues and the trace to their sum, we have just derived the following relationships:
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:
- Compute the product of the numbers of rows of the input matrices.
- Compute product of the numbers of columns of the input matrices.
- The output matrix will have as many rows as you got in Step 1, and as many columns as you got in Step 2.
- In particular, if you have matrices of the same size, the output matrix has its dimensions equal to the original dimensions squared.
A | = |
|
B | = |
|
⌈ | 0 | 0 | 0 | 0 | ⌉ |
| | 0 | 0 | 0 | 0 | | |
| | 0 | 0 | 0 | 0 | | |
⌊ | 0 | 0 | 0 | 0 | ⌋ |