# Output the tensor product of two matrix as a matrix

How do I output the matrix form like the RHS without the tensor product sign remaining $\otimes$?

I need it for display purpose where I can see easily what the form of the whole product matrix is.

• Why can't you post more than two image links? Anyway, you should post code, properly formatted in code blocks, rather than screenshots. Please edit your post and click on the grey question mark on the right-side of the toolbar for help with formatting. Finally, look up KroneckerProduct. TensorProduct is for symbolic manipulation, and you seem to want to actually make the matrices: that is implemented as KroneckerProduct in Mathematica. – march May 13 '16 at 5:42
• I have under 10 reputations so I cannot post more than two image links. – diff May 13 '16 at 5:46
• Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – user9660 May 13 '16 at 6:14
• – user9660 May 13 '16 at 6:14
• @march Yes. I need it for display purpose where I can see easily what the form of the whole product matrix is. – diff May 13 '16 at 6:16

Since you say that you still do not get the output you desire using KroneckerProduct, I am guessing that you should try restarting the kernel. In any case, this should also fit your needs:

mat1 = Array[m1, {2, 2}];
mat2 = Array[m2, {2, 2}];
KroneckerProduct[mat1, mat2] // MatrixForm


• Thanks. Do you use Array to create elements of matrix? Is {2,2} a two by two matrix? – diff May 15 '16 at 22:52
• @diff yes. But of course you can also do it like {{a,b},{c,d}} – Lukas May 16 '16 at 8:08

Perhaps

 X = IdentityMatrix[2]
Y = Array[y, {2, 2}]
TensorProduct[X, Y] // MatrixForm


$\left( \begin{array}{cc} \left( \begin{array}{cc} y(1,1) & y(1,2) \\ y(2,1) & y(2,2) \\ \end{array} \right) & \left( \begin{array}{cc} 0 & 0 \\ 0 & 0 \\ \end{array} \right) \\ \left( \begin{array}{cc} 0 & 0 \\ 0 & 0 \\ \end{array} \right) & \left( \begin{array}{cc} y(1,1) & y(1,2) \\ y(2,1) & y(2,2) \\ \end{array} \right) \\ \end{array} \right)$

• Thanks. But $Y$ here is an array. Is this the same as list, which is a matrix? – diff May 15 '16 at 22:51