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

Hi, the following codes output a wrong result.

{x,y}::Coordinate;
{a,b,c,d,e,f# }::Indices(vielbein, values={x,y}, position=independent);
{a,b,c,d,e,f# }::Integer(range=0..1)
\gamma_{a}::SelfAntiCommuting.
\omega^{a b}::AntiSymmetric.
ex:=  xxx  =  \gamma_{a} \gamma_{b} \omega^{a b}  ;
evaluate(ex,rhsonly=True,simplify=False);

I obtained

$\gamma_x \gamma_y \omega^{y x} +\gamma_y \gamma_x \omega^{x y}$

The right result should be

$\gamma_x \gamma_y \omega^{x y} +\gamma_y \gamma_x \omega^{y x}$

Any suggestion would be greatly appreciated!

in Bug reports by (190 points)

Hi Zhaozhh, thank you for sharing your findings.

I reproduce your unexpected behaviour (a global minus sign)\, while using version `Version 2.4.3 (build 2899.366cb44e13 dated 2023-04-10)` running on a Manjaro GNU/Linux system.

Any news over here?

If I only rewrite the expression in the following form, I will get the desired result

ex:= xxx = \gamma_{b} \gamma_{a} \omega^{a b};

the output is

$$xxx=\gamma_x\gamma_y\omega^{yx}+\gamma_y\gamma_x\omega^{xy}$$

The canonicalise operation also works very well

canonicalise(_);

the output is

$$xxx=-\gamma_x\gamma_y\omega^{xy}+\gamma_y\gamma_x\omega^{xy}$$

The version of cadabra is Cadabra_2.5.6_x86_64.AppImage

Great news. Thank you Zhaozhh.

1 Answer

+2 votes

The evaluate algorithm does not preserve the order of factors in a product at present. I am working on a fix for this; if there's anything new to test/try I will report here.

by (82.6k points)

Kasper, thank you very much!

Thank you Kasper, we shall be expecting for news.

...