(* Enter the atom - 
        specific data. *) 

 (* 
      This defines the {S, L, J, I, 
          F} values for the states in the D1 and D2 lines of 6  
        Li *) 

StateA = {1/2, 0, 1/2, 
          1, 1/2};
StateB = {1/2, 0, 1/2, 1, 3/2};
StateC = {1/2, 1, 1/2, 1, 1/2};
StateD = {1/2, 1, 1/2, 1, 3/2};
StateE = {1/2, 1, 3/2, 1, 1/2};
StateF = {1/2, 1, 3/2, 1, 3/2};
StateG = {1/2, 1, 3/2, 1, 
          5/2};

 (* 
      The remainder of the code requries no modification *) 

 (* 
      Define functions for extracting quantum numbers from the state definitions *) 

Sval[state_] := state[[1]];
Lval[state_] := state[[2]];
Jval[state_] := state[[3]];
Ival[state_] := state[[4]];
Fval[state_] := 
        state[[5]];

  

\(\(Coeff[A_, ma_, B_, 
          mb_] := 
		\((\(-1\))\)^\((Fval[B] - 
                mb)\)*
		ThreeJSymbol[
						{Fval[
                B], \(-mb\)}, 
						{1, \((mb - 
                  ma)\)}, 
						{Fval[A], 
              ma}
					]*
		\((\(-1\))\)^\((Jval[B] + Ival[A] + Fval[A] + 
                1)\)*
		Sqrt[
				\((2*Fval[B] + 1)\)*\((2*Fval[A] + 
                  1)\)
			]*
		SixJSymbol[
					{Jval[B], Ival[A], 
              Fval[B]}, 
					{Fval[A], 1, 
              Jval[A]}
				\ \ \ ];\)

 (*\ 
      Define\ a\ function\ that\ runs\ over\ all\ possible\ m - 
        values\ in\ both\ F - 
        states\ to\ make\ a\ pretty\ \(\(table\)\(.\)\)\ *) 
\)
\(MakeTable[A_, 
        B_] := 
	\(\(Table[
		Table[
				Coeff[A, ma, B, 
              mb], 
			{mb, \(-Fval[B]\), Fval[B], 
              1}
			], 
		{ma, \(-Fval[A]\), Fval[A], 
            1}
		]\)\(//\)\(TableForm\)\(
\)\)\)