src/MultiSys/MultiExch0.cc
/* This functions fills all the elements of a single block in a non-mutual
   exchange superoperator. The superoperator will be associated with multiple
   spin system msys and for a single exchange process Pro. Elements in the
   superoperator Xp will be filled for the block between cmpI and cmpJ.
   The exchange rate K is modified from the process Pro exchange rate to 
   account for any differences in the component populations.

   Each two component spin systems in msys, cmpI and cmpJ, define a block of
   Xp (in spin Liouville space). The row length (height) is the spin Liouville
   space of the 1st component, cmpI.  The column length (width) is the spin
   Liouville space of the 2nd component, cmpJ. The start of this block will
   be <Io|Xp|Jo> and the end of the block is <Io+Iend-1|Xp|Jo+Jend-1>.       */
This functions fills all the elements of a single block in a non-mutual
exchange superoperator. The superoperator will be associated with multiple
spin system msys and for a single exchange process Pro. Elements in the
superoperator Xp will be filled for the block between cmpI and cmpJ.
The exchange rate K is modified from the process Pro exchange rate to
account for any differences in the component populations.

Each two component spin systems in msys, cmpI and cmpJ, define a block of
Xp (in spin Liouville space). The row length (height) is the spin Liouville
space of the 1st component, cmpI.  The column length (width) is the spin
Liouville space of the 2nd component, cmpJ. The start of this block will
be  and the end of the block is .
This functions fills all the elements of a single block in a non - mutual exchange superoperator . The superoperator will be associated with multiple spin system msys and for a single exchange process Pro . Elements in the superoperator Xp will be filled for the block between cmpI and cmpJ . The exchange rate K is modified from the process Pro exchange rate to account for any differences in the component populations . Each two component spin systems in msys cmpI and cmpJ define a block of Xp ( in spin Liouville space ) . The row length ( height ) is the spin Liouville space of the 1st component cmpI . The column length ( width ) is the spin Liouville space of the 2nd component cmpJ . The start of this block will be and the end of the block is .
void Xnmpblk(const multi_sys& msys, const ExchProc& Pro, matrix& Xp,
              double K, int cmpI, int cmpJ, int Io, int Iend, int Jo, int Jend)
  {
  int I, J;					
  row_vector braI, ketI;			
  row_vector braJ, ketJ;			
  int hsnorm;					
  bool match;					
  for(I=Io; I<Iend; I++)			
    { 						
    braI = LS_qState_bra(msys, I);		
    ketI = LS_qState_ket(msys, I);		
    for(J=Jo; J<Jend; J++) 			
      { 					
      braJ  = LS_qState_bra(msys, J);		
      ketJ  = LS_qState_ket(msys, J);		
      match = Xnmpelem(msys,Pro,braI,ketI,	
                    braJ,ketJ,cmpI,cmpJ,hsnorm);
      if(match) 				
        {					
        Xp.put(-K/double(hsnorm),I,J); 		
        }					
      }						
    }						
  }
void Xnmpblk ( const multi_sys & msys , const ExchProc & Pro , matrix & Xp , double K , int cmpI , int cmpJ , int Io , int Iend , int Jo , int Jend ) { int I , J ; row_vector braI , ketI ; row_vector braJ , ketJ ; int hsnorm ; bool match ; for ( I = Io ; I < Iend ; I ++ ) { braI = LS_qState_bra ( msys , I ) ; ketI = LS_qState_ket ( msys , I ) ; for ( J = Jo ; J < Jend ; J ++ ) { braJ = LS_qState_bra ( msys , J ) ; ketJ = LS_qState_ket ( msys , J ) ; match = Xnmpelem ( msys , Pro , braI , ketI , braJ , ketJ , cmpI , cmpJ , hsnorm ) ; if ( match ) { Xp . put ( - K / double ( hsnorm ) , I , J ) ; } } } }
This functions fills all the elements of a single block in a non-mutual
exchange superoperator.
This functions fills all the elements of a single block in a non - mutual exchange superoperator .
// Global Xp indices // for |I><I| basis function // for |J><J| basis function // Normalization by dim of HS // Flag if non-zero exch. elem. //   Loop <I|Xp|J> rows //   for process p  //   Essence of |ketI><braI| //   form superbra & superket //     Loop <I|Xp|J> columns //     for process p  //     Essence of |ketJ><braJ| //     form superbra & superket //     See if element has exch. //     (set hsnorm if it is) // Exchange will swap I & J // so we must set <I|Xp|J> // to normalized rate good //   for any non-mutual exch.  // Next column of Xp in comp. // Next column component