2.2. Covariant and contravariant abstract indices

Abstract indices in xTensor` are valid atomic symbols without numeric value (excluding therefore E and I) and with no special output (excluding symbols like Space, Tab, etc.) One of the most important decisions when working with tensors is the notation for covariant and contravariant indices. Given the binary character of the problem there is only one natural simple choice: the use of signs + and - . We shall denote contravariant indices as +a or a, and covariant indices as -a. This choice is very simple, but not particularly convenient when doing pattern matching, due to the asymmetry of a being a symbol but -a being a composite expression.

AIndexQ                    Validate an abstract index
VB`Q                    
Check that an abstract up-index belongs to vbundle VB
VB`pmQ                    
Check that an abstract (up- or down-) index belongs to vbundle VB

Validation of indices.

We can check whether a symbol has been registered as an abstract index using the function AIndexQ

In[78]:=

AIndexQ[A]

Out[78]=

True

In[79]:=

AIndexQ[-b]

Out[79]=

True

In[80]:=

AIndexQ[q]

Out[80]=

False

In particular, we can specify the vbundle it must belong to:

In[81]:=

AIndexQ[A, TangentS2]

Out[81]=

True

In[82]:=

AIndexQ[, TangentM3]

Out[82]=

False

In[83]:=

AIndexQ[, InnerC]

Out[83]=

True

In[84]:=

AIndexQ[†, InnerC]

Out[84]=

False

In[85]:=

AIndexQ[†, InnerC†]

Out[85]=

True

Each vbundle has two special functions that select abstract indices on that manifold. For example for the vbundle TangentM3 they are TangentM3`Q and TangentM3`pmQ. The former only accepts contravariant indices; the latter accepts both characters. The use of context notation (the ` ) is purely historical : before using upvalues to store information I tried to use contexts, but it is less convenient.

In[86]:=

TangentM3`Q[a]

Out[86]=

True

In[87]:=

TangentM3`Q[-a]

Out[87]=

False

In[88]:=

TangentM3`Q[A]

Out[88]=

False

In[89]:=

TangentM3`pmQ[a]

Out[89]=

True

In[90]:=

TangentM3`pmQ[-a]

Out[90]=

True


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