So I found a code that allows me to compute the covariant derivative of some vector, here it is:

\[CapitalGamma]udd[aa_, bb_, cc_] := (1/2)*
Sum[guu[[aa, dd]]*(D[gdd[[dd, cc]], clist[[bb]]] + 
 D[gdd[[dd, bb]], clist[[cc]]] - 
 D[gdd[[bb, cc]], clist[[dd]]]), {dd, 1, Length[gdd]}]

covDu[A_, a_, b_] := 
D[A[[a]], clist[[b]]] + 
Sum[\[CapitalGamma]udd[a, b, c]*A[[c]], {c, 1, Length[gdd]}]
clist = {T[t], R[t], \[Theta], \[Phi]}

gdd = DiagonalMatrix[{-1, 1 , R[t]^2, R[t]^2 Sin[\[Theta]]^2}];
guu = Inverse[gdd] // Simplify;
Table[\[CapitalGamma]udd[a, b, c], {a, Length[gdd]}, {b, 
Length[gdd]}, {c, Length[gdd]}]```

Now we define some vector, A, and we can take the covariant derivative:

A = {-R'[t], T[t], 0, 0}
Table[covDu[A, a, b], {a, Length[gdd]}, {b, Length[gdd]}] // Simplify

This gives me the output:

{{0, 0, 0, 0}, {1, 0, 0, 0}, {0, 0, T[t]/R[t], 0}, {0, 0, 0, T[t]/R[t]}} 

Now, I am happy because I recognize the terms and I know they are right. But I am also frustrated since I canno't reverse engineer a pattern. I simply don't know how I can see what indices belong to what term in the above table. So if I use another vector I don't know how to interpret the result.

Any help here? Mabye tips on represeting the results in another way that is more straight forward?

Thanks so much in advance.

  • 1
    $\begingroup$ Try Table[{i,j},{i,1,4},{j,1,4}] and you will see the indices of each term. $\endgroup$ Feb 11 at 13:29
  • $\begingroup$ Thank you very much! Can you elaborate a bit? Would be highly appreciated, because that line alone under my code gives me a table of numbers. :) $\endgroup$ Feb 11 at 17:15
  • 1
    $\begingroup$ Your example gives 4 lists of 4 elements. The command I gave you produces 4 lists of 4 elements. where each element is a list of 2 numbers, that are the indices of the corresponding element. $\endgroup$ Feb 11 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.