I think the PHYSOP package has some error.
My test code is following.
scalop a,b; noncom a,b; oporder b,a;
let comm(a,b) = unit;
When I run the above code,
"a*b*a*b*a*b" return the wrong result:
"7*b*a + 7*b*b*a*a + b*b*b*a*a*a + unit".
The expected result is following:
"7*b*a + 6*b*b*a*a + b*b*b*a*a*a + unit".
Furthermore, the last line causes segmentation fault.
Please fix this error.
I do not yet understand it, but I confirm the abrupt collapse on your last line. When I look into that it is an apparently infinite recursion via multopop!* and physoptimes. Specifically I observe a nesting of calls
physoptimes((times b b a a b a a) b)
=> physoptimes((times b b a a b a a) b)
*** recursive repeat here
and the segmentation faiult you see eventually is it being hard to recover gracefully from infinite recursion and stack overflow.
I do not know the internals of the hephys/physop package at all well - is there somebody else out there who can join in understaning this one? I can look some more but I would hardly recognise a correct answer if I saw one! Arthur
The code makes small changes to very old versions of multf and multfnc which were known to
have some problems with noncommuting vars. Making a quick (without much thinking) adaption
to the newer routines at least yields the correct answer to
but still loops on the next expression. Unfortunately, I have no time at the moment to look any further.
If nobody else volunteers, I might be able next week to give it another try.
I just commited a fix to this problem. Please fetch the new version and try it out.