src/IntRank2/IntRank2.cc
/* Here we set the 5 spherical spin tensor components applicable to single spin
   interactions that are "interacting with themselves" in the sense that their
   own state modifies their environment which they interact. An example of such
   an interaciton would bea a quadrupolar interactions. However since this 
   class maintains "scaled" spin tensors, all single spin "self" interactions
   will share the same spin tensors. The five arrays will only differ between
   single spin "self" interactions if the spin quantum value differs.  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
        [1]      2                      1                          1  2
  T   = |-| * [3I - I(I+1)]     T   = - -(I I + I I )       T    = - I
   2,0  [6]      z               2,1    2  + z   z +         2,2   2  +

                                            SINGLE SPIN INTERACTION 
          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                         : QUAD spin tensors are stored in the
                                         linked list SPQlist.  Thus, herein
                                         the spin tensor components are either
                                         constructed & stored, or copied from
                                         the spin tensor in the linked list.
          Note                         : For QUAD interactions Ival is always 
                                         greater than 2 (Ival=2*I+1, I>=1)   */
Here we set the 5 spherical spin tensor components applicable to single spin
interactions that are "interacting with themselves" in the sense that their
own state modifies their environment which they interact. An example of such
an interaciton would bea a quadrupolar interactions. However since this
class maintains "scaled" spin tensors, all single spin "self" interactions
will share the same spin tensors. The five arrays will only differ between
single spin "self" interactions if the spin quantum value differs.  This
class maintains a static linked list of such spin tensors to avoid
regenerating them during computations involving multi-spin systems.



SINGLE SPIN INTERACTION
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                         : QUAD spin tensors are stored in the
linked list SPQlist.  Thus, herein
the spin tensor components are either
constructed & stored, or copied from
the spin tensor in the linked list.
Note                         : For QUAD interactions Ival is always
greater than 2 (Ival=2*I+1, I>=1)
Here we set the 5 spherical spin tensor components applicable to single spin interactions that are " interacting with themselves " in the sense that their own state modifies their environment which they interact . An example of such an interaciton would bea a quadrupolar interactions . However since this class maintains " scaled " spin tensors all single spin " self " interactions will share the same spin tensors . The five arrays will only differ between single spin " self " interactions if the spin quantum value differs . This class maintains a static linked list of such spin tensors to avoid regenerating them during computations involving multi - spin systems . SINGLE SPIN INTERACTION 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 : QUAD spin tensors are stored in the linked list SPQlist . Thus herein the spin tensor components are either constructed & stored or copied from the spin tensor in the linked list . Note : For QUAD interactions Ival is always greater than 2 ( Ival = 2 * I + 1 I > = 1 )
void IntRank2::setSPQ()
  {
  IntRank2TList::iterator item, prev;		
  item = SPQlist.begin();			
  int ihs;                                      
  while(item != SPQlist.end())			
    {                                           
    ihs = (*item).IV();				
    if(ihs == Ival)                             
      {                                         
      IntRank2T::operator= (*item);		
      return;
      }  
    else if(ihs < Ival)                         
      {                                         
      prev = item;
      item++;
      }
    else                                        
      {                                         
      IntRank2T::setSPQ();			
      SPQlist.insert(item, *this);		
      return;
      }
    }
  IntRank2T::setSPQ();				
  SPQlist.push_back(*this);			
  return;                                       
  }
void IntRank2 :: setSPQ ( ) { IntRank2TList :: iterator item , prev ; item = SPQlist . begin ( ) ; int ihs ; while ( item != SPQlist . end ( ) ) { ihs = ( * item ) . IV ( ) ; if ( ihs == Ival ) { IntRank2T :: operator = ( * item ) ; return ; } else if ( ihs < Ival ) { prev = item ; item ++ ; } else { IntRank2T :: setSPQ ( ) ; SPQlist . insert ( item , * this ) ; return ; } } IntRank2T :: setSPQ ( ) ; SPQlist . push_back ( * this ) ; return ; }
Here we set the 5 spherical spin tensor components applicable to single spin
interactions that are "interacting with themselves" in the sense that their
own state modifies their environment which they interact.
Here we set the 5 spherical spin tensor components applicable to single spin interactions that are " interacting with themselves " in the sense that their own state modifies their environment which they interact .
// Item in spin tensor list // Start of Quad 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 // If not match, find where // it should be entered // Here we must make a new // spin tensor.  So construct // single spin interaction // and add it to the list // We will only reach this if // no list or at list end! So // new interaction & append