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

Hi,

I have the following code:

{M,N,P}::Indices(position=free);
{M,N,P}::Integer(1..D);
\partial{#}::Derivative;
d::Depends(\partial{#});
\eta^{M N}::Metric;
\eta_{M N}::InverseMetric;
exp:= A^{F} (\eta^{M N})*(1/(D-1))*\partial_{F}{d} + A^{F} (\eta^{N M})*(1/(D-1))*\partial_{F}{d};
canonicalise(_);
collect_terms(_);

By using "canonicalise" I was expecting Cadabra to recognize that the second term is equal to the first one, but it just returns the same expression. I think the problem is the (D-1) factor in the denominator, somehow spoils the canonicalise command and the symmetric property of the metric. Any suggestion how could this be solved?

thank you,

Victor

in Bug reports by (200 points)

1 Answer

+1 vote

Ah, interesting one ;-) The reason why this fails is that canonicalise is made to not do anything with products which contain sums as factors; it only canonicalises pure monomials. Normally that doesn't cause any trouble.

Unfortunately, I messed up this check, making it search the expression tree arbitrarily deep. As a result, the check mentioned above flags the 1/(D-1) as containing a sum D-1, and canonicalise refuses to touch your expression. You can see this because the \eta^{N M} does not get its indices sorted.

I'll need to fix this properly, but as a workaround, use e.g. 1/Dm1 for 1/(D-1) and then replace Dm1 later.

by (80.3k points)

ok! thank you for the answer!!! bye!

...