nextuppreviouscontents
Next:Finding the coupled spin Up:Mathematica for the Heisenberg Previous:Generating the coupled spin

Transforming to the measurement basis

The coupled-spin basis vectors are transformed from the energy eigenbasis to the tex2html_wrap_inline15403 basis using transVec[].
transVec[{rep_,order_,scale_}] :=
  Block[ { vec={},n=Length[rep],q,j1,m1,j2,m2,j12,m12,newrep } ,
         q = 2 order ;
         If[ order!=0 ,
             j1  = rep[[q-1]] ;
             j2  = rep[[q]]   ;
             j12 = rep[[q+1]] ;
             m12 = rep[[q+2]] ;
             For[ m1=-j1,m1<=j1,m1++,
                  m2=m12-m1 ;
                  If[ ((-j2<=m2) && (m2<=j2)),
                      newrep=Delete[rep,q+1] ;
                      newrep=Delete[newrep,q+1] ;
                      newrep=Insert[newrep,m1,q] ;
                      newrep=Insert[newrep,m2,q+2] ;
                      vec=Join[vec,
                      transVec[{newrep,
                      order-1,
                      scale*cg[j1,j2,m1,m2,j12,m12]}] ] ;
                    ] ;
                ] ; ,
            Return[{{rep,order,scale}}] ;
          ] ;
        Return[vec] ;
      ] ;
The argument of transVec is a length-three list consisting of rep, the representation of the basis vector in the basis produced by genVecs, order, the order of the representation given, usually N-1, where N is the number of spins (note that transVec is recursive, order keeps track of the depth), and scale, the value of the normalization of the vector generated. For example,
equation9711
transforms the vector tex2html_wrap_inline18037 to the vector
eqnarray9727
which is a list of three lists, each of these being a vector in the tex2html_wrap_inline18039 basis, along with an order and scale indicator, and the whole list to be interpreted as the sum of these vectors.

Along with transVec, the routine transVecs transforms a list of many vectors, such as would be produced by the output of genVecs.

transVecs[x_] :=
  Block[ {n,vecs={},i} ,
         n=Length[x] ;
         For[ i=1,i<=n,i++,
              vecs=Join[vecs,{transVec[x[[i]]]}] ;
            ] ;
         Return[vecs] ;
       ] ;
For example
equation9756
produces the output
eqnarray9762
which is a list of the four vectors in the tex2html_wrap_inline18047 basis corresponding to the four vectors in the coupled spin basis produced by the genVecs command in equation 13.1.
 


David Wolf

Tue Mar 25 08:11:49 CST 1997