def run(self, cxn, context):
        self.scan_phi = [WithUnit(x, 'deg') for x in [0.0, 90.0, 180.0, 270.0]]
        self.setup_data_vault()
        scan_time = scan_methods.simple_scan(self.parameters.SZX.duration_scan, 'us')
        self.scan = scan_time
        for i, t in enumerate(scan_time):
            should_stop = self.pause_or_stop()
            if should_stop: break
            p = []
            for j, phi in enumerate(self.scan_phi):
                replace = TreeDict.fromdict({'SZX.duration':t})
                replace['SZX.second_pulse_phase'] = phi
                self.excite.set_parameters(replace)
                p.extend( self.excite.run(cxn, context) )

            submission = [t['us']]
            print p
            submission.extend(p)
            p0, p90, p180 = p[0], p[1], p[2]
            #print p0
            k = p0 + p180
            c = np.sqrt((2*p0 - k)**2 + (2*p90 - k)**2)
            submission.extend([c])
            self.dv.add(submission, context = self.save_context)
            self.update_progress(i)
    def run(self, cxn, context):

        dv_args = {'output_size':self.rabi_flop.excite.output_size,
                   'experiment_name': self.name,
                   'window_name': 'current',
                   'dataset_name': 'injection_current_scan'
                   }
        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

        scan_param = self.parameters.CalibrationScans.current_scan
        self.scan = scan_methods.simple_scan(scan_param, 'V')
        frequency = self.get_frequency()
        cs = self.parameters.CalibrationScans
        for i, v in  enumerate(self.scan):
            should_stop = self.pause_or_stop()
            if should_stop: break
            replace = TreeDict.fromdict({
                                     'RabiFlopping.frequency_selection':'manual',
                                     'RabiFlopping.manual_frequency_729':frequency,
                                     'RabiFlopping_Sit.sit_on_excitation': cs.excitation_time,
                                    })
            self.rabi_flop.set_parameters(replace)
            self.dac.set_individual_analog_voltages([('06', v['V'])])
            time.sleep(2) # time to make sure the current gets set from the dac

            excitation = self.rabi_flop.run(cxn, context)
            if excitation is None: break 
            submission = [v['V']]
            submission.extend([excitation])
            self.dv.add(submission, context = self.save_context)
            self.update_progress(i)
 def run(self, cxn, context):
     
     dv_args = {'output_size':self.rabi_flop.excite.output_size,
                'experiment_name': self.name,
                'window_name': 'Motional397PulseWidth',
                'dataset_name': 'pulse_width397'
                }
     scan_methods.setup_data_vault(cxn, self.save_context, dv_args)
     
     scan_param = self.parameters.Motion_Analysis.scan_pulse_width_397
     self.scan = scan_methods.simple_scan(scan_param, 'us')
     
     for i,t in enumerate(self.scan):
         should_stop = self.pause_or_stop()
         if should_stop: break
         replace = TreeDict.fromdict({
                                  'Motion_Analysis.pulse_width_397':t
                                 })
         self.rabi_flop.set_parameters(replace)
         excitation = self.rabi_flop.run(cxn, context)
         if excitation is None: break 
         submission = [t['us']]
         submission.extend([excitation])
         self.dv.add(submission, context = self.save_context)
         self.update_progress(i)
    def run(self, cxn, context):
        self.scan_phi = [WithUnit(x, 'deg') for x in [0.0, 90.0, 180.0, 270.0]]
        self.setup_data_vault()
        scan_time = scan_methods.simple_scan(self.parameters.SZX.duration_scan,
                                             'us')
        self.scan = scan_time
        for i, t in enumerate(scan_time):
            should_stop = self.pause_or_stop()
            if should_stop: break
            p = []
            for j, phi in enumerate(self.scan_phi):
                replace = TreeDict.fromdict({'SZX.duration': t})
                replace['SZX.second_pulse_phase'] = phi
                self.excite.set_parameters(replace)
                p.extend(self.excite.run(cxn, context))

            submission = [t['us']]
            print p
            submission.extend(p)
            p0, p90, p180 = p[0], p[1], p[2]
            #print p0
            k = p0 + p180
            c = np.sqrt((2 * p0 - k)**2 + (2 * p90 - k)**2)
            submission.extend([c])
            self.dv.add(submission, context=self.save_context)
            self.update_progress(i)
 def run(self, cxn, context):
     
     dv_args = {'output_size':self.rabi_flop.excite.output_size,
                'experiment_name': self.name,
                'window_name': 'current',
                'dataset_name': '854_scan'
                }
     scan_methods.setup_data_vault(cxn, self.save_context, dv_args)
     
     scan_param = self.parameters.CalibrationScans.sbc_854_scan
     self.scan = scan_methods.simple_scan(scan_param, 'dBm')
     
     for i,ampl in enumerate(self.scan):
         should_stop = self.pause_or_stop()
         if should_stop: break
         replace = TreeDict.fromdict({
                                  'SidebandCooling.sideband_cooling_amplitude_854':ampl
                                 })
         self.rabi_flop.set_parameters(replace)
         excitation = self.rabi_flop.run(cxn, context)
         if excitation is None: break 
         submission = [ampl['dBm']]
         submission.extend([excitation])
         self.dv.add(submission, context = self.save_context)
         self.update_progress(i)
 def run(self, cxn, context):
     
     dv_args = {'output_size':self.rabi_flop.excite.output_size,
                'experiment_name': self.name,
                'window_name': 'current',
                'dataset_name': 'det_scan'
                }
     scan_methods.setup_data_vault(cxn, self.save_context, dv_args)
     
     scan_param = self.parameters.CalibrationScans.sbc_ac_stark
     self.scan = scan_methods.simple_scan(scan_param, 'kHz')
     
     for i,freq in enumerate(self.scan):
         should_stop = self.pause_or_stop()
         if should_stop: break
         replace = TreeDict.fromdict({
                                  'SidebandCooling.stark_shift':freq
                                 })
         self.rabi_flop.set_parameters(replace)
         excitation = self.rabi_flop.run(cxn, context)
         if excitation is None: break 
         submission = [freq['kHz']]
         submission.extend([excitation])
         self.dv.add(submission, context = self.save_context)
         self.update_progress(i)
Example #7
0
    def run(self, cxn, context):
        
        dv_args = {'output_size':3,
                   'experiment_name': self.name,
                   'window_name': 'current',
                   'dataset_name': 'Two_Line_Rabi_Flop'
                   }
        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)
        
        scan_param = self.parameters.RabiFlopping.manual_scan
        self.scan = scan_methods.simple_scan(scan_param, 'us')
        
        for i,duration in enumerate(self.scan):
            should_stop = self.pause_or_stop()
            if should_stop: break
            replace = TreeDict.fromdict({
                                     'RabiFlopping_Sit.sit_on_excitation':duration,
                                     'RabiFlopping.frequency_selection':'auto',
                                     'RabiFlopping.sideband_selection':[0,0,0,0],
                                     'RabiFlopping.line_selection':'S-1/2D-1/2'
                                    })
            self.rabi_flop.set_parameters(replace)
            excitation_delta_m0 = self.rabi_flop.run(cxn, context)
            if excitation_delta_m0 is None: break 

            replace = TreeDict.fromdict({
                                     'RabiFlopping_Sit.sit_on_excitation':duration,
                                     'RabiFlopping.frequency_selection':'auto',
                                     'RabiFlopping.sideband_selection':[0,0,0,0],
                                     'RabiFlopping.line_selection':'S-1/2D-3/2'
                                    })
            self.rabi_flop.set_parameters(replace)
            excitation_delta_m1 = self.rabi_flop.run(cxn, context)
            if excitation_delta_m1 is None: break 

            replace = TreeDict.fromdict({
                                     'RabiFlopping_Sit.sit_on_excitation':duration,
                                     'RabiFlopping.frequency_selection':'auto',
                                     'RabiFlopping.sideband_selection':[0,0,0,0],
                                     'RabiFlopping.line_selection':'S-1/2D-5/2'
                                    })
            self.rabi_flop.set_parameters(replace)
            excitation_delta_m2 = self.rabi_flop.run(cxn, context)
            if excitation_delta_m2 is None: break 

            submission = [duration['us']]
            submission.extend([excitation_delta_m0, excitation_delta_m1, excitation_delta_m2])
            
            self.dv.add(submission, context = self.save_context)
            self.update_progress(i)
 def run(self, cxn, context):
     self.scan_phi = [WithUnit(x, 'deg') for x in [0.0, 90.0, 180.0, 270.0]]
     self.setup_data_vault()
     scan_time = scan_methods.simple_scan(self.parameters.SZX.duration_scan, 'us')
     self.scan = scan_time
     for i, t in enumerate(scan_time):
         should_stop = self.pause_or_stop()
         if should_stop: break
         replace = TreeDict.fromdict({'SZX.duration':t})
         replace['SZX.second_pulse_phase'] = WithUnit(0.0, 'deg')
         self.excite.set_parameters(replace)
         submission = [t['us']]
         submission.extend(self.excite.run(cxn, context))
         self.dv.add(submission, context = self.save_context)
         self.update_progress(i)
 def run(self, cxn, context):
     self.scan_phi = [WithUnit(x, 'deg') for x in [0.0, 90.0, 180.0, 270.0]]
     self.setup_data_vault()
     scan_time = scan_methods.simple_scan(self.parameters.SZX.duration_scan,
                                          'us')
     self.scan = scan_time
     for i, t in enumerate(scan_time):
         should_stop = self.pause_or_stop()
         if should_stop: break
         replace = TreeDict.fromdict({'SZX.duration': t})
         replace['SZX.second_pulse_phase'] = WithUnit(0.0, 'deg')
         self.excite.set_parameters(replace)
         submission = [t['us']]
         submission.extend(self.excite.run(cxn, context))
         self.dv.add(submission, context=self.save_context)
         self.update_progress(i)
Example #10
0
    def run(self, cxn, context):

        scan = scan_methods.simple_scan(
            self.parameters.MolmerSorensen.detuning_scan, 'kHz')
        self.scan = scan

        self.setup_data_vault()
        for i, freq in enumerate(scan):
            should_stop = self.pause_or_stop()
            if should_stop: break
            replace = TreeDict.fromdict({'MolmerSorensen.detuning': freq})
            self.excite.set_parameters(replace)
            states = self.excite.run(cxn, context)
            if states is None: break
            submission = [freq['kHz']]
            submission.extend(states)
            self.dv.add(submission, context=self.save_context)
            self.update_progress(i)
    def run(self, cxn, context):

        scan = scan_methods.simple_scan(self.parameters.MolmerSorensen.detuning_scan, 'kHz')
        self.scan = scan

        self.setup_data_vault()
        for i, freq in enumerate(scan):
            should_stop = self.pause_or_stop()
            if should_stop: break
            replace = TreeDict.fromdict({
                'MolmerSorensen.detuning':freq
                })
            self.excite.set_parameters(replace)
            states = self.excite.run(cxn, context)
            if states is None: break
            submission = [freq['kHz']]
            submission.extend(states)
            self.dv.add(submission, context = self.save_context)
            self.update_progress(i)
    def run(self, cxn, context):

        dv_args = {
            'output_size': 1,
            'experiment_name': self.name,
            'window_name': 'current',
            'dataset_name': 'Heating_Rate'
        }

        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

        scan_param = self.parameters.CalibrationScans.heating_rate_scan_interval

        self.scan = scan_methods.simple_scan(scan_param, 'us')

        # randomizing scan
        shuffle(self.scan)

        for i, heat_time in enumerate(self.scan):
            #should_stop = self.pause_or_stop()
            #if should_stop: break

            replace = TreeDict.fromdict({
                'Heating.background_heating_time':
                heat_time,
                'Documentation.sequence':
                'calibrate_heating_rates',
            })

            self.calibrate_temp.set_parameters(replace)
            #self.calibrate_temp.set_progress_limits(0, 33.0)

            (rsb_ex, bsb_ex) = self.calibrate_temp.run(cxn, context)

            fac = rsb_ex / bsb_ex
            nbar = fac / (1.0 - fac)

            submission = [heat_time['us']]
            submission.extend([nbar])
            print nbar
            self.dv.add(submission, context=self.save_context)
    def run(self, cxn, context):

        dv_args = {'output_size': 1,
                    'experiment_name' : self.name,
                    'window_name': 'current',
                    'dataset_name' : 'Heating_Rate'
                    }

        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

        scan_param = self.parameters.CalibrationScans.heating_rate_scan_interval

        self.scan = scan_methods.simple_scan(scan_param, 'us')

        # randomizing scan
        shuffle(self.scan)

        for i,heat_time in enumerate(self.scan):
            #should_stop = self.pause_or_stop()
            #if should_stop: break
       
            replace = TreeDict.fromdict({
                                    'Heating.background_heating_time':heat_time,
                                    'Documentation.sequence':'calibrate_heating_rates',
                                       })
            
            self.calibrate_temp.set_parameters(replace)
            #self.calibrate_temp.set_progress_limits(0, 33.0)
   
            (rsb_ex, bsb_ex) = self.calibrate_temp.run(cxn, context)

            fac = rsb_ex/bsb_ex
            nbar = fac/(1.0-fac)

            submission = [heat_time['us']]
            submission.extend([nbar])
            print nbar
            self.dv.add(submission, context = self.save_context)
Example #14
0
    def run(self, cxn, context):

        dv_args = {
            'output_size': self.rabi_flop.excite.output_size,
            'experiment_name': self.name,
            'window_name': 'MotionalRamseyTime',
            'dataset_name': 'ramsey_time'
        }
        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

        scan_param = self.parameters.Motion_Analysis.scan_ramsey_time
        self.scan = scan_methods.simple_scan(scan_param, 'us')

        for i, t in enumerate(self.scan):
            should_stop = self.pause_or_stop()
            if should_stop: break
            replace = TreeDict.fromdict({'Motion_Analysis.ramsey_time': t})
            self.rabi_flop.set_parameters(replace)
            excitation = self.rabi_flop.run(cxn, context)
            if excitation is None: break
            submission = [t['us']]
            submission.extend([excitation])
            self.dv.add(submission, context=self.save_context)
            self.update_progress(i)
    def run(self, cxn, context):

        dv_args = {
            'output_size': self.rabi_flop.excite.output_size,
            'experiment_name': self.name,
            'window_name': 'current',
            'dataset_name': 'injection_current_scan'
        }
        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

        scan_param = self.parameters.CalibrationScans.current_scan
        self.scan = scan_methods.simple_scan(scan_param, 'V')
        frequency = self.get_frequency()
        cs = self.parameters.CalibrationScans
        for i, v in enumerate(self.scan):
            should_stop = self.pause_or_stop()
            if should_stop: break
            replace = TreeDict.fromdict({
                'RabiFlopping.frequency_selection':
                'manual',
                'RabiFlopping.manual_frequency_729':
                frequency,
                'RabiFlopping_Sit.sit_on_excitation':
                cs.excitation_time,
            })
            self.rabi_flop.set_parameters(replace)
            self.dac.set_individual_analog_voltages([('06', v['V'])])
            time.sleep(
                2)  # time to make sure the current gets set from the dac

            excitation = self.rabi_flop.run(cxn, context)
            if excitation is None: break
            submission = [v['V']]
            submission.extend([excitation])
            self.dv.add(submission, context=self.save_context)
            self.update_progress(i)
Example #16
0
    def run(self, cxn, context):
       
        dv_args = {'output_size': 1,
                    'experiment_name' : self.name,
                    'window_name': 'current',
                    'dataset_name' : 'Line_Trigger_Scan'
                    }

        scan_param = (WithUnit(2.0, 'ms'), WithUnit(16.0, 'ms'), 10)
        
        self.scan = scan_methods.simple_scan(scan_param, 'ms')
        
        scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

        dt = self.parameters.DriftTracker

        original_linetrigger_state = self.pulser.line_trigger_state()
        self.pulser.line_trigger_state(True)

        # save original state of DDS 5
        dds5_state = self.dds_cw.output('5')

        self.dds_cw.output('5', True)
        time.sleep(1)

        for i,line_trigger_time in enumerate(self.scan):

            #'StateReadout.repeat_each_measurement':no_of_repeats,
            replace = TreeDict.fromdict({
                'DopplerCooling.doppler_cooling_duration':line_trigger_time,
                'Spectrum.line_selection':'S-1/2D-5/2',
                'Spectrum.sideband_selection':[0,0,0,0],
                'Spectrum.sensitivity_selection':'custom',
                'StatePreparation.sideband_cooling_enable':False,
                'StatePreparation.optical_pumping_enable':True,
                'Display.relative_frequencies':False,
                'StateReadout.use_camera_for_readout':False
                })

            self.spectrum.set_parameters(self.parameters)
            self.spectrum.set_parameters(replace)
            self.spectrum.set_progress_limits(0.0, 100.0)
        
            fr, ex = self.spectrum.run(cxn, context)

            fr = np.array(fr)
            ex = np.array(ex)
            ex = ex.flatten()
    
            # take the maximum of the line excitation
            try:
                fit_center, rsb_ex, fit_width = self.fitter.fit(fr, ex, return_all_params = True)
            except:
                fit_center = None

            submission = [line_trigger_time['ms']]
            submission.extend([ 1e3 * (fit_center - self.linecenter) ])
            self.dv.add(submission, context = self.save_context)
 

        # resetting DDS5 state
        time.sleep(1)
        #self.dds_cw.output('5', False)
        self.dds_cw.output('5', dds5_state)
        time.sleep(1)

        # set line trigger back to original state
        self.pulser.line_trigger_state(original_linetrigger_state)
    def run(self, cxn, context):
        scan_param = self.parameters.Motion_Analysis.scan_frequency

        if self.parameters.Motion_Analysis.do_radial1_scan:
            #mode = self.parameters.Motion_Analysis.sideband_selection
            mode = 'radial_frequency_1'
            self.scan = scan_methods.simple_scan(
                scan_param,
                'MHz',
                offset=self.parameters['TrapFrequencies.' + mode])

            dv_args = {
                'output_size': self.rabi_flop.excite.output_size,
                'experiment_name': self.name,
                'window_name': 'radial1',
                'dataset_name': 'exc_freq',
                'axis': self.scan,
                'send_to_current': True,
            }

            scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

            self.rabi_flop.set_progress_limits(0, 50.0)

            for i, f in enumerate(self.scan):
                should_stop = self.pause_or_stop()
                if should_stop: break
                self.agi.set_frequency(f)
                time.sleep(1)

                replace = TreeDict.fromdict({
                    #                                             'Motion_Analysis.excitation_enable':True,
                    'RabiFlopping.sideband_selection': [1, 0, 0, 0],
                })
                self.rabi_flop.set_parameters(replace)
                excitation = self.rabi_flop.run(cxn, context)
                print excitation
                if excitation is None: break
                submission = [f['MHz']]
                submission.extend([excitation])
                self.dv.add(submission, context=self.save_context)
                self.update_progress(i)

            self.rabi_flop.save_parameters(self.dv, cxn, self.cxnlab,
                                           self.save_context)
            self.rabi_flop.finalize(cxn, context)

        # secondary scan
        if self.parameters.Motion_Analysis.do_radial2_scan:

            mode = 'radial_frequency_2'
            self.scan = scan_methods.simple_scan(
                scan_param,
                'MHz',
                offset=self.parameters['TrapFrequencies.' + mode])

            dv_args = {
                'output_size': self.rabi_flop.excite.output_size,
                'experiment_name': self.name,
                'window_name': 'radial2',
                'dataset_name': 'exc_freq',
                'axis': self.scan,
                'send_to_current': True,
            }

            scan_methods.setup_data_vault(cxn, self.save_context, dv_args)

            self.rabi_flop.set_progress_limits(50.0, 100.0)

            for i, f in enumerate(self.scan):
                should_stop = self.pause_or_stop()
                if should_stop: break
                self.agi.set_frequency(f)
                time.sleep(1)

                replace = TreeDict.fromdict({
                    #                                             'Motion_Analysis.excitation_enable':True,
                    'RabiFlopping.sideband_selection': [0, 1, 0, 0],
                })
                self.rabi_flop.set_parameters(replace)
                excitation = self.rabi_flop.run(cxn, context)
                if excitation is None: break
                submission = [f['MHz']]
                submission.extend([excitation])
                self.dv.add(submission, context=self.save_context)
                self.update_progress(i)

            self.rabi_flop.save_parameters(self.dv, cxn, self.cxnlab,
                                           self.save_context)
            self.rabi_flop.finalize(cxn, context)
 def run(self, cxn, context):
     scan_param = self.parameters.Motion_Analysis.scan_ramsey_time
     
     
     if self.parameters.Motion_Analysis.do_radial1_scan:
         #mode = self.parameters.Motion_Analysis.sideband_selection
         self.scan = scan_methods.simple_scan(scan_param, 'us') #Creates linspace to scan over
         
         dv_args = {'output_size':self.rabi_flop.excite.output_size,
                           'experiment_name': self.name,
                           'window_name': 'ramsey',
                           'dataset_name': 'exc_freq',
                           'axis': self.scan,
                           'send_to_current': True,
                           }
                
         scan_methods.setup_data_vault(cxn, self.save_context, dv_args)
         freq=self.parameters.TrapFrequencies.radial_frequency_1+self.parameters.Motion_Analysis.ramsey_detuning
         self.rabi_flop.set_progress_limits(0, 50.0)
         
         for i,t in enumerate(self.scan):
             should_stop = self.pause_or_stop()
             if should_stop: break
             self.agi.set_frequency(freq)
             time.sleep(1)                            
             
             replace = TreeDict.fromdict({
                                          'Motion_Analysis.excitation_enable':True,
                                          'RabiFlopping.sideband_selection':[1,0,0,0],
                                          'Motion_Analysis.ramsey_time':t,
                                          })
             self.rabi_flop.set_parameters(replace)
             excitation = self.rabi_flop.run(cxn, context)
             if excitation is None: break 
             submission = [t['us']]
             submission.extend([excitation])
             self.dv.add(submission, context = self.save_context)
             self.update_progress(i)
             
         self.rabi_flop.save_parameters(self.dv, cxn, self.cxnlab, self.save_context)
         self.rabi_flop.finalize(cxn, context)
                
     # secondary scan
     if self.parameters.Motion_Analysis.do_radial2_scan:
                 
         self.scan = scan_methods.simple_scan(scan_param, 'us') #Creates linspace to scan over
                 
         dv_args = {'output_size':self.rabi_flop.excite.output_size,
                    'experiment_name': self.name,
                    'window_name': 'ramsey',
                    'dataset_name': 'exc_freq',
                    'axis': self.scan,
                    'send_to_current': True,
                    }
     
         scan_methods.setup_data_vault(cxn, self.save_context, dv_args)
         freq=self.parameters.TrapFrequencies.radial_frequency_2+self.parameters.Motion_Analysis.ramsey_detuning            
         self.rabi_flop.set_progress_limits(50.0, 100.0)
                     
         for i,t in enumerate(self.scan):
             should_stop = self.pause_or_stop()
             if should_stop: break
             self.agi.set_frequency(freq)
             time.sleep(1)
                             
             replace = TreeDict.fromdict({
                                          'Motion_Analysis.excitation_enable':True,
                                          'RabiFlopping.sideband_selection':[0,1,0,0],
                                          'Motion_Analysis.ramsey_time':t,
                                          })
             self.rabi_flop.set_parameters(replace)
             excitation = self.rabi_flop.run(cxn, context)
             if excitation is None: break 
             submission = [t['us']]
             submission.extend([excitation])
             self.dv.add(submission, context = self.save_context)
             self.update_progress(i)
             
         self.rabi_flop.save_parameters(self.dv, cxn, self.cxnlab, self.save_context)
         self.rabi_flop.finalize(cxn, context)