Grouping similar indices together in an expression

*To*: mathgroup at smc.vnet.net*Subject*: [mg65242] Grouping similar indices together in an expression*From*: "David Sanders" <dpsanders at gmail.com>*Date*: Tue, 21 Mar 2006 07:46:03 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Hi, I am a newbie in Mathematica, and am trying to do the following. I have terms which look like a[i] a[j] b[i] b[j] I need to apply a function F, for which I need to group the different indices (by which I mean i, j) together as follows: F(a[i] a[j] b[i] b[j]) = F(a[i] b[i]) F(a[j] b[j]) I do not in general know how many different indices there might be in a term. E.g. I might have a[i] a[j] a[k] b[j] Could somebody please give me a hint as to how to do this? Thanks, David.

**Follow-Ups**:**Re: Grouping similar indices together in an expression***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>