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

Hi Folks, The following code produces terms like \partial_{b}{g^{b b}} which is clearly wrong. Can anybody spot my error? Or is there a better way to do this calculation (the Riemann tensor in terms of the metric) that avoids this problem? Many thanks, Leo

{a,b,c,d,e,f,i,j,k,l,m,n,o,p,q,r,s,t,u#}::Indices(position=fixed).
\partial{#}::PartialDerivative.
g_{a b}::Metric.
g^{a b}::InverseMetric.
g_{a b}::Depends(\partial{#}).
g^{a b}::Depends(\partial{#}).
\Gamma^{a}_{b c}::Depends(\partial{#}).
Riem := R^{a}_{b c d} ->
            \partial_{c}{\Gamma^{a}_{b d}} + \Gamma^{a}_{e c} \Gamma^{e}_{b d}
          - \partial_{d}{\Gamma^{a}_{b c}} - \Gamma^{a}_{e d} \Gamma^{e}_{b c};
Gam := \Gamma^{a}_{b c} ->
        (1/2) g^{a e}(   \partial_{b}{g_{e c}}
                       + \partial_{c}{g_{b e}}
                       - \partial_{e}{g_{b c}});
Ric := R_{a b} -> g^{c d} g_{a e} R^{e}_{c b d};
ex := R_{a b};
substitute(ex,Ric);
substitute(ex,Riem);
substitute(ex,Gam);
in Bug reports by

1 Answer

+1 vote
 
Best answer

As Leo already spotted in a private email: it was a trivial mistake. The 12th line (1/2) g^{a e}( \partial_{b}{g_{e c}} was missing a space between the first instance of "}(". The correct line should be (1/2) g^{a e} ( \partial_{b}{g_{e c}}.

by (82.5k points)
...