next up previous contents
Next: Transforming to the measurement Up: Mathematica for the Heisenberg Previous: Mathematica for the Heisenberg

 

Generating the coupled spin basis

The basis vectors of the coupled spin (energy eigenstate) basis tex2html_wrap_inline18003 are generated using genVecs[].

genVecs[ {rep_,order_,scale_} ] := 
         Block[ { a={},n,j,m,q,newrep },
                n=Length[rep]-order;
                q=2(order+1);
                If[ order<(n-1) ,
                    For[ j=Abs[rep[[q]]-rep[[q-1]]],
                         j<=(rep[[q]]+rep[[q-1]]),
                         j++,
                         newrep=Insert[rep,j,q+1] ;
                         a=Join[a,
                           genVecs[{newrep,order+1,scale}]] ;
                       ] ;
                  ] ;
                If[ order==(n-1) ,
                    For[ m=-rep[[q-1]], m<=rep[[q-1]], m++,
                         a=Join[a,{{Join[rep,{m}],n-1,scale}}]
                       ] ;
                  ] ;
                Return[a] ;
              ]

The arguments of genVecs are rep, a list of the spin values, order, the order of the representation given, usually 0, and scale, the value of the amplitude to be assigned to the vectors generated. For example,
 equation9687
produces the list of four vectors with their order and scale.
equation9694
Here the order has become 1 because one coupling has occurred between the two spins given.



David Wolf
Tue Mar 25 08:11:49 CST 1997