(*
   Compute the coeeficients of newy as functions of those of y:

        exp(newy) = exp(x) exp(y) .

                           Ren-Cang Li, June 1, 1996
                           na.rcli@na-net.ornl.gov   
*)

Print["Load BCH Formula"];
<<expXexpY;

<<CompHead;

Print["Load definitions for various functions"];
<<DefFun;

(* Define x and y *)
x = g t Y; 
y=( t   a1 X 
   +t   b1 Y
   +t^2 a2 a2Cmt
   +t^3 a3 a3Cmt
   +t^3 b3 b3Cmt
   +t^4 a4 a4Cmt
   +t^4 b4 b4Cmt
   +t^5 a5 a5Cmt
   +t^5 b5 b5Cmt
   +t^5 c5 c5Cmt
   +t^5 d5 d5Cmt
   +t^6 a6 a6Cmt
   +t^6 b6 b6Cmt
   +t^6 c6 c6Cmt
   +t^6 d6 d6Cmt
   +t^6 e6 e6Cmt
   +t^7 a7 a7Cmt
   +t^7 b7 b7Cmt
   +t^7 c7 c7Cmt
   +t^7 d7 d7Cmt
   +t^7 e7 e7Cmt
   +t^7 f7 f7Cmt
   +t^7 g7 g7Cmt
   +t^7 h7 h7Cmt
   +t^7 i7 i7Cmt 
   +t^7 j7 j7Cmt );

Print["Compute all terms"];
<<CompCoeff;

(* Four more rules *)

Cmt[Cmt[X,Cmt[X,Y]],z_Cmt]:=-Cmt[Cmt[Cmt[X,Y],z],X]-Cmt[Cmt[z,X],Cmt[X,Y]];
Cmt[Cmt[Y,Cmt[X,Y]],z_Cmt]:=-Cmt[Cmt[Cmt[X,Y],z],Y]-Cmt[Cmt[z,Y],Cmt[X,Y]];
Cmt[z_Cmt,Cmt[Y,Cmt[X,Y]]]:=-Cmt[Y,Cmt[Cmt[X,Y],z]]-Cmt[Cmt[X,Y],Cmt[z,Y]];
Cmt[z_Cmt,Cmt[X,Cmt[X,Y]]]:=-Cmt[X,Cmt[Cmt[X,Y],z]]-Cmt[Cmt[X,Y],Cmt[z,X]];

Print["Compute and Dump coefficients"]
<<DumpCoeff;

CopyFile["Coeff", "YCoeff"];  DeleteFile["Coeff"];
CopyFile["Coeffp","YCoeffp"]; DeleteFile["Coeffp"];
