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

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!

in General questions by (190 points)

They are; for me the output is

$$a x_{a} K_{a b} P^\dagger_{b\alpha}$$

If that's not what you got, there must be some other properties which interfere with your sort order.

Yes, you're absolutely right, I don't know why it didn't work for me that time, maybe I didn't restart the kernel after putting a? in the sort order definition or something. It works now! Thank you, sorry for the trouble!

Please log in or register to answer this question.

...