MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Commutators with boson operators

  • To: mathgroup at
  • Subject: [mg97865] Re: Commutators with boson operators
  • From: "Steve Luttrell" <steve at>
  • Date: Tue, 24 Mar 2009 05:31:03 -0500 (EST)
  • References: <gq2epg$e90$>

Make some definitions to tell Mathematica how to do your operator algebra:

comm[x_, y_] := opprod[x, y] - opprod[y, x];

opprod[u___, ann, cre, v___] := opprod[u, v] + opprod[u, cre, ann, v];
opprod[u___, (f_: 1) opprod[v___], w___] := f opprod[u, v, w];
opprod[u___, {v___}, w___] := opprod[u, v, w];
opprod[u___, (f_: 1) (x_ + y_), v___] := f opprod[u, x, v] + f opprod[u, y, 
opprod[] := opprod[id];
opprod[u___, a_?NumberQ, v___] := a opprod[u, v];
opprod[u___, a_ v_, w___] /; FreeQ[a, opprod] := a opprod[u, v, w];
opprod[u__, id, v___] := opprod[u, v];
opprod[u___, id, v__] := opprod[u, v];

I copied these definitions from an operator algebra problem that I solved 
many years ago, so some of the definitions may not actually be necessary to 
solve your problem. It would probably be a good idea to work up a fresh set 
of definitions that suit your particular type of problem.

Define a function for building the operator expressions that interest you:

func[{a_, b_, c_, d_, e_, f_, g_}] :=
  a opprod[id] + b opprod[cre] + c opprod[ann] + d opprod[cre, ann] +
   e opprod[ann, cre] + f opprod[cre, cre] + g opprod[ann, ann];

You could make this definition more general than the one I have given.

Create 3 operator expressions to play with:

func1 = func[{a1, b1, c1, d1, e1, f1, g1}];
func2 = func[{a2, b2, c2, d2, e2, f2, g2}];
func3 = func[{a3, b3, c3, d3, e3, f3, g3}];

Evaluate and simplify a commutator of the form [A,B]:

comm[func1, func2] // Collect[#, opprod[___], Simplify] &

(-c2 (d1+e1)+c1 (d2+e2)+2 b2 g1-2 b1 g2) opprod[ann]+(b2 (d1+e1)-b1 
(d2+e2)-2 c2 f1+2 c1 f2) opprod[cre]+(b2 c1-b1 c2+2 f2 g1-2 f1 g2) 
opprod[id]+2 (d2 g1+e2 g1-(d1+e1) g2) opprod[ann,ann]+(4 f2 g1-4 f1 g2) 
opprod[cre,ann]+2 (-d2 f1-e2 f1+(d1+e1) f2) opprod[cre,cre]

Evaluate and simplify a commutator of the form [A,[B,C]]:

comm[func1, comm[func2, func3]] // Collect[#, opprod[___], Simplify] &

(c3 (d2 e1+e1 e2+d1 (d2+e2)-4 f2 g1)-c2 (d3 e1+e1 e3+d1 (d3+e3)-4 f3 g1)-2 
(b3 (-d2 g1-e2 g1+(d1+e1) g2)+b2 (d3 g1+e3 g1-(d1+e1) g3)+2 (-c1 f3 g2+c1 f2 
g3+b1 (d3 g2+e3 g2-(d2+e2) g3)))) opprod[ann]+(b3 (d2 e1+e1 e2+d1 (d2+e2)-4 
f1 g2)-b2 (d3 e1+e1 e3+d1 (d3+e3)-4 f1 g3)-2 (c3 (-d2 f1-e2 f1+(d1+e1) 
f2)+c2 (d3 f1+e3 f1-(d1+e1) f3)+2 (c1 (d3 f2+e3 f2-d2 f3-e2 f3)+b1 (f3 g2-f2 
g3)))) opprod[cre]+(-b2 c1 d3-b2 c1 e3-2 c1 c3 f2+2 c1 c2 f3-4 d3 f2 g1-4 e3 
f2 g1+4 d2 f3 g1+4 e2 f3 g1-4 d3 f1 g2-4 e3 f1 g2+b3 (c1 (d2+e2)-2 b1 g2)+4 
d2 f1 g3+4 e2 f1 g3+b1 (c3 (d2+e2)-c2 (d3+e3)+2 b2 g3)) opprod[id]+4 (-d3 e1 
g2-e1 e3 g2+2 f3 g1 g2+d2 e1 g3+e1 e2 g3-2 f2 g1 g3+d1 (-d3 g2-e3 g2+(d2+e2) 
g3)) opprod[ann,ann]+8 (-d3 (f2 g1+f1 g2)-e3 (f2 g1+f1 g2)+(d2+e2) (f3 g1+f1 
g3)) opprod[cre,ann]+4 (-d3 e1 f2-e1 e3 f2+d2 e1 f3+e1 e2 f3+d1 (-d3 f2-e3 
f2+(d2+e2) f3)-2 f1 f3 g2+2 f1 f2 g3) opprod[cre,cre]

Stephen Luttrell
West Malvern, UK

"Volodymyr" <ktpist at> wrote in message 
news:gq2epg$e90$1 at
> Hello,
> I need some help.
> I want to write code that Mathematica would calculate commutators [A,B], 
> [A,[B,C]] and so on...,
> where A,B,C,D,... are functions like
> A = a+ b*creat + c*annih + d*creat**annih + e*annih**creat + 
> f*creat^2+g*annih^2+...
> where a,b,c,d,... are usual complex numbers;
> and annih & creat are boson noncommutative operators
> that satisfy commutation relation:
> [annih, creat] = 1.
> Thank you in advance!

  • Prev by Date: Re: Recursive algorithm
  • Next by Date: Re: utterly confused by Lightweight Grid
  • Previous by thread: Re: Commutators with boson operators
  • Next by thread: Re: Commutators with boson operators