Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+2 votes

Is there any command/package for computing the traces of gamma matrices using Cadabra? Or if it can be calculated in a simple way with existing commands? If not, it would be a really great addition for doing computations. Thanks in advance for either of the cases.

asked in Feature requests by

1 Answer

+1 vote

You can do it with recent versions of Cadabra but it's a little awkward. For example,

{\mu,\nu,\rho,\sigma}::Indices(vector);
{\mu,\nu,\rho,\sigma}::Integer(0..3);
{a,b,c,d}::Indices(spinor);
Tr{#}::Trace(indices=spinor);
\delta_{\mu \nu}::KroneckerDelta;
\Gamma^{#}::GammaMatrix(metric=\delta);
\Gamma^{\mu}::ImplicitIndex(\Gamma^{\mu}_{a b});
\Gamma^{\mu \nu}::ImplicitIndex(\Gamma^{\mu \nu}_{a b});
\Gamma^{\mu \nu \rho \sigma}::ImplicitIndex(\Gamma^{\mu \nu \rho \sigma}_{a b});
ex:=Tr(\Gamma^{\mu} \Gamma^{\nu \rho} \Gamma^{\sigma});

Then call "join_gamma", "distribute", "untrace" until you only see traces of single gamma matrices. Finally "canonicalise" will kill all of them except Tr(1).

answered by (240 points)

A small improvement in the code

{\mu,\nu,\rho,\sigma}::Indices(vector).
{\mu,\nu,\rho,\sigma}::Integer(0..3).
{a,b,c,d}::Indices(spinor).
Tr{#}::Trace(indices=spinor).
\delta{#}::KroneckerDelta.
\Gamma{#}::GammaMatrix(metric=\delta).
\Gamma{#}::ImplicitIndex(\Gamma{#}_{a b}).
ex:=Tr(\Gamma^{\mu} \Gamma^{\nu \rho} \Gamma^{\sigma}).

Then

converge(ex):
    join_gamma(ex)
    distribute(_)
    untrace(_)
;

Finally

canonicalise(_);

This is in fact excellent! But needs some work in how to handle the unit from the Clifford algebra. It can't (to my knowledge) factor_out the trace.

...