Cant compute tensor contraction with xCoba and ToValues

532 views
Skip to first unread message

Gus Micha

unread,
Jul 16, 2015, 3:30:21 PM7/16/15
to xa...@googlegroups.com
Hello everyone, this is the first time I write in this forum. Also, im new at xAct (and xCoba).

My issue is that I want to get an specific tensor contraction (for example the Ricci tensor). But when I take the "ToValues" operation, Mathematica doesn't compute the upper index components.

For example, this is what i do with the Schuarzschild metric:


DefManifold[M, 4, {a, b, c, d, e, i, j}]
DefChart[A, M, {0, 1, 2, 3}, {t[], r[], \[Theta][], \[Phi][]}]
DefMetric[-1, g[-i, -j], CD, {";", "\[CapitalDelta]"}]

MetricInBasis[g, -A, DiagonalMatrix[{-(1 - r0/r[]), (1 - r0/r[])^-1, r[]^2, 
   Sin[\[Theta][]]^2}]]

MetricCompute[g, A, All]

TraceBasisDummy[RicciCD[{a, A}, {b, A}] RicciCD[{-a, -A}, {-b, -A}]]

% // ToValues

And the output is:

(r0 (r0 - r[])  RicciCD[{0, A}, {0, A}])/(2 r[]^4) - ( r0  RicciCD[{1, A}, {1, A}])/(2 (r0 - r[]) r[]^2) + (Cot[\[Theta][]]  RicciCD[{1, A}, {2, A}])/r[] 
+ (Cot[\[Theta][]]  RicciCD[{2, A}, {1, A}])/r[] + (1 - r0/r[]) RicciCD[{2, A}, {2, A}] + (RicciCD[{3, A}, {3, A}]  Sin[\[Theta][]]^2)/r[]^2

I think that the problem must be related to xCoba not computing the upper index tensors. Is there any way to do this? Or am i missing something else?

Any help would be appreciated.

Gus.

PS: I dont know if this question has already been asked before, I searched in the forum but didnt find anything.
 

Leo Stein

unread,
Jul 16, 2015, 9:36:44 PM7/16/15
to Gus Micha, xAct Tensor Computer Algebra
Hi Gus,

Since this requires contraction with the metric, the old approach in xCoba did not automate this calculation. To change index position (or basis) required using the function ChangeComponents[old,new]. See Sec. 7.7 of xAct/Documentation/English/xCobaDoc.nb for details and examples about this function.

Or, you can use the new approach with CTensor[], which *does* automate this calculation. The documentation for the new approach is mostly in xAct/Documentation/English/xCobaDoc2.nb. In the attached file, you can see what your example would look like in the new approach with CTensor[]. Notice that CTensor[] objects get automatically computed when their indices are moved around. Once a certain calculation is done, it is also cached so that it doesn't have to happen again later.

Personally I think the new approach is simpler and easier. Hope this helps!

Good luck
Leo

--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Example-for-Gus.nb

Gus Micha

unread,
Jul 17, 2015, 3:35:58 PM7/17/15
to xa...@googlegroups.com, gustav...@gmail.com
Hi Leo!

Thank you very much, the second method you mention is exactly what I was looking for. I found the first method just after posting this question, but i found it to be too slow. This one, on the other hand, seems to be more simply and efficient.
Also, the file was very helpfull, its very instructive.

Thanks for your help Leo!

Greetings,

Gus.
Reply all
Reply to author
Forward
0 new messages