[Date Index] [Thread Index] [Author Index]
rearranging symbolic variables
I have a group of symbolic variables that look like this phi_1.phi_3.phi_1.phi_2 + phi_2.phi_1.phi_1.phi1 + ..... Need to rearrange the above expression such that all the (phi_1)s are on the left and all (phi_2)s are to right side of (phi_1)s but to the left of (phi_3)s i.e. REWRITE the above as phi_1.phi_1.phi_2.phi_3 + phi_1.phi_1.phi_1.phi_2 + .... The dots may not be necessarily multiplication, they may be just strings with a certain combination of (phi_1)s and (phi_2)s in a certain order, to be ordered in a given way. Any help is appreciated.