Commutators on Maple

1. Apr 18, 2010

luisgml_2000

Hi!

I'm trying to evaluate some commutators on Maple 12 and so far I have defined the rule for $$[x_i^\alpha,p_j^\beta]=i\hbar \delta_{ij}\delta^{\alpha,\beta}$$, where $$i$$ denotes a space coordinate and $$\alpha$$ represents a particle. The code that I used for that is

Setup(quantumop = {p, x}, algebrarule = {%Commutator(x[i, alpha], p[j, beta]) = I* hbar* KroneckerDelta[i, j]* KroneckerDelta[alpha, beta]})

I'm trying to code a similar rule for

$$[p_i^\alpha,f(x)]=-i\hbar \frac{\partial}{\partial x_i^\alpha}f(x)$$, and I tried

Setup(quantumop = {f, p}, algebrarule = {%Commutator(p[i, alpha], f(x)) = -I*hbar* Diff(f(x), x[i, alpha])})

but it doesn't work. Does anyone know how to implement this rule? By the way, how can I implement the Einstein summation convention on Maple?