- 457
- 40
I have a statement that looks like :
vD.vD.vD.vD
Where vD is noncommutative (but that doesn't really matter)
I want to replace it so that each vD becomes v[a].D[a]
But I would like it so the "a" is not repeating. So I need somehow a function that each time it is run returns it with an increased index : v[a[1]].D[a[1]]
So that
vD.vD.vD /.{vD :> FXN}
results in
v[a[1]].D[a[1]].v[a[2]].D[a[2]].v[a[3]].D[a[3]]
Does anyone know how to do this?
vD.vD.vD.vD
Where vD is noncommutative (but that doesn't really matter)
I want to replace it so that each vD becomes v[a].D[a]
But I would like it so the "a" is not repeating. So I need somehow a function that each time it is run returns it with an increased index : v[a[1]].D[a[1]]
So that
vD.vD.vD /.{vD :> FXN}
results in
v[a[1]].D[a[1]].v[a[2]].D[a[2]].v[a[3]].D[a[3]]
Does anyone know how to do this?