Beispiel #1
0
def generate_sequence(do_program=True):
        seq = Sequence('Test')

        # vars for the channel names
        trigger_chan= 'trigger'
        
        
        awgcfg.configure_sequence(seq, 'awg_trigger_jitter')
        
        ename='trigger'
        seq.add_element(ename,goto_target='trigger')
        #start_reference='before',link_start_to='end',
        #seq.add_pulse('before',trigger_chan,ename,start=0,duration=1000,amplitude=0)
        seq.add_pulse('trigger',trigger_chan,ename,start=0,duration=500, amplitude=1)
        seq.add_pulse('wait',trigger_chan,ename,start=0,
                start_reference='trigger', link_start_to = 'end',duration=3000, amplitude=0)   
        seq.add_pulse('trigger2',trigger_chan,ename,start=0, 
                start_reference='wait',link_start_to = 'end',duration=500,
                amplitude=1)
        seq.add_pulse('wait2',trigger_chan,ename,start=0,
               start_reference='trigger2',link_start_to='end',duration=6000,
                amplitude=0)
        
         #sweep the pulse length
       
        seq.set_instrument(AWG)
        seq.set_clock(1e9)
        seq.set_send_waveforms(do_program)
        seq.set_send_sequence(do_program)
        seq.set_program_channels(True)
        seq.set_start_sequence(False)
        seq.force_HW_sequencing(True)
        seq.send_sequence()
        
        return True
def generate_sequence(do_program=True):
        seq = Sequence('Test')

        # vars for the channel names
        trigger_chan= 'trigger'
        trigger2_chan= 'trigger2'
        
        awgcfg.configure_sequence(seq, 'awg_trigger_jitter')
        
        ename='trigger'
        seq.add_element(ename,goto_target='trigger')
        seq.add_pulse('trigger',trigger_chan,ename,start=0,duration=500, amplitude=1)
        seq.add_pulse('wait',trigger_chan,ename,start=0,
                start_reference='trigger', link_start_to = 'end',duration=2500, amplitude=0)
        seq.add_pulse('trigger2',trigger2_chan,ename,start=0,duration=500, amplitude=1)
        seq.add_pulse('wait2',trigger2_chan,ename,start=0,
                start_reference='trigger2', link_start_to = 'end',duration=2500, amplitude=0)
         #sweep the pulse length
       
        seq.set_instrument(AWG)
        seq.set_clock(1e9)
        seq.set_send_waveforms(do_program)
        seq.set_send_sequence(do_program)
        seq.set_program_channels(True)
        seq.set_start_sequence(False)
        seq.force_HW_sequencing(True)
        seq.send_sequence()
        
        return True
def SP_seq(sweep_param, yellow_amp, do_program=True):
    '''
    This sequence consists of single pulse on the Newfocus AW|G channel
                }
    '''
    awg = qt.instruments['AWG']
    seq = Sequence('spinpumping')
   
    
    # vars for the channel names
    chan_hhsync = 'HH_sync'         # historically PH_start
    chan_hh_ma1 = 'HH_MA1'          # historically PH_sync
      
    chan_ylaser = 'AOM_Yellow'
    awgcfg.configure_sequence(seq,'hydraharp', 
            yellow = {chan_ylaser: { 'high' :  yellow_amp}})
    nr_of_datapoints = len(sweep_param)
    print sweep_param
    
    for i in np.arange(nr_of_datapoints):
        print i
       
        #create element for each datapoint and link last element to first   
        el_name = 'spinpumping'+str(i+1)
        if i == nr_of_datapoints-1:
            target= 'spinpumping'+str(1)
        else:
            target='none'
        
        seq.add_element(name = el_name, 
            trigger_wait = True, goto_target=target)

        seq.add_pulse('debug_sync',  chan_hhsync, el_name,         
                    start = 0, duration = 50, 
                    amplitude = 2.0)
        
        seq.add_pulse('initialdelay', chan_ylaser, el_name,
                start = 0, duration = 1000, amplitude=0, )
        
        seq.add_pulse('spinpumping', chan_ylaser, el_name, 
                start = 0, duration = sweep_param[i],
                start_reference='initialdelay',
                link_start_to='end', amplitude=1)
        seq.add_pulse('singletdelay', chan_ylaser, el_name,
                start = 0, duration = 2000, start_reference='spinpumping',
                link_start_to='end', amplitude=0, )

        
    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    max_seq_time = seq.send_sequence()

    name= 'spinpumping'
    return {"seqname":name, "max_seq_time":max_seq_time}
def generate_sequence(do_program=True):
    seq = Sequence('spin_control')
    awgcfg.configure_sequence(seq,'mw')
    # vars for the channel names
    
    
    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
        chan_mw_pm = 'MW_pulsemod_lt1' #is connected to ch3m2
    else:
        chan_mwI = 'MW_Imod' #ch1
        chan_mwQ = 'MW_Qmod' #ch3
        chan_mw_pm = 'MW_pulsemod' #is connected to ch1m1
    
    if lt1:
        MW_pulse_mod_risetime = 10
    else:
        MW_pulse_mod_risetime = 10

    for i in np.arange(nr_of_datapoints):
        if i == nr_of_datapoints-1:
            seq.add_element(name = 'spin_control_'+str(i+1), 
                trigger_wait = True, goto_target = 'spin_control_1')
        else:
            seq.add_element(name = 'spin_control_'+str(i+1), 
                trigger_wait = True)
        seq.add_pulse('wait', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start = 0, duration = 100, amplitude = 0)

        if length[i] != 0:
            seq.add_pulse('mwburst', channel = chan_mwI, element = 'spin_control_'+str(i+1),
                    start = 0, duration = length[i], amplitude = amplitude_ssbmod, start_reference = 'wait',
                    link_start_to = 'end', shape='sine',frequency=f_mod)

            seq.add_pulse('pulse_mod', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
                start_reference = 'mwburst', link_start_to = 'start', 
                duration_reference = 'mwburst', link_duration_to = 'duration', 
                amplitude = 2.0) # NOTE should be 2.0
 

    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    seq.send_sequence()
def SP_seq(sweep_param, SP_duration=40000, do_program=True):
    '''
    This sequence consists of single pulse on the Newfocus AW|G channel
                }
    '''
    awg = qt.instruments['AWG']
    seq = Sequence('spinpumping')

    # vars for the channel names
    chan_hhsync = 'HH_sync'  # historically PH_start
    chan_hh_ma1 = 'HH_MA1'  # historically PH_sync

    chan_alaser = 'AOM_Newfocus'
    awgcfg.configure_sequence(
        seq, 'hydraharp', optical_rabi={chan_alaser: {
            'high': sweep_param[0]
        }})
    nr_of_datapoints = len(sweep_param)
    measure_singlet = False
    print sweep_param

    for i in np.arange(nr_of_datapoints):
        print i

        #create element for each datapoint and link last element to first
        el_name = 'spinpumping' + str(i + 1)
        if i == nr_of_datapoints - 1:
            target = 'spinpumping' + str(1)
        else:
            target = 'none'

        seq.add_element(name=el_name, trigger_wait=True, goto_target=target)

        seq.add_pulse('debug_sync',
                      chan_hhsync,
                      el_name,
                      start=0,
                      duration=50,
                      amplitude=2.0)

        seq.add_pulse(
            'initialdelay',
            chan_alaser,
            el_name,
            start=0,
            duration=500,
            amplitude=0,
        )

        seq.add_pulse('spinpumping',
                      chan_alaser,
                      el_name,
                      start=0,
                      duration=SP_duration,
                      start_reference='initialdelay',
                      link_start_to='end',
                      amplitude=sweep_param[i])
        seq.add_pulse(
            'singletdelay',
            chan_alaser,
            el_name,
            start=0,
            duration=1000,
            start_reference='spinpumping',
            link_start_to='end',
            amplitude=0,
        )
        if measure_singlet:

            seq.add_pulse('singletpumping',
                          chan_alaser,
                          el_name,
                          start=0,
                          duration=10000,
                          start_reference='singletdelay',
                          link_start_to='end',
                          amplitude=sweep_param[i])
            seq.add_pulse(
                'finaldelay',
                chan_alaser,
                el_name,
                start=0,
                duration=500,
                start_reference='singletpumping',
                link_start_to='end',
                amplitude=0,
            )

    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    max_seq_time = seq.send_sequence()

    name = 'spinpumping'
    return {"seqname": name, "max_seq_time": max_seq_time}
def XY8_cycles(sweep_param,pulse_dict,lt1 = False,do_program=True):
    '''
    This sequence consists of a number of decoupling-pulses per element
    
    sweep_param = numpy array with number of Pi-pulses per element
    pulse_dict={
                "Pi":{"duration": ...,
                      "amplitude": ...},

                "istate_pulse": {"duration":... , 
                                 "amplitude":...}, First pulse to create init state
                
                
                "duty_cycle_time": ...,            waiting time at the end of each element
                }
    '''
    seq = Sequence('XY8')
   
    
    # vars for the channel names
  
    superposition_pulse=False
    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
        chan_mw_pm = 'MW_pulsemod_lt1' #is connected to ch3m2
    else:
        chan_mwI = 'MW_Imod' #ch1
        chan_mwQ = 'MW_Qmod' #ch3
        chan_mw_pm = 'MW_pulsemod' #is connected to ch1m
#FIXME: take this from a dictionary
    if lt1:
        MW_pulse_mod_risetime = 10
    else:
        MW_pulse_mod_risetime = 10

    nr_of_datapoints = len(sweep_param)
    nr_of_XY8_cycles =  pulse_dict["nr_of_XY8_cycles"]
    pulse_nr = 8*nr_of_XY8_cycles

    pi = pulse_dict["Pi"]
    tau_sweep = sweep_param
    duty_cycle_time = pulse_dict["duty_cycle_time"]
    istate_pulse = pulse_dict["init_state_pulse"]
    awgcfg.configure_sequence(seq,mw={chan_mwQ:{'high': pi["amplitude"]}})
    for i in np.arange(nr_of_datapoints):

        #create element for each datapoint and link last element to first
        if i == nr_of_datapoints-1:
            seq.add_element(name = 'spin_control_'+str(i+1), 
                trigger_wait = True, goto_target = 'spin_control_1')
        else:
            seq.add_element(name = 'spin_control_'+str(i+1), 
                trigger_wait = True)

   
        tau=tau_sweep[i]

        seq.add_pulse('first_wait', channel = chan_mw_pm, 
                element = 'spin_control_'+str(i+1),start = 0, 
                duration = 50, amplitude = 0)

        seq.add_pulse('init_state_pulse' , channel = chan_mwI, element = 'spin_control_'+str(i+1),
            start_reference = 'first_wait', link_start_to = 'end', start = 0, 
            duration = istate_pulse["duration"], amplitude = istate_pulse["amplitude"], shape = 'rectangular')

        seq.add_pulse('init_state_pulse_mod', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'init_state_pulse', link_start_to = 'start', 
            duration_reference = 'init_state_pulse', link_duration_to = 'duration', 
            amplitude = 2.0)
        
        last = 'init_state_pulse'

        for j in np.arange(pulse_nr):
            if pulse_nr ==2:
                pulse_array = [1,2]
            else:
                pulse_array=[1,3,6,8]
            if np.mod(j,8)+1 in pulse_array:
                chan = chan_mwI
            else:
                chan = chan_mwQ

            if tau != 0:
                seq.add_pulse('wait_before' + str(j), channel = chan_mw_pm, element = 'spin_control_'+str(i+1), 
                    start_reference = last, link_start_to='end',start = 0, 
                    duration = tau, amplitude = 0)
            else:
                seq.add_pulse('wait_before' + str(j), channel = chan_mw_pm, element = 'spin_control_'+str(i+1), 
                    start_reference = last, link_start_to='end',start = 0, 
                    duration = 20, amplitude = 0)
           
            seq.add_pulse('pi' + str(j), channel = chan, element = 'spin_control_'+str(i+1),
                start = 0, start_reference = 'wait_before'+str(j), link_start_to = 'end', 
                duration = pi["duration"], amplitude = pi["amplitude"], shape = 'rectangular')

            seq.add_pulse('pulse_mod' + str(j), channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
                start_reference = 'pi' + str(j), link_start_to = 'start', 
                duration_reference = 'pi'+str(j), link_duration_to = 'duration', 
                amplitude = 2.0)

            if tau !=0:
                seq.add_pulse('wait_after' + str(j), channel = chan_mw_pm, element = 'spin_control_'+str(i+1), 
                    start_reference = 'pi'+str(j), link_start_to='end',start = 0, 
                    duration = tau, amplitude = 0)
            else:
                seq.add_pulse('wait_after' + str(j), channel = chan_mw_pm, element = 'spin_control_'+str(i+1), 
                    start_reference = 'pi'+str(j), link_start_to='end',start = 0, 
                    duration = 20., amplitude = 0)
            
            last = 'wait_after'+str(j)
        
        seq.add_pulse('readout_pulse' , channel = chan_mwI, element = 'spin_control_'+str(i+1),
            start_reference = last, link_start_to = 'end', start = 0, 
            duration = istate_pulse["duration"], amplitude = istate_pulse["amplitude"], shape = 'rectangular')

        seq.add_pulse('readout_pulse_mod', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'readout_pulse', link_start_to = 'start', 
            duration_reference = 'init_state_pulse', link_duration_to = 'duration', 
            amplitude = 2.0)

        seq.add_pulse('final_wait', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start_reference = 'readout_pulse',link_start_to ='end', 
                duration = duty_cycle_time, amplitude = 0)

    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    max_seq_time = seq.send_sequence()


    name= '%d XY8_cycles' % nr_of_XY8_cycles
    return {"seqname":name, "max_seq_time":max_seq_time}
Beispiel #7
0
def XY8_cycles_multiple_elements(sweep_param,
                                 pulse_dict,
                                 lt1=False,
                                 do_program=True):
    '''
    This sequence consists of a number of decoupling-pulses per sweepparam
    every pulse is in a single element, tau is repeated to decrease number of points
    
    sweep_param = numpy array with number of Pi-pulses per element
    pulse_dict={
                "Pi":{"duration": ...,
                      "amplitude": ...},

                "istate_pulse": {"duration":... , 
                                 "amplitude":...}, First pulse to create init state
                
                
                "duty_cycle_time": ...,            waiting time at the end of each element
                "tau_el_length":...
                }
    '''
    seq = Sequence('XY8')
    awgcfg.configure_sequence(seq, 'mw')

    # vars for the channel names
    chan_mw_pm = 'MW_pulsemod'  #is connected to ch1m1

    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
    else:
        chan_mwI = 'MW_Imod'
        chan_mwQ = 'MW_Qmod'

#FIXME: take this from a dictionary
    if lt1:
        MW_pulse_mod_risetime = 10
    else:
        MW_pulse_mod_risetime = 10

    nr_of_datapoints = len(sweep_param)
    nr_of_XY8_cycles = pulse_dict["nr_of_XY8_cycles"]
    pulse_nr = 8 * nr_of_XY8_cycles

    pi = pulse_dict["Pi"]
    tau_sweep = sweep_param
    duty_cycle_time = pulse_dict["duty_cycle_time"]
    istate_pulse = pulse_dict["init_state_pulse"]

    tau_len = pulse_dict["tau_el_length"]  # ns

    for i in np.arange(nr_of_datapoints):

        #create element for each datapoint and link last element to first
        el_name = 'Pi_over2_' + str(i + 1)
        seq.add_element(name=el_name, trigger_wait=True)
        seq.add_pulse(name='first_wait',
                      channel=chan_mw_pm,
                      element=el_name,
                      start=0,
                      duration=960,
                      amplitude=0)
        seq.add_pulse(name='Pi/2_pulse',
                      channel=chan_mwI,
                      element=el_name,
                      start_reference='first_wait',
                      link_start_to='end',
                      start=0,
                      duration=istate_pulse["duration"],
                      amplitude=istate_pulse["amplitude"],
                      shape='rectangular')

        seq.add_pulse(name='Pi/2_pulse_mod',
                      channel=chan_mw_pm,
                      element=el_name,
                      start=-MW_pulse_mod_risetime,
                      duration=2 * MW_pulse_mod_risetime,
                      start_reference='Pi/2_pulse',
                      link_start_to='start',
                      duration_reference='Pi/2_pulse',
                      link_duration_to='duration',
                      amplitude=2.0)

        pulse_idx = 0
        tau_idx = 0
        for j in np.arange(pulse_nr):
            if np.mod(j, 8) + 1 in [1, 3, 6, 8]:
                chan = chan_mwI
                pulse_el_name = 'X' + str(pulse_idx) + '_' + str(i + 1)
            else:
                chan = chan_mwQ
                pulse_el_name = 'Y' + str(pulse_idx) + '_' + str(i + 1)

            ## tau1
            cur_el_name = 'tau' + str(tau_idx) + '_' + str(i + 1)
            seq.add_element(name=cur_el_name,
                            trigger_wait=False,
                            repetitions=tau_sweep[i])
            seq.add_pulse(name='tau' + str(tau_idx),
                          channel=chan_mw_pm,
                          element=cur_el_name,
                          start=0,
                          duration=tau_len - int(1000. / tau_sweep[i] / 2.))
            tau_idx += 1

            ## pi pulse
            seq.add_element(name=pulse_el_name,
                            trigger_wait=False,
                            repetitions=1)

            seq.add_pulse(name='extra_wait' + str(j),
                          channel=chan_mw_pm,
                          element=pulse_el_name,
                          start=0,
                          duration=500. - int(pi["duration"] / 2),
                          amplitude=0)
            seq.add_pulse('pi' + str(j),
                          channel=chan,
                          element=pulse_el_name,
                          start=0,
                          duration=pi["duration"],
                          amplitude=pi["amplitude"],
                          shape='rectangular',
                          start_reference='extra_wait' + str(j),
                          link_start_to='end')
            seq.add_pulse('pulse_mod' + str(j),
                          channel=chan_mw_pm,
                          element=pulse_el_name,
                          start=-MW_pulse_mod_risetime,
                          duration=2 * MW_pulse_mod_risetime,
                          start_reference='pi' + str(j),
                          link_start_to='start',
                          duration_reference='pi' + str(j),
                          link_duration_to='duration',
                          amplitude=2.0)
            seq.add_pulse(name='extra_wait_2' + str(j),
                          channel=chan_mw_pm,
                          element=pulse_el_name,
                          start=0,
                          duration=500. - int(pi["duration"] / 2),
                          amplitude=0,
                          start_reference='pi' + str(j),
                          link_start_to='end')
            pulse_idx += 1

            ## tau2
            cur_el_name = 'tau' + str(tau_idx) + '_' + str(i + 1)
            seq.add_element(name=cur_el_name,
                            trigger_wait=False,
                            repetitions=tau_sweep[i])
            seq.add_pulse(name='tau' + str(tau_idx),
                          channel=chan_mw_pm,
                          element=cur_el_name,
                          start=0,
                          duration=tau_len - int(1000. / tau_sweep[i] / 2.))
            tau_idx += 1

        ##Final readout pulse
        cur_el_name = 'readout' + str(i + 1)
        if i == nr_of_datapoints - 1:
            print 'going to nr 1'
            target = 'Pi_over2_' + str(1)
        else:
            target = 'none'
        seq.add_element(name=cur_el_name,
                        trigger_wait=False,
                        goto_target=target)
        seq.add_pulse('readout_pulse',
                      channel=chan_mwI,
                      element=cur_el_name,
                      start=0,
                      duration=istate_pulse["duration"],
                      amplitude=istate_pulse["amplitude"],
                      shape='rectangular')
        seq.add_pulse('Pi/2_pulse_mod',
                      channel=chan_mw_pm,
                      element=cur_el_name,
                      start=-MW_pulse_mod_risetime,
                      duration=2 * MW_pulse_mod_risetime,
                      start_reference='readout_pulse',
                      link_start_to='start',
                      duration_reference='readout_pulse',
                      link_duration_to='duration',
                      amplitude=2.0)

        seq.add_pulse('final_wait',
                      channel=chan_mw_pm,
                      element=cur_el_name,
                      start_reference='readout_pulse',
                      link_start_to='end',
                      duration=duty_cycle_time,
                      amplitude=0)
    print 'start to set AWG specs'
    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    a = seq.send_sequence()
    print 'done sending AWG sequence'

    tau_max = tau_len * (tau_sweep.max())
    max_seq_time = pulse_nr * (
        pi["duration"] +
        2 * tau_max) + duty_cycle_time + 50 + 2 * istate_pulse["duration"]
    print 'max seq time %d' % max_seq_time
    name = '%d XY8_cycles' % nr_of_XY8_cycles
    return {"seqname": name, "max_seq_time": max_seq_time}
Beispiel #8
0
def XY8_cycles(sweep_param, pulse_dict, lt1=False, do_program=True):
    '''
    This sequence consists of a number of decoupling-pulses per element
    
    sweep_param = numpy array with number of Pi-pulses per element
    pulse_dict={
                "Pi":{"duration": ...,
                      "amplitude": ...},

                "istate_pulse": {"duration":... , 
                                 "amplitude":...}, First pulse to create init state
                
                
                "duty_cycle_time": ...,            waiting time at the end of each element
                }
    '''
    seq = Sequence('XY8')
    awgcfg.configure_sequence(seq, 'mw')

    # vars for the channel names
    chan_mw_pm = 'MW_pulsemod'  #is connected to ch1m1
    superposition_pulse = False

    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
    else:
        chan_mwI = 'MW_Imod'
        chan_mwQ = 'MW_Qmod'


#FIXME: take this from a dictionary
    if lt1:
        MW_pulse_mod_risetime = 10
    else:
        MW_pulse_mod_risetime = 10

    nr_of_datapoints = len(sweep_param)
    nr_of_XY8_cycles = pulse_dict["nr_of_XY8_cycles"]
    pulse_nr = 8 * nr_of_XY8_cycles

    pi = pulse_dict["Pi"]
    tau_sweep = sweep_param
    duty_cycle_time = pulse_dict["duty_cycle_time"]
    istate_pulse = pulse_dict["init_state_pulse"]

    for i in np.arange(nr_of_datapoints):

        #create element for each datapoint and link last element to first
        if i == nr_of_datapoints - 1:
            seq.add_element(name='spin_control_' + str(i + 1),
                            trigger_wait=True,
                            goto_target='spin_control_1')
        else:
            seq.add_element(name='spin_control_' + str(i + 1),
                            trigger_wait=True)

        tau = tau_sweep[i]

        seq.add_pulse('first_wait',
                      channel=chan_mw_pm,
                      element='spin_control_' + str(i + 1),
                      start=0,
                      duration=50,
                      amplitude=0)

        seq.add_pulse('init_state_pulse',
                      channel=chan_mwI,
                      element='spin_control_' + str(i + 1),
                      start_reference='first_wait',
                      link_start_to='end',
                      start=0,
                      duration=istate_pulse["duration"],
                      amplitude=istate_pulse["amplitude"],
                      shape='rectangular')

        seq.add_pulse('init_state_pulse_mod',
                      channel=chan_mw_pm,
                      element='spin_control_' + str(i + 1),
                      start=-MW_pulse_mod_risetime,
                      duration=2 * MW_pulse_mod_risetime,
                      start_reference='init_state_pulse',
                      link_start_to='start',
                      duration_reference='init_state_pulse',
                      link_duration_to='duration',
                      amplitude=2.0)

        last = 'init_state_pulse'

        for j in np.arange(pulse_nr):
            if np.mod(j, 8) + 1 in [1, 3, 6, 8]:
                chan = chan_mwI
            else:
                chan = chan_mwQ

            seq.add_pulse('wait_before' + str(j),
                          channel=chan_mw_pm,
                          element='spin_control_' + str(i + 1),
                          start_reference=last,
                          link_start_to='end',
                          start=0,
                          duration=tau,
                          amplitude=0)

            seq.add_pulse('pi' + str(j),
                          channel=chan,
                          element='spin_control_' + str(i + 1),
                          start=0,
                          start_reference='wait_before' + str(j),
                          link_start_to='end',
                          duration=pi["duration"],
                          amplitude=pi["amplitude"],
                          shape='rectangular')

            seq.add_pulse('pulse_mod' + str(j),
                          channel=chan_mw_pm,
                          element='spin_control_' + str(i + 1),
                          start=-MW_pulse_mod_risetime,
                          duration=2 * MW_pulse_mod_risetime,
                          start_reference='pi' + str(j),
                          link_start_to='start',
                          duration_reference='pi' + str(j),
                          link_duration_to='duration',
                          amplitude=2.0)

            seq.add_pulse('wait_after' + str(j),
                          channel=chan_mw_pm,
                          element='spin_control_' + str(i + 1),
                          start_reference='pi' + str(j),
                          link_start_to='end',
                          start=0,
                          duration=tau,
                          amplitude=0)

            last = 'wait_after' + str(j)

        seq.add_pulse('readout_pulse',
                      channel=chan_mwI,
                      element='spin_control_' + str(i + 1),
                      start_reference=last,
                      link_start_to='end',
                      start=0,
                      duration=istate_pulse["duration"],
                      amplitude=-istate_pulse["amplitude"],
                      shape='rectangular')

        seq.add_pulse('init_state_pulse_mod',
                      channel=chan_mw_pm,
                      element='spin_control_' + str(i + 1),
                      start=-MW_pulse_mod_risetime,
                      duration=2 * MW_pulse_mod_risetime,
                      start_reference='readout_pulse',
                      link_start_to='start',
                      duration_reference='init_state_pulse',
                      link_duration_to='duration',
                      amplitude=2.0)

        seq.add_pulse('final_wait',
                      channel=chan_mw_pm,
                      element='spin_control_' + str(i + 1),
                      start_reference='readout_pulse',
                      link_start_to='end',
                      duration=duty_cycle_time,
                      amplitude=0)

    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    max_seq_time = seq.send_sequence()

    name = '%d XY8_cycles' % nr_of_XY8_cycles
    return {"seqname": name, "max_seq_time": max_seq_time}
Beispiel #9
0
def XY8_cycles_multiple_elements(sweep_param,pulse_dict,lt1 = False,do_program=True):
    '''
    This sequence consists of a number of decoupling-pulses per sweepparam
    every pulse is in a single element, tau is repeated to decrease number of points
    
    sweep_param = numpy array with number of Pi-pulses per element
    pulse_dict={
                "Pi":{"duration": ...,
                      "amplitude": ...},

                "istate_pulse": {"duration":... , 
                                 "amplitude":...}, First pulse to create init state
                
                
                "duty_cycle_time": ...,            waiting time at the end of each element
                "tau_el_length":...
                }
    '''
    seq = Sequence('XY8')
    awgcfg.configure_sequence(seq,'mw')
    
    # vars for the channel names
    chan_mw_pm = 'MW_pulsemod' #is connected to ch1m1
    
    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
    else:
        chan_mwI = 'MW_Imod'
        chan_mwQ = 'MW_Qmod'
    
#FIXME: take this from a dictionary
    if lt1:
        MW_pulse_mod_risetime = 10
    else:
        MW_pulse_mod_risetime = 10

    nr_of_datapoints = len(sweep_param)
    nr_of_XY8_cycles =  pulse_dict["nr_of_XY8_cycles"]
    pulse_nr = 8*nr_of_XY8_cycles

    pi = pulse_dict["Pi"]
    tau_sweep = sweep_param
    duty_cycle_time = pulse_dict["duty_cycle_time"]
    istate_pulse = pulse_dict["init_state_pulse"]

    tau_len=pulse_dict["tau_el_length"]          # ns

    for i in np.arange(nr_of_datapoints):
       
        #create element for each datapoint and link last element to first   
        el_name = 'Pi_over2_'+str(i+1)
        seq.add_element(name = el_name, 
            trigger_wait = True)
        seq.add_pulse(name='first_wait', channel = chan_mw_pm, 
                element = el_name,start = 0, 
                duration = 960, amplitude = 0)
        seq.add_pulse(name='Pi/2_pulse' , channel = chan_mwI, element = el_name,
            start_reference = 'first_wait', link_start_to = 'end', start = 0, 
            duration = istate_pulse["duration"], amplitude = istate_pulse["amplitude"], shape = 'rectangular')

        seq.add_pulse(name='Pi/2_pulse_mod', channel = chan_mw_pm, element = el_name,
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'Pi/2_pulse', link_start_to = 'start', 
            duration_reference = 'Pi/2_pulse', link_duration_to = 'duration', 
            amplitude = 2.0)

        pulse_idx = 0
        tau_idx=0
        for j in np.arange(pulse_nr):
            if np.mod(j,8)+1 in [1,3,6,8]:
                chan = chan_mwI
                pulse_el_name = 'X'+str(pulse_idx)+'_'+str(i+1)
            else:
                chan = chan_mwQ
                pulse_el_name = 'Y'+str(pulse_idx)+'_'+str(i+1)
            
            ## tau1
            cur_el_name='tau'+str(tau_idx)+'_'+str(i+1)
            seq.add_element(name=cur_el_name,trigger_wait = False,repetitions=tau_sweep[i])
            seq.add_pulse(name='tau'+str(tau_idx),channel=chan_mw_pm,element=cur_el_name,
                        start=0,duration=tau_len-int(1000./tau_sweep[i]/2.))
            tau_idx+=1

            ## pi pulse
            seq.add_element(name=pulse_el_name,trigger_wait = False,repetitions=1)
            
            seq.add_pulse(name='extra_wait'+str(j), channel = chan_mw_pm, 
                element = pulse_el_name,start = 0, 
                duration = 500.-int(pi["duration"]/2), amplitude = 0)
            seq.add_pulse('pi' + str(j), channel = chan, element = pulse_el_name,
                start = 0, duration = pi["duration"], amplitude = pi["amplitude"], shape = 'rectangular',
                start_reference='extra_wait'+str(j),link_start_to='end')
            seq.add_pulse('pulse_mod' + str(j), channel = chan_mw_pm, element = pulse_el_name,
                start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
                start_reference = 'pi' + str(j), link_start_to = 'start', 
                duration_reference = 'pi'+str(j), link_duration_to = 'duration', 
                amplitude = 2.0)
            seq.add_pulse(name='extra_wait_2'+str(j), channel = chan_mw_pm, 
                element = pulse_el_name,start = 0, 
                duration = 500.-int(pi["duration"]/2), amplitude = 0,start_reference='pi'+str(j),link_start_to='end')
            pulse_idx+=1
            
            ## tau2
            cur_el_name='tau'+str(tau_idx)+'_'+str(i+1)
            seq.add_element(name=cur_el_name,trigger_wait = False,repetitions=tau_sweep[i])
            seq.add_pulse(name='tau'+str(tau_idx),channel=chan_mw_pm,element=cur_el_name,
                        start=0,duration=tau_len-int(1000./tau_sweep[i]/2.))
            tau_idx+=1
                    
        ##Final readout pulse
        cur_el_name = 'readout'+str(i+1)
        if i == nr_of_datapoints-1:
            print 'going to nr 1'
            target= 'Pi_over2_'+str(1)
        else:
            target='none'
        seq.add_element(name = cur_el_name ,trigger_wait = False,goto_target=target)
        seq.add_pulse('readout_pulse' , channel = chan_mwI, element = cur_el_name,
            start = 0, duration = istate_pulse["duration"], amplitude = istate_pulse["amplitude"], shape = 'rectangular')
        seq.add_pulse('Pi/2_pulse_mod', channel = chan_mw_pm, element = cur_el_name,
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'readout_pulse', link_start_to = 'start', 
            duration_reference = 'readout_pulse', link_duration_to = 'duration', 
            amplitude = 2.0)

        seq.add_pulse('final_wait', channel = chan_mw_pm, element = cur_el_name,
                start_reference = 'readout_pulse',link_start_to ='end', 
                duration = duty_cycle_time, amplitude = 0)
    print 'start to set AWG specs'
    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    a = seq.send_sequence()
    print 'done sending AWG sequence'
     
    tau_max = tau_len*(tau_sweep.max())
    max_seq_time = pulse_nr*(pi["duration"]+2*tau_max)+duty_cycle_time+50+2*istate_pulse["duration"]
    print 'max seq time %d' % max_seq_time
    name= '%d XY8_cycles' % nr_of_XY8_cycles
    return {"seqname":name, "max_seq_time":max_seq_time}
def generate_sequence_SE(do_program=True): 

    #######################################
    ###### SPIN ECHO SEQUENCE #############
    #######################################
    seq = Sequence('spin_control')
    awgcfg.configure_sequence(seq,'mw')
    # vars for the channel names
    if lt1:
        chan_mw_pm = 'MW_pulsemod_lt1' #is connected to ch3m2
    else:
        chan_mw_pm = 'MW_pulsemod' #is connected to ch1m1
    
    par['sequence_wait_time'] = int(ceil(((max_wait_time+pi_2_pulse_length)*2 + pi_2_pulse_length+100)/1e3)+1)
    print 'sequence Wait time:', par['sequence_wait_time']

    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
    else:
        chan_mwI = 'MW_Imod'
        chan_mwQ = 'MW_Qmod'
    
    if lt1:
        MW_pulse_mod_risetime = 2
    else:
        MW_pulse_mod_risetime = 6

    for i in np.arange(nr_of_datapoints):
        if i == nr_of_datapoints-1:
            seq.add_element(name = 'spin_control_'+str(i+1), 
                trigger_wait = True, goto_target = 'spin_control_1')
        else:
            seq.add_element(name = 'spin_control_'+str(i+1), 
                trigger_wait = True)

        seq.add_pulse('wait', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start = 0, duration = 50, amplitude = 0)

        seq.add_pulse('first_pi_over_2', channel = chan_mwI, element = 'spin_control_'+str(i+1),
                start = 0, duration = pi_2_pulse_length, amplitude = pi_2_pulse_amp, start_reference = 'wait',
                link_start_to = 'end', shape = 'rectangular')
            

        seq.add_pulse('pulse_mod', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'first_pi_over_2', link_start_to = 'start', 
            duration_reference = 'first_pi_over_2', link_duration_to = 'duration', 
            amplitude = 2.0)

        seq.add_pulse('tau', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start_reference = 'first_pi_over_2',link_start_to ='end', duration = tau[i], amplitude = 0)

        seq.add_pulse('pi', channel = chan_mwI, element = 'spin_control_'+str(i+1),
                start = 0, duration = pi_pulse_length, amplitude = pi_pulse_amp, start_reference = 'tau',
                link_start_to = 'end', shape = 'rectangular')
            

        seq.add_pulse('pulse_mod_2', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'pi', link_start_to = 'start', 
            duration_reference = 'pi', link_duration_to = 'duration', 
            amplitude = 2.0)

        seq.add_pulse('tau_2', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start_reference = 'pi',link_start_to ='end', duration = tau[i], amplitude = 0)


        seq.add_pulse('second_pi_over_2', channel = chan_mwI, element = 'spin_control_'+str(i+1),
                start = 0, duration = pi_2_pulse_length, amplitude = pi_2_pulse_amp, start_reference = 'tau_2',
                link_start_to = 'end', shape = 'rectangular')
            

        seq.add_pulse('pulse_mod2', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'second_pi_over_2', link_start_to = 'start', 
            duration_reference = 'second_pi_over_2', link_duration_to = 'duration', 
            amplitude = 2.0)

        seq.add_pulse('final_wait', channel = chan_mw_pm, element = 'spin_control_'+str(i+1),
                start_reference = 'second_pi_over_2',link_start_to ='end', duration = 50, amplitude = 0)
    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    seq.send_sequence()
Beispiel #11
0
def generate_sequence(fstart = f_start-f_mw, fstop = f_stop-f_mw, steps = nr_of_datapoints, do_program = True):
    seq = Sequence('dark_esr')

    print 'start frequency = ',(fstart+f_mw)/1E9
    print 'stop frequency = ',(fstop+f_mw)/1E9

    awgcfg.configure_sequence(seq,'mw')
    
    # vars for the channel names
    

    if lt1:
        chan_mwI = 'MW_Imod_lt1'
        chan_mwQ = 'MW_Qmod_lt1'
        chan_mw_pm = 'MW_pulsemod_lt1' #is connected to ch3m2
    else:
        chan_mwI = 'MW_Imod'
        chan_mwQ = 'MW_Qmod'
        chan_mw_pm = 'MW_pulsemod' #is connected to ch1m1

    # in this version we keep the center frequency and sweep the
    # modulation frequency

    # f_central = (fstart+fstop)/2.0
    
    pipulse = pi_pulse_length

    mode = 'SSB'
    amplitude_i = 0.
    amplitude_q = 0. 

    

    if lt1:
        MW_pulse_mod_risetime = 2
    else:
        MW_pulse_mod_risetime = 6

    # sweep the modulation freq
    for i, f_mod in enumerate(linspace(fstart, fstop, steps)):
    
        ###################################################################
        # the actual rabi sequence and readout
        
        ename = 'desrseq%d' % i
        kw = {} if i < steps-1 else {'goto_target': 'desrseq0'}
        seq.add_element(ename, trigger_wait = True, **kw)

        seq.add_pulse('wait', channel = chan_mw_pm, element = ename,
                start = 0, duration = 100, amplitude = 0)
        
        seq.add_pulse(name = 'mwburst', channel = chan_mwI, 
            element = ename, start = 0, duration = pipulse,
            frequency = f_mod, shape = 'cosine', 
            amplitude = amplitude_ssbmod, link_start_to = 'end',
            start_reference = 'wait')
        seq.add_pulse(name = 'mwburstQ', channel = chan_mwQ, 
            element = ename, start = 0, duration = pipulse,
            frequency = f_mod, shape = 'sine', 
            amplitude = amplitude_ssbmod, link_start_to = 'end',
            start_reference = 'wait')
                             
        seq.add_pulse('pulse_mod', channel = chan_mw_pm, element = ename,
            start=-MW_pulse_mod_risetime, duration=2*MW_pulse_mod_risetime, 
            start_reference = 'mwburst', link_start_to = 'start', 
            duration_reference = 'mwburst', link_duration_to = 'duration', 
            amplitude = 2.0)

        ###################################################################

    

    seq.set_instrument(awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(do_program)
    seq.set_send_sequence(do_program)
    seq.set_program_channels(True)
    seq.set_start_sequence(False)
    seq.force_HW_sequencing(True)
    seq.send_sequence()
Beispiel #12
0
from measurement.lib.config import awgchannels_lt2 as awgcfg
from measurement.lib.AWG_HW_sequencer_v2 import Sequence

seq = Sequence('argh')
reload(awgcfg)

#os.chdir('D:/measuring/qtlab/')
#reload(awgcfg)
#os.chdir('D:/measuring/user/scripts/lt2_scripts/')

awgcfg.configure_sequence(seq,'mw')

#seq.add_channel('PH_start', 'ch4m2', cable_delay=0)
#seq.add_channel('Green', 'ch2m1', cable_delay=604, high=0.5)
#seq.add_channel('MW_pulsemod', 'ch2m2', high=2.0, cable_delay = 0)
#seq.add_channel('MW_Imod', 'ch1', high=0.9, low=-0.9)
#seq.add_channel('MW_Qmod', 'ch4', high=0.9, low=-0.9, cable_delay = 0)
#seq.add_channel('trigger','ch3m2', high=1.0)
#seq.add_channel('pm','ch1m1', high=2.0, cable_delay=27)

trigger = 'adwin_sync'
chan_mw_pm = 'MW_pulsemod'
chan_mwI = 'MW_Qmod'
chan_mwQ = 'MW_Imod'

MW_pulse_mod_risetime = 10#10#6 = correct for LT2, 2 =  correct for LT1
MW_Imod_duration = 40 

elt = 'test'
seq.add_element(elt, goto_target = elt)
#seq.add_pulse('PH', 'PH_start', elt, start=0, duration=50)