Problem extracting components

98 views
Skip to first unread message

Max Banados

unread,
Apr 12, 2022, 2:30:48 PM4/12/22
to xAct Tensor Computer Algebra
Hi everyone, I am new to xCoba, hope this is not too trivial:  I want to extract the components of a tensor defined using the covariant derivative; it does not work as expected. 

For example, I create a vector (I don't include here all the preamble, see attached notebook):
 v = CTensor[{2, r[], 5, 4}, {ch}]
and the associated tensor:
T1[a_, b_] = v[a] v[b]
I can extract its components with
T1[{0, ch}, {0, -ch}]
which works fine.  But if the definition of the tensor involves a derivative:
T2[-a_, b_] = cd[-a][v[b]]
The command
T2[{0, -ch}, {0, ch}]
does not deliver the required component.  Details in attached notebook 

Any help? 

(Of course I have a much longer calculation and really need to extract the components.)
Thanks! 
Max



DefxCoba.nb

Jose

unread,
May 1, 2022, 7:01:24 PM5/1/22
to xAct Tensor Computer Algebra
Hi,

This is an issue with pattern matching. When you define something like this:

    T2[-a_, b_] = ...

you are requesting indices that are of the form -a_, and {0, -ch} are not of this form. In other words, the pattern -a_ only matches covariant abstract indices, not covariant component indices.

We could discuss alternative patterns, but I actually recommend changing the definition of T2 to:

   T2 = TensorDerivative[v, cd]

Then T2 will be another CTensor object with all the components you are interested in, and you will be able to extract components as usual.

Cheers,
Jose.
Reply all
Reply to author
Forward
0 new messages