def plot_current_sequence(self, cxn):
     from common.okfpgaservers.pulser.pulse_sequences.plot_sequence import SequencePlotter
     dds = cxn.pulser.human_readable_dds()
     ttl = cxn.pulser.human_readable_ttl()
     channels = cxn.pulser.get_channels()
     sp = SequencePlotter(ttl, dds.aslist, channels)
     sp.makePlot()
Beispiel #2
0
 def plot_current_sequence(self, cxn):
     from common.okfpgaservers.pulser.pulse_sequences.plot_sequence import SequencePlotter
     dds = cxn.pulser.human_readable_dds()
     ttl = cxn.pulser.human_readable_ttl()
     channels = cxn.pulser.get_channels()
     sp = SequencePlotter(ttl, dds.aslist, channels)
     sp.makePlot()
    def run(self, cxn, context):
        p = self.parameters.Dephasing_Pulses
        self.data_vault_new_trace()
        self.setup_sequence_parameters()
        for i, interaction_duration in enumerate(self.scan_t):
            second_pulse_dur = min(self.max_second_pulse, interaction_duration)
            ramsey_time = max(WithUnit(0, 'us'),
                              interaction_duration - self.max_second_pulse)
            p.evolution_ramsey_time = ramsey_time
            p.evolution_pulses_duration = second_pulse_dur
            N = int(p.analysis_ion_number)  # index from 0
            print N
            #-------------------- Phase loop
            submission = [interaction_duration['us']]  #This is the time
            phase_list = []
            for j, interaction_phase in enumerate(self.scan_phi):
                should_stop = self.pause_or_stop()
                if should_stop:
                    return False
                p.evolution_pulses_phase = interaction_phase  #added for the phase steps
                self.excite.set_parameters(self.parameters)
                excitation, readout = self.excite.run(cxn, context)
                # excitation looks like [ion1 excit, ion2 ex, ... ]
                # pull out just the ion readout we care about with excitation[N]
                phase_list.append(
                    excitation[N]
                )  # only look at the excitation for the ion we readout

            submission.extend(
                phase_list
            )  # The excitation is attached to the time now in a second column (?)
            self.dv.add(
                submission, context=self.data_save_context
            )  #Saving to data file where submission now includes the time and excitation

            # now have submitted raw data, save contrast for online analysis
            try:
                contrast = (max(phase_list) - min(phase_list)) / (
                    max(phase_list) + min(phase_list)
                )  # will fail with 0 excitation
            except:
                contrast = 0  # in case there's no excitation
            contrast_submission = [interaction_duration['us'], contrast]
            self.dv.add(contrast_submission,
                        context=self.contrast_save_context)

            self.update_progress(i)
        self.save_parameters(self.dv, cxn, self.cxnlab, self.data_save_context)
        ####### PULSE SEQUENCE PLOTTING #########
        ttl = self.cxn.pulser.human_readable_ttl()
        dds = self.cxn.pulser.human_readable_dds()
        channels = self.cxn.pulser.get_channels().asarray
        sp = SequencePlotter(ttl.asarray, dds.aslist, channels)
        sp.makePlot()
        ############################################
        return True
Beispiel #4
0
 def plot_current_sequence(self, cxn):
     
     # Bypass creating pulse sequence plot
     if self.parameters_dict.global_scan_options.quick_finish:
         return
     
     #t0 = time.time()
     from common.okfpgaservers.pulser.pulse_sequences.plot_sequence import SequencePlotter
     dds = cxn.pulser.human_readable_dds()
     ttl = cxn.pulser.human_readable_ttl()
     channels = cxn.pulser.get_channels()
     #sp = SequencePlotter(ttl, dds.aslist, channels)
     sp = SequencePlotter(ttl, dds, channels)
     sp.makePDF()
    def run(self, cxn, context):
        p = self.parameters.Dephasing_Pulses
        self.data_vault_new_trace()
        self.setup_sequence_parameters()
        for i,interaction_duration in enumerate(self.scan_t):
            second_pulse_dur = min(self.max_second_pulse, interaction_duration)
            ramsey_time = max(WithUnit(0,'us'), interaction_duration - self.max_second_pulse)
            p.evolution_ramsey_time = ramsey_time
            p.evolution_pulses_duration = second_pulse_dur
            N = int(p.analysis_ion_number) # index from 0
            print N
            #-------------------- Phase loop
            submission = [interaction_duration['us']] #This is the time
            phase_list = []
            for j,interaction_phase in enumerate(self.scan_phi):                
                should_stop = self.pause_or_stop()
                if should_stop:
                    return False
                p.evolution_pulses_phase = interaction_phase #added for the phase steps
                self.excite.set_parameters(self.parameters)
                excitation, readout = self.excite.run(cxn, context)
                # excitation looks like [ion1 excit, ion2 ex, ... ]
                # pull out just the ion readout we care about with excitation[N]
                phase_list.append(excitation[N]) # only look at the excitation for the ion we readout

            submission.extend(phase_list) # The excitation is attached to the time now in a second column (?)
            self.dv.add(submission, context = self.data_save_context) #Saving to data file where submission now includes the time and excitation
            
            # now have submitted raw data, save contrast for online analysis
            try:
                contrast = (max(phase_list) - min(phase_list))/(max(phase_list) + min(phase_list)) # will fail with 0 excitation
            except:
                contrast = 0 # in case there's no excitation
            contrast_submission = [interaction_duration['us'], contrast]
            self.dv.add(contrast_submission, context = self.contrast_save_context)

            self.update_progress(i)
        self.save_parameters(self.dv, cxn, self.cxnlab, self.data_save_context)
        ####### PULSE SEQUENCE PLOTTING #########
        ttl = self.cxn.pulser.human_readable_ttl()
        dds = self.cxn.pulser.human_readable_dds()
        channels = self.cxn.pulser.get_channels().asarray
        sp = SequencePlotter(ttl.asarray, dds.aslist, channels)
        sp.makePlot()
        ############################################
        return True
Beispiel #6
0
    def run(self, cxn, context):
        self.setup_data_vault()
        self.setup_sequence_parameters()
        self.pulser.switch_auto('397mod')
        self.pulser.switch_auto('parametric_modulation')
        for i, duration in enumerate(self.scan):
            should_stop = self.pause_or_stop()
            if should_stop: break

            self.parameters['ParametricCoupling.parametric_coupling_duration'] = duration
            self.excite.set_parameters(self.parameters)
            excitation = self.excite.run(cxn, context)
            self.dv.add((duration, excitation), context = self.mode_coupling_save_context)
            self.update_progress(i)
            
        dds = self.cxn.pulser.human_readable_dds()
        ttl = self.cxn.pulser.human_readable_ttl()
        channels = self.cxn.pulser.get_channels().asarray
        sp = SequencePlotter(ttl.asarray, dds.aslist, channels)
        sp.makePlot()
Beispiel #7
0
    def run(self, cxn, context):
        self.setup_data_vault()
        self.setup_sequence_parameters()
        self.pulser.switch_auto('397mod')
        self.pulser.switch_auto('parametric_modulation')
        for i, duration in enumerate(self.scan):
            should_stop = self.pause_or_stop()
            if should_stop: break

            self.parameters[
                'ParametricCoupling.parametric_coupling_duration'] = duration
            self.excite.set_parameters(self.parameters)
            excitation = self.excite.run(cxn, context)
            self.dv.add((duration, excitation),
                        context=self.mode_coupling_save_context)
            self.update_progress(i)

        dds = self.cxn.pulser.human_readable_dds()
        ttl = self.cxn.pulser.human_readable_ttl()
        channels = self.cxn.pulser.get_channels().asarray
        sp = SequencePlotter(ttl.asarray, dds.aslist, channels)
        sp.makePlot()
Beispiel #8
0
                  ['0.00962008', '00000000000000000000000000000000'],
                  ['0.00982', '00000000000000000010000000000000'],
                  ['0.00982008', '00000000000000000000000000000000'],
                  ['0.01002', '00000000000000000010000000000000'],
                  ['0.01002008', '00000000000000000000000000000000'],
                  ['0.010026', '00000000000000000010000000000000'],
                  ['0.01002608', '00000000000000000000000000000000'],
                  ['0.010226', '00000000000000000010000000000000'],
                  ['0.01022608', '00000000000000000000000000000000'],
                  ['0.010276', '00001000000000000010000000000000'],
                  ['0.01027608', '00001000000000000000000000000000'],
                  ['0.010376', '00000000000000000010000000000000'],
                  ['0.01037608', '00000000000000000000000000000000'],
                  ['0.010381', '00000000000000000010000000000000'],
                  ['0.01038108', '00000000000000000000000000000000'],
                  ['0.010431', '00000000000000000010000000000000'],
                  ['0.01043108', '00000000000000000000000000000000'],
                  ['0.010631', '00000000000000000010100000000000'],
                  ['0.01063108', '00000000000000000000100000000000'],
                  ['0.013631', '00000000000000000010000000000000'],
                  ['0.01363108', '00000000000000000000000000000000'],
                  ['0.013731', '00000000000000000010000000000000'],
                  ['0.01373108', '00000000000000000001000000000000'],
                  ['0.01373116', '00000000000000000000000000000000'],
                  ['0.0', '00000000000000000000000000000000']]
    readout = cxn.pulser.get_readout_counts().asarray
    print readout
    channels = cxn.pulser.get_channels().asarray
    sp = SequencePlotter(ttl.asarray, dds.aslist, channels)
    sp.makePlot()
        try:
            sequence = tested_sequence(a)
        except Exception:
            pass
        else:
            print 'key not needed', key
    tinit = time.time()
    cs = tested_sequence(d)
    cs.programSequence(cxn.pulser)
    print 'to program', time.time() - tinit
#    cxn.pulser.start_number(10)
#    cxn.pulser.wait_sequence_done()
#    cxn.pulser.stop_sequence()
    dds = cxn.pulser.human_readable_dds()
    ttl = cxn.pulser.human_readable_ttl()
    ttl_result = [['0.0', '00000000000000000000000000000000'], ['1e-05', '00000000000000000010000000000000'], ['1.008e-05', '00000000000000000000000000000000'], ['6e-05', '00000000000000000010000000000000'], ['6.008e-05', '00000000000000000000000000000000'], ['0.00026', '00000000000000000010000000000000'], ['0.00026008', '00000000000000000000000000000000'], ['0.00132', '00000000000000000010000000000000'], ['0.00132008', '00000000000000000000000000000000'], ['0.00142', '00000000000000000010000000000000'], ['0.00142008', '00000000000000000000000000000000'], ['0.00242', '00000000000000000010000000000000'], ['0.00242008', '00000000000000000000000000000000'], ['0.00262', '00000000000000000010000000000000'], ['0.00262008', '00000000000000000000000000000000'], ['0.00282', '00000000000000000010000000000000'], ['0.00282008', '00000000000000000000000000000000'], ['0.00332', '00000000000000000010000000000000'], ['0.00332008', '00000000000000000000000000000000'], ['0.00352', '00000000000000000010000000000000'], ['0.00352008', '00000000000000000000000000000000'], ['0.00372', '00000000000000000010000000000000'], ['0.00372008', '00000000000000000000000000000000'], ['0.00422', '00000000000000000010000000000000'], ['0.00422008', '00000000000000000000000000000000'], ['0.00442', '00000000000000000010000000000000'], ['0.00442008', '00000000000000000000000000000000'], ['0.00462', '00000000000000000010000000000000'], ['0.00462008', '00000000000000000000000000000000'], ['0.00512', '00000000000000000010000000000000'], ['0.00512008', '00000000000000000000000000000000'], ['0.00532', '00000000000000000010000000000000'], ['0.00532008', '00000000000000000000000000000000'], ['0.00552', '00000000000000000010000000000000'], ['0.00552008', '00000000000000000000000000000000'], ['0.00602', '00000000000000000010000000000000'], ['0.00602008', '00000000000000000000000000000000'], ['0.00622', '00000000000000000010000000000000'], ['0.00622008', '00000000000000000000000000000000'], ['0.00642', '00000000000000000010000000000000'], ['0.00642008', '00000000000000000000000000000000'], ['0.00692', '00000000000000000010000000000000'], ['0.00692008', '00000000000000000000000000000000'], ['0.00712', '00000000000000000010000000000000'], ['0.00712008', '00000000000000000000000000000000'], ['0.00732', '00000000000000000010000000000000'], ['0.00732008', '00000000000000000000000000000000'], ['0.00782', '00000000000000000010000000000000'], ['0.00782008', '00000000000000000000000000000000'], ['0.00802', '00000000000000000010000000000000'], ['0.00802008', '00000000000000000000000000000000'], ['0.00822', '00000000000000000010000000000000'], ['0.00822008', '00000000000000000000000000000000'], ['0.00872', '00000000000000000010000000000000'], ['0.00872008', '00000000000000000000000000000000'], ['0.00892', '00000000000000000010000000000000'], ['0.00892008', '00000000000000000000000000000000'], ['0.00912', '00000000000000000010000000000000'], ['0.00912008', '00000000000000000000000000000000'], ['0.00962', '00000000000000000010000000000000'], ['0.00962008', '00000000000000000000000000000000'], ['0.00982', '00000000000000000010000000000000'], ['0.00982008', '00000000000000000000000000000000'], ['0.01002', '00000000000000000010000000000000'], ['0.01002008', '00000000000000000000000000000000'], ['0.01003', '00000000000000000010000000000000'], ['0.01003008', '00000000000000000000000000000000'], ['0.01004', '00000000000000000010000000000000'], ['0.01004008', '00000000000000000000000000000000'], ['0.01005', '00000000000000000010000000000000'], ['0.01005008', '00000000000000000000000000000000'], ['0.01006', '00000000000000000010000000000000'], ['0.01006008', '00000000000000000000000000000000'], ['0.010066', '00000000000000000010000000000000'], ['0.01006608', '00000000000000000000000000000000'], ['0.010076', '00000100000000000010100000000000'], ['0.01007608', '00000100000000000000100000000000'], ['0.010176', '00000000000000000000100000000000'], ['0.013076', '00000000000000000010000000000000'], ['0.01307608', '00000000000000000000000000000000'], ['0.013176', '00000000000000000010000000000000'], ['0.01317608', '00000000000000000001000000000000'], ['0.01317616', '00000000000000000000000000000000'], ['0.0', '00000000000000000000000000000000']]
    print ttl == ttl_result
    for a,b in zip(ttl_result, ttl):
        if not a == b:
            print 'TTL Difference', a,b
    dds_result = [('global397', 0.0, -63.0), ('global397', 0.0, -63.0), ('global397', 89.99999987194315, -15.0), ('global397', 89.99999987194315, -15.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -13.000457770656901), ('global397', 89.99999987194315, -63.0), ('global397', 89.99999987194315, -63.0), ('854DP', 0.0, -63.0), ('854DP', 0.0, -63.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -11.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -5.000457770656901), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('854DP', 79.99999990686774, -63.0), ('729DP', 0.0, -63.0), ('729DP', 0.0, -63.0), ('729DP', 0.0, -63.0), ('729DP', 0.0, -63.0), ('729DP', 0.0, -63.0), ('729DP', 219.99999997671694, -10.000228885328454), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 224.99999986612238, -11.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 219.99999997671694, -10.000228885328454), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 224.99999986612238, -11.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 219.99999997671694, -10.000228885328454), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 224.99999986612238, -11.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 219.99999997671694, -10.000228885328454), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 224.99999986612238, -11.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 224.99999986612238, -63.0), ('729DP', 219.99999997671694, -10.000228885328454), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 219.99999997671694, -63.0), ('729DP', 214.99999990104698, -63.0), ('729DP', 214.99999990104698, -5.000457770656901), ('729DP', 214.99999990104698, -63.0), ('729DP', 214.99999990104698, -63.0), ('729DP', 214.99999990104698, -63.0), ('866DP', 0.0, -63.0), ('866DP', 0.0, -63.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -63.0), ('866DP', 79.99999990686774, -15.0), ('866DP', 79.99999990686774, -15.0), ('866DP', 79.99999990686774, -63.0), ('866DP', 79.99999990686774, -63.0), ('866DP', 79.99999990686774, -63.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -11.0), ('866DP', 79.99999990686774, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 0.0, -63.0), ('radial', 99.99999983701855, -17.0004577706569), ('radial', 99.99999983701855, -63.0), ('radial', 99.99999983701855, -63.0), ('radial', 99.99999983701855, -63.0), ('radial', 99.99999983701855, -63.0), ('radial', 99.99999983701855, -63.0), ('radial', 99.99999983701855, -63.0), ('radial', 99.99999983701855, -63.0)]
    print dds == dds_result
    for a,b in zip(dds_result, dds):
        if not a == b:
            print 'DDS Difference', a,b
            
    readout = cxn.pulser.get_readout_counts().asarray
    print 'readout', readout
    channels = cxn.pulser.get_channels().asarray
    sp = SequencePlotter(ttl.asarray, dds.aslist, channels)
    sp.makePlot()