# bugs with sort_product&meld

The following code

{\mu,\nu,\rho,\sigma}::Indices(vector).
\epsilon^{\mu\nu\rho\sigma}::EpsilonTensor.
{a^{\mu},b^{\mu}}::NonCommuting.
{a^{\mu},b^{\mu}}::SelfNonCommuting.
tr{#}::Trace.
ts:=\epsilon^{\mu\nu\rho\sigma}\tr{a^{\mu}a^{\nu}b^{\rho}b^{\sigma}}+\epsilon^{\mu\nu\rho\sigma}\tr{a^{\mu}b^{\nu}b^{\rho}a^{\sigma}};
meld(_);
sort_product(_);
canonicalise(_);

can't get the right result, are there some bugs here?

edited

It seems you're interested in manipulating the expression: $$\epsilon^{\mu \nu \rho \sigma} tr\left(a^{\mu} a^{\nu} b^{\rho} b^{\sigma}\right)+\epsilon^{\mu \nu \rho \sigma} tr\left(a^{\mu} b^{\nu} b^{\rho} a^{\sigma}\right)$$

But you didn't define the trace

tr{#}::Trace.

Then

{\mu,\nu,\rho,\sigma}::Indices(vector).
\epsilon^{\mu\nu\rho\sigma}::EpsilonTensor.
{a^{\mu},b^{\mu}}::NonCommuting.
{a^{\mu},b^{\mu}}::SelfNonCommuting.
tr{#}::Trace.
ts:=\epsilon^{\mu\nu\rho\sigma} tr{a^{\mu}a^{\nu}b^{\rho}b^{\sigma}}
+\epsilon^{\mu\nu\rho\sigma} tr{a^{\mu}b^{\nu}b^{\rho}a^{\sigma}};
meld(_);

returns $$2\epsilon^{\mu \nu \rho \sigma} tr\left(a^{\mu} a^{\nu} b^{\rho} b^{\sigma}\right)$$

by (10.3k points)

Sorry for my carelessness and I've fixed the bug. But this is not the key point, and the right result is zero, is it?

Yes, I believe it should be zero! @kasper

The meld algorithm does not work with noncommuting/anticommuting objects yet, please wait a little longer.

by (71.6k points)

OK. How about sort_product&canonicalise? They also can't get the right result.