I have a code that gives me the Christoffel symbols of a metric. How do I take the covariant derivative of a vector?
It does not necessarily have to build upon my code, but this is what I have used so far that gives me the affine connactions:
n = 4
coord = {T, R, \[Theta], \[Phi]}
metric = {{-1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, R^2, 0}, {0, 0, 0, R^2 Sin[\[Theta]]^2}}
inversemetric = Simplify[Inverse[metric]]
affine := affine = Simplify[Table[(1/2)*Sum[(inversemetric[[i, s]])*
(D[metric[[s, j]], coord[[k]] ] +
D[metric[[s, k]], coord[[j]] ] -
D[metric[[j, k]], coord[[s]] ]), {s, 1, n}],
{i, 1, n}, {j, 1, n}, {k, 1, n}] ]
listaffine :=
Table[If[UnsameQ[affine[[i, j, k]],
0], {ToString[\[CapitalGamma][i, j, k]], affine[[i, j, k]]}] , {i,
1, n}, {j, 1, n}, {k, 1, j}]
TableForm[Partition[DeleteCases[Flatten[listaffine], Null], 2],
TableSpacing -> {2, 2}]```