Tensor Product Calculator
Enter two matrices below to compute their tensor product (also called the Kronecker product, written A x B). The result is displayed as a formatted matrix together with its dimensions, Frobenius norm, and estimated rank. The steps panel walks through the block-by-block expansion so you can check every entry by hand. Both matrices can be any size: enter each row on its own line, separating values with spaces or commas.
Formula
Worked example
For A = [[1,2],[3,4]] and B = [[0,5],[6,7]], A x B is a 4x4 matrix. Block (1,1): 1*B = [[0,5],[6,7]]. Block (1,2): 2*B = [[0,10],[12,14]]. Block (2,1): 3*B = [[0,15],[18,21]]. Block (2,2): 4*B = [[0,20],[24,28]]. Assembled: top half [[0,5,0,10],[6,7,12,14]], bottom half [[0,15,0,20],[18,21,24,28]].
What is the tensor product of two matrices?
The tensor product of two matrices A and B, written A x B and also called the Kronecker product, is a structured block matrix. If A is r_A x c_A and B is r_B x c_B, then A x B is an (r_A * r_B) x (c_A * c_B) matrix formed by replacing every entry a_ij of A with the scaled block a_ij * B. This operation appears constantly in quantum computing (combining qubit state spaces), signal processing (separable filters), and machine learning (building structured covariance matrices). Unlike ordinary matrix multiplication, it always produces a result regardless of whether the inner dimensions match, and it grows the matrix rather than reducing it.
How to use this calculator
Enter matrix A in the first text box, one row per line, with values separated by spaces or commas. Enter matrix B the same way. The calculator parses both inputs, runs the Kronecker product, and instantly shows the full result matrix, the dimensions, the Frobenius norm, and the estimated rank. The steps panel expands each a_ij * B block so you can trace every entry. Fractions are not supported directly, but decimals to any precision are fine. Rows must all have the same number of values, and both matrices must contain only real numbers.
Step-by-step: block-by-block expansion
The most reliable way to compute a Kronecker product by hand is to work block by block. Write A as a grid of scalars. Replace each scalar a_ij with the matrix a_ij * B. Then assemble those blocks into a single large matrix by placing the (i,j) block at row position (i-1)*r_B and column position (j-1)*c_B. For a 2x2 A and 2x2 B this gives four 2x2 blocks arranged in a 2x2 pattern, producing a 4x4 result. This calculator's steps panel automates that process and shows up to four blocks so you can follow along for smaller matrices.
Applications: quantum computing and beyond
In quantum mechanics, the state space of a composite system is the tensor product of the component state spaces, so combining two single-qubit states (each in C^2) gives a two-qubit state in C^4. In numerical methods, Kronecker products build structured matrices for solving partial differential equations on rectangular grids via the mixed-product rule (A x B)(C x D) = AC x BD, which allows large systems to be solved more efficiently. In graph theory, the Kronecker product of two adjacency matrices produces the adjacency matrix of a tensor graph product. Each field benefits from the same underlying algebra, which is why this tool matters across so many disciplines.
Key properties of the Kronecker product
| Property | Formula | When it holds |
|---|---|---|
| Bilinearity (scalar) | (cA) x B = c(A x B) | Always |
| Bilinearity (addition) | (A+B) x C = A x C + B x C | A, B same size |
| Associativity | A x (B x C) = (A x B) x C | Always |
| Mixed product rule | (A x B)(C x D) = AC x BD | AC and BD defined |
| Transpose | (A x B)^T = A^T x B^T | Always |
| Inverse | (A x B)^-1 = A^-1 x B^-1 | A and B invertible |
| Rank | rank(A x B) = rank(A) * rank(B) | Always |
| Trace | tr(A x B) = tr(A) * tr(B) | A and B square |
| Determinant | det(A x B) = det(A)^n * det(B)^m | A: m x m, B: n x n |
| Non-commutativity | A x B != B x A in general | Commutes only in special cases |
A and B are matrices of compatible dimensions; scalars c, d.
Frequently asked questions
Is the tensor product the same as the Kronecker product?
Yes, for matrices these two terms refer to the same operation. The Kronecker product is the concrete, coordinate-based realisation of the abstract tensor product for finite-dimensional vector spaces. The notation A x B or A (x) B is used interchangeably in most textbooks and software.
What are the dimensions of A x B?
If A is r x c and B is p x q, then A x B is (r*p) x (c*q). For example, a 3x2 matrix tensored with a 4x5 matrix gives a 12x10 result. Dimensions multiply independently for rows and columns, so the result can become large quickly.
Is the Kronecker product commutative?
No. In general, A x B and B x A are different matrices. They are always the same size when A and B are both square (because r*p = p*r), but their entries differ unless A or B is a scalar multiple of the identity. There is a permutation matrix P such that B x A = P (A x B) P^T, which is called the commutation matrix relation, but A x B and B x A are not equal.
Is the Kronecker product associative?
Yes. (A x B) x C = A x (B x C) always holds. This means you can tensor-multiply a chain of matrices in any bracketing and get the same result, which is essential in quantum computing when combining three or more qubit systems.
How do I compute the Kronecker product by hand?
Replace each entry a_ij in A with the block a_ij * B, then lay those blocks side by side to form one large matrix. For a 2x2 A and 2x2 B: top-left block = a_11 * B, top-right = a_12 * B, bottom-left = a_21 * B, bottom-right = a_22 * B. Stack the top two blocks horizontally and the bottom two horizontally, then vertically combine the two halves.
What does the Frobenius norm of the result tell me?
The Frobenius norm is the square root of the sum of the squares of all matrix entries. For the Kronecker product it equals the product of the Frobenius norms of A and B: ||A x B||_F = ||A||_F * ||B||_F. It gives a single number measuring the overall magnitude of the result, useful for checking numerical stability and comparing products.
What is the rank of A x B?
The rank of A x B equals rank(A) * rank(B). If either matrix has a zero entry pattern that drops its rank below full rank, the product will also be rank-deficient. This is why combining two invertible matrices always produces an invertible Kronecker product.