Hi Luca and Kasper.
I was puzzled by your post Luca, and wanted to try myself. FYI I'm using a fair new version of cadabra (Version 2.3.9 (build 2829.40f334a67c dated 2022-08-05)
).
Your code
First let me point that I copy your code and my cadabra session got stocked! Weird, because so far you're defining a expression.
- Problem: there is a
\+
in your ex
.
- Solution: Change
\+
by +
.
Then, unlike Kasper, I reproduce your error! Even more puzzled...
Since you're not computing anything (yet), I tried the rendering.
- Possible problem: Rendering options.
- Solution: simplifying the rendering properties.
Then, I got the expected result.
Updated code
NOTE: I've added the algorithms suggested by Kasper
{\alpha,\beta,\gamma,\delta,\alpha#,\beta#}::Indices(spinor, position=fixed).
{a,b,c,d,e,a#, b#}::Indices(flat,position=fixed).
\gamma{#}::GammaMatrix(metric=\eta);
\delta{#}::KroneckerDelta.
{\psi1, \psi2}::Spinor(dimension=4, type=Majorana);
\bar{#}::DiracBar.
# {\psi1, \psi2}::AntiCommuting.
# {\psi1, \psi2}::SortOrder.
# \psi1::LaTeXForm("\psi_{1}").
# \psi2::LaTeXForm("\psi_{2}").
ex:= \bar{\psi1} \gamma_{a b} \gamma_{c} \psi2 + \bar{\psi2} \gamma_{a b} \gamma_{c} \psi1;
join_gamma(_)
distribute(_)
sort_spinors(_);
See the result in an image
UPDATE 1
Sorry I noticed that I commented a couple of desired properties...
The new code
{\alpha,\beta,\gamma,\delta,\alpha#,\beta#}::Indices(spinor, position=fixed).
{a,b,c,d,e,a#, b#}::Indices(flat,position=fixed).
\gamma{#}::GammaMatrix(metric=\eta);
\delta{#}::KroneckerDelta.
{\psi1, \psi2}::Spinor(dimension=4, type=Majorana);
\bar{#}::DiracBar.
{\psi1, \psi2}::AntiCommuting.
{\psi1, \psi2}::SortOrder.
# \psi1::LaTeXForm("\psi_{1}").
# \psi2::LaTeXForm("\psi_{2}").
ex:= \bar{\psi1} \gamma_{a b} \gamma_{c} \psi2 + \bar{\psi2} \gamma_{a b} \gamma_{c} \psi1;
join_gamma(_)
distribute(_)
sort_spinors(_);
See the new result