Question: Getting an error with a commutator/algebra rule


iam trying to define a commutator rule (using the Physics package) but iam getting an error i do  not understand.


I have (quantum) operators like this: Aij  i and j are numbers from 0 to 3

The commutator relation i want to define is: [Aij,Akl] = Ailδjk - Akjδil


My worksheet looks like this:


restart; with(Physics); Setup(mathematicalnotation = true);
                 [mathematicalnotation = true]

Setup(quantumop = {A[0, 0], A[0, 1], A[0, 2], A[0, 3], A[1, 0], A[1, 1], A[2, 0], A[2, 1], A[2, 2], A[3, 0], A[3, 1], A[3, 2], A[3, 3]});

Setup(algebrarule = {%Commutator(A[i, j], A[k, l]) = A[i, l]*KroneckerDelta[j, k]-A[k, j]*KroneckerDelta[l, i]});

Commutator(A[3, 2], A[2, 1]);

Error, (in zz) found different free indices in different operands of a sum; in operand 1: [j, k], in operand 2: [i, l]

The last line shows the Error, what did i wrong?

Please Wait...