Raise and lower indices in xTensor

368 views
Skip to first unread message

Anupam Ah

unread,
May 18, 2023, 3:31:08 AM5/18/23
to xAct Tensor Computer Algebra
Hi,

i would like to know if there is any command in which i can raise and lower indices of any arbitrary tensor using the metric.

Thanks,

Anupam

Jose

unread,
May 18, 2023, 7:22:23 PM5/18/23
to xAct Tensor Computer Algebra
Hi Anupam,

Yes, raising and lowering indices of tensors is a core part of xAct, sometimes performed automatically and sometimes when instructed with the function ContractMetric.

With abstract tensors you can do something like this:

   << xAct`xTensor`

   DefManifold[M, 4, {a, b, c, d}]
   DefTensor[T[a, -b], M]
   DefMetric[-1, g[-a, -b], cd]

   In[5]:= ContractMetric[T[a, -b] g[-a, -c]]
   Out[5]= T[-c, -b]

   In[6]:= ContractMetric[T[a, -b] g[-a, -c] g[b, d]]
   Out[6]= T[-c, d]

Undefine the metric, because we will use a different metric for the component example below:

   UndefMetric[g]

With component tensors you can do something like this:

   << xAct`xCoba`

   DefChart[cart, M, {0, 1, 2, 3}, {t[], x[], y[], z[]}]

Introduce a component metric in that chart, in this case a simple diagonal matrix:

   met = CTensor[DiagonalMatrix[{-1, 1, 1, 1}], {-cart, -cart}]
   SetCMetric[met, cart]

Take this tensor defined by components:

   S = CTensor[RandomInteger[{-10, 10}, {4, 4}], {cart, -cart}]

You can now work with it in any up/down configurations of its indices:

   S[b, -c]
   S[-b, -c]
   S[b, c]

Cheers,
Jose.

Anupam Ah

unread,
May 18, 2023, 10:26:09 PM5/18/23
to xAct Tensor Computer Algebra
Hi Jose,

Thanks very much. I had something else in my mind actually. Consider a tensor T[-a,-b] (covariant). After some manipulations (like applying ToCanonical etc), I finally end up in a bunch of terms which has terms like T[-a,-b], T[a,b] and T[a,-b]. I wanted to express T[a,b] = g[a,c]g[b,d]T[-b,-d] and similarly for the mixed tensor. Is there any way in which i can do that?

In short. Is there any way in which I can express a contravariant tensor or a mixed tensor, in terms of inverse metric and covariant tensor, 

Thanks,

Anupam

Jose

unread,
May 19, 2023, 12:08:51 AM5/19/23
to xAct Tensor Computer Algebra
Yes, we have the function SeparateMetric for that. It will make explicit all metric contractions. Try this:

   << xAct`xTensor`

   $PrePrint = ScreenDollarIndices;

   DefManifold[M, 4, {a, b, c, d, e, f}]

   DefTensor[T[-a, -b], M]


   DefMetric[-1, g[-a, -b], cd]

   T[a, b] T[-b, c] // SeparateMetric[]

Note the need of that empty pair of brackets. You can specify which metric must be separated in that pair of brackets, for cases in which we have several vbundles, each with a metric.

Cheers,
Jose

Reply all
Reply to author
Forward
0 new messages