1
$\begingroup$
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?

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

1 Answer 1

3
$\begingroup$
KroneckerProduct[PauliMatrix[1], IdentityMatrix[2]]
MatrixForm@%

{{0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, 1, 0, 0}}

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.