Mathematica Asked by John Greger on February 21, 2021
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}]```
If you google something like "covariant derivative mathematica" you will get some hits that lead to mathematica.stackexchange.com where similar questions are answered. One example is Covariant derivative given Christoffel symbols which I think gives you the answer you are looking for. Be aware that the covariant derivative of a "vector" depends on whether you mean a covariant or contravariant vector - see e.g. https://mathworld.wolfram.com/CovariantDerivative.html for the difference.
Answered by Sofie on February 21, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP