How to define the Energy-Momentum tensor in xCoba?

815 views
Skip to first unread message

Pereira

unread,
Jan 20, 2015, 12:38:13 PM1/20/15
to xa...@googlegroups.com
Hello everyone,

I'm trying to understand how the package works and I can't figure out how to define a new tensor from already defined tensors.

My initial code is,

Needs["xAct`xCoba`"];
$DefInfoQ = $UndefInfoQ = False;
DefManifold[M4, 4, {\[Mu], \[Nu], \[Alpha], \[Beta], \[Gamma], \
\[Delta], \[Lambda]}]
DefChart[schw, M4, {0, 1, 2, 3}, {t[], r[], \[Theta][], \[Phi][]}]
ServantsOf[schw]
DefConstantSymbol[Mass, PrintAs -> "M"]
DefScalarFunction[a]
k = 0;
g = CTensor[
   DiagonalMatrix[{-1, a[t[]]^2/(1 - k*r[]^2), a[t[]]^2*r[]^2, 
     a[t[]]^2*(r[]^2)*Sin[\[Theta][]]^2}], {-schw, -schw}];
MetricsOfVBundle[TangentM4] ^= {g};
CD = CovDOfMetric[g];
RicciScalar[CD]

and now I'm trying to define the Energy-Momentum tensor using the 4 velocity
u = CTensor[{1, 0, 0, 0}, {-schw}];

and the combination 

DefScalarFunction[\[Rho]];
DefScalarFunction[p];
((\[Rho] + p)*u[-\[Alpha]]*u[-\[Beta]] + p*g[-\[Alpha], -\[Beta]])

My question is, how do I define a new tensor from the above expression in which the indices work as they should? I would like to be able to have a new tensor called T[\alpha,\beta] from the expression a above which would allow me to obtain, for example, the trace T[\alpha,-\alpha] and calculate covariant derivatives.

Thanks in advance!
P.


Jose

unread,
Jan 20, 2015, 1:44:57 PM1/20/15
to xa...@googlegroups.com
Hi,

You almost have it. Replace your last three lines by

DefTensor[\[Rho][], M4]
DefTensor[p[], M4]
T[\[Alpha]_, \[Beta]_] := ((\[Rho][] + p[]) u[\[Alpha]] u[\[Beta]] + p[] g[\[Alpha], \[Beta]])

You need to use scalar fields, not scalar functions. Well, you could use scalar functions of the coordinates if you wanted, but the natural thing here is to treat p and rho as you treat u, with fields. Yes, a CTensor is a field head (taking indices as arguments), never a scalar function head (taking scalar fields as arguments).

Then you can compute

T[-\[Alpha], -\[Beta]]

T[\[Alpha], \[Beta]]

and the trace

In[]:= T[\[Alpha], -\[Alpha]]
Out[]= 3 p[] - \[Rho][]

Cheers,
Jose.

Pereira

unread,
Jan 21, 2015, 2:14:02 PM1/21/15
to xa...@googlegroups.com
Thank you! Your response also cleared out some other doubts I had regarding CTensor.

Best regards,
P.
Reply all
Reply to author
Forward
0 new messages