Lukas' Notes

linear-algebra

Definition

Tensor Product

Let be an -matrix and a -matrix. Then the tensor product is the -matrix obtained by replacing each entry of with the block .

Equivalently, the entries of are given by

for , , , and .

Properties

\begin{alignat*}{3} \text{I.}\qquad &\lambda (v \otimes w) &=\;& (\lambda v) \otimes w &=\;& v \otimes (\lambda w) \qquad &\lambda \in \mathbb{C} \\ \text{II.}\qquad & (v + v') \otimes w &=\;& v \otimes w + v' \otimes w \\ \text{III.}\qquad & v \otimes (w + w') &=\;& v \otimes w + v \otimes w' \end{alignat*}

Einsum

Einsum notation can express the tensor product by keeping both pairs of indices separate:

In code, this is similar to

einsum('ij,kl->ikjl', A, B)

The result can then be reshaped into the usual matrix form of the tensor product.

Example

Example

For

the tensor product is