src/HSLib/SpinOp.cc
/* This set of functions deals with individual spin SOp matrices. Each
   composite spin operator is associated with a set of spins.  In some
   cases the SOp can be stored as a set of small single spin arrays rather
   than one big (full space) array.  Whereas the full space array will 
   have the dimension of the composite Hilbert space, the sub-space arrays
   reside in the much smaller individual spin Hilbert spaces.  The product
   of the sub-space dimensions equals the full space dimension.  Also the
   tensor product of the sub-space arrays is the full space array. Note
   that not all SOp's can be stored as sub-space arrays in which case they
   will not be present. The subspace arrays 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 individual spin SOp matrices. Each
composite spin operator is associated with a set of spins.  In some
cases the SOp can be stored as a set of small single spin arrays rather
than one big (full space) array.  Whereas the full space array will
have the dimension of the composite Hilbert space, the sub-space arrays
reside in the much smaller individual spin Hilbert spaces.  The product
of the sub-space dimensions equals the full space dimension.  Also the
tensor product of the sub-space arrays is the full space array. Note
that not all SOp's can be stored as sub-space arrays in which case they
will not be present. The subspace arrays 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 individual spin SOp matrices . Each composite spin operator is associated with a set of spins . In some cases the SOp can be stored as a set of small single spin arrays rather than one big ( full space ) array . Whereas the full space array will have the dimension of the composite Hilbert space the sub - space arrays reside in the much smaller individual spin Hilbert spaces . The product of the sub - space dimensions equals the full space dimension . Also the tensor product of the sub - space arrays is the full space array . Note that not all SOp ' s can be stored as sub - space arrays in which case they will not be present . The subspace arrays are set during construction from . 1 . From an input array of ( sub - space ) matrices 2 . From another input spin operator
void spin_op::CopySubArrays(matrix* prmxs)
  {
  if(pr) delete [] pr;
  if(!nspins) pr = NULL;
  else        pr = new matrix[nspins];
  for(int i=0; i<nspins; i++)
    pr[i] = prmxs[i];
  }
void spin_op :: CopySubArrays ( matrix * prmxs ) { if ( pr ) delete [ ] pr ; if ( ! nspins ) pr = NULL ; else pr = new matrix [ nspins ] ; for ( int i = 0 ; i < nspins ; i ++ ) pr [ i ] = prmxs [ i ] ; }
This set of functions deals with individual spin SOp matrices.
This set of functions deals with individual spin SOp matrices .