I compute a product of Bose operators and turn it into normal ordering using Boson commutation relations, e.g:
c1 * SuperDagger[a] ** SuperDagger[a] ** a ** a +
c2 * SuperDagger[a] ** SuperDagger[a] ** SuperDagger[a] ** a ** a ** a
and generally more terms. In the above c1, c2
are scalars while a, SuperDagger[a]
are the Bose operators.
I can convert it to a more readable form by adding
/.NonCommutativeMultiply[a___] :> Infix[NonCommutativeMultiply[a],"\[InvisibleTimes]"]
at the end of the evaluation command, which makes the **
symbol invisible (output is not displayed correctly here, sorry).
I would like to know whether I can make such expressions more readable by having in the output the various terms in the form SuperDagger[a]^3 a^3
and NOT like
SuperDagger[a] SuperDagger[a] SuperDagger[a] a a a
Also how can I isolate specific powers e.g SuperDagger[a]^2 a^2
in a long expression involving many different powers of SuperDagger[a]^n a^n
and get their display only, e.g:
(3 * c1 + 5 * c0 + 7 * c6) SuperDagger[a] ** SuperDagger[a] ** a ** a
Collect doesn't do the trick.