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]:=

expr = TT[{1, -polar}, -b, {2, cartesian}, c, -a] Basis[{1, -polar}, a] + Basis[a, {1, -polar}] Basis[-d, {2, cartesian}] U[-a, -b, d, {e, polar}] Basis[{-e, -polar}, c]

Out[169]=

e_ ( 1)^a  TT_ (1b  a)^(  2c ) + e_ ( 1)^a  e_ ( e)^c  e_d ^( 2) U_ab  ^(  de)

In[170]:=

cexpr = ContractBasis[expr]

Out[170]=

TT_ (1b  1)^(  2c ) + U_ (1b  )^(  2c)

In[171]:=

SeparateBasis[AIndex][cexpr]//ScreenDollarIndices

Out[171]=

e_ ( 1)^a  e_d ^( 2) e_ ( 1)^e  TT_ (ab  e)^(  dc ) + e_ ( 1)^a  e_d ^( 2) U_ab  ^(  dc)

In[172]:=

Simplify[%]

Out[172]=

e_ ( 1)^a  e_d ^( 2) (e_ ( 1)^e  TT_ (ab  e)^(  dc ) + U_ab  ^(  dc))

But we may also want to perform a change of basis. This is done as follows

In[173]:=

SeparateBasis[cartesian][cexpr]//ScreenDollarIndices

Out[173]=

In[174]:=

Simplify[%]

Out[174]=

e_b ^( d) e_ ( f)^c  e_1 ^( a) e_ ( e)^2  (e_1  ^( f1) TT_ (ad  f1)^(  ef  ) + U_ (ad  )^(  ef))

Now all tensor indices belong to the specified basis.

We have the same syntax as in ContractBasis for the second argument

In[175]:=

$PrePrint = ScreenDollarIndices ;

In[176]:=

SeparateBasis[AIndex][cexpr, {4, cartesian}]

Out[176]=

TT_ (1b  1)^(  2c ) + U_ (1b  )^(  2c)

In[177]:=

SeparateBasis[AIndex][cexpr, IndicesOf[polar]]

Out[177]=

e_ ( 1)^a  e_ ( 1)^d  TT_ (ab  d)^(  2c ) + e_ ( 1)^a  U_ab  ^(  2c)

In[178]:=

SeparateBasis[AIndex][cexpr, IndicesOf[CIndex]]

Out[178]=

e_ ( 1)^a  e_d ^( 2) e_ ( 1)^e  TT_ (ab  e)^(  dc ) + e_ ( 1)^a  e_d ^( 2) U_ab  ^(  dc)

When separating component indices, the function selects only those with valid coordinate numbers,

In[179]:=

v[{1, polar}] v[{2, polar}] v[{7, polar}]//SeparateBasis[AIndex]

Out[179]=

e_a ^( 1) e_b ^( 2) v_ ^a v_ ^b v_ ^7

We must be careful when working with scalar functions of scalars, lest we get meaningless outputs, such as powers of tensor products :

In[180]:=

v[{1, polar}]//SeparateBasis[AIndex]

Out[180]=

e_a ^( 1) v_ ^a

In[181]:=

v[{1, polar}] v[{1, polar}]//SeparateBasis[AIndex]

Out[181]=

v_ ^1^2

In[182]:=

%% ^2

Out[182]=

e_f$1109 ^(      1)^2 v_      ^f$1109^2

The safe way to manipulate such expressions is via the Scalar head,

In[183]:=

Scalar[v[{1, polar}]] Scalar[v[{1, polar}]]

Out[183]=

Scalar[v_ ^1]^2

In[184]:=

%//SeparateBasis[cartesian]

Out[184]=

Scalar[v_ ^1]^2

In[185]:=

%/.Scalar[scalar_] :→ Scalar[SeparateBasis[cartesian][scalar]]

Out[185]=

Scalar[e_ ( a)^1  v_ ^a]^2

If a component index is repeated, we may need to apply SeparateBasis several times

In[186]:=

expr4 = T[{1, -polar}, {1, -polar}]

Out[186]=

T_ (11)^  

In[187]:=

%//SeparateBasis[AIndex]

Out[187]=

e_ ( 1)^a  e_ ( 1)^b  T_ab^  

It works, but if we specify the index,

In[188]:=

SeparateBasis[AIndex][expr4, {1, -polar}]

Out[188]=

e_ ( 1)^a  T_ (a1)^  

{1, -polar} appears twice in the same tensor, so we need to reapply SeparateBasis (or pass it twice to the function)

In[189]:=

SeparateBasis[AIndex][%, {1, -polar}]

Out[189]=

e_ ( 1)^a  e_ ( 1)^b  T_ab^  

In[190]:=

SeparateBasis[AIndex][expr4, IndexList[{1, -polar}, {1, -polar}]]

Out[190]=

e_ ( 1)^a  e_ ( 1)^b  T_ab^  


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!