I'm working in a specific chart ch with a metric and associated covariant derivative cd:
<< xAct`xTensor`
<< xAct`xCoba`
DefManifold[M4, 4 , {a, b, c, d}];
DefChart[ch, M4, {0, 1, 2, 3}, {t[], r[], \[Theta][], \[CurlyPhi][]}];
DefScalarFunction[ff]
metric = CTensor[DiagonalMatrix[{-ff[r[]], (ff[r[]])^-1, r[]^2, r[]^2 Sin[\[Theta][]]^2}], {-ch,-ch}];
SetCMetric[metric, ch, SignatureOfMetric -> {3, 1, 0}, SignDetOfMetric -> -1];
cd = CovDOfMetric[metric];
Consider a vector field V defined as a Ctensor in the following way:
DefScalarFunction /@ {v0, v1, v2, v3};
V = CTensor[{v0[r[]], v1[r[]], 0, 0}, {ch}];
When I compute the following expression
V[b]cd[-b][V[a]]
I get the correct result for the 0-th component:
However, if I try to extract that specific component with
V[b]cd[-b][V[{0,ch}]]
the output is wrong:
Basically xCoba first replaces the index a with {0,ch} and only after computes the covariant derivative, thus losing the term involving the Christoffel symbols. How can I extract specific components in the correct way?
More generally, I would like to define functions as DerV[a_]:=V[b]cd[-b][V[a]] and use them to compute DerV[{0,ch}] correctly.