1
$\begingroup$

I have a problem, I want to compute kronecker product as given below;

rho1 = MatrixForm[KroneckerProduct[{{1}, {0}}, {{1, 0}}]]; 
rho2 = MatrixForm[KroneckerProduct[{{1}, {0}}, {{1, 0}}]]; 
rho3 = MatrixForm[KroneckerProduct[{{1}, {0}}, {{1, 0}}]]; 
rho = MatrixForm[KroneckerProduct[rho1, rho2, rho3]]

and I get

MatrixForm[KroneckerProduct[MatrixForm[{{1, 0}, {0, 0}}], 
MatrixForm[{{1, 0}, {0, 0}}], MatrixForm[{{1, 0}, {0, 0}}]]]

Why the ouput not evaluate the kroneckerproduct and become a single matrix

$\endgroup$
  • 2
    $\begingroup$ MatrixForm is something used for printing. Never use it in calculations, or define variables with it. $\endgroup$ – Marius Ladegård Meyer Jun 21 '16 at 8:16
  • $\begingroup$ what @MariusLadegårdMeyer is saying , rho1 = KroneckerProduct[{{1}, {0}}, {{1, 0}}] and likewise. After you evaluate rho, use MatrixForm[rho] to see how it looks. $\endgroup$ – Sumit Jun 21 '16 at 8:20
  • $\begingroup$ ok. thanks. I try it and get the result. thank you again for helping me $\endgroup$ – munirah Jun 21 '16 at 8:23
0
$\begingroup$

If you do want MatrixForm, then do it in this way.

(rho1 = KroneckerProduct[{{1}, {0}}, {{1, 0}}]) // MatrixForm
(rho2 = KroneckerProduct[{{1}, {0}}, {{1, 0}}]) // MatrixForm
(rho3 = KroneckerProduct[{{1}, {0}}, {{1, 0}}]) // MatrixForm
(rho = KroneckerProduct[rho1, rho2, rho3]) // MatrixForm

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you for suggestion coding. I will used it. $\endgroup$ – munirah Jun 21 '16 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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