예제 #1
0
    def lt2_sequence(self):
        print "Make lt2 sequence... "

        self.lt2_seq = pulsar.Sequence('TeleportationLT2')

        dummy_element = tseq._lt2_dummy_element(self)
        LDE_element = tseq._lt2_LDE_element(
            self, use_short_eom_pulse=self.params['use_short_eom_pulse'])
        finished_element = tseq._lt2_sequence_finished_element(self)

        self.lt2_seq.append(
            name='LDE_LT2',
            wfname=(LDE_element.name
                    if DO_LDE_SEQUENCE else dummy_element.name),
            trigger_wait=True,
            # jump_target = 'DD', TODO: not implemented yet
            goto_target='LDE_LT2',
            repetitions=self.params['LDE_attempts_before_CR'])

        elements = []
        elements.append(dummy_element)
        elements.append(finished_element)

        if DO_LDE_SEQUENCE:
            elements.append(LDE_element)

        qt.pulsar.upload(*elements)
        qt.pulsar.program_sequence(self.lt2_seq)
        self.awg_lt2.set_runmode('SEQ')
        self.awg_lt2.start()

        i = 0
        awg_ready = False
        while not awg_ready and i < 40:
            try:
                if self.awg_lt2.get_state() == 'Waiting for trigger':
                    awg_ready = True
            except:
                print 'waiting for awg: usually means awg is still busy and doesnt respond'
                print 'waiting', i, '/40'
                i = i + 1
            qt.msleep(0.5)
        if not awg_ready:
            raise Exception('AWG not ready')

        def finish(self):
            self.awg_lt2.stop()
            self.awg_lt2.set_runmode('CONT')
예제 #2
0
    def lt2_sequence(self):
        print "Make lt2 sequence... "

        self.lt2_seq = pulsar.Sequence('TeleportationLT2')

        dummy_element = tseq._lt2_dummy_element(self)
        LDE_element = tseq._lt2_LDE_element(self)
        finished_element = tseq._lt2_sequence_finished_element(self)

        self.lt2_seq.append(name = 'LDE_LT2',
            wfname = (LDE_element.name if DO_LDE_SEQUENCE else dummy_element.name),
            trigger_wait = True,
            # jump_target = 'DD', TODO: not implemented yet
            goto_target = 'LDE_LT2',
            repetitions = self.params['LDE_attempts_before_CR'])

        elements = []
        elements.append(dummy_element)
        elements.append(finished_element)

        if DO_LDE_SEQUENCE:
            elements.append(LDE_element)

        qt.pulsar.upload(*elements)
        qt.pulsar.program_sequence(self.lt2_seq)
        self.awg_lt2.set_runmode('SEQ')
        self.awg_lt2.start()

        i=0
        awg_ready = False
        while not awg_ready and i<40:
            try:
                if self.awg_lt2.get_state() == 'Waiting for trigger':
                    awg_ready = True
            except:
                print 'waiting for awg: usually means awg is still busy and doesnt respond'
                print 'waiting', i, '/40'
                i=i+1
            qt.msleep(0.5)
        if not awg_ready: 
            raise Exception('AWG not ready')

        def finish(self):
                self.awg_lt2.stop()
                self.awg_lt2.set_runmode('CONT')
예제 #3
0
    def lt2_sequence(self):
        print "Make lt2 sequence... "

        self.lt2_seq = pulsar.Sequence('TeleportationLT2')

        dummy_element = tseq._lt2_dummy_element(self)
        LDE_element = tseq._lt2_LDE_element(self)
        finished_element = tseq._lt2_sequence_finished_element(self)

        self.lt2_seq.append(name='LDE_LT2',
                            wfname=(LDE_element.name if DO_LDE_SEQUENCE else
                                    dummy_element.name),
                            trigger_wait=True,
                            goto_target='LDE_LT2',
                            repetitions=self.params['LDE_attempts_before_CR'])

        if DO_DD:
            self.lt2_seq, total_elt_time, elts = tseq._lt2_dynamical_decoupling(
                self,
                self.lt2_seq,
                name='DD',
                time_offset=LDE_element.length(),
                use_delay_reps=not (DO_READOUT))
            self.lt2_seq.append(name='dummy_after_DD',
                                wfname=dummy_element.name,
                                goto_target='dummy_after_DD')
        else:
            self.lt2_seq.append(name='DD',
                                wfname=dummy_element.name,
                                goto_target='LT2_ready_for_RO',
                                repetitions=20)

        #A_[ms,mi]
        # rotation axes: Y:=0 phase, X:=90

        ################################################### FF, DD and RO ##################################################################
        #TWO OPTIONS 'ALLES, of NIETS':
        #alles:
        #1. First program feaad forward pulse(s), independent of source_state_basis, but dependent on BSM RO result (and psi-/+)
        #2. Then program tomography (ro pulse), dependent on source_state_basis, but independent on BSM RO result (and psi-/+)
        #niets:
        #both FF and RO in one pulse, depending on source_state_basis, BSM RO result (and psi-/+)
        if DO_DD and DO_READOUT:
            RO_time_offset = LDE_element.length() + total_elt_time

            id_el = tseq._lt2_final_id(self,
                                       name='FF_Id',
                                       time_offset=RO_time_offset)
            piY_el = tseq._lt2_final_pi(self,
                                        name='FF_Y',
                                        time_offset=RO_time_offset,
                                        CORPSE_pi_phase=0)

            pi2y_el = tseq._lt2_final_pi2(self,
                                          name='FF_y',
                                          time_offset=RO_time_offset,
                                          CORPSE_pi2_phase=0)
            pi2miny_el = tseq._lt2_final_pi2(self,
                                             name='FF_-y',
                                             time_offset=RO_time_offset,
                                             CORPSE_pi2_phase=180)

            pi2x_el = tseq._lt2_final_pi2(self,
                                          name='FF_x',
                                          time_offset=RO_time_offset,
                                          CORPSE_pi2_phase=90)
            pi2minx_el = tseq._lt2_final_pi2(self,
                                             name='FF_-x',
                                             time_offset=RO_time_offset,
                                             CORPSE_pi2_phase=-90)

            if (self.params['tomography_basis'] == 'Z'):

                A00_psimin_RO_el = id_el
                A01_psimin_RO_el = piY_el
                A10_psimin_RO_el = id_el
                A11_psimin_RO_el = piY_el

                A00_psiplus_RO_el = id_el
                A01_psiplus_RO_el = piY_el
                A10_psiplus_RO_el = id_el
                A11_psiplus_RO_el = piY_el

            elif (self.params['tomography_basis'] == '-Z'):

                A00_psimin_RO_el = piY_el
                A01_psimin_RO_el = id_el
                A10_psimin_RO_el = piY_el
                A11_psimin_RO_el = id_el

                A00_psiplus_RO_el = piY_el
                A01_psiplus_RO_el = id_el
                A10_psiplus_RO_el = piY_el
                A11_psiplus_RO_el = id_el

            elif (self.params['tomography_basis'] == 'X'):

                A00_psimin_RO_el = pi2miny_el
                A01_psimin_RO_el = pi2y_el
                A10_psimin_RO_el = pi2y_el
                A11_psimin_RO_el = pi2miny_el

                A00_psiplus_RO_el = pi2y_el
                A01_psiplus_RO_el = pi2miny_el
                A10_psiplus_RO_el = pi2miny_el
                A11_psiplus_RO_el = pi2y_el

            elif (self.params['tomography_basis'] == '-X'):

                A00_psimin_RO_el = pi2y_el
                A01_psimin_RO_el = pi2miny_el
                A10_psimin_RO_el = pi2miny_el
                A11_psimin_RO_el = pi2y_el

                A00_psiplus_RO_el = pi2miny_el
                A01_psiplus_RO_el = pi2y_el
                A10_psiplus_RO_el = pi2y_el
                A11_psiplus_RO_el = pi2miny_el

            elif (self.params['tomography_basis'] == 'Y'):

                A00_psimin_RO_el = pi2x_el
                A01_psimin_RO_el = pi2x_el
                A10_psimin_RO_el = pi2minx_el
                A11_psimin_RO_el = pi2minx_el

                A00_psiplus_RO_el = pi2minx_el
                A01_psiplus_RO_el = pi2minx_el
                A10_psiplus_RO_el = pi2x_el
                A11_psiplus_RO_el = pi2x_el

            elif (self.params['tomography_basis'] == '-Y'):

                A00_psimin_RO_el = pi2minx_el
                A01_psimin_RO_el = pi2minx_el
                A10_psimin_RO_el = pi2x_el
                A11_psimin_RO_el = pi2x_el

                A00_psiplus_RO_el = pi2x_el
                A01_psiplus_RO_el = pi2x_el
                A10_psiplus_RO_el = pi2minx_el
                A11_psiplus_RO_el = pi2minx_el
            else:
                raise Exception('tomography basis not recognized.')

            self.lt2_seq.append(name='A00_psi-',
                                wfname=A00_psimin_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A01_psi-',
                                wfname=A01_psimin_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A10_psi-',
                                wfname=A10_psimin_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A11_psi-',
                                wfname=A11_psimin_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A00_psi+',
                                wfname=A00_psiplus_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A01_psi+',
                                wfname=A01_psiplus_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A10_psi+',
                                wfname=A10_psiplus_RO_el.name,
                                goto_target='LT2_ready_for_RO')
            self.lt2_seq.append(name='A11_psi+',
                                wfname=A11_psiplus_RO_el.name,
                                goto_target='LT2_ready_for_RO')

        ################################################### END FF, DD and RO ##################################################################
        ### JUMPING
        # EV0: first BSM: ms0 = 0, ms-1 = 1 --> espin
        # EV1: second BSM: ms0 = 0, ms-1 = 1 --> Nspin
        # EV2: 1 = decoupling, 0 = FF
        # EV3: PLU: psi+ = 0,  psi- = 1
        # int('xxxx',2) --> EV (3210)

        self.lt2_seq.set_djump(True)
        if DO_DD:
            # note: A01 etc. gives out nitrogen value first, jump expects electron RO first.
            if DO_FF:
                self.lt2_seq.add_djump_address(int('1000', 2), 'A00_psi-')
                self.lt2_seq.add_djump_address(int('1001', 2), 'A01_psi-')
                self.lt2_seq.add_djump_address(int('1010', 2), 'A10_psi-')
                self.lt2_seq.add_djump_address(int('1011', 2), 'A11_psi-')
                self.lt2_seq.add_djump_address(int('0000', 2), 'A00_psi+')
                self.lt2_seq.add_djump_address(int('0001', 2), 'A01_psi+')
                self.lt2_seq.add_djump_address(int('0010', 2), 'A10_psi+')
                self.lt2_seq.add_djump_address(int('0011', 2), 'A11_psi+')
            else:
                self.lt2_seq.add_djump_address(int('1000', 2), 'A00_psi-')
                self.lt2_seq.add_djump_address(int('1001', 2), 'A00_psi-')
                self.lt2_seq.add_djump_address(int('1010', 2), 'A00_psi-')
                self.lt2_seq.add_djump_address(int('1011', 2), 'A00_psi-')
                self.lt2_seq.add_djump_address(int('0000', 2), 'A00_psi+')
                self.lt2_seq.add_djump_address(int('0001', 2), 'A00_psi+')
                self.lt2_seq.add_djump_address(int('0010', 2), 'A00_psi+')
                self.lt2_seq.add_djump_address(int('0011', 2), 'A00_psi+')

            self.lt2_seq.add_djump_address(int('1100', 2), 'DD')
            self.lt2_seq.add_djump_address(int('1101', 2), 'DD')
            self.lt2_seq.add_djump_address(int('1110', 2), 'DD')
            self.lt2_seq.add_djump_address(int('1111', 2), 'DD')
            self.lt2_seq.add_djump_address(int('0100', 2), 'DD')
            self.lt2_seq.add_djump_address(int('0101', 2), 'DD')
            self.lt2_seq.add_djump_address(int('0110', 2), 'DD')
            self.lt2_seq.add_djump_address(int('0111', 2), 'DD')
        else:
            for i in range(16):
                self.lt2_seq.add_djump_address(i, 'DD')

        self.lt2_seq.append(name='LT2_ready_for_RO',
                            wfname=finished_element.name,
                            goto_target='LDE_LT2')

        ### AND ADD READOUT PULSES
        elements = []
        elements.append(dummy_element)

        if DO_LDE_SEQUENCE:
            elements.append(LDE_element)

        if DO_DD:
            for e in elts:  #the dynamical decoupling sequence elements
                if e not in elements:
                    elements.append(e)

            if DO_READOUT:
                elements.append(A00_psimin_RO_el)
                elements.append(A01_psimin_RO_el)
                elements.append(A10_psimin_RO_el)
                elements.append(A11_psimin_RO_el)
                elements.append(A00_psiplus_RO_el)
                elements.append(A01_psiplus_RO_el)
                elements.append(A10_psiplus_RO_el)
                elements.append(A11_psiplus_RO_el)
        elements.append(finished_element)

        qt.pulsar.upload(*elements)
        qt.pulsar.program_sequence(self.lt2_seq)
        self.awg_lt2.set_runmode('SEQ')
        self.awg_lt2.start()

        i = 0
        awg_ready = False
        while not awg_ready and i < 40:
            try:
                if self.awg_lt2.get_state() == 'Waiting for trigger':
                    awg_ready = True
            except:
                print 'waiting for awg: usually means awg is still busy and doesnt respond'
                print 'waiting', i, '/40'
                i = i + 1
            qt.msleep(0.5)
        if not awg_ready:
            raise Exception('AWG not ready')
    def lt2_sequence(self):
        print "Make lt2 sequence... "

        self.lt2_seq = pulsar.Sequence('TeleportationLT2')

        dummy_element = tseq._lt2_dummy_element(self)
        LDE_element = tseq._lt2_LDE_element(self)
        finished_element = tseq._lt2_sequence_finished_element(self)

        self.lt2_seq.append(name = 'LDE_LT2',
            wfname = (LDE_element.name if DO_LDE_SEQUENCE else dummy_element.name),
            trigger_wait = True,
            goto_target = 'LDE_LT2',
            repetitions = self.params['LDE_attempts_before_CR'])

        if DO_DD:
            self.lt2_seq, total_elt_time, elts = tseq._lt2_dynamical_decoupling(self,
                self.lt2_seq,
                name = 'DD',
                time_offset = LDE_element.length(),
                use_delay_reps = not(DO_READOUT))
            self.lt2_seq.append(name = 'dummy_after_DD',
                wfname = dummy_element.name,
                goto_target = 'dummy_after_DD')
        else:
            self.lt2_seq.append(name = 'DD',
                wfname = dummy_element.name,
                goto_target = 'LT2_ready_for_RO',
                repetitions = 20)

        #A_[ms,mi]
        # rotation axes: Y:=0 phase, X:=90 

        ################################################### FF, DD and RO ##################################################################
        #TWO OPTIONS 'ALLES, of NIETS':
        #alles:
        #1. First program feaad forward pulse(s), independent of source_state_basis, but dependent on BSM RO result (and psi-/+)
        #2. Then program tomography (ro pulse), dependent on source_state_basis, but independent on BSM RO result (and psi-/+)
        #niets:
        #both FF and RO in one pulse, depending on source_state_basis, BSM RO result (and psi-/+)
        if DO_DD and DO_READOUT:
            RO_time_offset = LDE_element.length() + total_elt_time

            id_el      = tseq._lt2_final_id(self,  name = 'FF_Id',  time_offset = RO_time_offset)
            piY_el     = tseq._lt2_final_pi(self,  name = 'FF_Y',   time_offset = RO_time_offset, CORPSE_pi_phase = 0)
            
            pi2y_el    = tseq._lt2_final_pi2(self, name = 'FF_y',   time_offset = RO_time_offset, CORPSE_pi2_phase = 0)
            pi2miny_el = tseq._lt2_final_pi2(self, name = 'FF_-y',  time_offset = RO_time_offset, CORPSE_pi2_phase = 180)

            pi2x_el    = tseq._lt2_final_pi2(self, name = 'FF_x',   time_offset = RO_time_offset, CORPSE_pi2_phase =  90)
            pi2minx_el = tseq._lt2_final_pi2(self, name = 'FF_-x',  time_offset = RO_time_offset, CORPSE_pi2_phase = -90)
              

            if  (self.params['source_state_basis'] == 'Z' and self.params['ro_basis'] == 'Z') or \
                    (self.params['source_state_basis'] == '-Z' and self.params['ro_basis'] == '-Z'): 
                
                A00_psimin_RO_el  = id_el
                A01_psimin_RO_el  = piY_el
                A10_psimin_RO_el  = id_el
                A11_psimin_RO_el  = piY_el
                
                A00_psiplus_RO_el = id_el
                A01_psiplus_RO_el = piY_el
                A10_psiplus_RO_el = id_el
                A11_psiplus_RO_el = piY_el

            elif (self.params['source_state_basis'] == 'Z' and self.params['ro_basis'] == '-Z') or \
                    (self.params['source_state_basis'] == '-Z' and self.params['ro_basis'] == 'Z'): 
                
                A00_psimin_RO_el  = piY_el
                A01_psimin_RO_el  = id_el
                A10_psimin_RO_el  = piY_el
                A11_psimin_RO_el  = id_el
                
                A00_psiplus_RO_el = piY_el
                A01_psiplus_RO_el = id_el
                A10_psiplus_RO_el = piY_el
                A11_psiplus_RO_el = id_el

            elif (self.params['source_state_basis'] == 'X' and self.params['ro_basis'] == 'Z') or \
                    (self.params['source_state_basis'] == '-X' and self.params['ro_basis'] == '-Z'): 
                
                A00_psimin_RO_el  = pi2miny_el
                A01_psimin_RO_el  = pi2y_el
                A10_psimin_RO_el  = pi2y_el
                A11_psimin_RO_el  = pi2miny_el
                
                A00_psiplus_RO_el = pi2y_el
                A01_psiplus_RO_el = pi2miny_el
                A10_psiplus_RO_el = pi2miny_el
                A11_psiplus_RO_el = pi2y_el

            elif  (self.params['source_state_basis'] == 'X' and self.params['ro_basis'] == '-Z') or \
                    (self.params['source_state_basis'] == '-X' and self.params['ro_basis'] == 'Z'): 
                
                A00_psimin_RO_el  = pi2y_el
                A01_psimin_RO_el  = pi2miny_el
                A10_psimin_RO_el  = pi2miny_el
                A11_psimin_RO_el  = pi2y_el
                
                A00_psiplus_RO_el = pi2miny_el
                A01_psiplus_RO_el = pi2y_el
                A10_psiplus_RO_el = pi2y_el
                A11_psiplus_RO_el = pi2miny_el

            elif (self.params['source_state_basis'] == 'Y' and self.params['ro_basis'] == 'Z') or \
                    (self.params['source_state_basis'] == '-Y' and self.params['ro_basis'] == '-Z'): 
                
                A00_psimin_RO_el  = pi2x_el
                A01_psimin_RO_el  = pi2x_el
                A10_psimin_RO_el  = pi2minx_el
                A11_psimin_RO_el  = pi2minx_el
                
                A00_psiplus_RO_el = pi2minx_el
                A01_psiplus_RO_el = pi2minx_el
                A10_psiplus_RO_el = pi2x_el
                A11_psiplus_RO_el = pi2x_el

            elif (self.params['source_state_basis'] == 'Y' and self.params['ro_basis'] == '-Z') or \
                    (self.params['source_state_basis'] == '-Y' and self.params['ro_basis'] == 'Z'): 

                A00_psimin_RO_el  = pi2minx_el
                A01_psimin_RO_el  = pi2minx_el
                A10_psimin_RO_el  = pi2x_el
                A11_psimin_RO_el  = pi2x_el
                
                A00_psiplus_RO_el = pi2x_el
                A01_psiplus_RO_el = pi2x_el
                A10_psiplus_RO_el = pi2minx_el
                A11_psiplus_RO_el = pi2minx_el
            else:
                raise Exception('source_state_basis/ro_basis not recognized.')

            
            self.lt2_seq.append(name = 'A00_psi-', 
                wfname = A00_psimin_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A01_psi-', 
                wfname = A01_psimin_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A10_psi-', 
                wfname = A10_psimin_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A11_psi-', 
                wfname = A11_psimin_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A00_psi+', 
                wfname = A00_psiplus_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A01_psi+', 
                wfname = A01_psiplus_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A10_psi+', 
                wfname = A10_psiplus_RO_el.name,
                goto_target = 'LT2_ready_for_RO')
            self.lt2_seq.append(name = 'A11_psi+', 
                wfname = A11_psiplus_RO_el.name,
                goto_target = 'LT2_ready_for_RO')

        ################################################### END FF, DD and RO ##################################################################
        ### JUMPING
        # EV0: first BSM: ms0 = 0, ms-1 = 1 --> espin
        # EV1: second BSM: ms0 = 0, ms-1 = 1 --> Nspin
        # EV2: 1 = decoupling, 0 = FF
        # EV3: PLU: psi+ = 0,  psi- = 1
        # int('xxxx',2) --> EV (3210)

        self.lt2_seq.set_djump(True)
        if DO_DD:
            # note: A01 etc. gives out nitrogen value first, jump expects electron RO first. 
            self.lt2_seq.add_djump_address(int('1000',2),'A00_psi-') 
            self.lt2_seq.add_djump_address(int('1001',2),'A01_psi-')
            self.lt2_seq.add_djump_address(int('1010',2),'A10_psi-')
            self.lt2_seq.add_djump_address(int('1011',2),'A11_psi-')
            self.lt2_seq.add_djump_address(int('0000',2),'A00_psi+')
            self.lt2_seq.add_djump_address(int('0001',2),'A01_psi+')
            self.lt2_seq.add_djump_address(int('0010',2),'A10_psi+')
            self.lt2_seq.add_djump_address(int('0011',2),'A11_psi+')

            self.lt2_seq.add_djump_address(int('1100',2),'DD') 
            self.lt2_seq.add_djump_address(int('1101',2),'DD')
            self.lt2_seq.add_djump_address(int('1110',2),'DD') 
            self.lt2_seq.add_djump_address(int('1111',2),'DD') 
            self.lt2_seq.add_djump_address(int('0100',2),'DD') 
            self.lt2_seq.add_djump_address(int('0101',2),'DD') 
            self.lt2_seq.add_djump_address(int('0110',2),'DD') 
            self.lt2_seq.add_djump_address(int('0111',2),'DD')
        else:
            for i in range(16):
                self.lt2_seq.add_djump_address(i,'DD')

        self.lt2_seq.append(name = 'LT2_ready_for_RO',
            wfname = finished_element.name,
            goto_target = 'LDE_LT2')

        ### AND ADD READOUT PULSES
        elements = []
        elements.append(dummy_element)
        
        if DO_LDE_SEQUENCE:
            elements.append(LDE_element)

        if DO_DD:
            for e in elts: #the dynamical decoupling sequence elements
                if e not in elements:
                    elements.append(e)

            if DO_READOUT:
                elements.append(A00_psimin_RO_el)
                elements.append(A01_psimin_RO_el)
                elements.append(A10_psimin_RO_el)
                elements.append(A11_psimin_RO_el)
                elements.append(A00_psiplus_RO_el)
                elements.append(A01_psiplus_RO_el)
                elements.append(A10_psiplus_RO_el)
                elements.append(A11_psiplus_RO_el)
        elements.append(finished_element)

        qt.pulsar.upload(*elements)
        qt.pulsar.program_sequence(self.lt2_seq)
        self.awg_lt2.set_runmode('SEQ')
        self.awg_lt2.start()

        i=0
        awg_ready = False
        while not awg_ready and i<40:
            try:
                if self.awg_lt2.get_state() == 'Waiting for trigger':
                    awg_ready = True
            except:
                print 'waiting for awg: usually means awg is still busy and doesnt respond'
                print 'waiting', i, '/40'
                i=i+1
            qt.msleep(0.5)
        if not awg_ready: 
            raise Exception('AWG not ready')