I want to be able to take an Indexed object, substitute values for its indices but still remember its original indices.
from sympy.tensor import IndexedBase, Idx
C = IndexedBase("C")
i,j = Idx("i"), Idx("j")
expr = C[i,j]
expr = expr.subs({i:1, j:2})
Is it possible to get the original indices (i,j) from expr? Since expressions are immutable any modifications I do on the original expression won't show up in the new expression.
I suppose the general question here is how do I attach additional information to Sympy symbols.