0
|
7867 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

# How to Construct Matrix Representation of a Tensor Product from submatrices

Posted 9 years ago
 For an online quantum mechanics course, I had to construct a matrix representation of the tensor product of two Pauli Spin Matrices. I did it as follows: In[1]:= p1 = PauliMatrix[1]; p2 = PauliMatrix[2]; In[2]:= Join[Join[p1[[1, 1]]*p2, p1[[1, 2]]*p2, 2], Join[p1[[2, 1]]*p2, p1[[2, 2]]*p2, 2]] Out[2]= {{0, 0, 0, -I}, {0, 0, I, 0}, {0, -I, 0, 0}, {I, 0, 0, 0}}  I got the right answer but don't like the method I used, as it would be difficult to generalize to large matrices. Any suggestions?
2 Replies
Sort By:
Posted 9 years ago
 This operation is called the kronecker product when applied to matrices. There is a function for it:http://reference.wolfram.com/language/ref/KroneckerProduct.html KroneckerProduct[p1, p2] Usually when you see this, you're actually doing a tensor product. ArrayFlatten@TensorProduct[p1, p2] {{0, 0, 0, -I}, {0, 0, I, 0}, {0, -I, 0, 0}, {I, 0, 0, 0}} But, if I hadn't known any of this before, here is how I might have written it: ArrayFlatten[placeholder*p2 /. placeholder -> p1] 
Posted 9 years ago
 Thanks. I've been using Mathematica since Version 2.2 but still only know part of its functionality.
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments