# Defining commutations rules over arbitrary matrix

I'm working with spin connections with Dirac gamma matrix commutator (I know, mathematica has specific ways to work with it), and I need to define the following rules;

$$[\gamma_{0},\gamma_{i}]= 2 \gamma_{0}\gamma_{i} \\$$, $$[\gamma_{i},\gamma_{0}]= 2 \gamma_{i}\gamma_{0} \\$$, $$[\gamma_{0},\gamma_{0}]= 0$$, $$\gamma_{0}.\gamma_{i}.\gamma_{0}.\gamma_{i} = 1$$, $$\gamma_{0}.\gamma_{i}.\gamma_{i}.\gamma_{0} = -1$$, $$\gamma_{0}.\gamma_{i}.\gamma_{j}.\gamma_{k} = 0$$

With ($$i,j,k = 1,2,3,4$$)

An example of my problem: I have the spin connection:

Gammamu = FullSimplify[Series[Table[1/4*Sum[omegamuAB[[μ, a1, b]]*gamma[[a1]].gamma[[b]], {a1, 1, 4}, {b, 1, 4}], {μ, 1,
4}], {e, 0, 1}]];


Where

gamma = {Subscript[γ, 0], Subscript[γ, 1],Subscript[γ, 2], Subscript[γ, 3]};
omegamuAB[[i, 0, i]] = -(Derivative[a][t]/n[t])
omegamuAB[[i, i, 0]] = (Derivative[a][t]/n[t])


(for $$i=2,3,4$$) are the nonvanishing components of spin-connection. Creating some current using Gammamu, I have:

cumuAB = FullSimplify[Series[Table[-I*f[crd]*(I/2*Gammamu[[μ]].gamma[[a1]].gamma[[b]]+I/2*gamma[[a1]].gamma[[b]].Gammamu[[μ]])*f[crd], {μ, 1, 4}, {a1, 1, 4}, {b, 1, 4}], {e, 0, 1}]];


My componente cumuAB[[2,1,2]] is:

$$\frac{1}{2} \left(\frac{\left(\gamma _1\cdot\gamma _0-\gamma _0\cdot\gamma _1\right) a'(t)}{4 n(t)}\cdot\gamma _0\cdot\gamma _1+\gamma _0\cdot\gamma _1\cdot\frac{\left(\gamma _1\cdot\gamma _0-\gamma _0\cdot\gamma _1\right) a'(t)}{4 n(t)}\right) f(\{t,\text{x1},\text{x2},\text{x3}\})^2$$

Now I'm using a non-smart way to solve the gamma matrix algebra :

cumuAB[[2, 1, 2]] /.Subscript[γ, 0].Subscript[γ,1].(((-Subscript[γ, 0].Subscript[γ, 1] + Subscript[γ, 1].Subscript[γ, 0]) Derivative[a][t])/(4 n[t])) + (((-Subscript[γ, 0].Subscript[γ, 1] +Subscript[γ, 1].Subscript[γ, 0]) Derivative[a][t])/(4 n[t])).Subscript[γ, 0].Subscript[γ,1] -> Derivative[a][t]/ n[t]


$$\frac{a'(t) f(\{t,\text{x1},\text{x2},\text{x3}\})^2}{2 n(t)}$$

In simple cases, like this above, I see no problem to use consideration with "/.", but in more complex cases, using "/." is turning my code into a mass, and more, I'm getting strange dot products, like

$$0.\gamma_{0}\gamma_{1}-\gamma_{1}\gamma_{0}.0$$

How can I define these gamma matrix algebra in a more usefull way ?

• You might need a package called FeynCalc. – Αλέξανδρος Ζεγγ Sep 29 '18 at 18:06
• Thanks, I'll try it – Kamog Sep 29 '18 at 18:13
• @ΑλέξανδροςΖεγγ, saddly, FeynCalc isn't explicit, just symbolic. =\ – Kamog Sep 30 '18 at 2:36