Edwin Woollett wrote:
> On Nov. 17, Feifei Li wrote
> --------------------------------------
> Thanks for the pauli matrices implementation.
>
> Maybe I didn't make it clear enough that I am looking for a general way to
> simplify commutators based on a few elementary commutation rules, for
> example:
>
> given a set of elementary rules, e.g., [A, B]=iC, [B, C]=iA, [C, A]=iB,
> can we simplify arbitrary commutators like [A^10+A^5.B^10, C^3+B^5]
>
> I think the key should be to specify customized rules and let Maxima
> simplify expressions according to those rules. However as I go through the
> documentation, I can not find good example indicating this is doable.
I think this is doable. I have done similar stuff in Mathematica with
Poisson brackets, the trick is to use rules such as (for Poisson brackets,
not very different for commutators):
pb/: pb[(a_)^(n_)?NumberQ, b_] := n*a^(n - 1)*pb[a, b]
pb/: pb[a_, (b_)^(n_)?NumberQ] := n*b^(n - 1)*pb[a, b]
pb/: pb[a_, pb[b_, c_]] :=
-pb[c, pb[a, b]] + pb[b, pb[a, c]] /; OrderedQ[{b, a}] && OrderedQ[{c,
a}]
pb/: pb[pb[a_, b_], c] :=
pb[pb[a, c], b] - pb[pb[b, c], a] /; OrderedQ[{c, a}] && OrderedQ[{c, b}]
Here you see the Jacobi identity at work, of course you need to order
variables to forbid cyclic substitutions.
Mathematica has a particularly nice syntax to write such rules but there are
similar tools in maxima, you have to play with "matchdeclare" and
"tellsimpafter" to write the rules. The corresponding documentation is
particularly unclear, but there has been a discussion of these tools in this
forum which helped me to discover how to use them.
--
Michel Talon