Add
substitute(ex, $g_{a}^{b} = \delta_{a}^{b}$)
to your post_process function.
Yes, I know that will definitely work, but I was thinking about why does it give that answer, as there does not exist a metric with one index of each kind, it's a Kronecker delta (and it's treated like that by cadabra).
My point is: don't you think that the substitution should be automatic?
Anyway, thanks a lot for your quick answer. =)
If you want that to happen automatically, use
g_{a}^{b}::LaTeXForm("\delta").
This keeps it g_{a}^{b}
internally, but displays as δab.
I tried
{a,b,c}::Indices.
g_{a b}::Metric.
g_{a}^{b}::LaTeXForm("\delta")
d:=g_{a b} g^{b c};
eliminate_metric(_);
And it doesn't work. What am I doing wrong?