I am looking the achieve a working set of Mathematica functions that would allow me to take products, commutators, etc. of (2x2) matrix differential operators and apply them to vector-valued functions of the form {f[x], g[x]}.
Here is what I have now and the problem I am encountering. The function
CircleTimes[a_,b_]:=Inner[Composition[#1,#2]&,a,b]
does the right job of computing the matrix operator resulting from the product of two matrix differential operators a and b. With the function
CenterDot[a_,v_]:=Inner[Through[#1[#2]&, Plus],a, v]
one can compute the action of the matrix differential operator a on the vector-valued function v, and it seems to be working fine.
Problems arise when I want to compute the products of more than 2 operators or their commutator on vector-valued functions.
For example, if one defines
d=CircleTimes[a,CircleTimes[b,c]]
which is the matrix operator corresponding to a x b x c, then
v=CenterDot[d,{f[x],g[x]}]
does not produce anything useful. The same happens if we define for example the anticommutator
e=Plus[CircleTimes[a,b], CircleTimes[b,a]]
then
w=CenterDot[e,{f[x],g[x]}]
does not apply properly. It seems that Mathematica does not complete the process of applying the various operators to the functions f[x] and g[x].
You can try with the following operators to see the problem
I1:={{0 &, (x # + D[#,x] &)}, {0 &, - D[#,x] &}
I2:= {{0 &, x^2# &}, {0 &, D[#,x] &}
We see that with
u={f[x],g[x]}
the following are perfectly computed
CenterDot[I1,u]
CenterDot[I2,u]
CenterDot[CircleTimes[I1,I2],u]
but trying to evaluate thing like the anticommutator in the following way
I3:=Plus[CircleTimes[I1,I2], CircleTimes[I2,I1]]
CenterDot[I3,u]
one finds that Mathematica does not complete the evaluation and we are left with stuff.
My guess is that I should be telling Mathematica to apply the "Through" function as long as there are things to evaluate, but I am not sure how this can be done.
Hope this is clear :)
Many thanks !
I add the following for the sake of information; see the first answer for a better solution (I think).
As a way to have Mathematica evaluate everything correctly, I came up with the following modification of the CenterDot[a_,b_] function. It reads
CenterDot[a_,b_]:=FixedPoint[Through[#,Plus]&/@# &,#]&/@Inner[#1[#2]&,a,b]
This arranges for Mathematica to perform all evaluations, distributing over the sums. It is also suitable for combination with the CirclePlus[a_,b_] defined in the first answer.

The only problem remaining is that something strange happens when the operators are ordinary matrices. For example if we want to add the Identity to the Identity with CirclePlus[a_,b_] as defined above, one gets thins like 2[f[x]] like "2" is an operator waiting to be evaluated. (Even though the identity was defined as a true operator)
– Vincent Dec 17 '14 at 00:16PlusinsideThreadis not held unevaluated when its arguments have values that are known at the time of evaluation. To make it works for such cases it's probably best to avoidPlus- I'll edit the answer to deal with the example you gave. – Jens Dec 17 '14 at 02:46