Advanced maths

Kronecker product and sum calculator for matrices

Construct an exact rational Kronecker product or compatible Kronecker sum, with block indexing and a stated column-vectorization convention.

Your numbers

Rectangular rational matrix up to 4×4; sum mode requires a square matrix.
Rectangular rational matrix up to 4×4; sum mode requires a square matrix.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A Kronecker product expands each entry of the first matrix into a scaled copy of the second matrix. It keeps both pairs of indices instead of summing over a shared index as ordinary multiplication does. Rectangular inputs are valid, and the output dimensions multiply. The same page provides a Kronecker sum for square inputs with its identity-factor convention stated explicitly. Exact rational arithmetic preserves fractions and signs, while the table labels every output row and column so the block construction can be checked directly.

THE FORMULA(A⊗B)_(i·p+k,j·q+l)=AᵢⱼBₖₗ; A⊕B=A⊗Iₚ+Iₘ⊗B for square Aₘ,Bₚ.

A worked example

For A=((1,2),(3,4)) and B=((0,5),(6,7)), the upper-left block of A⊗B is B and the upper-right block is 2B. The first output row is (0,5,0,10), and the second is (6,7,12,14). The lower blocks are 3B and 4B, giving a 4×4 result. Sum mode on the same 2×2 inputs also produces 4×4, but it adds A⊗I2 to I2⊗B rather than multiplying entry pairs across the full block pattern.

Good to know

Two rational matrices, each with one through four rows and columns. Product mode permits rectangular shapes; sum mode requires both inputs square. Output can be 16×16 and may require horizontal table scrolling on small screens. Exact coefficient and fraction-growth bounds apply. The product and sum use the displayed factor order. No implicit row-stacking convention, ordinary matrix product, tensor contraction or entrywise product is substituted.

Block positions preserve the order of both index pairs

If A is m×n and B is p×q, then A⊗B is mp×nq. Rows within each p-row block follow B, and blocks follow the rows of A. Columns obey the analogous q-column convention. An entry with a zero coefficient creates a full zero block, while a negative coefficient reverses signs throughout its block. These dimension and indexing rules apply even when ordinary AB is not defined.

Swapping A and B usually changes the displayed matrix, although appropriate row and column permutations connect the two products. Matrix equality and permutation equivalence are different claims. A simple comparison of spectra or dimensions cannot establish that two block arrays use the same indexing. The displayed zero-based index formula specifies exactly where each coefficient pair lands, so software using another tensor flattening order can be reconciled deliberately.

Each entry of A selects an entire scaled B blockB2B3B4BFirst output row: 0, 5, 0, 10
For A=((1,2),(3,4)), the Kronecker product A⊗B has blocks B,2B in the first block row and 3B,4B in the second. With B of size 2×2, the output has four rows and four columns; the first row for B=((0,5),(6,7)) is 0,5,0,10.

A Kronecker sum is tied to its identity sizes and vectorization convention

With square A of order m and B of order p, the chosen sum is A⊗Ip+Im⊗B. Both terms have order mp and can be added entrywise. Replacing an identity by the wrong order either makes dimensions incompatible or constructs another operator. The sum is useful for independent coordinate actions, but it is not the ordinary matrix sum A+B, which would require equal input shapes and remain at their original order.

For column-stacked vec(X), the identity vec(AXBᵀ)=(B⊗A)vec(X) places B first. A row-stacked convention changes that order, so a formula copied without its stacking rule can silently permute coordinates. This page states column stacking explicitly. The Matrix multiplication calculator contracts the shared inner dimension; the present construction instead expands the operator space. It should therefore be used for block tensor structure rather than as another interface to ordinary multiplication.

A few questions, answered

Do A and B need compatible multiplication dimensions?

No for a Kronecker product. Any supported rectangular pair works. Only the separate sum mode requires each input to be square.

Is A⊗B always equal to B⊗A?

No. They generally differ in entry ordering and sometimes shape. Permutation relationships do not make the arrays equal under the stated index convention.

Find your calculator

Start typing to explore the library.