I am trying to use the SNEG Library for evaluating some commutators. For instance I am trying to evaluate $$ \left[n_1^2,a^\dagger_1\right]$$ with the code in Mathematica

<< sneg`;
nSquare = (nc[number[a[1]], number[a[1]]]);
aCR1 = a[CR, 1];
Comm1 = komutator[nSquare, aCR1] // SnegFullSimplify

The result using SNEG is $$ a_1^\dagger + 2 a_1^\dagger \cdot a_1^\dagger \cdot a_1 $$.

However I would like to simplify it to $$ a_1^\dagger + 2 a_1^\dagger \cdot n_1 $$, automatically.

Is there any way to tell SNEG to simplify the expression in this way?

  • 1
    $\begingroup$ You could write your own replacement rule, snegbosonoperators[n]; Comm1 /. nc[bef___, sym_[0, 1], sym_[1, 1], aft___] :> nc[bef, n[1, 1], aft] $\endgroup$ – Jason B. Aug 8 '18 at 16:25
  • $\begingroup$ Thank you! It's a good idea and it works. $\endgroup$ – Galuoises Aug 9 '18 at 9:17
  • $\begingroup$ Anyhow how this could be generalized to the case of more operators, namely $n_1$, $n_2$, ... ? $\endgroup$ – Galuoises Aug 9 '18 at 9:22
  • $\begingroup$ Sneg is a very nice QFT package. I had seen it many years ago and then forgotten it. I am glad you brought it up. Unfortunately it seems that it has not been maintained that much in the recent years. For example the documentation files, which seem quite good (see the "number" doc file for example ), are not directly accessible from the documentation center in version 11.3 . I have not tested older versions. Which version of Mathematica are you using? $\endgroup$ – magma Aug 16 '18 at 10:47
  • $\begingroup$ I now try to contact the developer and see what we can do about it $\endgroup$ – magma Aug 16 '18 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.