src/IntRank2/IntRank2.cc
/* We set the 5 spherical spin tensor components applicable to interactions
   involving a single spin interacting with a static magnetic field. Two such
   cases would be shift anisotropy (NMR) & g electron (EPR) interactions. Since
   this class maintains "scaled" spin tensors, all single spin - field
   interactions will share the same spin tensors. The 5 spin tensor components
   (arrays) will only differ between single spin interactions if the spin
   quantum value differs (or if the field orientation is set differently). 
   Typically, the static magnetic field is taken to be a normalized vector
   pointing along +z.  This class maintains a static linked list of such
   spin tensors to avoid regenerating them during computations involving
   multi-spin systems.
                                          +
                                       m  |
                            T    = (-1)  T
                             2,m          2,-m

                   1/2
                [4]                      1
          T   = |-| * I         T    = - - I           T    = 0
           2,0  [6]    z         2,1     2  +           2,2

                                  SINGLE SPIN - FIELD INTERACTIONS
           Input        R2I     : Rank 2 interaction (this)
           Output       none    : Interaction Spin Tensor spherical
                                  spin components are generated
	   Note			: Dont Forget To Set Ival & Sval 1st
           Note                 : For G interactions Ival is usually 2
                                  (Ival = 2*0.5 + 1, where I = 1/2 e-)
           Note                 : SA & G spin tensors are stored in the
                                  linked list SPFlist.  Thus, herein
                                  the spin tensor components are either
                                  constructed & stored, or copied from
                                  the spin tensor in the linked list.        */
We set the 5 spherical spin tensor components applicable to interactions
involving a single spin interacting with a static magnetic field. Two such
cases would be shift anisotropy (NMR) & g electron (EPR) interactions. Since
this class maintains "scaled" spin tensors, all single spin - field
interactions will share the same spin tensors. The 5 spin tensor components
(arrays) will only differ between single spin interactions if the spin
quantum value differs (or if the field orientation is set differently).
Typically, the static magnetic field is taken to be a normalized vector
pointing along +z.  This class maintains a static linked list of such
spin tensors to avoid regenerating them during computations involving
multi-spin systems.




We set the 5 spherical spin tensor components applicable to interactions involving a single spin interacting with a static magnetic field . Two such cases would be shift anisotropy ( NMR ) & g electron ( EPR ) interactions . Since this class maintains " scaled " spin tensors all single spin - field interactions will share the same spin tensors . The 5 spin tensor components ( arrays ) will only differ between single spin interactions if the spin quantum value differs ( or if the field orientation is set differently ) . Typically the static magnetic field is taken to be a normalized vector pointing along + z . This class maintains a static linked list of such spin tensors to avoid regenerating them during computations involving multi - spin systems .
void IntRank2::setSPF()
  {
  IntRank2TList::iterator item, prev;		
  item = SPFlist.begin();			
  int ihs;                                      
  while(item != SPFlist.end())			
    {                                           
    ihs = (*item).IV();				
    if(ihs == Ival)				
      { 					
      IntRank2T::operator= (*item);		
      return;
      }
    else if(ihs < Ival)                         
      {                                         
      prev = item;				
      item++;					
      }
    else                                        
      {                                         
      IntRank2T::setSPF();			
      SPFlist.insert(item, *this);		
      return;
      }
    }
  IntRank2T::setSPF();                          
  SPFlist.push_back(*this);			
  return;                                       
  }
void IntRank2 :: setSPF ( ) { IntRank2TList :: iterator item , prev ; item = SPFlist . begin ( ) ; int ihs ; while ( item != SPFlist . end ( ) ) { ihs = ( * item ) . IV ( ) ; if ( ihs == Ival ) { IntRank2T :: operator = ( * item ) ; return ; } else if ( ihs < Ival ) { prev = item ; item ++ ; } else { IntRank2T :: setSPF ( ) ; SPFlist . insert ( item , * this ) ; return ; } } IntRank2T :: setSPF ( ) ; SPFlist . push_back ( * this ) ; return ; }
We set the 5 spherical spin tensor components applicable to interactions
involving a single spin interacting with a static magnetic field.
We set the 5 spherical spin tensor components applicable to interactions involving a single spin interacting with a static magnetic field .
// Item in spin tensor list // Start of SA & G tensor list // For list Hilbert spaces // Loop through list entries // & try and find match // Entry Hilbert space // If match just copy // the spin tensor and get // back to business // Not matched, goes in later // down in the list.  Lets // store where we're at then // and move to next list entry // Here we must make a new // spin tensor.  So construct // single spin interaction // just one compared to // We will only reach this if // no list or at list end! So // new interaction & append