a field-theory motivated approach to computer algebra

## join_gamma

Work out the product of two generalised Dirac gamma matrices.
Join two fully anti-symmetrised gamma matrix products according to the expression $$\Gamma^{b_{1}\dots b_{n}}\Gamma_{a_{1}\dots a_{m}} = \sum_{p=0}^{\text{min}(n,m)}\ \frac{n! m!}{(n-p)! (m-p)! p!} \Gamma^{[b_{1}... b_{n-p}}{}_{[a_{p+1}... a_{m}} \eta^{b_{n-p+1}... b_{n}]}{}_{a_{1}... a_{m-p}]} \, .$$ This is the opposite of split_gamma. Without further arguments, the anti-symmetrisations will be worked out explicitly (changed from v1). The setting the flag "expand" to false instead keeps them implicit. Compare
\Gamma{#}::GammaMatrix(metric=g). ex:= \Gamma_{m n} \Gamma_{p}; join_gamma(ex, expand=False);
$$\displaystyle{}\Gamma_{m n} \Gamma_{p}$$
\Gamma_{m n} \Gamma_{p}
$$\displaystyle{}\Gamma_{m n p}+2\Gamma_{m} g_{n p}$$
\Gamma_{m n p} + 2\Gamma_{m} g_{n p}
with
\Gamma{#}::GammaMatrix(metric=g). ex:= \Gamma_{m n} \Gamma_{p}; join_gamma(ex, expand=True);
$$\displaystyle{}\Gamma_{m n} \Gamma_{p}$$
\Gamma_{m n} \Gamma_{p}
$$\displaystyle{}\Gamma_{m n p}+\Gamma_{m} g_{n p}-\Gamma_{n} g_{m p}$$
\Gamma_{m n p} + \Gamma_{m} g_{n p}-\Gamma_{n} g_{m p}
Note that the gamma matrices need to have a metric associated to them in order for this algorithm to work.
In order to reduce the number of terms somewhat, one can instruct the algorithm to make use of generalised Kronecker delta symbols in the result; these symbols are defined as $$\delta^{r_1}{}_{s_1}{}^{r_2}{}_{s_2}\cdots{}^{r_n}{}_{s_n} = \delta^{[r_1}{}_{s_1}\delta^{r_2}{}_{s_2}\cdots {}^{r_n]}{}_{s_n}\, .$$ Anti-symmetrisation is implied in the set of even-numbered indices. The use of these symbols is triggered by the use_gendelta option,
{m,n,p,q}::Indices(position=fixed). \Gamma{#}::GammaMatrix(metric=\delta). ex:=\Gamma_{m n} \Gamma^{p q}; join_gamma(_, use_gendelta=True);
$$\displaystyle{}\Gamma_{m n} \Gamma^{p q}$$
\Gamma_{m n} \Gamma^{p q}
$$\displaystyle{}\Gamma_{m n}\,^{p q}+\Gamma_{m}\,^{q} \delta_{n}\,^{p}-\Gamma_{m}\,^{p} \delta_{n}\,^{q}-\Gamma_{n}\,^{q} \delta_{m}\,^{p}+\Gamma_{n}\,^{p} \delta_{m}\,^{q}+2\delta_{n}\,^{p}\,_{m}\,^{q}$$
\Gamma_{m n}^{p q} + \Gamma_{m}^{q} \delta_{n}^{p}-\Gamma_{m}^{p} \delta_{n}^{q}-\Gamma_{n}^{q} \delta_{m}^{p} + \Gamma_{n}^{p} \delta_{m}^{q} + 2\delta_{n}^{p}_{m}^{q}