Ejemplo n.º 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
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
def test_sequence(do_program=True):
    """
    an example sequence.
    """

    seq = Sequence('Noise')
    seq.add_channel('chan2', 'ch2', high=2.0, low=-2.0, cable_delay=0)

    seq.add_element('element1', trigger_wait=False, goto_target='element1')
    noise = False
    if noise:
        seq.add_pulse(name='hi' + '-1',
                      channel='chan2',
                      element='element1',
                      shape='gaussian_noise',
                      start=0,
                      amplitude=2.,
                      duration=10000)
    else:
        seq.add_pulse(name='hi' + '-1',
                      channel='chan2',
                      element='element1',
                      shape='sine',
                      start=0,
                      frequency=114e6 / 2,
                      amplitude=2.,
                      duration=10000)

    seq.set_instrument(ins_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
Ejemplo n.º 4
0
    def generate_sequence(self, do_program=True):
        seq = Sequence('QuTau')

        seq.add_channel(name='sync_chan', AWG_channel='ch2m2', high=1.0)
        seq.add_channel(name='green_chan', AWG_channel='ch4m2', high=0.50)
        seq.add_channel(name='dummy_chan', AWG_channel='ch4m1', high=1.0)

        ename = 'PAM'
        seq.add_element(ename, repetitions=self.noof_reps, goto_target=ename)

        if self.sync_rep_rate > 50 + self.green_duration:

            for pulse in range(self.noof_pulses_per_element):
                #add the first pulse, without a start reference of course
                if pulse == 0:

                    last = ''
                    for presync in range(10):
                        seq.add_pulse('Presync_%d' % presync,
                                      'sync_chan',
                                      ename,
                                      start=0,
                                      start_reference=last,
                                      link_start_to='end',
                                      duration=50,
                                      amplitude=1.)
                        seq.add_pulse('Presync_%d_wait' % presync,
                                      'sync_chan',
                                      ename,
                                      start=0,
                                      start_reference='Presync_%d' % presync,
                                      link_start_to='end',
                                      duration=self.sync_rep_rate - 50,
                                      amplitude=0.)

                        last = 'Presync_%d_wait' % (presync)

                    seq.add_pulse('Sync_0',
                                  'sync_chan',
                                  ename,
                                  start=0,
                                  start_reference='Presync_%d_wait' % presync,
                                  link_start_to='end',
                                  duration=50,
                                  amplitude=1)
                    seq.add_pulse('Green_0',
                                  'green_chan',
                                  ename,
                                  start=0,
                                  start_reference='Sync_0',
                                  link_start_to='end',
                                  duration=self.green_duration,
                                  amplitude=0.50)

                    seq.add_pulse('Count_ch0_0',
                                  'dummy_chan',
                                  ename,
                                  start=0,
                                  start_reference='Sync_0',
                                  link_start_to='end',
                                  duration=50,
                                  amplitude=0.50)
                #add the rest of the pulses
                else:
                    seq.add_pulse('Sync_%d' % pulse,
                                  'sync_chan',
                                  ename,
                                  start=self.sync_rep_rate - 50 -
                                  self.green_duration,
                                  start_reference='Green_%d' % (pulse - 1),
                                  link_start_to='end',
                                  duration=50,
                                  amplitude=1)

                    seq.add_pulse('Green_%d' % pulse,
                                  'green_chan',
                                  ename,
                                  start=0,
                                  start_reference='Sync_%d' % pulse,
                                  link_start_to='end',
                                  duration=self.green_duration,
                                  amplitude=0.50)

                    seq.add_pulse('Count_ch0_%d' % pulse,
                                  'dummy_chan',
                                  ename,
                                  start=0,
                                  start_reference='Sync_%d' % pulse,
                                  link_start_to='end',
                                  duration=50,
                                  amplitude=0.50)

        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
Ejemplo n.º 5
0
def generate_sequence(do_program=True):
    seq = Sequence('QuTau')

    seq.add_channel(name='sync_chan', AWG_channel='ch2m2', high=2.7)
    seq.add_channel(name='apd1_chan', AWG_channel='ch3m1', high=2.7)
    seq.add_channel(name='apd2_chan', AWG_channel='ch3m2', high=2.7)
    seq.add_channel(name='mrkr1_chan', AWG_channel='ch4m1', high=2.7)
    seq.add_channel(name='mrkr2_chan', AWG_channel='ch4m2', high=2.7)

    ename = 'Entanglement_Simulation'

    if forever:
        seq.add_element(ename, repetitions=1, goto_target=ename)
    else:
        seq.add_element(ename, repetitions=1)

    for k in range(int(noof_entanglement_tries)):

        if k == 0:
            last = ''
        else:
            last = last

        #presyncs
        for p in range(presyncs):
            if p == 0:
                seq.add_pulse('PreSync_%d_%d' % (p, k),
                              'sync_chan',
                              ename,
                              start=0,
                              start_reference=last,
                              link_start_to='end',
                              duration=50,
                              amplitude=2.7)
            elif p > 0:
                seq.add_pulse('PreSync_%d_%d' % (p, k),
                              'sync_chan',
                              ename,
                              start=sync_separation - 50,
                              start_reference=last,
                              link_start_to='end',
                              duration=50,
                              amplitude=2.7)

            last = 'PreSync_%d_%d' % (p, k)

        #marker
        seq.add_pulse('Marker1_%d' % k,
                      'mrkr1_chan',
                      ename,
                      start=marker_after_sync,
                      start_reference=last,
                      link_start_to='end',
                      duration=50,
                      amplitude=2.7)

        #real sync 1
        seq.add_pulse('RealSync1_%d' % k,
                      'sync_chan',
                      ename,
                      start=sync_separation - 50,
                      start_reference=last,
                      link_start_to='end',
                      duration=50,
                      amplitude=2.7)

        #possible click apd 1 or apd 2
        if apd1_pulse1[k]:
            seq.add_pulse('1st_APD1_%d' % k,
                          'apd1_chan',
                          ename,
                          start=click_after_sync,
                          start_reference='RealSync1_%d' % k,
                          link_start_to='end',
                          duration=50,
                          amplitude=2.7)
        if apd2_pulse1[k]:
            seq.add_pulse('1st_APD2_%d' % k,
                          'apd2_chan',
                          ename,
                          start=click_after_sync,
                          start_reference='RealSync1_%d' % k,
                          link_start_to='end',
                          duration=50,
                          amplitude=2.7)

        #real sync 2
        seq.add_pulse('RealSync2_%d' % k,
                      'sync_chan',
                      ename,
                      start=sync_separation - 50,
                      start_reference='RealSync1_%d' % k,
                      link_start_to='end',
                      duration=50,
                      amplitude=2.7)

        #possible click apd 1 or apd 2
        if apd1_pulse2[k]:
            seq.add_pulse('2nd_APD1_%d' % k,
                          'apd1_chan',
                          ename,
                          start=click_after_sync,
                          start_reference='RealSync2_%d' % k,
                          link_start_to='end',
                          duration=50,
                          amplitude=2.7)
        if apd2_pulse2[k]:
            seq.add_pulse('2nd_APD2_%d' % k,
                          'apd2_chan',
                          ename,
                          start=click_after_sync,
                          start_reference='RealSync2_%d' % k,
                          link_start_to='end',
                          duration=50,
                          amplitude=2.7)

        #if two clicks, then a marker on mrkr2_chan
        if (apd1_pulse1[k] or apd2_pulse1[k]) and (apd1_pulse2[k]
                                                   or apd2_pulse2[k]):
            print "Entanglemet event generated!"

            if apd1_pulse2[k] > 0:
                start_ref = '2nd_APD1_%d' % k
            else:
                start_ref = '2nd_APD2_%d' % k

            seq.add_pulse('Entanglement_from_PLU_%d' % k,
                          'mrkr2_chan',
                          ename,
                          start=plu_after_apd,
                          start_reference=start_ref,
                          link_start_to='end',
                          duration=50,
                          amplitude=2.7)

        last = 'RealSync2_%d' % k

        #postsyncs
        for p in range(postsyncs):
            seq.add_pulse('PostSync_%d_%d' % (p, k),
                          'sync_chan',
                          ename,
                          start=sync_separation - 50,
                          start_reference=last,
                          link_start_to='end',
                          duration=50,
                          amplitude=2.7)

            last = 'PostSync_%d_%d' % (p, k)

        #wait some time
        seq.add_pulse('Wait_%d' % k,
                      'sync_chan',
                      ename,
                      start=0,
                      start_reference=last,
                      link_start_to='end',
                      duration=7200,
                      amplitude=0)

        last = 'Wait_%d' % k

    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
Ejemplo n.º 6
0
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}
Ejemplo n.º 7
0
def mw_and_rf_sequence(do_program=True):
    """
    Use this sequence for checking on the fast sampling scope
    """

    mw_frq = 1e9 - 25e6
    mw_power = 0

    ins_mw.set_iq('on')
    ins_mw.set_pulm('on')
    ins_mw.set_frequency(mw_frq)
    ins_mw.set_power(mw_power)
    ins_mw.set_status('on')

    seq = Sequence('Test')
    seq.add_channel('MW_pulsemod', 'ch1m1', high=2.0, cable_delay=44)
    seq.add_channel('MW_Imod', 'ch3', high=0.9, low=-0.9, cable_delay=27)
    seq.add_channel('MW_Qmod', 'ch4', high=0.9, low=-0.9, cable_delay=27)

    seq.add_channel('RF', 'ch1', high=2, low=-2, cable_delay=0)

    seq.add_channel('trigger', 'ch2', high=.5, low=0, cable_delay=0)

    seq.add_element('test', goto_target='test')

    seq.add_pulse('trigger',
                  'trigger',
                  'test',
                  amplitude=.5,
                  duration=20,
                  start=0)
    seq.add_pulse('filler',
                  'trigger',
                  'test',
                  amplitude=0,
                  duration=1000,
                  start=0)

    seq.add_IQmod_pulse(name='mwpulse',
                        channel=('MW_Imod', 'MW_Qmod'),
                        element='test',
                        start=300,
                        duration=20,
                        frequency=25e6,
                        amplitude=0.9)

    seq.add_pulse('pmod',
                  'MW_pulsemod',
                  'test',
                  amplitude=2.0,
                  duration=26,
                  start=-3,
                  start_reference='mwpulse-I',
                  link_start_to='start')

    seq.add_pulse('rf',
                  'RF',
                  'test',
                  shape='sine',
                  frequency=1e6,
                  amplitude=1,
                  duration=50,
                  start=10,
                  start_reference='mwpulse-I',
                  link_start_to='end')

    seq.set_instrument(ins_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(True)
    seq.force_HW_sequencing(True)
    seq.send_sequence()

    return True
Ejemplo n.º 8
0
def mw_sequence(do_program=True, name='cable_delay'):
    """
    with this sequence the delay of the MW pulses with respect to the
    PH sync can be determined;
    here, we simply leave on green during the whole time;
    """
    GreenAOM.set_power(10e-6)
    ins_mw.set_iq('on')
    ins_mw.set_pulm('on')
    ins_mw.set_frequency(mw_frq)
    ins_mw.set_power(mw_power)
    ins_mw.set_status('on')

    seq = Sequence(name)

    # vars for the channel names
    chan_phstart = 'PH_start'  # historically PH_start
    chan_phsync = 'PH_MA1'  # historically PH_sync

    awgcfg.configure_sequence(seq, 'picoharp', 'mw')

    seq.add_element('sync', goto_target='sync')
    seq.add_pulse('PH_sync', 'PH_start', 'sync', duration=50)
    seq.add_pulse('PH_sync_wait',
                  'PH_start',
                  'sync',
                  start=0,
                  duration=20000,
                  start_reference='PH_sync',
                  link_start_to='start',
                  amplitude=0)

    seq.add_IQmod_pulse(name='mwburst',
                        channel=('MW_Imod', 'MW_Qmod'),
                        element='sync',
                        start=5000,
                        duration=10000,
                        start_reference='PH_sync',
                        link_start_to='start',
                        frequency=mw_frq_ssb,
                        amplitude=mw_amp_ssb)

    seq.clone_channel('MW_pulsemod',
                      'MW_Imod',
                      'sync',
                      start=-mw_pulse_mod_risetime,
                      duration=2 * mw_pulse_mod_risetime,
                      link_start_to='start',
                      link_duration_to='duration',
                      amplitude=2.0)

    seq.set_instrument(ins_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(True)
    seq.force_HW_sequencing(True)
    seq.send_sequence()

    return True
Ejemplo n.º 9
0
def aom_sequence(do_program=True):
    """
    Simple sequence for aom cable delay and apd gate cable delay.
    Test with PH software.
    """
    seq = Sequence('Test')
    seq.add_channel('AOM', 'ch2', high=1.0, cable_delay=690, low=0.0)
    seq.add_channel('PH_start', 'ch2m2', high=2.0, low=0.0, cable_delay=0)
    seq.add_channel('APD_gate', 'ch2m1', high=2.0, low=0.0, cable_delay=163)

    seq.add_element('test', goto_target='test')
    seq.add_pulse('trigger',
                  'PH_start',
                  'test',
                  duration=50,
                  amplitude=2,
                  start=0)

    seq.add_pulse('laser_low1',
                  'AOM',
                  'test',
                  start=0,
                  duration=5000,
                  amplitude=0.0)

    seq.add_pulse('laser',
                  'AOM',
                  'test',
                  start=1000,
                  duration=1000,
                  amplitude=1.0,
                  start_reference='laser_low1',
                  link_start_to='end')

    seq.add_pulse('laser_low2',
                  'AOM',
                  'test',
                  start=0,
                  duration=5000,
                  amplitude=0.0,
                  start_reference='laser',
                  link_start_to='end')

    seq.add_pulse('apd_off',
                  'APD_gate',
                  'test',
                  start=400,
                  duration=200,
                  amplitude=2.0,
                  start_reference='laser',
                  link_start_to='start')

    seq.set_instrument(ins_awg)
    seq.set_clock(1e9)
    seq.set_send_waveforms(True)
    seq.set_send_sequence(True)
    seq.set_program_channels(True)
    seq.set_start_sequence(True)
    seq.force_HW_sequencing(True)
    seq.send_sequence()

    return True
Ejemplo n.º 10
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}
Ejemplo n.º 11
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}
Ejemplo n.º 12
0
def test_sequence(do_program=True):
    """
    an example sequence.
    """

    amp_hi = 2
    amp_lo = 1
    scaling = 0.5
    len_hi = 5000
    len_lo = 10000

    seq = Sequence('Example')
    seq.add_channel('chan1', 'ch1', high=2.0, cable_delay=0)
    seq.add_channel('chan2', 'ch2', high=2.0, cable_delay=0)

    seq.add_element('element1')

    seq.add_pulse(name='hi1',
                  channel='chan1',
                  element='element1',
                  start=0,
                  amplitude=amp_hi,
                  duration=len_hi)

    seq.add_pulse(name='lo1',
                  channel='chan1',
                  element='element1',
                  start=0,
                  start_reference='hi1',
                  link_start_to='end',
                  amplitude=amp_lo,
                  duration=len_lo,
                  envelope='erf',
                  envelope_risetime=1000)

    seq.add_pulse(name='hi2',
                  channel='chan2',
                  element='element1',
                  start=0,
                  start_reference='hi1',
                  link_start_to='start',
                  amplitude=amp_hi * scaling,
                  duration=len_hi)

    seq.add_pulse(name='lo2',
                  channel='chan2',
                  element='element1',
                  start=0,
                  start_reference='hi2',
                  link_start_to='end',
                  amplitude=amp_lo * scaling,
                  duration=len_lo)

    seq.add_pulse(name='wait',
                  channel='chan1',
                  element='element1',
                  amplitude=0,
                  start=0,
                  start_reference='lo1',
                  link_start_to='end',
                  duration=5000)

    seq.add_element('element2', goto_target='element1', repetitions=20)

    seq.add_pulse(name='hi1',
                  channel='chan1',
                  element='element2',
                  start=0,
                  amplitude=amp_hi,
                  duration=len_hi)

    seq.set_instrument(ins_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
Ejemplo n.º 13
0
import numpy as np
Ejemplo n.º 14
0
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()
Ejemplo n.º 15
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()