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

Hi, this is my code

{\mu,\nu}::Indices(vector).
f^{\mu?\nu?}::AntiSymmetric.
h^{\mu?\nu?}::Symmetric.
{u^{\mu?},f^{\mu?\nu?},h^{\mu?\nu?}}::NonCommuting.
ex:=u^{\mu}u^{\nu}f^{\nu\mu}+f^{\mu\nu}h^{\mu\nu};
canonicalise(_);

the result is 0, it's wrong. How to get the correct result?(i.e. uμuνfμν)

in General questions by (2.2k points)
edited by

1 Answer

+3 votes
 
Best answer

The NonCommuting property only relates different objects; your line says that uμ does not commute with fμν, but it says nothing about how uμ commutes with uν. To impose what you want, use SelfNonCommuting, as in:

{\mu,\nu}::Indices(vector).
f^{\mu\nu}::AntiSymmetric.
h^{\mu\nu}::Symmetric.
u^{\mu}::SelfNonCommuting.
ex:=u^{\mu}u^{\nu}f^{\nu\mu}+f^{\mu\nu}h^{\mu\nu};
canonicalise(_);

which then gives uμuνfμν.

(I have taken the liberty of removing the question marks on the indices (you don't need them)).

by (85.9k points)
selected by

Thanks, it works.

...