2.3. SeparateBasis
SeparateBasis[basis][expr, indices] Expand the selected indices of a given expression in the specified basis
Expansion of an expression in a given basis.
SeparateBasis works in a similar way to ContractBasis, but now we have two brackets. In the second one we can specify which indices should be `separated' from their original tensor. In the first one we say what should remain in their place (either AIndex or a basis).
In[169]:=
Out[169]=
In[170]:=
Out[170]=
In[171]:=
Out[171]=
In[172]:=
Out[172]=
But we may also want to perform a change of basis. This is done as follows
In[173]:=
Out[173]=
In[174]:=
Out[174]=
Now all tensor indices belong to the specified basis.
We have the same syntax as in ContractBasis for the second argument
In[175]:=
In[176]:=
Out[176]=
In[177]:=
Out[177]=
In[178]:=
Out[178]=
When separating component indices, the function selects only those with valid coordinate numbers,
In[179]:=
Out[179]=
We must be careful when working with scalar functions of scalars, lest we get meaningless outputs, such as powers of tensor products :
In[180]:=
Out[180]=
In[181]:=
Out[181]=
In[182]:=
Out[182]=
The safe way to manipulate such expressions is via the Scalar head,
In[183]:=
Out[183]=
In[184]:=
Out[184]=
In[185]:=
Out[185]=
If a component index is repeated, we may need to apply SeparateBasis several times
In[186]:=
Out[186]=
In[187]:=
Out[187]=
It works, but if we specify the index,
In[188]:=
Out[188]=
{1, -polar} appears twice in the same tensor, so we need to reapply SeparateBasis (or pass it twice to the function)
In[189]:=
Out[189]=
In[190]:=
Out[190]=
Created by Mathematica (May 16, 2008) | ![]() |