src/HSLib/SpinOp.cc
/* This set of functions deals with specification of spin flags. Each
   composite spin operator is associated with a set of spins.  However each
   SOp need not act on any particular spin.  These flags indicate whether
   SOp is active on the spin or not.  If it is NOT active, the flag will be
   zero and the associated sub-space array (if present) will be an I matrix.
   If SOp is active on a spin, the spin flag will be non-zero and the sub-
   space array (if it exists) will be something else but an I matrix.  The
   spin flags are set during construction from:

		1. From an input array of (sub-space) matrices
		2. From another input spin operator                          */
This set of functions deals with specification of spin flags. Each
composite spin operator is associated with a set of spins.  However each
SOp need not act on any particular spin.  These flags indicate whether
SOp is active on the spin or not.  If it is NOT active, the flag will be
zero and the associated sub-space array (if present) will be an I matrix.
If SOp is active on a spin, the spin flag will be non-zero and the sub
space array (if it exists) will be something else but an I matrix.  The
spin flags are set during construction from.

1. From an input array of (sub-space) matrices
2. From another input spin operator
This set of functions deals with specification of spin flags . Each composite spin operator is associated with a set of spins . However each SOp need not act on any particular spin . These flags indicate whether SOp is active on the spin or not . If it is NOT active the flag will be zero and the associated sub - space array ( if present ) will be an I matrix . If SOp is active on a spin the spin flag will be non - zero and the sub space array ( if it exists ) will be something else but an I matrix . The spin flags are set during construction from . 1 . From an input array of ( sub - space ) matrices 2 . From another input spin operator
void spin_op::CopySpinFlags(matrix* prmxs)
  {
  if(spinflags) delete [] spinflags;
  if(!nspins) spinflags = NULL;
  else        spinflags = new int[nspins];
  for(int i=0; i<nspins; i++)
    if(prmxs[i].stored_type() == i_matrix_type) spinflags[i] = 0;
    else                                        spinflags[i] = 1;
  }
void spin_op :: CopySpinFlags ( matrix * prmxs ) { if ( spinflags ) delete [ ] spinflags ; if ( ! nspins ) spinflags = NULL ; else spinflags = new int [ nspins ] ; for ( int i = 0 ; i < nspins ; i ++ ) if ( prmxs [ i ] . stored_type ( ) == i_matrix_type ) spinflags [ i ] = 0 ; else spinflags [ i ] = 1 ; }
This set of functions deals with specification of spin flags.
This set of functions deals with specification of spin flags .