1

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

Philipp J
  • 11
  • 2
  • Did your Needs command return any errors? Is NormalOrder blue or black in your notebook? Have you tried loading the package file with Get instead, e.g. Get["C:\\path\\to\\NormalOrdering.m"]? If I do that, then your expression produces 2 a^2 + 4 c ** a^3 + c^2 ** a^4. – MarcoB Dec 19 '23 at 18:38
  • It normal-ordered correctly for me. But if I restricted the notebook's context to "unique to this notebook" then I could reproduce your problem. The relevant menu entry is Evaluation / Notebook's Default Context / Global`. – Stephen Luttrell Dec 19 '23 at 18:38
  • @MarcoB the Needs did not return any errors. Using Get with the path where the package is saved fixed the problem, now NormalOrder appears also in red color. Thank you very much guys! – Philipp J Dec 19 '23 at 18:49
  • You might want to just define your own bracket handling. Here is one prior thread along these lines. – Daniel Lichtblau Dec 19 '23 at 19:24

0 Answers0