src/HSLib/SpinOpCmp.cc
/* These functions generate spin operators that are a specific type (or a
   specific axis).  The operator type is specified by a single input "type".
   Valid characters and their meaning are as follows:

      character: x      y      z      p      m      e      a       b
      operator:  Ix     Iy     Iz     I+     I-     Ie   Ialpha  Ibeta
 
         OverLoads of Function where Type of Second Argument Changes
 
           OL Function    Type    Label  Result
           -- --------    ----    ----   ------------------------------
           A. Faxis       int     spin   Spin index, only spin affected
           B. Faxis       string  iso    Isotope label, spins of type iso hit
           C. Faxis       ---            All spins in sys affected
           D. Faxis_sp    ---            Spins with flags TRUE affected
           E. Faxis_sp    vector  flags  Spins with flags TRUE affected
 
    Note that some of these spin operators will have a specialized matrix
    structure. Currently this is NOT handled well by class spin_op so the
    structures must be enforced here.  That can be removed when spin_op
    works better with GAMMA matrix classes - sosi.                           */
These functions generate spin operators that are a specific type (or a
specific axis).  The operator type is specified by a single input "type".
Valid characters and their meaning are as follows.

x      y      z      p      m      e      a       b
operator:  Ix     Iy     Iz     I+     I-     Ie   Ialpha  Ibeta

OverLoads of Function where Type of Second Argument Changes

OL Function    Type    Label  Result
A. Faxis       int     spin   Spin index, only spin affected
B. Faxis       string  iso    Isotope label, spins of type iso hit
C. Faxis       ---            All spins in sys affected
D. Faxis_sp    ---            Spins with flags TRUE affected
E. Faxis_sp    vector  flags  Spins with flags TRUE affected

Note that some of these spin operators will have a specialized matrix
structure. Currently this is NOT handled well by class spin_op so the
structures must be enforced here.  That can be removed when spin_op
works better with GAMMA matrix classes - sosi.
These functions generate spin operators that are a specific type ( or a specific axis ) . The operator type is specified by a single input " type " . Valid characters and their meaning are as follows . x y z p m e a b operator : Ix Iy Iz I + I - Ie Ialpha Ibeta OverLoads of Function where Type of Second Argument Changes OL Function Type Label Result A . Faxis int spin Spin index only spin affected B . Faxis string iso Isotope label spins of type iso hit C . Faxis --- All spins in sys affected D . Faxis_sp --- Spins with flags TRUE affected E . Faxis_sp vector flags Spins with flags TRUE affected Note that some of these spin operators will have a specialized matrix structure . Currently this is NOT handled well by class spin_op so the structures must be enforced here . That can be removed when spin_op works better with GAMMA matrix classes - sosi .
spin_op Faxis(const spin_sys& sys, int spin, char axis)
  {
  spin_op SOp;
  switch(axis)
    {
    case 'x': SOp = Ix(sys,spin); break;				
    case 'y': SOp = Iy(sys,spin); break;				
    case 'z': SOp = Iz(sys,spin); break;			 	
    case 'e': SOp = Ie(sys,spin); break;				
    case 'p': SOp = Ip(sys,spin); break;				
    case 'm': SOp = Im(sys,spin); break;				
    case 'a': SOp = Ia(sys,spin); break;				
    case 'b': SOp = Ib(sys,spin); break;				
    }
  return SOp;
  }
spin_op Faxis ( const spin_sys & sys , int spin , char axis ) { spin_op SOp ; switch ( axis ) { case ' ' : SOp = Ix ( sys , spin ) ; break ; case ' ' : SOp = Iy ( sys , spin ) ; break ; case ' ' : SOp = Iz ( sys , spin ) ; break ; case ' ' : SOp = Ie ( sys , spin ) ; break ; case ' ' : SOp = Ip ( sys , spin ) ; break ; case ' ' : SOp = Im ( sys , spin ) ; break ; case ' ' : SOp = Ia ( sys , spin ) ; break ; case ' ' : SOp = Ib ( sys , spin ) ; break ; } return SOp ; }
These functions generate spin operators that are a specific type (or a
specific axis).
These functions generate spin operators that are a specific type ( or a specific axis ) .
// Fx // Fy // Fz // Fe // F+ // F- // Falp // Fbet