2
$\begingroup$

I would like to calculate

$$(\mathbb{1} \otimes \mathbb{1} \otimes \sigma^+)(\mathbb{1} \otimes \mathbb{1} \otimes \sigma^-) = (\mathbb{1} \otimes \mathbb{1} \otimes \left( \begin{array} \\ 1 &0 \\ 0 &0\\ \end{array} \right) )$$

The code I have been using is

splus = {{0, 1}, {0, 0}};
sminus = Transpose[splus];
KroneckerProduct[IdentityMatrix[2], IdentityMatrix[2], splus].KroneckerProduct[IdentityMatrix[2], IdentityMatrix[2],  sminus]

However this does not give me a tensorproduct of the 3 tensors.

Edit I want that that the result is again in the compact format as the right-hand-side of the equation and not the expanded form in one large matrix. And i am also not able to rewrite the form of the left-hand-side, because i have a more complicated example where this is not easily possible.

Edit 2 This is the result i get from Soner's answer. What he writes is his output is the output i want, yet when i run his code i get this different output. Result of soners answers

$\endgroup$
1
  • $\begingroup$ From the first impression Your task is to conduct the .-product. Your identity contains plenty of unity matrices from 2x2-matrix space. I accept Your definition of the sigma+/- matrices and Dot is Your operation: [reference.wolfram.com/language/ref/Dot.html] $\endgroup$ Commented Mar 20, 2020 at 21:16

4 Answers 4

2
$\begingroup$

An easy way is to use build-in symbol CircleTimes. We define that dot product is distributed over tensor product:

ClearAll[CircleTimes];
CircleTimes /: (a1_\[CircleTimes] b1_ \[CircleTimes] c1_ ).(a2_ \[CircleTimes] b2_ \[CircleTimes] c2_ ) := a1.a2 \[CircleTimes] b1.b2 \[CircleTimes] c1.c2 ;

Now, if we define our elements as

id = IdentityMatrix[2];
splus = {{0, 1}, {0, 0}};
sminus = Transpose[splus];

we get what OP wants:

CircleTimes[id, id, splus].CircleTimes[id, id, sminus]
(* {{1, 0}, {0, 1}}\[CircleTimes]{{1, 0}, {0, 1}}\[CircleTimes]{{1, 0}, {0, 0}} *)
$\endgroup$
2
  • $\begingroup$ thanks. what you write as a comment is the output i want, yet when i run your code i get a different result. I made an edit to the orginal post to show you what output i get from your code, because i cannot post a picture to the comment section i think. $\endgroup$
    – Franzi
    Commented Mar 21, 2020 at 13:48
  • $\begingroup$ @Franzi I edited the reply, there was a typo: \[CircleTimes] between a2_ and b2_ were written as [CircleTimes]. $\endgroup$ Commented Mar 22, 2020 at 6:45
3
$\begingroup$

Use assumptions with TensorExpand[]:

Assuming[(id | sp) ∈ Matrices[{2, 2}], 
         TensorExpand[KroneckerProduct[id, id, sp].KroneckerProduct[id, id, Transpose[sp]]]]
   (* KroneckerProduct[MatrixPower[id, 2], MatrixPower[id, 2], sp.Transpose[sp, {2, 1}]] *)

% /. {MatrixPower[id, 2] -> id, sp -> {{0, 1}, {0, 0}}}
  (* KroneckerProduct[id, id, {{1, 0}, {0, 0}}] *)
$\endgroup$
3
$\begingroup$

It's a little unclear what you're asking for, but I think what you want is not easy to achieve in any system. First, let me note that KroneckerProduct is correctly computing what you want:

splus = {{0, 1}, {0, 0}};
sminus = Transpose[splus];
id = IdentityMatrix[2];
KroneckerProduct[id, id, splus].KroneckerProduct[id, id, sminus] == 
 KroneckerProduct[id, id, {{1, 0}, {0, 0}}]
(* True *)

Now, you make claim the output isn't what you want, but you want it to look like the RHS of your formula. So I guess you want the literal output TensorProduct[id, id, {{1,0},{0,0}}]. Well, this mixture of explicit and symbolic results its really hard to get to in any system, since it can't read your mind about which symbols to keep and which to expand out. Also, notice that id is not a symbolic representation of the identity matrix but rather an expliict matrix:

id (* aka IdentityMatrix[2] *)
(* {{1, 0}, {0, 1}} *)

If you want manipulate matrices symbolically, you should use the assumptions mechanism and TensorReduce or TensorExpand. In this case, TensorExpand gives us a useful representation of your LHS. For any two $2\times2$ matrices id2 and sp we have:

Assuming[
    {(id2 | sp) \[Element] Matrices[{2, 2}]}, 
    TensorExpand[KroneckerProduct[id2, id2, sp].KroneckerProduct[id2, id2, Transpose[sp]]]
]
(* KroneckerProduct[MatrixPower[id2, 2], MatrixPower[id2, 2], sp.Transpose[sp, {2, 1}]] *)

(The Transpose[sp,{2,1}] is just an explicit form of Transpose, saying you are transposing the first two levels of the array. Obviously, for a matrix those are the only levels.) Since we know that id2 squares to itself and that sp . Transpose[sp] == {{1,0},{0,0}}, we can substitute those in:

% /. { MatrixPower[id2, 2] -> id2, sp.Transpose[sp, {2, 1}] -> {{1, 0}, {0, 0}}}
(* KroneckerProduct[id2, id2, {{1, 0}, {0, 0}}]*)

So getting the answer is semi-automatic, which is typically necessary for mixed symbolic/explicit results. I hope this helps.

$\endgroup$
1
$\begingroup$

You need to massage the ordering of the indices to make this calculation work. In general, if we have six $2\times2$ matrices

a = RandomInteger[{-10, 10}, {2, 2}];
b = RandomInteger[{-10, 10}, {2, 2}];
c = RandomInteger[{-10, 10}, {2, 2}];
d = RandomInteger[{-10, 10}, {2, 2}];
e = RandomInteger[{-10, 10}, {2, 2}];
f = RandomInteger[{-10, 10}, {2, 2}];

you can tensor-multiply them in two ways to get to your result:

(1) dot-products component-wise:

X = TensorProduct[a.d, b.e, c.f];

(2) tensor products and tensor contractions:

abc = TensorProduct[a, b, c];
def = TensorProduct[d, e, f];
X == Transpose[TensorContract[TensorProduct[abc, def],
                              {{2, 7}, {4, 9}, {6, 11}}],
               {1, 3, 5, 2, 4, 6}]
(*    True    *)

For your specific case,

a = IdentityMatrix[2];
b = IdentityMatrix[2];
c = splus = {{0, 1}, {0, 0}};
d = IdentityMatrix[2];
e = IdentityMatrix[2];
f = sminus = Transpose[splus];
$\endgroup$
1
  • 2
    $\begingroup$ thank you. i made an edit to my post (1) does not work, because i have more complicated terms, where this is not easily possible, so i need to work in the form as it is. (2) does not work, because i do not want a single matrix, but a compact description like the right-hand-side of the equation in my original post. $\endgroup$
    – Franzi
    Commented Mar 20, 2020 at 23:10

Your Answer

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

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