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

Consider the following example:



for i in ex.top().free_indices(): 

for i in ex.top().free_indices(): 

One would expect no free indices in both expressions. Indeed, for D{x\mu}{\theta_\mu}, there are no free indices. However, for the expression involving the user-defined LaTeXForm symbols \m, there are free indices.

This creates issues when trying to add two expressions like this together.

in Bug reports by (170 points)

1 Answer

0 votes

You cannot use x_\mu or x_\m in the derivative like that. Current github HEAD will report $x_\mu$ and $\mu$ (twice) as free indices in both cases. However, if you use

D_{\mu}{ \theta_\mu }

or in the 2nd case


then things work and (again with current github HEAD) will report no free indices.

Please let me know if this is still a problem with github HEAD (

by (82.0k points)