Hi
I have attached the code I used to find the tensor components. What I get is an answer that does not present the variables and constant, and does not run on the entire tensor.
Please tell me what mistake I am making?
<< xAct`xTensor`
(*Define manifold and chart*)
DefManifold[M, 4, {a, b, c, d}];
DefChart[cM, M, {t, r, \[Theta], \[Phi]}];
(*Define metric*)
DefMetric[-1, g[-a, -b], CD, {";", "\[Del]"}, PrintAs -> "g"];
(*Define metric components (Kerr-like)*)
DefMetricComponents[
g[-a, -b], {{-(r^2 - (2 G M r)/c^2 + a^2 Cos[\[Theta]]^2)/(r^2 +
a^2 Cos[\[Theta]]^2) c^2, 0,
0, -(a Sin[\[Theta]]^2 (2 G M r)/c)/(r^2 +
a^2 Cos[\[Theta]]^2)}, {0, (r^2 +
a^2 Cos[\[Theta]]^2)/(r^2 - (2 G M r)/c^2 + a^2), 0,
0}, {0, 0, r^2 + a^2 Cos[\[Theta]]^2,
0}, {-(a Sin[\[Theta]]^2 (2 G M r)/c)/(r^2 +
a^2 Cos[\[Theta]]^2), 0,
0, ((r^2 + a^2)^2 -
a^2 (r^2 - (2 G M r)/c^2 +
a^2) Sin[\[Theta]]^2) Sin[\[Theta]]^2/(r^2 +
a^2 Cos[\[Theta]]^2)}}];
(*Define tensors*)
DefTensor[F[-a, -b], M, Antisymmetric[{-a, -b}]];
DefTensor[T[-a, -b], M, Symmetric[{-a, -b}]];
(*Define F_ab components directly*)
FcompRules = {F[__] :> 0, F[-t, -r] -> (M G)/(c r^2),
F[-r, -t] -> -(M G)/(c r^2)};
(*Apply component substitution before raising indices*)
FwithComponents = F[-a, -b] /. FcompRules;
FUp2 := Raise[FwithComponents, g, 2];
FUpAll := Raise[FwithComponents, g, All];
(*Define stress-energy tensor*)
K = c^2/G;
Texpr = K (FwithComponents[-a, -c] FUp2[-b, -c] - (1/
4) g[-a, -b] FwithComponents[-c, -d] FUpAll[-c, -d]);
(*Build 4x4 matrix of components*)
coords = {t, r, \[Theta], \[Phi]};
Tmatrix =
Table[Simplify[
ComponentValue[Texpr, {coords[[i]], coords[[j]]}]], {i, 1, 4}, {j,
1, 4}];
(*Display neatly*)
MatrixForm[Tmatrix]