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

when I use

{\mu,\nu}::Indices(vector).
tr{#}::Trace.
ex:=A A tr{u^{\mu} u^{\nu}} tr{u^{\nu} u^{\mu}}- B B tr{u^{\mu} u^{\nu}} tr{u^{\mu} u^{\nu}};
sort_product(_);
collect_factors(_);
factor_in(_,$A**2,B**2$);

I get the following error

{\color{red}{\begin{verbatim}RuntimeError: Power with free indices not allowed.

At: (4): \end{verbatim}}}

How to solve it?

in General questions by (2.2k points)

1 Answer

+1 vote
 
Best answer

Now fixed on github. The problem was that collect_factors would try to collect the trace expressions because it didn't correctly scan for free indices on those factors.

by (82.5k points)
selected by
...