Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Simplify expressions containing a symbolic identity tensor
ResourceFunction["IdentityTensorReduce"][expr] converts TensorContract expressions containing symbolic identity tensors into equivalent forms with the identity tensors removed. |
A simple tensor contraction of a tensor with an identity matrix:
In[1]:= |
Out[1]= |
TensorReduce does not simplify the tensor:
In[2]:= |
Out[2]= |
IdentityTensorReduce simplifies the tensor:
In[3]:= |
Out[3]= |
Use Inactive when the dimensions of the identity tensor are explicit:
In[4]:= |
Out[4]= |
IdentityTensorReduce simplifies the tensor:
In[5]:= |
Out[5]= |
Define assumptions for a matrix X and scalars a, b and c:
In[6]:= |
A tensor expression involving the identity tensor:
In[7]:= |
Out[7]= |
Contract this tensor with another tensor:
In[8]:= |
Out[8]= |
Expand the tensor into a sum of tensors:
In[9]:= |
Out[9]= |
Use IdentityTensorReduce to eliminate contracted identity tensors:
In[10]:= |
Out[10]= |
The ResourceFunction "FromTensor" can be used to rewrite this expression in terms of Dot:
In[11]:= |
Out[11]= |
This work is licensed under a Creative Commons Attribution 4.0 International License