Further Examples
Load xTensor`:
In[1]:=
Define a manifold (and its associated tangent bundle) and a tensor:
In[2]:=
In[3]:=
The basic operation of tracing is as follows, replacing a dummy pair by different possibilities, adding up the results:
In[4]:=
Out[4]=
Several indices can be splitted at the same time:
In[5]:=
Out[5]=
If a dummy is not present then it is not traced:
In[6]:=
Out[6]=
It is possible to use more powerful rules, with patterns on the LHS and delayed index generation on the RHS:
In[7]:=
Out[7]=
The function TraceDummy is rather efficient. This is an example tracing 6 dummy pairs in 6 dimensions (final expression with 6^6=46656 components):
In[8]:=
Out[8]=
Verbose log message can be turned on:
In[9]:=
Out[9]=
It is possible to mark the expanded terms using a third argument:
In[10]:=
Out[10]=
In[11]:=
Out[11]=
Tidy up:
In[12]:=
In[13]:=
Created by Mathematica (May 16, 2008) |