2.2. ContractBasis
ContractBasis is responsible for all contractions of Basis with any other object.
ContractBasis[expr, indices] Perform the contractions of Basis objects involving the specified dummy indices
Contraction of Basis objects with tensors.
We have complete control over which dummy indices should be eliminated. We can select them in several ways, all of which are eventually converted into a list of indices with head IndexList:
- IndexList[...],
be careful not to use the normal Mathematica List, which could be mistaken for a BCIndex. IndicesOf[selectors] as a second argument is treated as IndicesOf[selectors][expr] and gives great flexibility, but it is sometimes too long for simple cases. To handle them, several shorthands are defined:
- ContractBasis[expr,basis] = ContractBasis[expr,IndicesOf[basis]],
- ContractBasis[expr,vbundle] = ContractBasis[expr,IndicesOf[vbundle]],
- ContractBasis[expr,tensor] = ContractBasis[expr,IndicesOf[tensor]],
- ContractBasis[expr,index] = ContractBasis[expr,IndexList[index]] .
It is important to keep in mind that the second argument gives the list of indices to be contracted, not their pairs in the Basis object.
All of this is best illustrated through some examples:
In[139]:=
Out[139]=
In[140]:=
Out[140]=
The function called with just one argument performs all the possible contractions.
In[141]:=
Out[141]=
If we choose to give the indices directly, we can specifiy either element of the pair
In[142]:=
Out[142]//TableForm=
![]() |
![]() |
![]() |
![]() |
Nothing happens if we give an invalid index
In[143]:=
Out[143]=
More simple examples
In[144]:=
Out[144]=
In[145]:=
Out[145]=
In[146]:=
Out[146]=
In[147]:=
Out[147]=
In[148]:=
Out[148]=
In[149]:=
Out[149]=
Notice how only the index {-e, -polar} has been supressed. Nothing has been done to a, even though its pair in the Basis object belongs to polar. If we want to act on that index, we can use
In[150]:=
Out[150]=
to contract everything that appears in a Basis object that has at least one polar index. Or
In[151]:=
Out[151]=
to contract only abstract indices whose pair in Basis belongs to polar. Notice that some specifications can be redundant; IndicesOf[Basis, x] is equivalent to IndicesOf[x], because all the indices that can be contracted by this function already have to appear in Basis.
Contraction of Basis objects can be performed with ContractBasis, or automatized:
In[152]:=
Out[152]=
In[153]:=
Out[153]=
In[154]:=
In[155]:=
Out[155]=
In[156]:=
The default behaviour of ContractBasis disregards contractions involving derivatives. We must use the option OverDerivatives:
In[157]:=
In[158]:=
Out[158]=
In[159]:=
Out[159]=
In[160]:=
Out[160]=
A new Christoffel tensor is automatically defined. We shall see more about the interplay between bases and derivatives in Section 5. Any type of derivate exhibits the same behaviour,
In[161]:=
Out[161]=
In[162]:=
Out[162]//TableForm=
![]() |
![]() |
In[163]:=
Out[163]=
In[164]:=
Out[164]//TableForm=
![]() |
![]() |
In[165]:=
In[168]:=
The input expression is automatically expanded (with Expand) before applying ContractBasis. It would be better, in principle, to contract the bases only locally, but this is not yet implemented.
At the moment, the user cannot specify in which order the indices should be contracted. An option ContractFirst is planned but not yet coded.
Created by Mathematica (May 16, 2008) | ![]() |