kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

Joining gamma matrices with different index types is buggy/incomplete #261

Open kpeeters opened 1 year ago

kpeeters commented 1 year ago

Should either make the checks solid so that joins never work with mixed indices, or make it always do the same thing consistently.

{a,b}::Indices(flat, position=fixed).
{\mu, \nu}::Indices(curved, position=fixed).
\gamma{#}::GammaMatrix(metric=\eta);

and I would like to signal the following behavior of join_gamma.

Calling join_gamma on the following expression does nothing

ex:=\gamma_{a} \gamma_{\mu};

join_gamma(_);

while join_gamma works fine on expressions containing only one type of
indices. This implies that it is hard to manipulate these terms since
sort_spinors does not work if previously the gamma has not been joined.

Furthermore acting on a term like

ex2:=\gamma_{a}\gamma_{\mu}\gamma_{\nu}\gamma_{b};

it produces

(\gamma_{a  \mu}+\eta_{a \mu})\gamma_{\nu}\gamma_{b};