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

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?
in General questions by (15.1k points)
edited by

1 Answer

+1 vote
 
Best answer

I would do this as follows:

{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{#}::KroneckerDelta.
\Gamma{#}::GammaMatrix(metric=\delta).

ex := \Gamma^{m} \Gamma_{n} \Gamma_{m q};

converge(_):
   join_gamma(_)
   distribute(_)
   eliminate_kronecker(_)
   distribute(_)
   sort_product(_)
   canonicalise(_)
;

factor_out(_, $\Gamma_{n q}, \delta_{n q}$);

The converge logic takes care of applying the join_gamma and associated cleanup things until the expression no longer changes. Worth learning (it's a Cadabra extension, not standard Python). The ; after the converge block makes it print only the final result.

The factor_out algorithm isn't as smart as I would like it to be (you cannot, for instance, give it the \Gamma{#} pattern to factor out all \Gamma with equal index structure). Every time I plan to sit down to fix this, something else (and more urgent) pops up.

by (83.1k points)
selected by
...