Group Abstract Group Abstract

Message Boards Message Boards

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

Contract a Rank Two Tensor with one Indice of another Rank Two Tensor

Posted 6 years ago
POSTED BY: Hollis Williams
2 Replies
Posted 6 years ago

An alternative could be to use TensorProduct and TensorContract:

mA = {{a11, a12}, {a21, a22}};
mB = {{b11, b12}, {b21, b22}};

In[3]:= TensorContract[TensorProduct[mA, mB], {1, 3}]
Out[3]= {{a11 b11 + a21 b21, a11 b12 + a21 b22}, {a12 b11 + a22 b21, a12 b12 + a22 b22}}

Same result as with Sam's method:

In[4]:= Transpose[mA].mB
Out[4]= {{a11 b11 + a21 b21, a11 b12 + a21 b22}, {a12 b11 + a22 b21, a12 b12 + a22 b22}}
POSTED BY: Hans Milton
Posted 6 years ago
POSTED BY: Sam M
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard