I am new to Mathematica and am trying to apply it to quantum mechanics problems.
The practice project I am dealing with now is considering quantum harmonic oscillator and ladder operator algebra used to solve it. I had to define replacements, which would take into account all of the algebraic properties when dealing with ladder operators (linearity, commutation relation, non-commutative product, etc.), and then apply these replacements to the Hamiltonian in standard p-x form to convert it into ladder operator form.
I've encountered a bit of a snag in the final replacement, which should expand:
(a+b)^2 = a**a + a**b + b**a + b**b
a, b are operators. Conventional
// Expand does this commutatively. Is there a way to do it for a general power?
All the help is much appreciated!