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

Hi!

I think I just nailed down a bug I noticed one time or the other:

{\alpha,\beta,\mu,\nu}::Indices;
{\alpha,\beta,\mu,\nu}::Integer{0..3};

\eta^{\mu\nu}::Metric;
\eta_{\mu\nu}::InverseMetric;
\eta_\mu^\nu::KroneckerDelta;
\eta^\mu_\nu::KroneckerDelta;

Exp:= \eta^\mu_\mu \eta^\alpha_\beta A^\beta;
eliminate_metric(_);

let's the self-contracted metric \eta^\mu_\mu vanish instead of giving A^\alpha as it should.
It's not just the wrong order but in this setup, the first \eta should give a factor of 4, which gets lost this way.

Best Regards,
Karim

asked in Bug reports by (290 points)

1 Answer

+1 vote

Be careful with index positions. If you want upper and lower indices to mean something different, declare your indices with the position=fixed attribute. So

{\alpha,\beta,\mu,\nu}::Indices(position=fixed);
{\alpha,\beta,\mu,\nu}::Integer(0..3);

\eta^{\mu\nu}::Metric;
\eta_{\mu\nu}::InverseMetric;
\eta_\mu^\nu::KroneckerDelta;
\eta^\mu_\nu::KroneckerDelta;

Exp:= \eta^\mu_\mu \eta^\alpha_\beta A^\beta;
eliminate_metric(_);
eliminate_kronecker(_);

This gives the expected answer.

answered by (46.2k points)

Thanks for the quick answer!
So Cadabra does not see the difference between the Kronecker-Delta and the Metric here.

Sorry that I keep asking, but I still don't see, why this means that \eta^\mu_\mu should just vanish here.
If I write

Exp:= \eta^{\mu\mu};
\eliminate_metric(_);

it does not vanish. And I don't see, why \eta^\mu_\mu should, even if it is interpreted as a metric instead of a Kronecker-Delta.

...