Hey, I have been working for a few hours now with substitute and it behaves perfectly so far!
However, now that symbols which were initially indices appear in the main expression, there seems to be a problem with sort product. I am attaching below a sample piece of code:
{\dagger}::Symbol.
{a,b,c,\alpha,\beta,\gamma}::Symbol;
{P^{\dagger}_{a? \alpha?}, K_{a? b?}}::NonCommuting.
{a?, x_{a?},P^{\dagger}_{a? \alpha?}, K_{a? b?}}::SortOrder;
ex:=K_{a b} a x_{a} P^{\dagger}_{b \alpha};
sort_product(_);
In this case the expression remains unchanged, although the c-numbers a and x_a should be taken to the left. Am I missing something?
Thank you!