# How to make a tensor product into matrix?

TensorProduct[PauliMatrix[1], DiagonalMatrix[{1, 1}]] // TableForm


created a tensor, which could be flatten to table form. However, how to make the tensor into a matrix?

• ArrayFlatten[TensorProduct[PauliMatrix[1], DiagonalMatrix[{1, 1}]]]. – Henrik Schumacher Dec 10 '19 at 7:51
• @HenrikSchumacher Thank! So I need to use ArrayFlatten directly? Why doesn't it work for TableForm? – ShoutOutAndCalculate Dec 10 '19 at 7:53
• TableForm like all other commands ending on Form such MatrixForm are just for displaying purposes. Do not use them in computations. – Henrik Schumacher Dec 10 '19 at 7:58

KroneckerProduct[PauliMatrix[1], IdentityMatrix[2]]

$$\left( \begin{array}{cccc} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ \end{array} \right)$$