# Spin Connection using Mathematica

Hello I want to use Mathematica in order to calculate the spin connection of a metric, specifically of the metric $$$$\left(\begin{array}{cccc} -1 & 0 & 0 & 0 \\ 0 & \frac{1-K\left(y^{2}+z^{2}\right)}{1-K\left(x^{2}+y^{2}+z^{2}\right)} & \frac{K x y}{1-K\left(x^{2}+y^{2}+z^{2}\right)} & \frac{K x z}{1-K\left(x^{2}+y^{2}+z^{2}\right)} \\ 0 & \frac{K x y}{1-K\left(x^{2}+y^{2}+z^{2}\right)} & \frac{1-K\left(x^{2}+z^{2}\right)}{1-K\left(x^{2}+y^{2}+z^{2}\right)} & \frac{K y z}{1-K\left(x^{2}+y^{2}+z^{2}\right)} \\ 0 & \frac{K x z}{1-K\left(x^{2}+y^{2}+z^{2}\right)} & \frac{K y z}{1-K\left(x^{2}+y^{2}+z^{2}\right)} & \frac{1-K\left(x^{2}+y^{2}\right)}{1-K\left(x^{2}+y^{2}+z^{2}\right)} \end{array}\right)$$$$ I have calculated the Christoffel Symbols as follows,

coord = {t, x, y, z}
n = 4
metric = {{-1, 0, 0,
0}, {0, (1 - K*(y^2 + z^2))/(1 - K*(x^2 + y^2 + z^2)),
K*x*y/(1 - K*(x^2 + y^2 + z^2)),
K*x*z/(1 - K*(x^2 + y^2 + z^2))}, {0,
K*x*y/(1 - K*(x^2 + y^2 + z^2)), (1 - K*(x^2 + z^2))/(1 -
K*(x^2 + y^2 + z^2)), K*y*z/(1 - K*(x^2 + y^2 + z^2))}, {0,
K*x*z/(1 - K*(x^2 + y^2 + z^2)),
K*y*z/(1 - K*(x^2 + y^2 + z^2)), (1 - K*(x^2 + y^2))/(1 -
K*(x^2 + y^2 + z^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}]


I will be using the following definition for the spin connection $$$$\omega_{\mu b}^{a}=e_{\nu}^{a} e_{b}^{\sigma} \Gamma_{\sigma \mu}^{\nu}+e_{\nu}^{a} \partial_{\mu} e_{b}^{\nu}$$$$ where $$=e_{\nu}^{a}$$ is the vierbein (tetrad) and $$e_{b}^{\sigma}$$ is the inverse vierbein. I have tried the following

e = {{1, 0, 0, 0}, {0, (
y^2 + z^2 + x^2 Sqrt[1/(1 - K (x^2 + y^2 + z^2))])/(
x^2 + y^2 + z^2), (x y (-1 + Sqrt[1/(1 - K (x^2 + y^2 + z^2))]))/(
x^2 + y^2 + z^2), (x z (-1 + Sqrt[1/(1 - K (x^2 + y^2 + z^2))]))/(
x^2 + y^2 + z^2)}, {0, (
x y (-1 + Sqrt[1/(1 - K (x^2 + y^2 + z^2))]))/(x^2 + y^2 + z^2), (
x^2 + z^2 + y^2 Sqrt[1/(1 - K (x^2 + y^2 + z^2))])/(
x^2 + y^2 + z^2), (y z (-1 + Sqrt[1/(1 - K (x^2 + y^2 + z^2))]))/(
x^2 + y^2 + z^2)}, {0, (
x z (-1 + Sqrt[1/(1 - K (x^2 + y^2 + z^2))]))/(x^2 + y^2 + z^2), (
y z (-1 + Sqrt[1/(1 - K (x^2 + y^2 + z^2))]))/(x^2 + y^2 + z^2), (
x^2 + y^2 + z^2 Sqrt[1/(1 - K (x^2 + y^2 + z^2))])/(
x^2 + y^2 + z^2)}};
dete = Det[e];
inve = Simplify[Inverse[e]];
detinve = Det[inve];
Omega := Omega =
Simplify[Table[
Sum[(e[[i, a]]*inve[[j, b]]*affine[[i, k, j]]) +
e[[i, a]]*D[inve[[i, b]], coord[[k]]], {i, 1, n}, {j, 1,
n}], {k, 1, n}, {a, 1, n}, {b, 1, n}]]
listOmega :=
Table[If[UnsameQ[Omega[[k, a, b]],
0], {ToString[\[CapitalOmega][k, a, b]], Omega[[k, a, b]]}], {k,
1, n}, {a, 1, n}, {b, 1, n}]
TableForm[Partition[DeleteCases[Flatten[listOmega], Null], 2],
TableSpacing -> {2, 2}]


But unfortunately, I get very long solutions and such should not be the case. I would really appreciate if I could get some assistance in this matter, as I am fairly new to Mathematica and don't quite truly understand its workings. One last thing, my question is regarding the vierbein. Does it matter that $$e_{\nu}^{a}$$ has a contravariant and covariant index, as in does Mathematica know that it is taking a sum as the one of the formula? Or does it suffice to simply define it as a matrix and take a sum over the corresponding indices? Thank you in advance

• Add the code for the metric tensor and for tetrad. Commented Mar 5, 2020 at 13:13
• Certainly, I have added them. Commented Mar 6, 2020 at 1:43
• Check the equation $g_{ik}=\eta _{ab}e^a_ie^b_k$ Commented Mar 6, 2020 at 13:48
• Thank you so much, I found that the vierbein I gave does not satisfy the equation that you proposed. I have since changed the vierbein and even checked the second equation it must also satisfy, i.e. $\eta_{ab}=e^{\mu}_{a}e^{\nu}_{b}g_{\mu \nu}$, and found that the inverse vierbein, i.e. the inverse of the matrix e does indeed satisfy the equation. Commented Mar 6, 2020 at 20:58
• OK! Now $\omega^a_{\mu \nu}$ are calculated correctly? Commented Mar 7, 2020 at 11:14