Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Display symbolic tensor expressions as a diagram
ResourceFunction["TensorDiagram"][expr] gives a graphical representation of a symbolic tensor expression. |
Display a rank-3 tensor diagram with indices shown as graph edges:
In[1]:= | ![]() |
Out[1]= | ![]() |
Given tensors of various rank:
In[2]:= | ![]() |
Display them:
In[3]:= | ![]() |
Out[3]= | ![]() |
Contract two indices of a 3-rank tensor:
In[4]:= | ![]() |
Out[4]= | ![]() |
Tensor product:
In[5]:= | ![]() |
Out[5]= | ![]() |
Contract tensors:
In[6]:= | ![]() |
Out[6]= | ![]() |
Contract multiple indices:
In[7]:= | ![]() |
Out[7]= | ![]() |
Numeric matrix:
In[8]:= | ![]() |
Out[8]= | ![]() |
Numeric rank-4 tensor:
In[9]:= | ![]() |
Out[9]= | ![]() |
Contraction of a numeric matrix:
In[10]:= | ![]() |
Out[10]= | ![]() |
Multiply 10 matrices:
In[11]:= | ![]() |
Out[11]= | ![]() |
Make a ladder, contracting 3-rank tensors in series:
In[12]:= | ![]() |
Out[12]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License