(*  six_j_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Wigner 6j coefficient*)
(*    at selected argument values *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  07 February 2007 *)
(*  Author:  John Burkardt *)

j1vec={ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
j2vec={ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8};
j3vec={ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};
j4vec={ 13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2,13/2};
j5vec={ 15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2};
j6vec={ 15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2,15/2};
fvec = {};
num = Length [ j1vec ];

Do [ { j1= j1vec[[i]], 
       j2=j2vec[[i]],
      j3 = j3vec[[i]],
      j4 = j4vec[[i]],
      j5 = j5vec[[i]],
      j6 = j6vec[[i]],
     f=SixJSymbol[{j1,j2,j3},{j4,j5,j6}],fvec = Append [ fvec, f],
      Print["6J[{",j1,",",j2,",",j3,"},{",j4,",",j5,",",j6,"} = ",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt.BURKARDTPC\\Desktop\\Misc\\mathematica\\six_j_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  six_j_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  j1  j2  j3  j4  j5  j6  f"];
Write[fileout,"#"];
Do[{j1=j1vec[[i]];j2=j2vec[[i]];j3=j3vec[[i]];j4=j4vec[[i]];j5=j5vec[[i]];j6=j6vec[[i]];f=fvec[[i]];Write[fileout,N[j1,2],"  ",N[j2,2],"  ",N[j3,2],"  ",N[j4,2],"  ",N[j5,2],"  ",N[j6,2],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];