Baker-Campbell-Hausdorff Series

Author

Eric W. Weisstein
April 13, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Algebra/Baker-Campbell-HausdorffSeries.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Baker-Campbell-HausdorffSeries.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Additional Authors

Code slightly cleaned up from
Matthias W. Reinsch
“A Simple Expression for the Terms in the Baker-Campbell-Hausdorff Series”
http://www.arxiv.org/abs/math-ph/9905012
13 Jan 2000

Code

p[n_,s_] := p[n,s] = Module[{i,j,F,G,qthpower,FGm1,q},
F = Table[1/(j-i)!,{i,n+1},{j,n+1}];
G = Table[1/(j-i)! Product[s[k],{k,i,j-1}],{i,n+1},{j,n+1}];
qthpower = IdentityMatrix[n+1];
FGm1 = F.G - qthpower;
Expand[
-Sum[qthpower=qthpower.FGm1;
(-1)^q/q qthpower,{q,n}][[1,n+1]]]
]

BCHTerm[1,l_List]:=Plus@@(ToString/@l)

BCHTerm[n_,{x_,y_}] :=Module[{temp,i,k,s},
 temp = Expand[Product[s[k]^2, {k,n}] p[n,s]];
Sum[term = Apply[List, temp[[i]]];
term[[1]] Apply[StringJoin,Take[term,-n] /. {s[i_]^2->ToString[x],s[i_]^3->ToString[y]}], {i,Length[temp]}]
]

p3[n_,s_] := p3[n,s] = Module[
{F,G,H,i,j,k,qthpower,FGm1,q},
F = Table[1/(j-i)! Product[s[k,"x"],{k,i,j-1}],{i,n+1},{j,n+1}];
G = Table[1/(j-i)! Product[s[k,"y"],{k,i,j-1}],{i,n+1},{j,n+1}];H = Table[1/(j-i)! Product[s[k,"w"],{k,i,j-1}],{i,n+1},{j,n+1}];
qthpower = IdentityMatrix[n+1]; 
FGm1 = F.G.H - qthpower;
Expand[-Sum[qthpower=qthpower.FGm1; (-1)^q/q qthpower,{q,n}][[1,n+1]]]
]

BCHTerm[n_,{x_,y_,z_}]:= Module[{temp},
temp = p3[n,s];
 Sum[term = Apply[List, temp[[i]]]; term[[1]]Apply[StringJoin,Take[term,-n]/.s[j_,k_]->k/.Thread[{"x","y","w"}->ToString/@{x,y,z}]],{i,Length[temp]}]
]

NoncommutativeForm[l_]:=l/;FreeQ[l,Times]

NoncommutativeForm[l_]:=Module[{coefs,vars},
{coefs,vars}=Transpose[List@@l/.Times:>List];
coefs.StringJoin/@(If[Length[#]==1,#[[1]],"\<\!\("<>#[[1]]<>"\^"<>ToString[Length[#]]<>"\)\>"]&/@Split[Characters[#]]&/@vars)
]

Table[{n,FactorTerms[BCHTerm[n,{x,y}]//NoncommutativeForm]},{n,5}]//ColumnForm

Table[{n,FactorTerms[BCHTerm[n,{x,y,w}]//NoncommutativeForm]},{n,4}]//ColumnForm