Question: how to define a correct Commutator relations with Setup

Hi, friends

The physics package was provided a good tool to compute Commutator or anticommutator relations. Here, I met some problems.

Example 1:

      restart: with(Physics):Setup(mathematicanotaion=true):

      Setup (op={p[x],p[y]},p[z]):

      alg:=%commutator(p[z],p[x])=2p[x], %commutator(p[z],p[y])=-2p[y], %commutator(p[x],p[y])= p[z]

      Setup (alg):

Given a error message:Error, (in Setup) multiple definition of algebra rule; received values for %Commutator(p[z], p[y]) are {rule, 2*p[x]}

Example 2:

       Setup (op={sigma[x],sigma[y],sigma[z]}):

       alg1:=%Commutator (sigma[x], sigma[y]) =2I sigma[z], %Commutator(sigma[y],sigma[z])=2I sigma[x], %Commutator(sigma[z],sigma[x])=2I sigma[y]

      Setup (alg1):

Question one, example 1 and example 2 seems extremely similar, why example 1 yields an error

Example 3:

     Setup (op={x[x],p[y]},p[z]):

     alg:=%Commutator(p[z],x[x])=2p[x], %Commutator(p[z],p[y])=-2p[y],%Commutator(s[x],p[y])= p[z]

     Setup (alg):

If I subs p[x] with s[x], the example’s problem will be not happed, but meet another trouble,

The result of Commutator (p[z],p[y]) can’t work out,yet, Commutator (sigma[x], sigma[y] can do.

From above troubles, what I can do? Thanks a lot in an advance.

Please Wait...