# Symbolic calculations with operator ordering

Given the following set of equations:

       a*opA = b*opB + c*opC;
b*opB = a*opA + c*OpC;
a*opAprime = b*opBprime + c*opCprime;
b*opBprime = a*opAprime + c*OpCprime;


where a,b,c are complex coefficients and the quantities opA , opB, opC, opAprime, opBprime, opCprime are some operators which do not commute in general. How to make Mathematica to do the addition of these two equations and that the "numbers" and "operators" are written separately, something like when adding first and third equation as:

a*(opA+opAprime) = b*(opB+opBprime) + c*(opC+opCprime)


As there is no multiplication of operators in these equations, there is no problem of commutation. The "*" is an ordinary multiplication relative to a scalar. Therefore you may write:

e1 = a*opA == b*opB + c*opC;
e2 = b*opB == a*opA + c*OpC;
e3 = a*opAprime == b*opBprime + c*opCprime;
e4 = b*opBprime == a*opAprime + c*OpCprime;


And the to add equaions, e.g.:

e1[[1]] + e3[[1]] == e1[[2]] + e3[[2]] // Simplify

a (opA + opAprime) == b (opB + opBprime) + c (opC + opCprime)

• Thanks, @Daniel. I was wondering whether it would be possible to instruct Mathemtica to replace the sum of operators by a different letter, say /.{opA+opAprime->A}. But /. doesn't seem to work here. Could you suggest some way of doing this?
– Jee
Commented Apr 15 at 11:54
• Your proposal works: a (opA + opAprime) == b (opB + opBprime) + c (opC + opCprime) /. {opA + opAprime -> A}this evaluates to a A == b (opB + opBprime) + c (opC + opCprime) Commented Apr 15 at 12:03