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

Hi, I don't know if this is a bug: Does eliminate_metric supposed to move the metric tensor inside partial derivative freely?

I have the following code:

{x1,x2,x3,x4}::Coordinate;
{k,l,m,n,p,q,r,s,t}::Indices(position=fixed,values=[x1,x2,x3,x4]);
g{m n}::Metric;
g^{m n}::InverseMetric;
g{m}^{n}::KroneckerDelta;
g^{m}{n}::KroneckerDelta;
{g{m n},g^{m n}}::Depends(x1,x2,x3,x4);
\nabla{#}::Derivative.
\partial{#}::PartialDerivative.
test := Q^{s}_{r m n} -> g^{s k} \partial{r m}{g{k n}};
eliminate_metric();

The output I get is that the inverse-metric goes inside the derivative and contracts with the metric to form the Kronecker-delta. Is this supposed to happen? Am I supposed to limit the method eliminate_metric to avoid partial-derivatives?

in Bug reports by (400 points)
edited by

2 Answers

+1 vote

This way of declaring dependency of the metric on coordinates $x_1\ldots x_4$ does not work; you need to write it as

{g_{m n},g^{m n}}::Depends(\partial{#});

Then the metric will not be moved inside the partial derivative.

by (83.5k points)

Thank you, I will try it

0 votes

I know that Kasper already answer the question, but I'd like to comment some additional points:

  • The metric should depend on the partial derivatives (perhaps the covariant derivative, if you are working with nonmetricity).
  • It is useful to denote the indices of the metric as subindices, with the _ sign, e.g. g_{m n} instead of g{m n}. Same for the Kronecker delta and the derivatives.
  • The eliminate_metric algorithm requires an argument, in this case either (test), or the customary (_) to apply it to the pravious expression.

The modified code

{x1,x2,x3,x4}::Coordinate;
{k,l,m,n,p,q,r,s,t}::Indices(position=fixed,values=[x1,x2,x3,x4]);
\nabla{#}::Derivative;
\partial{#}::PartialDerivative;
g_{m n}::Metric;
g^{m n}::InverseMetric;
g_{m}^{n}::KroneckerDelta;
g^{m}_{n}::KroneckerDelta;
{g_{m n},g^{m n}}::Depends(\partial{#});
test := Q^{s}_{r m n} -> g^{s k} \partial_{r m}{g_{k n}};
eliminate_metric(_);
by (15.1k points)

I now see that I forgot (_) in the last line of my code - a typo

...