3
$\begingroup$

"If $A$ is an $m \times n$ matrix and $B$ is a $p \times q$ matrix, then the Kronecker product $A \otimes B$ is the $mp \times nq$ block matrix..."

Thus the Kronecker product of two vectors, i.e. $3\times 1$ matrices, should be a $9\times 1$ matrix, i.e. another vector. Nevertheless, Mathematica gives me a $3 \times 3$ matrix instead. Why is this the case and how can I change this?

$\endgroup$
2
  • $\begingroup$ A 3-by-3 matrix is a 9-by-1 matrix, for most intents and purposes. $\endgroup$
    – march
    Oct 7, 2015 at 15:50
  • 1
    $\begingroup$ Anyway, Mathematica has to make some assumptions, and (look at the documentation for Dot), it sometimes treats a 3-by-1 vector as a 1-by-3 matrix instead. Try KroneckerProduct[{d, e, f}, {{a}, {b}, {c}}]. $\endgroup$
    – march
    Oct 7, 2015 at 15:56

1 Answer 1

6
$\begingroup$

I'm not quite sure how you obtained a $9\times 9$ matrix. Here is a workaround, in any event:

KroneckerProduct[List /@ {a, b, c}, List /@ {p, q, r}] // Flatten
   {a p, a q, a r, b p, b q, b r, c p, c q, c r}
$\endgroup$

Your Answer

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

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