src/Pulses/PulComposite.cc
/* These functions allow for the filling up two arrays of propagators for each
   step in the waveform (Usteps and Usums).  These well NOT be generated during
   construction of the composite pulse although as they are system dependent.
   Rather, they will be generated when requested if the step Hamiltonians are
   present.								     */
These functions allow for the filling up two arrays of propagators for each
step in the waveform (Usteps and Usums).  These well NOT be generated during
construction of the composite pulse although as they are system dependent.
Rather, they will be generated when requested if the step Hamiltonians are
present.
These functions allow for the filling up two arrays of propagators for each step in the waveform ( Usteps and Usums ) . These well NOT be generated during construction of the composite pulse although as they are system dependent . Rather they will be generated when requested if the step Hamiltonians are present .
void PulComposite::SetUs()
  {
  if(!WFsteps) return;			
  if(!CheckH(10,15)) CPulfatality(16);	
  if(!Usteps)                           
    Usteps = new HSprop[WFsteps];	
  if(!Usums)                            
    Usums = new HSprop[WFsteps];	
  if(!Uindex) SetUIndxs( );		
  double tinc;                          
  for(int i=0; i<WFsteps; i++)
    {
    if(i == Uindex[i])			
      {					
      tinc = WFtimes.getRe(i);		
      Usteps[i]=HSprop(Hsteps[Hindex[i]],tinc);
      }
    Usums[i] = Usteps[Uindex[i]];	
    if(i) Usums[i] *= Usums[i-1];       
    }
  }
void PulComposite :: SetUs ( ) { if ( ! WFsteps ) return ; if ( ! CheckH ( 10 , 15 ) ) CPulfatality ( 16 ) ; if ( ! Usteps ) Usteps = new HSprop [ WFsteps ] ; if ( ! Usums ) Usums = new HSprop [ WFsteps ] ; if ( ! Uindex ) SetUIndxs ( ) ; double tinc ; for ( int i = 0 ; i < WFsteps ; i ++ ) { if ( i == Uindex [ i ] ) { tinc = WFtimes . getRe ( i ) ; Usteps [ i ] = HSprop ( Hsteps [ Hindex [ i ] ] , tinc ) ; } Usums [ i ] = Usteps [ Uindex [ i ] ] ; if ( i ) Usums [ i ] *= Usums [ i - 1 ] ; } }
These functions allow for the filling up two arrays of propagators for each
step in the waveform (Usteps and Usums).
These functions allow for the filling up two arrays of propagators for each step in the waveform ( Usteps and Usums ) .
// Input                CPul    : A composite pulse (this) // Output               void  : Propagators for each step //                              of the composite pulse are calculated // Note                       : This assumes that the Hamiltonians //                              have already been calculated! // Note                       : U[i] is the propagator that evolves //                              the system from the start of the //                              composite pulse to the end of step i // Note                       : This does not destroy superpropagators //                              Only Hamiltonian changes do that. // Exit if NO steps // Insure Hamiltonians exist // If propagators don't yet exist // allocate some space for them // If sum propagators don't yet exist // allocate some space for them // Set propagator indices	 // Step time increment // If unique step propagator // then we have to calculate it // Step i length // Start prop step i full evolve // Add all previous steps evolutions