I have an expression that involves subscripts, powers and products, for example:
$3(m-1)^2 \alpha_{a,b}^c \alpha_{d,e} + n \alpha_{f,g}^h$
(Sorry, I had to use TeX, but read it as mathematica input expression.)
I want to replace the product of only alpha's, $\alpha_{a,b}^c \alpha_{d,e}$ and $\alpha_{f,g}^h$, with a function y[{{c,{a,b}},{1,{d,e}}]
and y[{{h,{f,g}}}]
, (note the 1 for the omitted exponent). That is turn it into the following form: 3(m-1)^2 y[{{c,{a,b}},{1,{d,e}}] + n y[{{h,{f,g}}}]
In general, in any expression, replace the product of powers of subscripted alpha's (could be one, two or more alpha's in each product), with the function y
taking for argument a list of the exponents and subscripts of each term in the product.
Edit: In a general case, not all alphas have the same number of subscripts. Could be: $3(m-1)^2 \alpha_{a,b}^c \alpha_{d,e} + n \alpha_{f,g,i}^h$
Can this be done? I'm not sure how to approach this.