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

Hi Troops,

Here is s short Cadabra code

{a,b,c,d,e,f#}::Indices(position=independent).

R_{a b c d}::RiemannTensor.

# this should give zero
foo := (1+s) R_{a b c d} p^{a} p^{b} p^{c} p^{d}.
canonicalise (foo);

# this gives the expected result
bah := s R_{a b c d} p^{a} p^{b} p^{c} p^{d}.
canonicalise (bah);

There are two ouputs foo and bah. Both should be zero (beacuse of the symmetries of the Riemann tensor). But only bah is correctly given as zero. This seems like a bug to me.

Cheers, Leo

in Bug reports by (1.8k points)

Hi Leo. I confirm the behaviour you/re reporting.

By the way, if you distribute before canonicalising, i.e.

foo := (1+s) R_{a b c d} p^{a} p^{b} p^{c} p^{d}.
distribute(foo)
canonicalise (foo);

You'll obtain the expected result.

Cheers, Dox.

Hi Dox,

Thanks for the reply. Yes, that was my workaround for this "feature".

Cheers, Leo

1 Answer

+1 vote
 
Best answer

This was because canonicalise was a bit too careful. If a term in an expression contains a sum as factor, and that factor has indices, then you have to distribute first. E.g.

(A_{m n} + B_{m n}) R_{p q}^{m n};

But canonicalise was rejecting any sums inside a factor, like in your example, even if it has no indices. That's not necessary.

Now fixed in github (2.4.5.9).

by (82.6k points)
selected by

Wonderful, thanks for the quick fix :).

Great, thank you again K.

...