Hi everybody,
I`ve recently started to learn how xCoba works and i have some difficulties in order to define some vectors in terms of it components and working with them.
My setup is as follows:
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.
<< xAct`xCoba`
$Info = False; $CVVerbose = False; $DefInfoQ = False;
DefManifold[M, 4, IndexRange[a, q]]
DefMetric[-1, metric[-a, -b], CD, PrintAs -> "g"]
DefChart[B, M, {0, 1, 2, 3}, {t[], r[], x[], z[]}]
$Assumptions = {r[] > 0};
DefParameter[L]; DefScalarFunction[F];
metricarray = DiagonalMatrix@
{-F[r[]], 1/F[r[]], r[]^2/L, r[]^2/L}
MetricCompute[metric, B, All, CVSimplify -> Simplify]
(* I`m trying to define a J tensor as an Einstein tensor plus a cosmological constant term *)
DefTensor[J[-a, -b], M]
J[-a, -b] := EinsteinCD[-a, -b] - 3/L metric[-a, -b]
(* is it correctly defined this way? When i try to do *)
ToValues@ComponentArray@ToBasis[B]@J[-a, -b] // MatrixForm
(* it shows all the tensor components as expected, but when i ask MMA to show a single component, it refuses and only prints J_00 *)
ToValues@J[{0, -B}, {0, -B}]
I don`t know what`s happening here. Please, could some one help me?
Also, i`d like to grasp what the difference would be in using the DefMetric/DefTensor approach vs the SetCMetric/CTensor one *)
Regards!