6.3. Coba and CobaArray

Coba            Component of an arbitrary expression
CobaArray        Array of component of an arbitrary expression

Heads for components

xCoba`  represents the concept of component of an arbitrary expression (a tensor, tensor product, covariant derivative, etc.) with the head Coba. Internally, Coba is treated as IndexList, but only allows bc-indices and is considered a tensor. It is output as a dotted box. This object has a more limited use than the function described above at user level, but it may be interesting for some sophisticated manipulations:

In[296]:=

Coba[{1, -cartesian}, {2, polar}, {1, -polar}]

Out[296]=

□_ (1 1)^( 2 )

In[297]:=

xTensorQ[Coba]

Out[297]=

True

The dotted box can stand for anything and there is no indication of which component of Coba goes to which slot of the expression in the box. However, the indices of Coba are sorted, so that Coba[{1,cartesian}, {1,polar}] ≠ Coba[{1,polar}, {1,cartesian}].  

In[298]:=

Coba[{1, -polar}, {2, -polar}]/.Coba→ T

Out[298]=

T_ (12)^  

In[299]:=

Coba[{2, -polar}, {1, -polar}]/.Coba→ T

Out[299]=

T_ (21)^  

In[300]:=

Coba[{1, -polar}, {2, -polar}]/.Coba→ Function[T[#2, #1]]

Out[300]=

T_ (21)^  

There is a special notation for that:

In[301]:=

Coba[{1, -polar}, {2, -polar}][T]

Out[301]=

T_ (12)^  

In[302]:=

Coba[{1, -polar}, {2, -polar}][T[#2, #1]]

Out[302]=

T_ (21)^  

In[303]:=

Coba[{1, -polar}, {2, -polar}][PD[#1] @ T[#2, #1] T[#1]]

Out[303]=

T_1^  ∂_1^ T_ (21)^  

The command CobaArray gives more flexibility and allows the user to generate all the components for given b-indices. An extended basis index notation is provided.

In[304]:=

CobaArray[{a, polar}]

Out[304]=

{□_ ^0, □_ ^1, □_ ^2}

In[305]:=

CobaArray[{a, polar}, {-A, -comp}]

Out[305]=

{{□_ ( -1)^0 , □_ ( 1)^0 }, {□_ ( -1)^1 , □_ ( 1)^1 }, {□_ ( -1)^2 , □_ ( 1)^2 }}

With component indices, CobaArray reduces to Coba,

In[306]:=

CobaArray[{1, polar}, {1, -comp}]

Out[306]=

□_ ( 1)^1

We can manually specify which components should be included as a third element in the {} of the basis index

In[307]:=

CobaArray[{a, polar, {1, 2}}]

Out[307]=

{□_ ^1, □_ ^2}

In[308]:=

CobaArray[{a, polar, {0, 0, 1, 1, 2, 2}}]

Out[308]=

{□_ ^0, □_ ^0, □_ ^1, □_ ^1, □_ ^2, □_ ^2}

We can get all the components of a tensor this way

In[309]:=

CobaArray[{a, polar}, {-b, -polar}, {-c, -polar}]

Out[309]=

In[310]:=

%/.Coba→ Function[PD[#1] @ T[#2, #3]]//MatrixForm

Out[310]//MatrixForm=


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