src/Level2/RelaxBas.cc
/* This function sets up an array containing R2 times for each coherence in
   the system Hilbert space. If the associated spin system changes (i.e. its
   Hilbert space) or any relaxation rates are altered then this must be
   regnerated!                                                               */
This function sets up an array containing R2 times for each coherence in
the system Hilbert space. If the associated spin system changes  or any relaxation rates are altered then this must be
regnerated!
This function sets up an array containing R2 times for each coherence in the system Hilbert space . If the associated spin system changes or any relaxation rates are altered then this must be regnerated!
void RBasic::SetR2Mx()
  {
  int hs = HS();				
  int NS = spins();				
  R2mx = matrix(hs,hs,complex0,h_matrix_type);	
  double r2ave, delmtot, delm, msumsp;
  int a,b,i;					
  for(a=0; a<hs-1; a++)				
    for(b=a+1; b<hs; b++) 			
      {
      r2ave = 0;				
      delmtot = Fzs.getRe(a) - Fzs.getRe(b);	
      msumsp = 0;				
      for(i=0; i<NS; i++)			
        { 					
        delm=FZxNS.getRe(a,i)-FZxNS.getRe(b,i); 
        if(delm)				
          { 					
          r2ave += R2rates[i]/fabs(delm);	
          msumsp++;				
          }
        }
      R2mx.put_h(r2ave,a,b);			
      }
  }
void RBasic :: SetR2Mx ( ) { int hs = HS ( ) ; int NS = spins ( ) ; R2mx = matrix ( hs , hs , complex0 , h_matrix_type ) ; double r2ave , delmtot , delm , msumsp ; int a , b , i ; for ( a = 0 ; a < hs - 1 ; a ++ ) for ( b = a + 1 ; b < hs ; b ++ ) { r2ave = 0 ; delmtot = Fzs . getRe ( a ) - Fzs . getRe ( b ) ; msumsp = 0 ; for ( i = 0 ; i < NS ; i ++ ) { delm = FZxNS . getRe ( a , i ) - FZxNS . getRe ( b , i ) ; if ( delm ) { r2ave += R2rates [ i ] / fabs ( delm ) ; msumsp ++ ; } } R2mx . put_h ( r2ave , a , b ) ; } }
This function sets up an array containing R2 times for each coherence in
the system Hilbert space.
This function sets up an array containing R2 times for each coherence in the system Hilbert space .
// The spin Hilbert space // Spins in the system // Our system R2 array // Basis function indices // Loop over U.T. density // operator elements  // Begin with no relaxation // Total del Fz between a&b // Begin // Now loop over the spins // indices & see which flip //   delmz of spin i <a| & |b> //   If spin flip, add in //   relaxation contrib. //   Add scaled to R2 //   Total spins flipped // Store averaged R2 value