src/Level2/RelaxBas.cc
/* These functions will perform an ad-hoc evolution of the density operator
   under basic relaxation during an acquisition.  The density operator sig0
   will evolve for the time specified.  The evolution will first occur under
   the static Hamiltonian HO if one has be set, then under the pseudo-
   relaxation scheme of this class.

		Note			Assumes that the static Hamiltonain
				  	and the detection operator are set!
   									     */
These functions will perform an ad-hoc evolution of the density operator
under basic relaxation during an acquisition.  The density operator sig0
will evolve for the time specified.  The evolution will first occur under
the static Hamiltonian HO if one has be set, then under the pseudo
relaxation scheme of this class.

Note                    Assumes that the static Hamiltonain
and the detection operator are set!
These functions will perform an ad - hoc evolution of the density operator under basic relaxation during an acquisition . The density operator sig0 will evolve for the time specified . The evolution will first occur under the static Hamiltonian HO if one has be set then under the pseudo relaxation scheme of this class . Note Assumes that the static Hamiltonain and the detection operator are set!
void RBasic::FID(const gen_op& sigmap, double td, row_vector& fid, int N)
  {
  gen_op sigmat = sigmap;			
  bool LongRlx  = TestLong();			
  if(LongRlx)					
    {						
    if(!SetCsigs(sigmap)) RBasFatal(65);	
    }
  int hs = sigmap.dim();			
  int i;					
  double KIzi, eR1t;				
  int a,b;					
  complex z, eR2t;				
  double time = 0;
  int k;
  int ns = spins();
  if(LongRlx)
  {
  for(k=0; k<N; k++)
    {
    fid(k) = trace(Det, sigmat);		
    if(k<N-1)					
      {
      time += td;				
      if(H0.dim())				
        sigmat = evolve(sigmap, H0, time);	
      sigmat.set_DBR();				
      for(i=0; i<ns; i++)			
        {					
        eR1t = exp(-R1rates[i]*time);		
        KIzi = (Csig[i]-Cinf[i])*eR1t + Cinf[i];
        sigmat += (KIzi-Csig[i])*Izis[i];	
        }
      for(a=0; a<hs-1; a++)			
        for(b=a+1; b<hs; b++) 			
          {					
          eR2t = exp(-R2mx(a,b)*time); 		
          z = eR2t * sigmat.get(a,b);		
          sigmat.put(z,a,b);			
          sigmat.put(conj(z),b,a);		
          }
      }
    }
    }
  if(!LongRlx)
    {
    super_op L = R2LOp();			
    if(H0.dim())				
      L += complexi*Hsuper(H0);			
    acquire1D ACQ(Det,L);			
    fid = ACQ.T(sigmap, N, td);			
    }
  }
void RBasic :: FID ( const gen_op & sigmap , double td , row_vector & fid , int N ) { gen_op sigmat = sigmap ; bool LongRlx = TestLong ( ) ; if ( LongRlx ) { if ( ! SetCsigs ( sigmap ) ) RBasFatal ( 65 ) ; } int hs = sigmap . dim ( ) ; int i ; double KIzi , eR1t ; int a , b ; complex z , eR2t ; double time = 0 ; int k ; int ns = spins ( ) ; if ( LongRlx ) { for ( k = 0 ; k < N ; k ++ ) { fid ( k ) = trace ( Det , sigmat ) ; if ( k < N - 1 ) { time += td ; if ( H0 . dim ( ) ) sigmat = evolve ( sigmap , H0 , time ) ; sigmat . set_DBR ( ) ; for ( i = 0 ; i < ns ; i ++ ) { eR1t = exp ( - R1rates [ i ] * time ) ; KIzi = ( Csig [ i ] - Cinf [ i ] ) * eR1t + Cinf [ i ] ; sigmat += ( KIzi - Csig [ i ] ) * Izis [ i ] ; } for ( a = 0 ; a < hs - 1 ; a ++ ) for ( b = a + 1 ; b < hs ; b ++ ) { eR2t = exp ( - R2mx ( a , b ) * time ) ; z = eR2t * sigmat . get ( a , b ) ; sigmat . put ( z , a , b ) ; sigmat . put ( conj ( z ) , b , a ) ; } } } } if ( ! LongRlx ) { super_op L = R2LOp ( ) ; if ( H0 . dim ( ) ) L += complexi * Hsuper ( H0 ) ; acquire1D ACQ ( Det , L ) ; fid = ACQ . T ( sigmap , N , td ) ; } }
These functions will perform an ad-hoc evolution of the density operator
under basic relaxation during an acquisition.
These functions will perform an ad - hoc evolution of the density operator under basic relaxation during an acquisition .
// The evolved sigma // Flag if longitudinal relax. //bool RBasic::CheckAcq(bool warn) //  if(!LongRlx)					// If T1 processes not needed //    {						// we just work with T2 only // sosik //cout << "\n\tWorking With T2 Only"; //    } //  gen_op siginf = sigma_eq(sys);		// The equilibrium operator // If we include long. relax // then we'll need Izi coeffs. //    if(!SetCinfs(siginf)) RBasFatal(65);	//   Set siginf Izi coeffs. //   Set sigmap Izi coeffs. // Spin Hilbert space // Spin index // For longitudinal relax. // Basis function indices // For transverse relax. //              Begin Looping Over the Acquisition Points // Get point k    // Evolve to next point //   Time at point k //   Evolve under H0  //   if Hamiltonian is set // Put into default basis // Loop over all spins and // relax longitidunally //   The exponential factor //   Relaxed Izi coefficient //   Set relaxed Izi component // Loop over U.T. density // operator elements and relax // in transverse plane //   The exponential factor //   Relax the element //   Set relaxed <a|sigma(t)|b> //   Set relaxed <b|sigma(t)|a> //			   Only Using T2 Block For Relaxation // Liouvillian with R2 relax. // If a Hamiltonian is present // add it to the Liouvillian // Set up for acquisition // Generate FID