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

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?

in Bug reports by (2.2k points)
edited by

2 Answers

0 votes

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 (15.0k 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

0 votes

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

by (82.5k points)

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

...