I have an expression which is a sum of undefined function
v[n1,n2,n3,n4] with 4 arguments (
n_i are integers):
expr=a*v[n1, n2, n3, n4] + b*v[n5, n6, n7, n8] + c*v[n9, n10, n11, n12] + ....
Now I increase or decrease the
i-th argument of
expr, and also multiply each term with the value of
example=v[1,1,1,1]+10*v[0,0,2,0] inc[example,3] (* first argument is the expression, second argument is the index of v that should be increased *) (* example -> example=v[]*v[1,1,1+1,1]+10*v[]*v[0,0,2+1,0] -> example=1*v[1,1,2,1]+10*2*v[0,0,3,0] *)
In reality, my
v has much more terms, therefore hardcoding
inc for each index is not feasible. I think I know how to do it with an ugly
For loop, but I hope that there is some clever Mathematica-style way.