I have a set of "functions operators", say A1[u],A2[u],A3[u],and I would like to define a rule such that, for instance,
(x*A1[u1]).(y*A2[u2])
returns
x*y*A1[u1].A2[u2]
I have been trying something like:
operatorset = {A1[u1],A2[u1],A3[u1],A1[u2],A2[u2],A3[u2]};
distri = Dot -> Composition[Distribute, Dot];
rule1 = {Dot[Times[scalar1__, z1_ /; MemberQ[operatorset, z1]],
Times[scalar2__, z2_ /; MemberQ[operatorset, z2]]] ->
scalar1*scalar2 *z1.z2};
It works, however, I will need this kind of product when the operators have other arguments, like A1[u1^2], A2[u3], etc.
Is there a way to define an "operatorset" where each operator has arbitrary arguments?
Thanks in advance.