| Author |
Comment/Response |
tino
|
07/18/04 07:35am
Hello,
I want to do some algebraic computations with quantum mechanics creation and annihilation operators. while programming I found this really strange bug. this is the little programm:
Clear[d,u,ConstQ,cre,ann];
Unprotect[NonCommutativeMultiply];
SetAttributes[NCM, {Flat, OneIdentity}];
ConstQ[a_] := True;
ConstQ[_] := False;
ConstQ[ann[a_, i_]] := False;
ConstQ[cre[a_, i_]] := False;
l_ ** (a_?ConstQ) := a * l;
The Programm is supposed to bring constants (which have ConstQ == True) to the first place in an expression.
Now for the following expression
cre[a, l] ** d[l]
it works perfect.
But any other letter instead of the "d" for example
cre[a, l] ** u[l]
stays at the second place.
I have checked ConstQ[u[k]] and ConstQ[d[k]] and its both true.
What could be the Problem? And how do I solve it?
thanks a lot
tino
URL: , |
|