Whether this is odd or not depends a bit on what you were expecting.
First of all, in order to make the indices not be moved up/down at will, declare them with the position=fixed
argument, so on the first line
{\mu,\nu,\rho}::Indices(vector, position=fixed).
Otherwise declaring g_{\mu\nu}
a metric automatically makes the g
object with indices moved up or down a metric too. Which is nonsense (Cadabra cannot and will not warn against mathematical inconsistencies like this).
Now for the answer. As it stands above, the object \delta{g_{\mu\nu}}
is a metric (because the Metric
property is visible 'through' the Accent
) and can be used to lower the first index on the g^{\nu\rho}
object. That explains why you get g_{\mu}^{\rho}
as answer.
You may have expected that g^{\nu\rho}
would be used to instead raise the \nu
index on the \delta{g_{\mu\nu}}
. In that case you would probably want this to produce \delta{g_{\mu}^{\rho}}
. You can enforce this by simply not declaring that g_{\mu\nu}
is a metric (but only declaring that g^{\mu\nu}
is an inverse metric). If you drop the 2nd line in your example, you indeed get \delta{g_{\mu}^{\rho}}
.
Ideally Cadabra would understand that \delta{g_{\mu\nu}}
should not be used to lower indices, or maybe only on objects which carry a \delta
accent too. I have added this to the issue tracker at https://github.com/kpeeters/cadabra2/issues/305 to avoid the idea getting lost.