I'm calculating some Gamma Matrices identities in $N$ dimensions. And I don't know how to factorise correctly the $N$ with other numbers.
{m,n,p,q,r,s,t,u,v}::Indices(flat, position=independent).
{m,n,p,q,r,s,t,u,v}::Integer(1..N).
N::Integer.
\delta_{m n}::KroneckerDelta.
\delta^{m n}::KroneckerDelta.
\delta^{m}_{n}::KroneckerDelta.
\delta_{m}^{n}::KroneckerDelta.
\Gamma^{#{m}}::GammaMatrix(metric=\delta).
def post_process(ex):
join_gamma(ex)
distribute(ex)
eliminate_kronecker(ex)
join_gamma(ex)
distribute(ex)
eliminate_kronecker(ex)
canonicalise(ex)
sort_product(ex)
collect_factors(ex)
ga_m_ga_n_ga_m := \Gamma^{m} \Gamma_{n} \Gamma_{m}.
collect_terms(_)
factor_out(_, $\Gamma_{n}$);
I get
$$ 2 \Gamma_n - N \Gamma_n $$
Question
How can this be factorised as $ (2 - N) \Gamma_n$ ?
UPDATE 1
It seems that the problem is with the port_process function. I tried the code
{m,n,p,q,r,s,t,u,v}::Indices(flat, position=independent).
{m,n,p,q,r,s,t,u,v}::Integer(1..N).
N::Integer.
\delta_{m n}::KroneckerDelta.
\delta^{m n}::KroneckerDelta.
\delta^{m}_{n}::KroneckerDelta.
\delta_{m}^{n}::KroneckerDelta.
\Gamma^{#{m}}::GammaMatrix(metric=\delta).
ga_m_ga_n_ga_m := \Gamma^{m} \Gamma_{n} \Gamma_{m}.
join_gamma(_)
distribute(_)
eliminate_kronecker(_)
join_gamma(_)
distribute(_)
eliminate_kronecker(_)
canonicalise(_)
collect_terms(_)
factor_out(_, $\Gamma_{n}$);
and it works fine, $\Gamma_n (2-N)$
New Questions
- How could this processes be compatibilised?
- How can I generalise the
factor_out
algorithm to take out gammas with different number of indices?