src/LSLib/LSacquire.cc
// sosi - I had to fix this, the others may still be bad!
I had to fix this, the others may still be bad!
I had to fix this the others may still be bad!
void FID(gen_op& sigma,   gen_op& D, super_op& G, row_vector& data, int np)
  {
  if(np <= 0) np = data.size();		
  G.set_EBR();				
  G.LOp_base(sigma);			
  G.LOp_base(D);			
  basis S    = G.get_Lbasis();		
  matrix Sm1 = inv(S.U());		 inverse
  matrix mx  = sigma.get_mx();		
  int ls     = G.size();		
  int hs     = sigma.dim();		
  matrix Sm1sig = Sm1*mx.resize(ls,1);	
  matrix Gmx = G.get_mx();		
  matrix Umx(ls,ls,i_matrix_type);
  matrix Dmx = D.get_mx();		
  for(int k=0; k<np; k++)		
    {
    mx = (S.U()*Umx)*Sm1sig;		
    mx = mx.resize(hs,hs);		
    data.put(trace(Dmx, mx), k);	
    Umx *= Gmx;				
    }
  }
void FID ( gen_op & sigma , gen_op & D , super_op & G , row_vector & data , int np ) { if ( np <= 0 ) np = data . size ( ) ; G . set_EBR ( ) ; G . LOp_base ( sigma ) ; G . LOp_base ( D ) ; basis S = G . get_Lbasis ( ) ; matrix Sm1 = inv ( S . U ( ) ) ; matrix mx = sigma . get_mx ( ) ; int ls = G . size ( ) ; int hs = sigma . dim ( ) ; matrix Sm1sig = Sm1 * mx . resize ( ls , 1 ) ; matrix Gmx = G . get_mx ( ) ; matrix Umx ( ls , ls , i_matrix_type ) ; matrix Dmx = D . get_mx ( ) ; for ( int k = 0 ; k < np ; k ++ ) { mx = ( S . U ( ) * Umx ) * Sm1sig ; mx = mx . resize ( hs , hs ) ; data . put ( trace ( Dmx , mx ) , k ) ; Umx *= Gmx ; } }
sosi - I had to fix this, the others may still be bad!
sosi - I had to fix this the others may still be bad!
// Set up block size if not specified // Put superoperator into its eigenbase // Put sigma into LOp Hilbert basis // Put D into LOp Hilbert basis // Get superoperator basis // Get superoperator basis inverse // Get sigma as a matrix // Get Liouville space dimension // Get Hilbert space dimension // Determine inv(S)*sigma as matrix // Get the G array (diagonal) // Get detection operator array // Loop over acquisition points // Evolve sigma to this point // Set back into square array // Compute FID point // Set Gmx for evolve to next point