Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

Helo, first of all congratulations for the software, and thanks for sharing the program whit the comunity. Also sorry for my little English.

Ok. Yesterday I have made the computation whit cadabra for the Riemman tensor for the 2-sphere, I think is a god exercise for practice the software language. It's all ok, except that all the sings are the oposites in the expresion of Riemman tensor: R^1_221, R^2_121, R^1_212, and R^2_112. Other terms vanish. If we contract for the first and third indices an also we calculate the Ricci scalar gives -1/R**2 and a negative Ricci curvature.

I don't know because this occurs. I submit code. Ok anticipated thanks. : )

{\theta, \varphi}::Coordinate;
{\alpha, \beta, \gamma, \delta, \rho, \sigma, \mu, \nu, \lambda}::Indices(values={\varphi, \theta}, position=fixed);
\partial{#}::PartialDerivative;
g_{\alpha\beta}::Metric.
g^{\alpha\beta}::InverseMetric.

sphe:={ g_{\theta\theta} = r**2,
         g_{\varphi\varphi} = r**2 \sin(\theta)**2 }.
complete(sphe, $g^{\alpha\beta}$);

ch:= \Gamma^{\alpha}_{\mu\nu} = 1/2 g^{\alpha\beta} (
                                                       \partial_{\nu}{g_{\beta\mu}}
                                                      +\partial_{\mu}{g_{\beta\nu}}
                                                      -\partial_{\beta}{g_{\mu\nu}} ):
evaluate(ch, sphe, rhsonly=True);

rm:= R^{\rho}_{\sigma\mu\nu} = +\partial_{\mu}{\Gamma^{\rho}_{\sigma\nu}}
                           -\partial_{\nu}{\Gamma^{\rho}_{\sigma\mu}}
                           +\Gamma^{\rho}_{\beta\mu} \Gamma^{\beta}_{\sigma\nu}
                           -\Gamma^{\rho}_{\beta\nu} \Gamma^{\beta}_{\sigma\mu};

substitute(rm, ch);
evaluate(rm, sphe, rhsonly=True);
in General questions by (130 points)

1 Answer

+1 vote

Not sure if this is still an issue, but the current github version seems to do this correctly. I have added a notebook in examples/sphere.cnb which contains this computation (it's a nice example, hope you don't mind).

by (76.7k points)
...