I found a package that normal orders bosonic creation and annihilation operators for me. Here is the link to the package and explanation of normal ordering:
https://en.wikipedia.org/wiki/Normal_order
https://library.wolfram.com/infocenter/MathSource/625/
Now I tried to normal order the expression
$$ \mathcal{N}(aa^{\dagger}aaa^{\dagger}a) = {a^{\dagger}}^{2}a^{4} + 4a^{\dagger}a^{3} + 2a^{2} $$
with the following code having the package file installed in Mathematica
Needs["NormalOrdering`"]
normalorder = NormalOrder[a ** c ** a^2 ** c ** a]
However, Mathematica only returns the initial expression. Now I ask myself whether I do something cardinally wrong and would be glad if someone can help me. Thanks in advance!
Kind regards,
Philipp
Needscommand return any errors? IsNormalOrderblue or black in your notebook? Have you tried loading the package file withGetinstead, e.g.Get["C:\\path\\to\\NormalOrdering.m"]? If I do that, then your expression produces2 a^2 + 4 c ** a^3 + c^2 ** a^4. – MarcoB Dec 19 '23 at 18:38Needsdid not return any errors. UsingGetwith the path where the package is saved fixed the problem, nowNormalOrderappears also in red color. Thank you very much guys! – Philipp J Dec 19 '23 at 18:49