Greetings,
This short example
{a,b,c,d,e,f#}::Indices.
foo := A^{a} A^{b} g_{a b}.
substitute (foo,$A^{a}->B^{a}$)
does what you'd expect. It returns
foo := B^{a} B^{b} g_{a b}
But the following code
foo := A^{a} A^{b} g_{a b}.
substitute (foo,$A^{a}->{B}^{a}$)
returns
foo := B B g_{a b}
Now that seems wrong to me.
Any thoughts?
My guess is that the curly-braces around B in the second assignment disconnects B from the following indices. Those indices are orphaned and are thus lost in the substitution.
The simple answer is -- Don't use unnecessary curly-braces.
Cheers,
Leo