1.2. Basis objects and basis indices

Now that we have bases, we can use basis vectors and work with tensor componentes.  Two new kinds of indices are needed:
     {a, basisname} :  Basis index (BIndex),  a is an abstract index.
     {i, basisname} :  Component index (CIndex), i is a valid coordinate number.
When we define a basis in the tangent bundle, its dual in the cotangent bundle is also automatically defined. This dual basis is called -basisname and has the same cnumbers as the original. The notation for covariant bc-indices is
    {-a, -basisname} :  Basis index (BIndex),  a is an abstract index.
    {i,  -basisname} :  Component index (CIndex), i is a valid coordinate number.
Notice how a covariant b-index is -1 * (corresponding contravariant index), but this is not true for c-indices. This apparent inconsistency is a conscious choice: it allows us to use zero and negative cnumbers (the latter being common in treatments of angular momentum, tensor harmonics, etc.)

NOTE: In versions 0.3 and 0.4 we used b-indices like {a, polar}, {-a, polar} and c-indices like {1, polar} and {-1, polar}. This notational change is not backwards compatible. We apologize to those users of xCoba` who now need to change lots of signs in previously developed notebooks, but we feel that the use of this new notation will pay off.

Several functions are provided to check the validity.

In[63]:=

IndicesOfVBundle[TangentM3]

Out[63]=

{{a, b, c, d, e, f}, {f1, f2, f3}}

In[64]:=

indexlist = { {a, polar},    {-a, -cartesian}, {w, polar}, {A, polar} , {1, polar},    a ,    {1, -cartesian}, {a, spherical}, {5, polar}, {-1, -polar}} ;

In[65]:=

$Bases

Out[65]=

{polar, cartesian}

In[66]:=

BIndexQ/@ indexlist

Out[66]=

{True, True, False, False, False, False, False, False, False, False}

In[67]:=

CIndexQ /@ indexlist

Out[67]=

{False, False, False, False, True, False, True, False, False, False}

An extra function selects both basis and component indices,

In[68]:=

BCIndexQ /@ indexlist

Out[68]=

{True, True, False, False, True, False, True, False, False, False}

On ocassion, it is interesting to know whether an index is either an AIndex or a BIndex. Those are the only types that may be contracted, which makes them important for functions such as ContractBasis. We will call them `contractible indices'.

In[69]:=

ABIndexQ /@ indexlist

Out[69]=

{True, True, False, False, False, True, False, False, False, False}

Notice that we can get a False output for several reasons: The basis, abstract index or cnumber might not exist or they might belong to different vbundles.

If we use these indices inside of tensors, Mathematica will display them according to BasisColor,

In[70]:=

T[{1, -cartesian}, {2, -cartesian}] v[{a, polar}]

Out[70]=

T_ (12)^   v_ ^a

Objects like those in the previous output can be seen as contractions of the tensor with some kind of basis object. xCoba` provides Basis, a 1-covariant, 1-contravariant symmetric tensor. Its meaning depends on the type of indices used:
    - Basis[ AIndex, BCIndex] :    Basis vector (or dual basis covector).
    - Basis[ AIndex, AIndex]:     Identity tensor in the corresponding vbundle (turns into δ).
    - Basis[ BCIndex, BCIndex]:    If the indices belong to different bases, it represents a basis change.
                        If they belong to the same basis, we have a Kronecker delta (products of the elements of dual bases).

Basis is output as an e:

In[71]:=

{Basis[a, {1, -polar}], Basis[a, -b], Basis[{a, cartesian}, {-b, -polar}], Basis[{a, cartesian}, {-b, -cartesian}],   Basis[{1, polar}, {1, -polar}], Basis[{1, polar}, {2, -polar}]}

Out[71]=

{e_ ( 1)^a , δ_ ( b)^a , e_ ( b)^a , e_ ( b)^a , 1, 0}

If both indices are abstract, a different symbol (δ) is used. The reason for this is twofold: mathematical and computational. Basis has a lot of associated rules and definitions; if we added to them those of δ, we would have to perform many checks each time one of these objects appeared, thus slowing down  the operation. Notice how Basis is Orderless. Indeed, some authors even write its indices stacked rather than staggered.

In[72]:=

{Basis[a, {1, -polar}], Basis[{1, -polar}, a], Basis[-a, b], Basis[b, -a]}

Out[72]=

{e_ ( 1)^a , e_ ( 1)^a , δ_ ( a)^b , δ_ ( a)^b }

A Basis object with two indices of the same character is converted into a metric tensor. If we  have defined more than one metric, the first one is used (see xTensorDoc.nb for details)

In[73]:=

Catch @ Basis[-a, -b]

MetricsOfVBundle :: missing : There is no metric in TangentM3 .

In[74]:=

DefMetric[-1, metricg[-a, -b], CD, {";", "▽"}, PrintAs->"g"]

** DefTensor: Defining symmetric metric tensor metricg[-a, -b] .

** DefTensor: Defining antisymmetric tensor epsilonmetricg[a, b, c] .

** DefCovD: Defining covariant derivative CD[-a] .

** DefTensor: Defining vanishing torsion tensor TorsionCD[a, -b, -c] .

** DefTensor: Defining symmetric Christoffel tensor ChristoffelCD[a, -b, -c] .

** DefTensor: Defining Riemann tensor RiemannCD[-a, -b, -c, -d] .

** DefTensor: Defining symmetric Ricci tensor RicciCD[-a, -b] .

** DefCovD:  Contractions of Riemann automatically replaced by Ricci.

** DefTensor: Defining Ricci scalar RicciScalarCD[] .

** DefCovD:  Contractions of Ricci automatically replaced by RicciScalar.

** DefTensor: Defining symmetric Einstein tensor EinsteinCD[-a, -b] .

** DefTensor: Defining vanishing Weyl tensor WeylCD[-a, -b, -c, -d] .

** DefTensor: Defining symmetric TFRicci tensor TFRicciCD[-a, -b] .

   Rules  {1, 2}  have been declared as DownValues for TFRicciCD .

** DefCovD:  Computing RiemannToWeylRules for dim 3

** DefCovD:  Computing RicciToTFRicci for dim 3

** DefCovD:  Computing RicciToEinsteinRules for dim 3

In[75]:=

{Basis[-a, -b], Basis[{a, cartesian}, {b, cartesian}], Basis[{a, cartesian}, {b, polar}]}

Out[75]=

{g_ab^  , g_  ^(ab), g_  ^(ab)}

In[76]:=

UndefMetric[metricg]

** UndefTensor: Undefined antisymmetric tensor epsilonmetricg

** UndefTensor: Undefined symmetric Christoffel tensor ChristoffelCD

** UndefTensor: Undefined symmetric Einstein tensor EinsteinCD

** UndefTensor: Undefined symmetric Ricci tensor RicciCD

** UndefTensor: Undefined Ricci scalar RicciScalarCD

** UndefTensor: Undefined Riemann tensor RiemannCD

** UndefTensor: Undefined symmetric TFRicci tensor TFRicciCD

** UndefTensor: Undefined vanishing torsion tensor TorsionCD

** UndefTensor: Undefined vanishing Weyl tensor WeylCD

** UndefCovD: Undefined covariant derivative CD

** UndefTensor: Undefined symmetric metric tensor metricg

Basis is considered to be a tensor whose master is Symbol, so it cannot be undefined:

In[77]:=

xTensorQ[Basis]

Out[77]=

True

In[78]:=

MasterOf[Basis]

Out[78]=

Symbol

The bracket of two basis vector fields is automatically converted into a torsion tensor (structure coefficients). This tensor is associated with the PD of the basis

In[79]:=

Torsion[cartesian]

Out[79]=

TorsionPDcartesian

In[80]:=

Bracket[a][Basis[s, {1, -polar}], Basis[s, {2, -polar}]]

Out[80]=

-T_ ( 12)^a  

If and only if the basis is coordinated, its torsion tensor will be Zero.

Basis and Dir act as inverses of each other

In[81]:=

Dir[Basis[{a, polar}, -c]]

Out[81]=

{a, polar}

In[82]:=

Basis[{1, polar}, Dir[v[s]]]

Out[82]=

v_ ^1

An important issue is when to contract Basis objects with other tensors and with one another:

In[83]:=

ContractBasis/@{Basis[a, {-b, -polar}] Basis[-a, {c, cartesian}], Basis[a, {1, -polar}] Basis[-a, {1, polar}], Basis[a, {-b, -polar}] Basis[-c, {b, polar}]}

Out[83]=

{e_b ^( c), 1, δ_ ( c)^a }

It would be desirable to automatize this behaviour sometimes. We can do it with the command AutomaticBasisContractionStart[]:

AutomaticBasisContractionStart        Start automatic contraction of Basis objects
AutomaticBasisContractionStop        
Stop automatic contraction of Basis objects

Contraction of Basis objects

In[84]:=

AutomaticBasisContractionStart[]

In[85]:=

{Basis[a, {-b, -polar}] Basis[-a, {c, cartesian}], Basis[a, {1, -polar}] Basis[-a, {1, polar}], Basis[a, {-b, -polar}] Basis[-c, {b, polar}]}

Out[85]=

{e_b ^( c), 1, δ_ ( c)^a }

In[86]:=

AutomaticBasisContractionStop[]

When the contraction is between a Basis object and a different tensor, it is only performed if the former is a formal Kronecker delta or an identity tensor,

In[87]:=

{Basis[a, -b] T[-a, -c], Basis[{a, polar}, {-b, -polar}] v[{b, polar}], Basis[{a, polar}, -b] v[b], Basis[{a, cartesian}, {-b, -polar}] v[{b, polar}]}

Out[87]=

{T_bc^  , v_ ^a, e_b ^( a) v_ ^b, e_ ( b)^a  v_ ^b}

To force the contraction in the last two cases we need a new function (next section). Notice how the third contraction is equivalent to expressing a tensor in its components and the fourth represents a basis change.

We can define a special name  for the elements of one particular basis.

In[88]:=

FormatBasis[{1, polar}, "n"]

In[89]:=

{Basis[-a, {1, polar}], Basis[-a, {2, polar}], Basis[{1, -cartesian}, {1, polar}], Basis[{2, polar}, {1, -cartesian}]}

Out[89]=

{n_a^ , e_a ^( 2), n_1^ , e_1 ^( 2)}

In[90]:=

FormatBasis[{2, polar}, "l"]

In[91]:=

{Basis[-a, {1, polar}], Basis[-a, {2, polar}], Basis[{1, -cartesian}, {1, polar}], Basis[{2, polar}, {1, -cartesian}]}

Out[91]=

{n_a^ , l_a^ , n_1^ , l_1^ }

We remove the special names:

In[92]:=

FormatBasis[{1, polar}]

FormatBasis[{2, polar}]


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