2
$\begingroup$

I'm calculating in a context where it's valuable to me to keep "column vectors" in the appropriate format for display. I.e., I would like it if I could figure out how to do something like

a = {{1},{0}};
TensorProduct[a,a]
Out: {{1}, {0}, {0}, {0}}

As is, what I obtain is {{{{1}, {0}}}, {{{0}, {0}}}} . Is there a nice way to get Mathematica to output an honest-to-goodness column vector that will be presented as such by MatrixForm as the result of tensoring two column vectors together? Or am I stuck with clumsily excising the extra braces semi-manually?

$\endgroup$
0

1 Answer 1

4
$\begingroup$
KroneckerProduct[a, a]

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

$\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.