src/BWRRelax/relaxRF.cc
// -------------------- Level 3 via Element Calculation -----------------------
//                      (Applies Secular Approximation)
Level 3 via Element Calculation
(Applies Secular Approximation)
Level 3 via Element Calculation ( Applies Secular Approximation )
void Rrf_3(super_op& LOp, double* w, int rank, gen_op* T1s,
                                         gen_op* T2s, matrix* J12, double cutoff)
					LOp    = LOp   + R3
					   out	    in     12
	 Note				T1s, T2s, & LOp assumed in
					proper bases (eigenbasis of Heff)
 <a,a'| LOp |b,b'> += <a,a'| R3   |b,b'> == del           * <a,a'|R4   |b,b'>
                               1,2             w    , w             1,2
                                                a,a'   b,b'
 where a, a', b, b' are basis function indices.
   {
   int hs = T1s[0].dim();			 Get Hilbert space size
   double delwaa, delwbb;
   int aaa=0, bbb=0;
   complex Rel;
   for(int a=0; a<hs; a++)			 Sum over transition a-aa
     for(int aa=0; aa<hs; aa++)
       {
       delwaa = w[a] - w[aa];			 Transition a-aa frequency
       bbb = 0;
       for(int b=0; b<hs; b++)			 Sum over transition b-bb
         for(int bb=0; bb<hs; bb++)
           {
           delwbb = w[b] - w[bb];		 Transition b-bb frequency
	   if(fabs(delwaa-delwbb) < cutoff)	 Apply secular approximation
             {
             Rel = LOp.get(aaa,bbb);
             Rel += Rrf_4(hs,T1s,T2s,J12,
			       rank,a,b,aa,bb);
             LOp.put(aaa, bbb, Rel);		 Add to the relax. mx. element
             }
           bbb++;
           }
       aaa++;
       }
   return;
   }
void Rrf_3 ( super_op & LOp , double * w , int rank , gen_op * T1s , gen_op * T2s , matrix * J12 , double cutoff ) { int hs = T1s [ 0 ] . dim ( ) ; double delwaa , delwbb ; int aaa = 0 , bbb = 0 ; complex Rel ; for ( int a = 0 ; a < hs ; a ++ ) for ( int aa = 0 ; aa < hs ; aa ++ ) { delwaa = w [ a ] - w [ aa ] ; bbb = 0 ; for ( int b = 0 ; b < hs ; b ++ ) for ( int bb = 0 ; bb < hs ; bb ++ ) { delwbb = w [ b ] - w [ bb ] ; if ( fabs ( delwaa - delwbb ) < cutoff ) { Rel = LOp . get ( aaa , bbb ) ; Rel += Rrf_4 ( hs , T1s , T2s , J12 , rank , a , b , aa , bb ) ; LOp . put ( aaa , bbb , Rel ) ; } bbb ++ ; } aaa ++ ; } return ; }
Level 3 via Element Calculation
(Applies Secular Approximation)
Level 3 via Element Calculation ( Applies Secular Approximation )
// Input		LOp   : Current relaxation superoperator //			w     : Vector system enery levels of Heff //				(rad/sec) in the LAB frame //			rank  : Rank of the two interactions // 			T1s   : Spin tensor components, 1st mu // 			T2s   : Spin tensor components, 2nd mu //			J12   : Matrices of reduced spectral density  //				function values for 2 interactions //				times the two interaction constants //				evaluated at m based frequencies //                      cutoff: Secular approximation cutoff value (Hz) // Return		void  : Level 3 relax. superop for interactions //				1 & 2 added to input superoperator LOp // //				LOp    = LOp   + R3 //				   out	    in     12 // // Note				T1s, T2s, & LOp assumed in //				proper bases (eigenbasis of Heff) // <a,a'| LOp |b,b'> += <a,a'| R3   |b,b'> == del           * <a,a'|R4   |b,b'> //                               1,2             w    , w             1,2 //                                                a,a'   b,b' // where a, a', b, b' are basis function indices. // Get Hilbert space size // Sum over transition a-aa // Transition a-aa frequency // Sum over transition b-bb // Transition b-bb frequency // Apply secular approximation // Add to the relax. mx. element