def _lt3_LDE_element(msmt, **kw):  ### WE NEED THIS GUY
    """
    This element contains the LDE part for LT3, i.e., spin pumping and MW pulses
    for the LT3 NV and the optical pi pulses as well as all the markers for HH and PLU.
    """

    # variable parameters
    name = kw.pop('name', 'LDE_LT3')
    pi2_pulse_phase = kw.pop('pi2_pulse_phase', 0)
    if kw.pop('use_short_eom_pulse',False):
        eom_pulse=pulse.cp(msmt.short_eom_aom_pulse,
            aom_on=msmt.params_lt3['eom_aom_on'])
    else:
        eom_pulse=pulse.cp(msmt.eom_aom_pulse,
            eom_pulse_amplitude = kw.pop('eom_pulse_amplitude', msmt.params_lt3['eom_pulse_amplitude']),
            eom_off_amplitude = kw.pop('eom_off_amplitude', msmt.params_lt3['eom_off_amplitude']),
            aom_on=msmt.params_lt3['eom_aom_on'])

    ###
    e = element.Element(name, 
        pulsar = qt.pulsar, 
        global_time = True)
    e.add(pulse.cp(msmt.empty_pulse,
            amplitude = 0,
            length = msmt.params['LDE_element_length']))

    #1 SP
    e.add(pulse.cp(msmt.empty_pulse, 
            amplitude = 0, 
            length = msmt.params_lt3['initial_delay']), 
        name = 'initial delay')
    
    
    for i in range(msmt.params['opt_pi_pulses']):
        name = 'opt pi {}'.format(i+1)
        refpulse = 'opt pi {}'.format(i) if i > 0 else 'initial delay'
        start = msmt.params_lt3['opt_pulse_separation'] if i > 0 else msmt.params['wait_after_sp']
        refpoint = 'start' if i > 0 else 'end'

        e.add(eom_pulse,        
            name = name, 
            start = start,
            refpulse = refpulse,
            refpoint = refpoint,)
        e.add(msmt.eom_trigger,
            name = name+'_trigger', 
            start = start,
            refpulse = refpulse,
            refpoint = refpoint,)

    #5 HHsync
    syncpulse_name = e.add(msmt.TH_sync, refpulse = 'initial delay', refpoint = 'start', refpoint_new = 'end')

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

    if e.length() != msmt.params['LDE_element_length']:
        raise Exception('LDE element length'+e.name+' is not as specified - granylarity issue?')
    return e

    return e
    def get_sweep_elements(self):        
        elts = []

        for i in range(self.params['pts']):
            e = element.Element('CNOTPHaseCheck_pt-{}'.format(i), pulsar=qt.pulsar, global_time = True)
            e.append(self.T)
            e.append(self.shelving_pulse)
            e.append(self.T)
            e.append(self.N_pi2)
            e.append(pulse.cp(self.T, length=200e-9))
            for m in np.arange(self.params['multiplicity']/2):
                if m == 0:
                    e.append(self.pi2pi_m1)
                    e.append(self.TIQ)
                    e.append(self.pi2pi_m1)
                else:
                    e.append(self.TIQ)
                    e.append(self.pi2pi_m1)
                    e.append(self.TIQ)
                    e.append(self.pi2pi_m1)
            e.append(pulse.cp(self.T, length=200e-9))
            e.append(pulse.cp(self.N_pi2, 
                phase = self.params['analysis_phases'][i]))

            elts.append(e)

        return elts
示例#3
0
    def generate_sequence(self, upload=True, debug=False):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 1000e-9, amplitude = 0)

        X = pulselib.MW_IQmod_pulse('MW pulse',
            I_channel = 'MW_Imod',
            Q_channel = 'MW_Qmod',
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'] )

        # X = pulselib.HermitePulse_Envelope_IQ('MW pulse',
        #     I_channel = 'MW_Imod',
        #     Q_channel = 'MW_Qmod',
        #     PM_channel = 'MW_pulsemod',
        #     PM_risetime = self.params['MW_pulse_mod_risetime'] )

        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = self.params['AWG_to_adwin_ttl_trigger_duration'],
            amplitude = 2)

        # electron manipulation elements
        elts = []
        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-%d' % i, pulsar=qt.pulsar,
                global_time = True)
            e.append(T)

            for j in range(self.params['MW_pulse_multiplicities'][i]):
                e.append(
                    pulse.cp(X,
                        frequency = self.params['MW_pulse_mod_frqs'][i],
                        amplitude = self.params['MW_pulse_amps'][i],
                        length = self.params['MW_pulse_durations'][i]))
                e.append(
                    pulse.cp(T, length=self.params['MW_pulse_delays'][i]))

            e.append(adwin_sync)
            elts.append(e)

        # sequence
        seq = pulsar.Sequence('MBI Electron Rabi sequence')
        for i,e in enumerate(elts):
            seq.append(name = 'MBI-%d' % i, wfname = mbi_elt.name,
                trigger_wait = True, goto_target = 'MBI-%d' % i,
                jump_target = e.name)
            seq.append(name = e.name, wfname = e.name,
                trigger_wait = True)
            # seq.append(name = 'RO-%d' % i, wfname = mbi_elt.name,
            #     trigger_wait = True, goto_target = 'MBI-%d' % i,
            #     jump_target = e.name)
        print 'MBI at', self.params['AWG_MBI_MW_pulse_ssbmod_frq']
        print 'MW rotations at', self.params['MW_pulse_mod_frqs'][i]
        # program AWG
        if upload:
            #qt.pulsar.upload(mbi_elt, *elts)
            qt.pulsar.program_awg(seq, mbi_elt, *elts , debug=debug)
示例#4
0
    def get_sweep_elements(self):
        wait_elt = element.Element('pulse_delay', pulsar=qt.pulsar)
        wait_elt.append(pulse.cp(self.T, length=1e-6))

        pulse_elts = []
        sweep_elts = []

        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-{}'.format(i), pulsar=qt.pulsar)
            e.append(self.T)
            e.append(
                pulse.cp(self.e_pulse,
                         frequency=self.params['MW_pulse_mod_frqs'][i],
                         amplitude=self.params['MW_pulse_amps'][i],
                         length=self.params['MW_pulse_durations'][i]))
            pulse_elts.append(e)

        for i in range(self.params['pts']):
            if self.params['MW_pulse_multiplicities'][i] == 0:
                sweep_elts.append(pulse_elts[i])

            else:
                subelts = []
                for j in range(self.params['MW_pulse_multiplicities'][i]):
                    subelts.append(pulse_elts[i])
                    subelts.append(wait_elt)
                sweep_elts.append(subelts)

        return sweep_elts
示例#5
0
    def get_sweep_elements(self):
        """
        to lock phases it's important to set the tomo_time_offset parameter.
        """

        z_element = element.Element('Z Tomo pulse', pulsar=qt.pulsar)
        z_element.append(pulse.cp(self.TN, length=1e-6))

        x_element = element.Element('X Tomo pulse', pulsar=qt.pulsar)
        xn = x_element.append(pulse.cp(self.N_pi2, 
            phase = phaseref(self.N_pi2.frequency, 
                self.params['tomo_time_offset']) + \
                self.params['tomo_pulse_phases'][1]))

        y_element = element.Element('Y Tomo pulse', pulsar=qt.pulsar)
        yn = y_element.append(pulse.cp(self.N_pi2, 
            phase = phaseref(self.N_pi2.frequency, 
                self.params['tomo_time_offset']) + \
                self.params['tomo_pulse_phases'][2]))

        sweep_elements = []
        for n, tomo_elt in zip(self.params['tomo_bases'],
            [z_element, x_element, y_element]):

            if type(self.element) == list:
                elts = [e for e in self.element]
                elts.append(tomo_elt)
                sweep_elements.append(elts)
            else:
                elts = [self.element, tomo_elt]
                sweep_elements.append(elts)

        return sweep_elements
示例#6
0
    def get_sweep_elements(self):
        wait_elt = element.Element('pulse_delay', pulsar=qt.pulsar)
        wait_elt.append(pulse.cp(self.T, length=1e-6))

        pulse_elts = []
        sweep_elts = []
        
        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-{}'.format(i), pulsar=qt.pulsar)
            e.append(self.T)
            e.append(
                pulse.cp(self.e_pulse,
                    frequency = self.params_lt1['MW_pulse_mod_frqs'][i],
                    amplitude = self.params_lt1['MW_pulse_amps'][i],
                    length = self.params_lt1['MW_pulse_durations'][i]))
            pulse_elts.append(e)

        for i in range(self.params['pts']):
            if self.params_lt1['MW_pulse_multiplicities'][i] == 0:
                sweep_elts.append(pulse_elts[i])

            else:
                subelts = []
                for j in range(self.params_lt1['MW_pulse_multiplicities'][i]):
                    subelts.append(pulse_elts[i])
                    subelts.append(wait_elt)
                sweep_elts.append(subelts)

        return sweep_elts
示例#7
0
    def get_sweep_elements(self):
        """
        to lock phases it's important to set the tomo_time_offset parameter.
        """

        z_element = element.Element('Z Tomo pulse', pulsar=qt.pulsar)
        z_element.append(pulse.cp(self.TN, length=1e-6))

        x_element = element.Element('X Tomo pulse', pulsar=qt.pulsar)
        xn = x_element.append(pulse.cp(self.N_pi2,
            phase = phaseref(self.N_pi2.frequency,
                self.params['tomo_time_offset']) + \
                self.params['tomo_pulse_phases'][1]))

        y_element = element.Element('Y Tomo pulse', pulsar=qt.pulsar)
        yn = y_element.append(pulse.cp(self.N_pi2,
            phase = phaseref(self.N_pi2.frequency,
                self.params['tomo_time_offset']) + \
                self.params['tomo_pulse_phases'][2]))

        sweep_elements = []
        for n, tomo_elt in zip(self.params['tomo_bases'],
                               [z_element, x_element, y_element]):

            if type(self.element) == list:
                elts = [e for e in self.element]
                elts.append(tomo_elt)
                sweep_elements.append(elts)
            else:
                elts = [self.element, tomo_elt]
                sweep_elements.append(elts)

        return sweep_elements
示例#8
0
    def sequence(self, upload = True):
        # define the pulses we'll use
        sq_pulseAOM = pulse.SquarePulse(channel='AOM975', name='A square pulse on ThorLabsAOM')
        sq_pulseMW = pulse.SquarePulse(channel='MW_pulsemod', name='A square pulse on MW modulation')
        sq_pulsePC = pulse.SquarePulse(channel='photoncount', name='A square pulse on photon counting switch')
        sq_pulseMW_Imod = pulse.SquarePulse(channel='MW_Imod', name='A square pulse on MW I modulation')
        sq_pulseMW_Qmod = pulse.SquarePulse(channel='MW_Qmod', name='A square pulse on MW I modulation')

        elements = []
        # Create waveform that has laser, microwaves, photon counting, and 1/0 I/Q modulation on
        # all the time for a long period of time (~100 us).
        e = element.Element('CW_mode', pulsar=qt.pulsar)
        e.add(pulse.cp(sq_pulseAOM, amplitude=1, length=100e-6), name='laser')
        e.add(pulse.cp(sq_pulsePC, amplitude=1.0, length=100e-6), name='photoncountpulse')
        e.add(pulse.cp(sq_pulseMW_Imod, amplitude=1.0, length=100e-6),
        name='MWimodpulsecw', start=0e-9)
        e.add(pulse.cp(sq_pulseMW_Qmod, amplitude=0.0, length=100e-6),
        name='MWqmodpulsecw', start=0e-9)
        elements.append(e)

        # create a sequence from the pulses -- only one in this case
        seq = pulsar.Sequence('CW ESR Sequence')
        for e in elements:
            seq.append(name=e.name, wfname=e.name, trigger_wait=False, repetitions=-1)

        if upload:
            qt.pulsar.upload(*elements)
            time.sleep(2.0)
        # program the AWG
        qt.pulsar.program_sequence(seq)
示例#9
0
    def get_sweep_elements(self):
        e = element.Element('Hadamard', pulsar=qt.pulsar, 
            global_time = True)
        e.append(self.T)
        e.append(self.shelving_pulse)
        e.append(pulse.cp(self.T, length=100e-9))
        
        # this is by using two rotations around x/y -- This works much better!
        # phase of 0 makes x (rotate around +Y), -90 makes y (rotate around -X)
        prep_name = e.append(pulse.cp(self.N_pi2,
            phase = -90.,
            amplitude = 1))

        # first a pi/2 over +Y
        h_pi2_name = e.append(pulse.cp(self.N_pi2,
            phase = 0,
            amplitude = 1))
        
        # then a pi over +X
        h_pi_name = e.append(pulse.cp(self.N_pi,
            phase = 90.,
            amplitude = 1))

        self.element = e
        self.params['tomo_time_offset'] = e.length()

        return BSM.NTomo.get_sweep_elements(self)
示例#10
0
    def get_sweep_elements(self):
        e = element.Element('Hadamard', pulsar=qt.pulsar, 
            global_time = True)
        e.append(self.T)
        e.append(self.shelving_pulse)
        e.append(pulse.cp(self.T, length=100e-9))
        
        # this is by using two rotations around x/y -- This works much better!
        # phase of 0 makes x (rotate around +Y), -90 makes y (rotate around -X)
        prep_name = e.append(pulse.cp(self.N_pi2,
            phase = -90.,
            amplitude = 1))

        # first a pi/2 over +Y
        h_pi2_name = e.append(pulse.cp(self.N_pi2,
            phase = 0,
            amplitude = 1))
        
        # then a pi over +X
        h_pi_name = e.append(pulse.cp(self.N_pi,
            phase = 90.,
            amplitude = 1))

        self.element = e
        self.params['tomo_time_offset'] = e.length()

        return BSM.NTomo.get_sweep_elements(self)
示例#11
0
def program_test_master():
    #p=pulse.SinePulse(channel='EOM_Matisse', name='pp', length=100e-6, frequency=1/(100e-6), amplitude = 1.8)
    T = pulse.SquarePulse('scope_sync', length=200e-9, amplitude = 0)
    p_sync = pulse.SquarePulse('scope_sync', length=50e-9, amplitude = 1)
    p_pulse = pulse.SquarePulse('scope_pulse', length=200e-9, amplitude = 1)
    p_trig = pulse.SquarePulse('awg_lt1_trigger', length=50e-9, amplitude = 1)

    e=element.Element('Sinde', pulsar=qt.pulsar)
    e.append(T)
    e.append(p_trig)
    e.append(pulse.cp(T, length = 500e-9))
    e.append(p_sync)
    e.append(T)
    e.append(p_pulse)
    e.append(pulse.cp(T, length = 100
        \
        0e-9))

    e.print_overview()
    
    s= pulsar.Sequence('TEST_AWG_SYNC_LT3')
    s.append(name = 't1',
                    wfname = e.name,
                    trigger_wait = 0)
    qt.pulsar.upload(e)
    qt.pulsar.program_sequence(s)

    qt.instruments['AWG'].start()
示例#12
0
    def get_sweep_elements(self):
        elts = []

        for i in range(self.params['pts']):
            e = element.Element('CNOTPHaseCheck_pt-{}'.format(i),
                                pulsar=qt.pulsar,
                                global_time=True)
            e.append(self.T)
            e.append(self.shelving_pulse)
            e.append(self.T)
            e.append(self.N_pi2)
            e.append(pulse.cp(self.T, length=200e-9))
            for m in np.arange(self.params['multiplicity'] / 2):
                if m == 0:
                    e.append(self.pi2pi_m1)
                    e.append(self.TIQ)
                    e.append(self.pi2pi_m1)
                else:
                    e.append(self.TIQ)
                    e.append(self.pi2pi_m1)
                    e.append(self.TIQ)
                    e.append(self.pi2pi_m1)
            e.append(pulse.cp(self.T, length=200e-9))
            e.append(
                pulse.cp(self.N_pi2, phase=self.params['analysis_phases'][i]))

            elts.append(e)

        return elts
示例#13
0
    def generate_sequence(self, upload=True):
        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod',
                              length=100e-9,
                              amplitude=0)
        TIQ = pulse.SquarePulse(channel='MW_Imod', length=10e-9, amplitude=0)

        CORPSE_pi = pulselib.IQ_CORPSE_pulse(
            'CORPSE pi-pulse',
            I_channel='MW_Imod',
            Q_channel='MW_Qmod',
            PM_channel='MW_pulsemod',
            PM_risetime=self.params['MW_pulse_mod_risetime'],
            frequency=self.params['CORPSE_mod_frq'],
            rabi_frequency=self.params['CORPSE_rabi_frequency'],
            amplitude=self.params['CORPSE_amp'],
            eff_rotation_angle=180)

        CORPSE_pi2 = pulselib.IQ_CORPSE_pulse(
            'CORPSE pi-pulse',
            I_channel='MW_Imod',
            Q_channel='MW_Qmod',
            PM_channel='MW_pulsemod',
            PM_risetime=self.params['MW_pulse_mod_risetime'],
            frequency=self.params['CORPSE_mod_frq'],
            rabi_frequency=self.params['CORPSE_rabi_frequency'],
            amplitude=self.params['CORPSE_amp'],
            eff_rotation_angle=90)

        wait_1us = element.Element('1us_delay', pulsar=qt.pulsar)
        wait_1us.append(pulse.cp(T, length=1e-6))

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
                                       length=10e-6,
                                       amplitude=2)
        sync_elt.append(adwin_sync)

        elts = []
        seq = pulsar.Sequence('CORPSE test')

        for i in range(self.params['pts']):
            e = element.Element('CORPSE_Pi2_Pi-{}'.format(i),
                                pulsar=qt.pulsar,
                                global_time=True)
            e.append(T)
            e.append(pulse.cp(CORPSE_pi2))
            e.append(pulse.cp(TIQ, length=self.params['delays'][i]))
            e.append(pulse.cp(CORPSE_pi))
            e.append(T)
            elts.append(e)
            seq.append(name='CORPSE_Pi2_Pi-{}'.format(i),
                       wfname=e.name,
                       trigger_wait=True)
            seq.append(name='sync-{}'.format(i), wfname=sync_elt.name)

        if upload:
            qt.pulsar.upload(sync_elt, wait_1us, *elts)
        qt.pulsar.program_sequence(seq)
示例#14
0
    def generate_sequence(self, upload=True):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod', length=10e-9, amplitude=0)

        CORPSE_pi = pulselib.IQ_CORPSE_pi_pulse(
            'CORPSE pi-pulse',
            I_channel='MW_Imod',
            Q_channel='MW_Qmod',
            PM_channel='MW_pulsemod',
            PM_risetime=self.params['MW_pulse_mod_risetime'],
            frequency=self.params['CORPSE_pi_mod_frq'],
            amplitude=self.params['CORPSE_pi_amp'],
            length_60=self.params['CORPSE_pi_60_duration'],
            length_m300=self.params['CORPSE_pi_m300_duration'],
            length_420=self.params['CORPSE_pi_420_duration'])

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
                                       length=10e-6,
                                       amplitude=2)
        sync_elt.append(adwin_sync)

        wait_1us = element.Element('1us_delay', pulsar=qt.pulsar)
        wait_1us.append(pulse.cp(T, length=1e-6))

        elts = []
        for i in range(self.params['pts']):
            e = element.Element('CORPSE-{}'.format(i), pulsar=qt.pulsar)
            e.append(
                T,
                pulse.cp(CORPSE_pi,
                         amplitude=self.params['CORPSE_pi_sweep_amps'][i]))
            elts.append(e)

        # sequence
        seq = pulsar.Sequence('CORPSE pi calibration')
        for i, e in enumerate(elts):
            seq.append(name='MBI-%d' % i,
                       wfname=mbi_elt.name,
                       trigger_wait=True,
                       goto_target='MBI-%d' % i,
                       jump_target=e.name + '-0')

            for j in range(self.params['multiplicity']):
                seq.append(name=e.name + '-{}'.format(j),
                           wfname=e.name,
                           trigger_wait=(j == 0))
                seq.append(name='wait-{}-{}'.format(i, j),
                           wfname=wait_1us.name,
                           repetitions=self.params['delay_reps'])
            seq.append(name='sync-{}'.format(i), wfname=sync_elt.name)

        # program AWG
        if upload:
            qt.pulsar.upload(mbi_elt, sync_elt, wait_1us, *elts)
        qt.pulsar.program_sequence(seq)
示例#15
0
    def calibrate_CORPSE_pi_phase_shift_or_e_time(self):
        """
        Do a Hahn echo sequence with the CORPSE pi pulse, and sweep it's zero
        phase with respect the rotating frame at that time.
        """
        sweep_elements = []
        self.flattened_elements = []
        self.seq = pulsar.Sequence('{}_{}-Sequence'.format(
            self.mprefix, self.name))

        first_pi2_elt = element.Element('first pi2',
                                        pulsar=qt.pulsar,
                                        global_time=True)
        first_pi2_elt.append(pulse.cp(self.T, length=1e-6))
        first_pi2_name = first_pi2_elt.append(self.fast_pi2)
        first_pi2_elt.append(pulse.cp(self.TIQ, length=100e-9))

        self.flattened_elements.append(first_pi2_elt)

        # the start time of the second pi2, and the evolution time depends on the time when the
        # pulse stops in the first pi2 element:
        t_pi2 = first_pi2_elt.length() - \
            first_pi2_elt.effective_pulse_end_time(first_pi2_name, 'MW_Imod')

        # calculate the evolution time from the interpulse delay
        etimes = self.params_lt1[
            'interpulse_delays'] - t_pi2 - self.fast_pi2.effective_length() / 2.

        pi_elts = []
        second_pi2_elts = []
        for i in range(self.params['pts']):
            e = self.UNROT_element('pi-{}'.format(i),
                None, etimes[i], first_pi2_elt.length(),
                CORPSE_pi_phase_shift = \
                    self.params_lt1['CORPSE_pi_phase_shifts'][i])

            self.flattened_elements.append(e)
            pi_elts.append(e)

            # make the element
            second_pi2_elt = element.Element('second pi2-{}'.format(i),
                                             pulsar=qt.pulsar,
                                             global_time=True,
                                             time_offset=e.length() +
                                             first_pi2_elt.length())
            second_pi2_elt.append(pulse.cp(self.TIQ, length=t_pi2))
            second_pi2_elt.append(self.fast_pi2)

            self.flattened_elements.append(second_pi2_elt)
            second_pi2_elts.append(second_pi2_elt)

        self.flattened_elements.append(self.N_RO_CNOT_elt)

        for i in range(self.params['pts']):
            sweep_elements.append(
                [first_pi2_elt, pi_elts[i], second_pi2_elts[i]])

        self.seq = self._add_MBI_and_sweep_elements_to_sequence(
            sweep_elements, self.N_RO_CNOT_elt, self.adwin_lt1_trigger_element)
示例#16
0
def _lt2_final_id(msmt, name, time_offset, **kw):
    wait_length = msmt.params_lt2['CORPSE_pi2_wait_length'] + msmt.CORPSE_pi.length 
    final_id_elt = element.Element('second_id_elt-{}'.format(name), pulsar= qt.pulsar, 
                global_time = True, time_offset = time_offset)
    final_id_elt.append(pulse.cp(msmt.T, length =  wait_length)) 
    final_id_elt.append(pulse.cp(msmt.T, length =  100e-9 )) 

    return final_id_elt
    def generate_sequence(self, upload=True):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 10e-9, amplitude = 0)

        X = pulselib.MW_IQmod_pulse('MW pulse',
            I_channel = 'MW_Imod', 
            Q_channel = 'MW_Qmod',
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'])

        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = self.params['AWG_to_adwin_ttl_trigger_duration'], 
            amplitude = 2)

        # electron manipulation elements
        elts = []
        for i in range(self.params['pts']):
            e = element.Element('ERamsey_pt-%d' % i, pulsar=qt.pulsar,
                global_time = True)
            e.append(T)
        
            e.append(
                pulse.cp(X,
                    frequency = self.params['MW_pulse_mod_frqs'][i],
                    amplitude = self.params['MW_pulse_amps'][i],
                    length = self.params['MW_pulse_durations'][i],
                    phase = self.params['MW_pulse_1_phases'][i]))

            e.append(
                pulse.cp(T, length=self.params['MW_pulse_delays'][i]))

            e.append(
                pulse.cp(X, 
                    frequency = self.params['MW_pulse_mod_frqs'][i],
                    amplitude = self.params['MW_pulse_amps'][i],
                    length = self.params['MW_pulse_durations'][i],
                    phase = self.params['MW_pulse_2_phases'][i]))

            e.append(adwin_sync)
            elts.append(e)

        # sequence
        seq = pulsar.Sequence('MBI Electron Rabi sequence')
        for i,e in enumerate(elts):
            seq.append(name = 'MBI-%d' % i, wfname = mbi_elt.name, 
                trigger_wait = True, goto_target = 'MBI-%d' % i, 
                jump_target = e.name)
            seq.append(name = e.name, wfname = e.name, 
                trigger_wait = True)

        # program AWG
        if upload:
            qt.pulsar.upload(mbi_elt, *elts)
        qt.pulsar.program_sequence(seq)
示例#18
0
    def generate_sequence(self, upload=True, **kw):

        # define the necessary pulses
        
        X=kw.get('pulse_pi2', None)

        T = pulse.SquarePulse(channel='MW_Imod', name='delay',
            length = 200e-9, amplitude = 0.)

        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = self.params['AWG_to_adwin_ttl_trigger_duration'],
            amplitude = 2)

        self_trigger = pulse.SquarePulse(channel='self_trigger',
            length = self.params['self_trigger_duration'],
            amplitude = 2)

        # make the elements - one for each ssb frequency
        elements = []
        for i in range(self.params['pts']):

            e1 = element.Element('ElectronRamsey_pt-%d_A' % i, pulsar=qt.pulsar,
                global_time = True)
            e1.append(pulse.cp(T,
                length = 1000e-9))

            e1.append(pulse.cp(X,
                phase = self.params['pulse_sweep_pi2_phases1'][i]))

            e1.append(pulse.cp(T,
                length = self.params['evolution_times'][i] - self.params['self_trigger_delay']))

            e1.append(pulse.cp(self_trigger))
            elements.append(e1)

            e2 = element.Element('ElectronRamsey_pt-%d_B' % i, pulsar=qt.pulsar,
                global_time = True)

            e2.append(pulse.cp(X,
                phase = self.params['pulse_sweep_pi2_phases2'][i]))

            e2.append(T)
            e2.append(adwin_sync)

            elements.append(e2)
        # return_e=e
        # create a sequence from the pulses
        seq = pulsar.Sequence('ElectronRamsey self-triggered sequence with {} pulses'.format(self.params['pulse_shape']))
        for e in elements:
            seq.append(name=e.name, wfname=e.name, trigger_wait=True)

        # upload the waveforms to the AWG
        if upload:
            if upload=='old_method':
                qt.pulsar.upload(*elements)
                qt.pulsar.program_sequence(seq)
            else:
                qt.pulsar.program_awg(seq,*elements)
示例#19
0
 def generate_sequence(self, upload=True):
     # load all the other pulsar resources
     self._pulse_defs()
     
     self.FT_pulse = pulse.SquarePulse(channel='Velocity1AOM',
         length = self.params['sp_duration'], amplitude = self.params['FT_pulse_amp'])
     
     self.yel_pulse = pulse.SquarePulse(channel='YellowAOM',
         length = self.params['sp_duration']*3/4., amplitude = self.params['yellow_pulse_amp'])
     
     # make the list of elements required for uploading
     e = element.Element('N_FT_Polarisation', pulsar=qt.pulsar, global_time = True)
     
     e.append(pulse.cp(self.T, length=200e-9))
     last = e.append(self.yel_pulse)
     e.add(self.FT_pulse, refpulse=last, refpoint='start')
     e.append(pulse.cp(self.T, length=200e-9))
     e.append(pulse.cp(self.CORPSE_pi)) # ,
         # frequency = self.params['CORPSE_pi_mod_frq'],
         # amplitude = 0.))        
     
     # create the sequence
     seq = pulsar.Sequence('N_FT_Polarisation_Check_ESR_sequence')
     
     ro_elts = []
     for i,f in enumerate(self.params['RO_mod_frqs']):
         
         # 1: MBI 
         seq.append(name = 'MBI-{}'.format(i),
             wfname = self.mbi_elt.name,
             trigger_wait = True,
             goto_target = 'MBI-{}'.format(i),
             jump_target = 'ft_mw'+str(i))  
                 
         #2  then repeat (SP+MW pi)-element for the current number of times
         seq.append(name = 'ft_mw'+str(i), wfname=e.name,
                 repetitions = self.params['FT_element_repetitions'],
                 trigger_wait = True)
         
         #3 ESR type readout
         ro_e = element.Element('N_RO-{}'.format(i), pulsar=qt.pulsar, global_time = True)
         ro_e.append(self.T)
         ro_e.append(pulse.cp(self.slow_pi, 
             frequency = f))
         
         seq.append(name='N_ro'+str(i), wfname=ro_e.name,
             trigger_wait=False)
         ro_elts.append(ro_e)
             
         seq.append(name = 'sync-{}'.format(i), 
                 wfname = self.sync_elt.name) 
             
     # program AWG
     if upload:
         qt.pulsar.upload(self.mbi_elt, e ,self.sync_elt, *ro_elts)
     
     qt.pulsar.program_sequence(seq)        
示例#20
0
 def generate_sequence(self, upload=True):
     # load all the other pulsar resources
     self._pulse_defs()
     
     self.FT_pulse = pulse.SquarePulse(channel='Velocity1AOM',
         length = self.params['sp_duration'], amplitude = self.params['FT_pulse_amp'])
     
     self.yel_pulse = pulse.SquarePulse(channel='YellowAOM',
         length = self.params['sp_duration']*3/4., amplitude = self.params['yellow_pulse_amp'])
     
     # make the list of elements required for uploading
     e = element.Element('N_FT_Polarisation', pulsar=qt.pulsar, global_time = True)
     
     e.append(pulse.cp(self.T, length=200e-9))
     last = e.append(self.yel_pulse)
     e.add(self.FT_pulse, refpulse=last, refpoint='start')
     e.append(pulse.cp(self.T, length=200e-9))
     e.append(pulse.cp(self.CORPSE_pi)) # ,
         # frequency = self.params['CORPSE_pi_mod_frq'],
         # amplitude = 0.))        
     
     # create the sequence
     seq = pulsar.Sequence('N_FT_Polarisation_Check_ESR_sequence')
     
     ro_elts = []
     for i,f in enumerate(self.params['RO_mod_frqs']):
         
         # 1: MBI 
         seq.append(name = 'MBI-{}'.format(i),
             wfname = self.mbi_elt.name,
             trigger_wait = True,
             goto_target = 'MBI-{}'.format(i),
             jump_target = 'ft_mw'+str(i))  
                 
         #2  then repeat (SP+MW pi)-element for the current number of times
         seq.append(name = 'ft_mw'+str(i), wfname=e.name,
                 repetitions = self.params['FT_element_repetitions'],
                 trigger_wait = True)
         
         #3 ESR type readout
         ro_e = element.Element('N_RO-{}'.format(i), pulsar=qt.pulsar, global_time = True)
         ro_e.append(self.T)
         ro_e.append(pulse.cp(self.slow_pi, 
             frequency = f))
         
         seq.append(name='N_ro'+str(i), wfname=ro_e.name,
             trigger_wait=False)
         ro_elts.append(ro_e)
             
         seq.append(name = 'sync-{}'.format(i), 
                 wfname = self.sync_elt.name) 
             
     # program AWG
     if upload:
         qt.pulsar.upload(self.mbi_elt, e ,self.sync_elt, *ro_elts)
     
     qt.pulsar.program_sequence(seq)        
示例#21
0
    def generate_sequence(self, upload=True):
        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 100e-9, amplitude = 0)
        TIQ = pulse.SquarePulse(channel='MW_Imod',
            length = 10e-9, amplitude = 0)

        CORPSE_pi = pulselib.IQ_CORPSE_pulse('CORPSE pi-pulse',
            I_channel = 'MW_Imod', 
            Q_channel = 'MW_Qmod',    
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'],
            frequency = self.params['CORPSE_mod_frq'],
            rabi_frequency = self.params['CORPSE_rabi_frequency'],
            amplitude = self.params['CORPSE_amp'],
            eff_rotation_angle = 180)

        CORPSE_pi2 = pulselib.IQ_CORPSE_pulse('CORPSE pi-pulse',
            I_channel = 'MW_Imod', 
            Q_channel = 'MW_Qmod',    
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'],
            frequency = self.params['CORPSE_mod_frq'],
            rabi_frequency = self.params['CORPSE_rabi_frequency'],
            amplitude = self.params['CORPSE_amp'],
            eff_rotation_angle = 90)

        wait_1us = element.Element('1us_delay', pulsar=qt.pulsar)
        wait_1us.append(pulse.cp(T, length=1e-6))

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = 10e-6, amplitude = 2)
        sync_elt.append(adwin_sync)

        elts = []
        seq = pulsar.Sequence('CORPSE test')

        for i in range(self.params['pts']):
            e = element.Element('CORPSE_Pi2_Pi-{}'.format(i), 
                pulsar = qt.pulsar,
                global_time=True)
            e.append(T)
            e.append(pulse.cp(CORPSE_pi2))
            e.append(pulse.cp(TIQ, length=self.params['delays'][i]))
            e.append(pulse.cp(CORPSE_pi))
            e.append(T)
            elts.append(e)
            seq.append(name='CORPSE_Pi2_Pi-{}'.format(i),
                wfname = e.name,
                trigger_wait=True)
            seq.append(name='sync-{}'.format(i),
                wfname = sync_elt.name)

        if upload:
            qt.pulsar.upload(sync_elt, wait_1us, *elts)
        qt.pulsar.program_sequence(seq)
示例#22
0
    def generate_sequence(self, upload=True):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        self.T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 100e-9, amplitude = 0)

        self.g_pulse = self.PulseClass('gaussian IQ pulse',
            I_channel = 'MW_Imod',
            Q_channel = 'MW_Qmod',
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'],
            frequency = self.params['pulse_mod_frqs'][0],
            amplitude = self.params['pulse_amps'][0],
            length = self.params['pulse_durations'][0])
    
        elts = []
        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-{}'.format(i), pulsar=qt.pulsar)
            e.append(self.T)            
            for j in range(self.params['MW_pulse_multiplicities'][i]):
                e.append(
                    pulse.cp(self.g_pulse,
                        frequency = self.params['pulse_mod_frqs'][i],
                        amplitude = self.params['pulse_amps'][i],
                        length = self.params['pulse_durations'][i]))
                e.append(
                    pulse.cp(self.T, length=self.params['MW_pulse_delays'][i]))
            elts.append(e)

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = 10e-6, amplitude = 2)
        sync_elt.append(adwin_sync)

        seq = pulsar.Sequence('CNOT sequence')
        for i in range(self.params['pts']):

            seq.append(name = 'MBI-%d' % i, 
                wfname = mbi_elt.name, 
                trigger_wait = True, 
                goto_target = 'MBI-%d' % i, 
                jump_target = 'pulse-{}'.format(i))

            seq.append(name = 'pulse-{}'.format(i), 
                       wfname = elts[i].name,
                       trigger_wait=True)

            seq.append(name = 'sync-{}'.format(i),
                wfname = sync_elt.name)

        # program AWG
        if upload:
            qt.pulsar.upload(mbi_elt, sync_elt, *elts)
        qt.pulsar.program_sequence(seq)
    def generate_sequence(self, upload=True):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 10e-9, amplitude = 0)

        CORPSE_pi = pulselib.IQ_CORPSE_pi_pulse('CORPSE pi-pulse',
            I_channel = 'MW_Imod', 
            Q_channel = 'MW_Qmod',
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'],
            frequency = self.params['CORPSE_pi_mod_frq'],
            amplitude = self.params['CORPSE_pi_amp'],
            length_60 = self.params['CORPSE_pi_60_duration'],
            length_m300 = self.params['CORPSE_pi_m300_duration'],
            length_420 = self.params['CORPSE_pi_420_duration'])

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = 10e-6, amplitude = 2)
        sync_elt.append(adwin_sync)

        wait_1us = element.Element('1us_delay', pulsar=qt.pulsar)
        wait_1us.append(pulse.cp(T, length=1e-6))

        elts = []
        for i in range(self.params['pts']):
            e = element.Element('CORPSE-{}'.format(i), pulsar=qt.pulsar)
            e.append(T,
                pulse.cp(CORPSE_pi,
                    amplitude=self.params['CORPSE_pi_sweep_amps'][i]))
            elts.append(e)

        # sequence
        seq = pulsar.Sequence('CORPSE pi calibration')
        for i,e in enumerate(elts):
            seq.append(name = 'MBI-%d' % i, wfname = mbi_elt.name, 
                trigger_wait = True, goto_target = 'MBI-%d' % i, 
                jump_target = e.name+'-0')
            
            for j in range(self.params['multiplicity']):
                seq.append(name = e.name+'-{}'.format(j), 
                    wfname = e.name,
                    trigger_wait = (j==0))
                seq.append(name = 'wait-{}-{}'.format(i,j), 
                    wfname = wait_1us.name, 
                    repetitions = self.params['delay_reps'])
            seq.append(name = 'sync-{}'.format(i),
                wfname = sync_elt.name)

        # program AWG
        if upload:
            qt.pulsar.upload(mbi_elt, sync_elt, wait_1us, *elts)
        qt.pulsar.program_sequence(seq)
示例#24
0
    def generate_sequence(self, upload=True):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        self.T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 100e-9, amplitude = 0)

        self.g_pulse = self.PulseClass('gaussian IQ pulse',
            I_channel = 'MW_Imod',
            Q_channel = 'MW_Qmod',
            PM_channel = 'MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'],
            frequency = self.params['pulse_mod_frqs'][0],
            amplitude = self.params['pulse_amps'][0],
            length = self.params['pulse_durations'][0])
    
        elts = []
        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-{}'.format(i), pulsar=qt.pulsar)
            e.append(self.T)            
            for j in range(self.params['MW_pulse_multiplicities'][i]):
                e.append(
                    pulse.cp(self.g_pulse,
                        frequency = self.params['pulse_mod_frqs'][i],
                        amplitude = self.params['pulse_amps'][i],
                        length = self.params['pulse_durations'][i]))
                e.append(
                    pulse.cp(self.T, length=self.params['MW_pulse_delays'][i]))
            elts.append(e)

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = 10e-6, amplitude = 2)
        sync_elt.append(adwin_sync)

        seq = pulsar.Sequence('CNOT sequence')
        for i in range(self.params['pts']):

            seq.append(name = 'MBI-%d' % i, 
                wfname = mbi_elt.name, 
                trigger_wait = True, 
                goto_target = 'MBI-%d' % i, 
                jump_target = 'pulse-{}'.format(i))

            seq.append(name = 'pulse-{}'.format(i), 
                       wfname = elts[i].name,
                       trigger_wait=True)

            seq.append(name = 'sync-{}'.format(i),
                wfname = sync_elt.name)

        # program AWG
        if upload:
            qt.pulsar.upload(mbi_elt, sync_elt, *elts)
        qt.pulsar.program_sequence(seq)
示例#25
0
def _lt1_LDE_element(msmt):
    """
    This element contains the LDE part for LT1, i.e., spin pumping and MW pulses
    for the LT1 NV in the real experiment.
    """
    e = element.Element('LDE_LT1', pulsar=msmt.pulsar_lt1, global_time=True)

    # this pulse to ensure that the element has equal length as the lt2 element
    e.add(
        pulse.cp(msmt.SP_pulse,
                 amplitude=0,
                 length=msmt.params['LDE_element_length']))
    #
    #1 SP
    e.add(pulse.cp(msmt.SP_pulse,
                   amplitude=0,
                   length=msmt.params_lt1['initial_delay']),
          name='initial_delay')

    e.add(pulse.cp(msmt.SP_pulse,
                   length=msmt.params['LDE_SP_duration'],
                   amplitude=1.0),
          name='spinpumping',
          refpulse='initial_delay')

    e.add(pulse.cp(msmt.yellow_pulse,
                   length=msmt.params['LDE_SP_duration_yellow'],
                   amplitude=1. if msmt.params_lt1['AWG_yellow_use'] else 0.),
          name='spinpumpingyellow',
          refpulse='initial_delay')

    #2 MW pi/2
    if msmt.params_lt1['MW_during_LDE'] == 1:
        e.add(msmt.fast_pi2,
              name='mw_pi2_pulse',
              start=msmt.params_lt1['MW_wait_after_SP'],
              refpulse='spinpumping',
              refpoint='end',
              refpoint_new='start')

    #3 MW pi
    if msmt.params_lt1['MW_during_LDE'] == 1:
        e.add(msmt.fast_pi,
              name='mw_pi_pulse',
              start=msmt.params_lt1['MW_separation'],
              refpulse='mw_pi2_pulse',
              refpoint='end',
              refpoint_new='start')

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

    if e.length() != msmt.params['LDE_element_length']:
        raise Exception('LDE element length' + e.name +
                        ' is not as specified - granularity issue?')
    return e
示例#26
0
    def calibrate_CORPSE_pi_phase_shift_or_e_time(self):
        """
        Do a Hahn echo sequence with the CORPSE pi pulse, and sweep it's zero
        phase with respect the rotating frame at that time.
        """
        sweep_elements = []
        self.flattened_elements = []
        self.seq = pulsar.Sequence('{}_{}-Sequence'.format(self.mprefix, 
            self.name))

        first_pi2_elt = element.Element('first pi2', pulsar=qt.pulsar,
            global_time = True)
        first_pi2_elt.append(pulse.cp(self.T, length=1e-6))
        first_pi2_name = first_pi2_elt.append(self.fast_pi2)
        first_pi2_elt.append(pulse.cp(self.TIQ, length=100e-9))

        self.flattened_elements.append(first_pi2_elt)

        # the start time of the second pi2, and the evolution time depends on the time when the
        # pulse stops in the first pi2 element:
        t_pi2 = first_pi2_elt.length() - \
            first_pi2_elt.effective_pulse_end_time(first_pi2_name, 'MW_Imod')

        # calculate the evolution time from the interpulse delay
        etimes = self.params_lt1['interpulse_delays'] - t_pi2 - self.fast_pi2.effective_length()/2.

        pi_elts = []
        second_pi2_elts = []
        for i in range(self.params['pts']):
            e = self.UNROT_element('pi-{}'.format(i),
                None, etimes[i], first_pi2_elt.length(),
                CORPSE_pi_phase_shift = \
                    self.params_lt1['CORPSE_pi_phase_shifts'][i])
            
            self.flattened_elements.append(e)
            pi_elts.append(e)

            # make the element
            second_pi2_elt = element.Element('second pi2-{}'.format(i), pulsar=qt.pulsar,
                global_time = True, 
                time_offset = e.length()+first_pi2_elt.length())        
            second_pi2_elt.append(pulse.cp(self.TIQ, length=t_pi2))
            second_pi2_elt.append(self.fast_pi2)

            self.flattened_elements.append(second_pi2_elt)
            second_pi2_elts.append(second_pi2_elt)

        self.flattened_elements.append(self.N_RO_CNOT_elt)

        for i in range(self.params['pts']):
            sweep_elements.append([first_pi2_elt, 
                pi_elts[i],second_pi2_elts[i]])
        
        self.seq = self._add_MBI_and_sweep_elements_to_sequence(
            sweep_elements, self.N_RO_CNOT_elt, self.adwin_lt1_trigger_element)
示例#27
0
def _create_mw_pulses(msmt,Gate):
    Gate.mw_X = ps.X_pulse(msmt)
    Gate.mw_pi2 = ps.Xpi2_pulse(msmt)
    Gate.mw_mpi2 = ps.mXpi2_pulse(msmt)
    Gate.mw_first_pulse = pulse.cp(ps.Xpi2_pulse(msmt),amplitude = msmt.params['mw_first_pulse_amp'],length = msmt.params['mw_first_pulse_length'],phase = msmt.params['mw_first_pulse_phase'])
    Gate.mw_second_pulse = pulse.cp(ps.X_pulse(msmt),amplitude = msmt.params['mw_second_pulse_amp'],length = msmt.params['mw_second_pulse_length'])
    


    if hasattr(Gate,'first_pulse_is_pi2') and hasattr(Gate,'first_mw_pulse_phase'):
        if Gate.first_pulse_is_pi2:
            Gate.mw_first_pulse = pulse.cp(Gate.mw_pi2, phase = Gate.first_mw_pulse_phase)
    elif hasattr(Gate,'first_pulse_is_pi2'):
        if Gate.first_pulse_is_pi2:
            Gate.mw_first_pulse = pulse.cp(Gate.mw_pi2, phase = msmt.params['mw_first_pulse_phase'])

    if hasattr(Gate,'no_first_pulse'):
        if Gate.no_first_pulse:
            Gate.mw_first_pulse = pulse.cp(Gate.mw_X,amplitude = 0)

    if hasattr(Gate,'no_mw_pulse'):
        if Gate.no_mw_pulse:
            Gate.mw_first_pulse = pulse.cp(Gate.mw_X,amplitude = 0)
            Gate.mw_pi2 = pulse.cp(Gate.mw_X,amplitude = 0)
            Gate.mw_mpi2 = pulse.cp(Gate.mw_X,amplitude = 0)
            Gate.mw_X = pulse.cp(Gate.mw_X,amplitude = 0)
示例#28
0
def _lt2_final_id(msmt, name, time_offset, **kw):
    wait_length = msmt.params_lt2[
        'CORPSE_pi2_wait_length'] + msmt.CORPSE_pi.length
    final_id_elt = element.Element('second_id_elt-{}'.format(name),
                                   pulsar=qt.pulsar,
                                   global_time=True,
                                   time_offset=time_offset)
    final_id_elt.append(pulse.cp(msmt.T, length=wait_length))
    final_id_elt.append(pulse.cp(msmt.T, length=100e-9))

    return final_id_elt
示例#29
0
def _lt1_N_RO_elt(msmt):
    """
    This is an element with spin pumping to ms=0 and a (pi-2pi) CNOT pulse for the nitrogen readout.
    """
    N_RO_elt = element.Element('N-RO', pulsar=msmt.pulsar_lt1)
    N_RO_elt.append(pulse.cp(msmt.T, length=1000e-9))
    N_RO_elt.append(
        pulse.cp(msmt.SP_pulse, length=msmt.params_lt1['N_RO_SP_duration']))
    N_RO_elt.append(pulse.cp(msmt.T, length=2000e-9))
    N_RO_elt.append(msmt.pi2pi_m1)

    return N_RO_elt
示例#30
0
def _LDE_rephasing_elt(msmt,Gate,forced_wait_duration = 0,addressed_carbon=None):
    """waits the right amount of time after and LDE element for the 
    electron to rephase.

    NOTE: after developing the purification code for several one realizes that we should distinguish between LDE 1 and LDE 2.
    The two elements are very different from each other.
    """
    _create_wait_times(Gate)
    _create_syncs_and_triggers(msmt,Gate)
    e = element.Element(Gate.name, pulsar = qt.pulsar)

    if forced_wait_duration == 0:

        ### we need to add some time for the following carbon gate to this rephasing element
        ### this time is tau_cut and is calculated below.
        # TODO: generalize this to multiple carbons
        c = str(addressed_carbon)
        e_trans = msmt.params['electron_transition']

        #### for concatenating LDE with a longer entangling sequence, see also purify_slave, function carbon_swap_gate:
        if 'ElectronDD_tau' in msmt.params.to_dict().keys():
            tau = msmt.params['ElectronDD_tau']
        else:
            tau = msmt.params['C'+c+'_Ren_tau'+e_trans][0]
        ps.X_pulse(msmt) # update pi pulse parameters
        fast_pi_duration        = msmt.params['fast_pi_duration'] 
        pulse_tau               = tau - fast_pi_duration/2.0
        n_wait_reps, tau_remaind = divmod(round(2*pulse_tau*1e9),1e3) 
        if n_wait_reps %2 == 0:
            tau_cut = 1e-6
        else:
            tau_cut = 1.5e-6


        # LDE 2 does not need tau_cut because we do dynamic phase correction with a fixed tau_cut.
        if 'LDE_rephasing_2' in Gate.name:
            tau_cut =1e-6 #0e-6
            # print e.samples()


        ### avg. repump time + tau_cut gives the right amount of time.
        wait_duration = msmt.params['average_repump_time'] + tau_cut

        
        test = pulse.cp(Gate.T, length=wait_duration,name='rephasing')
        test.name = 'rephase'
        e.add(test)

    else:
        e = element.Element(Gate.name, pulsar = qt.pulsar)
        test = pulse.cp(Gate.T,length=forced_wait_duration,name = 'rephase_with_known_wait')
        e.add(test)
    return e
示例#31
0
    def generate_sequence(self, upload=True):
        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod', length=10e-9, amplitude=0)

        CORPSE = pulselib.IQ_CORPSE_pulse(
            'CORPSE pi-pulse',
            I_channel=self.params['cur_MW_channel'],
            Q_channel='dummy',
            PM_channel='MW_pulsemod',
            #second_MW_channel = 'MW_Qmod',
            PM_risetime=self.params['MW_pulse_mod_risetime'],
            amplitude=self.params['CORPSE_pi_amp'],
            frequency=self.params['frq_mod'],
            rabi_frequency=self.params['CORPSE_rabi_frequency'],
            pulse_delay=self.params['CORPSE_pulse_delay'],
            eff_rotation_angle=self.params['CORPSE_eff_rotation_angle'])
        CORPSE.channels.remove('dummy')

        wait_1us = element.Element('1us_delay', pulsar=qt.pulsar)
        wait_1us.append(pulse.cp(T, length=1e-6))

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
                                       length=10e-6,
                                       amplitude=2)
        sync_elt.append(adwin_sync)

        elts = []
        for i in range(self.params['pts']):
            e = element.Element('CORPSE-{}'.format(i), pulsar=qt.pulsar)
            e.append(
                T,
                pulse.cp(CORPSE,
                         amplitude=self.params['CORPSE_pi_sweep_amps'][i],
                         pulse_delay=self.params['CORPSE_pulse_delays'][i]))
            elts.append(e)

        # sequence
        seq = pulsar.Sequence('CORPSE pi calibration')
        for i, e in enumerate(elts):
            for j in range(self.params['multiplicity']):
                seq.append(name=e.name + '-{}'.format(j),
                           wfname=e.name,
                           trigger_wait=(j == 0))
                seq.append(name='wait-{}-{}'.format(i, j),
                           wfname=wait_1us.name,
                           repetitions=self.params['delay_reps'])
            seq.append(name='sync-{}'.format(i), wfname=sync_elt.name)

        # program AWG
        if upload:
            #qt.pulsar.upload(sync_elt, wait_1us, *elts)
            qt.pulsar.program_awg(seq, sync_elt, wait_1us, *elts)
示例#32
0
def _lt3_sequence_start_element(msmt):
    """
    first element of a two-setup sequence. Sends a trigger to AWG LT1
    """
    e = element.Element('LT3_start', pulsar = qt.pulsar)
    e.append(msmt.T_sync)
    ref_p=e.append(msmt.sync)
    e.append(pulse.cp(msmt.T_sync, length=msmt.params['AWG_wait_for_lt1_start']))
    ref_p=e.add(pulse.cp(msmt.plu_gate, length=50e-9), refpulse=ref_p, start=100e-9)
    ref_p=e.add(pulse.cp(msmt.plu_gate, length=50e-9), refpulse=ref_p, start=50e-9)
    ref_p=e.add(pulse.cp(msmt.plu_gate, length=50e-9), refpulse=ref_p, start=50e-9)
    ref_p=e.add(pulse.cp(msmt.plu_gate, length=50e-9), refpulse=ref_p, start=50e-9)
    return e
示例#33
0
def _lt1_N_RO_elt(msmt):
    """
    This is an element with spin pumping to ms=0 and a (pi-2pi) CNOT pulse for the nitrogen readout.
    """
    N_RO_elt = element.Element('N-RO', pulsar=msmt.pulsar_lt1)
    N_RO_elt.append(pulse.cp(msmt.T,
                              length=1000e-9))    
    N_RO_elt.append(pulse.cp(msmt.SP_pulse,
                             length = msmt.params_lt1['N_RO_SP_duration']))
    N_RO_elt.append(pulse.cp(msmt.T,
                             length=2000e-9))
    N_RO_elt.append(msmt.pi2pi_m1)

    return N_RO_elt
示例#34
0
    def generate_sequence(self, upload = True, **kw):

        qt.pulsar.AWG_sequence_cfg['JUMP_TIMING'] = 0 # ASYNC
        seq = pulsar.Sequence('Square Pulses')
        seq.set_djump(True)

        elements = []

        adwin_sync = pulse.SquarePulse(channel='adwin_sync', length = 1e-6, amplitude = 2)
        empty = pulse.SquarePulse(channel = 'adwin_sync', length = 1e-6, amplitude = 0)

        jump_index = 0

        e_loop = element.Element('loop', pulsar = qt.pulsar, global_time = True, min_samples = 1e3)
        e_wait = element.Element('trigger_wait', pulsar = qt.pulsar, global_time = True, min_samples = 1e3) # currently not used
    
        e_wait.add(pulse.cp(empty), name = e_wait.name)
        elements.append(e_wait)
        seq.append(name = e_wait.name, wfname = e_wait.name, goto_target = e_loop.name, trigger_wait = True)
        # seq.add_djump_address(jump_index, e_wait.name)

        e_loop.add(pulse.cp(empty, length = 1e-3), name = e_loop.name)
        elements.append(e_loop)
        seq.append(name = e_loop.name, wfname = e_loop.name, goto_target = e_wait.name, repetitions = 65536)

        for name, ps in kw.iteritems():
            jump_index += 1

            e = element.Element(name + '-%d' % jump_index, pulsar = qt.pulsar, global_time = True, min_samples = 1e3)
            e.add(pulse.cp(ps), name = e.name)

            elements.append(e)

            seq.append(name = e.name, wfname = e.name, goto_target = e_loop.name)
            seq.add_djump_address(jump_index, e.name)

        # For some strange reason the last pulse doenst treat goto_target correctly
        e_sync = element.Element('sync', pulsar = qt.pulsar, global_time = True, min_samples = 1e3)
        e_sync.add(pulse.cp(adwin_sync), name = e_sync.name)
        elements.append(e_sync)
        seq.append(name = e_sync.name, wfname = e_sync.name, goto_target = e_loop.name)
        seq.add_djump_address(0, e_sync.name)

        # upload the waveforms to the AWG
        if upload:
            if upload=='old_method':
                qt.pulsar.upload(*elements)
                qt.pulsar.program_sequence(seq)
            else:
                qt.pulsar.program_awg(seq,*elements)
示例#35
0
    def _First_element(self, name='First_element'):
        ## Make it the same as RO, but without syncs
        # define the necessary pulses
        sq_AOMpulse = pulse.SquarePulse(channel='AOM_Green',
                                        name='Green_square')
        sq_AOMpulse.amplitude = 1  #sets the marker high
        sq_AOMpulse.length = self.params['GreenAOM_pulse_length']
        sync = pulse.SquarePulse(channel='sync',
                                 length=self.params['pq_sync_length'],
                                 amplitude=1.0)

        adwin_trigger_pulse = pulse.SquarePulse(channel='adwin_sync',
                                                length=1590e-9,
                                                amplitude=2)
        wait_before_MW = 500e-9
        T = pulse.SquarePulse(channel='MW_Imod',
                              name='Wait',
                              length=wait_before_MW)

        # the actual element
        first_element = element.Element(name, pulsar=qt.pulsar)
        first_element.add(pulse.cp(adwin_trigger_pulse, amplitude=0),
                          name='adwin_trigger')
        first_element.add(T,
                          name='wait2',
                          refpulse='adwin_trigger',
                          refpoint='end')
        first_element.add(sq_AOMpulse,
                          name='GreenLight',
                          refpulse='wait2',
                          refpoint='end')
        first_element.add(pulse.cp(sync, amplitude=0),
                          name='Sync',
                          refpulse='wait2',
                          refpoint='end')
        first_element.add(pulse.cp(T,
                                   length=self.params['time_between_syncs']),
                          name='wait3',
                          refpulse='Sync',
                          refpoint='end')
        first_element.add(pulse.cp(sync, amplitude=0),
                          name='Sync2',
                          refpulse='wait3',
                          refpoint='end')
        first_element.add(pulse.cp(T, length=2.5e-6),
                          name='wait_for_singlet',
                          refpulse='GreenLight',
                          refpoint='end')
        return first_element
示例#36
0
    def generate_sequence(self, upload=True):
        # electron manipulation pulses
        T = pulse.SquarePulse(channel='MW_pulsemod',
                              length=100e-9,
                              amplitude=0)

        CORPSE = pulselib.IQ_CORPSE_pulse(
            'CORPSE pulse',
            I_channel='MW_Imod',
            Q_channel='MW_Qmod',
            PM_channel='MW_pulsemod',
            PM_risetime=self.params['MW_pulse_mod_risetime'],
            frequency=self.params['CORPSE_mod_frq'],
            rabi_frequency=self.params['CORPSE_rabi_frequency'])

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
                                       length=10e-6,
                                       amplitude=2)
        sync_elt.append(adwin_sync)
        wait_1us = element.Element('1us_delay', pulsar=qt.pulsar)
        wait_1us.append(pulse.cp(T, length=1e-6))

        elts = []
        for i in range(self.params['pts']):
            e = element.Element('CORPSE-{}'.format(i),
                                pulsar=qt.pulsar,
                                global_time=True)
            e.append(T)
            e.append(
                pulse.cp(CORPSE,
                         amplitude=self.params['CORPSE_sweep_amps'][i],
                         eff_rotation_angle=self.
                         params['CORPSE_effective_rotation_angles'][i]))

            elts.append(e)

        # sequence
        seq = pulsar.Sequence('CORPSE (any angle) calibration')
        for i, e in enumerate(elts):
            seq.append(name=e.name + '-{}'.format(i),
                       wfname=e.name,
                       trigger_wait=True)
            seq.append(name='sync-{}'.format(i), wfname=sync_elt.name)

        # program AWG
        if upload:
            #qt.pulsar.upload(sync_elt, *elts)
            qt.pulsar.program_awg(seq, sync_elt, wait_1us, *elts)
示例#37
0
    def generate_sequence(self, upload=True):

        # define the necessary pulses
        X = pulselib.IQ_CORPSE_pi2_pulse('CORPSE pi2-pulse', 
            I_channel='MW_Imod', 
            Q_channel='MW_Qmod', 
            PM_channel='MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'],
            frequency = self.params['CORPSE_pi2_mod_frq'],
            amplitude = self.params['CORPSE_pi2_amp'],
            length_24p3 = self.params['CORPSE_pi2_24p3_duration'],
            length_m318p6 = self.params['CORPSE_pi2_m318p6_duration'],
            length_384p3 = self.params['CORPSE_pi2_384p3_duration'])

        T = pulse.SquarePulse(channel='MW_Imod', name='delay', 
            length = 200e-9, amplitude = 0.)
        
        # make the elements - one for each ssb frequency
        elements = []
        for i in range(self.params['pts']):

            e = element.Element('ElectronRamsey_pt-%d' % i, pulsar=qt.pulsar,
                global_time = True)
            e.append(T)
            
            e.append(pulse.cp(X,
                amplitude = self.params['CORPSE_pi2_amps'][i],
                phase = self.params['CORPSE_pi2_phases1'][i]))

            e.append(pulse.cp(T,
                length = self.params['evolution_times'][i]))

            e.append(pulse.cp(X,
                amplitude = self.params['CORPSE_pi2_amps'][i],
                phase = self.params['CORPSE_pi2_phases2'][i]))
    
            elements.append(e)

        # create a sequence from the pulses
        seq = pulsar.Sequence('ElectronRamsey sequence')
        for e in elements:
            seq.append(name=e.name, wfname=e.name, trigger_wait=True)

        # upload the waveforms to the AWG
        if upload:
            qt.pulsar.upload(*elements)

        # program the AWG
        qt.pulsar.program_sequence(seq)
示例#38
0
def generate_test_sequence():

    RND_halt_combiner_ch = 'RND_halt'
    RND_halt_QRNG_ch = 'plu_sync'
    sync_ch = 'adwin_success_trigger'

    sync = pulse.SquarePulse(channel=sync_ch, length=50e-9, amplitude=2)
    RND_halt_QRNG = pulse.SquarePulse(channel=RND_halt_QRNG_ch,
                                      length=200e-9,
                                      amplitude=2)
    RND_halt_combiner = pulse.SquarePulse(channel=RND_halt_combiner_ch,
                                          length=200e-9,
                                          amplitude=2)

    elt = element.Element('combiner_test_elt', pulsar=qt.pulsar)
    elt.add(sync, name='sync_T', start=100e-9)
    elt.add(RND_halt_QRNG,
            start=500e-9,
            refpulse='sync_T',
            name='RND_halt_QRNG_p')
    elt.add(RND_halt_combiner,
            start=100e-9,
            refpulse='RND_halt_QRNG_p',
            refpoint='start',
            name='RND_halt_combiner_p')
    elt.add(pulse.cp(sync, amplitude=0, length=15e-6))

    elt2 = element.Element('combiner_test_wait_elt', pulsar=qt.pulsar)

    elt2.add(pulse.cp(sync, amplitude=0, length=15e-6), start=500e-9)

    seq = pulsar.Sequence('combiner_test_seq')

    seq.append(name='combiner_test_seq1',
               wfname=elt2.name,
               repetitions=1,
               trigger_wait=True)
    seq.append(name='combiner_test_seq2',
               wfname=elt.name,
               repetitions=50000,
               trigger_wait=False)

    #seq.append(name = 'photon_after_sync1',
    #    wfname = syncs_elt_mod0.name,
    #    repetitions = 100)

    #qt.pulsar.upload(no_syncs_elt, syncs_elt_mod0)
    #qt.pulsar.program_sequence(seq)
    qt.pulsar.program_awg(seq, elt, elt2)
    def generate_sequence(self, upload=True):

        # define the necessary pulse

        TT = pulse.SquarePulse(channel="HH_sync", length=1000e-9, amplitude=0)
        SP = pulse.SquarePulse(
            channel=self.params["sp_channel"],
            length=self.params["AWG_SP_duration"][0],
            amplitude=self.params["AWG_SP_voltage"][0],
        )

        # print self.params['AWG_SP_voltage']
        # make the elements - one for each ssb frequency
        elements = []
        for i in range(self.params["pts"]):
            e = element.Element("AWG_SP_sweep-%d" % i, pulsar=self.pulsar)
            e.add(TT, name="wait")
            e.append(pulse.cp(SP(length=self.params["AWG_SP_duration"][i], amplitude=self.params["AWG_SP_voltage"][i])))
            elements.append(e)

        # create a sequence from the pulses
        seq = pulsar.Sequence("SSRO sequence")
        for e in elements:
            seq.append(name=e.name, wfname=e.name, trigger_wait=True)

        # upload the waveforms to the AWG
        if upload:
            self.pulsar.upload(*elements)

        # program the AWG
        self.pulsar.program_sequence(seq)
示例#40
0
    def generate_subsequence(self, seq='x'):

        for i in range(len(seq)):

            start = self.params['tau_larmor']

            #If the sequence is empty then do not add something, since we get MV
            #switch noise in this case
            if seq[i]=='e':
                return

            
            if seq[i] == 'u' or seq[i] =='v':
                current_pi = True
            else:   current_pi = False


            #In case the last pulse we did was a pi pulse and we are also no having a pi pulse, then we want to echo correctly by having two times tau larmor,
            ##sine usually we just use tau larmor for the spacing.
            if self.last_pi == True and current_pi == True:
                start *=2.

            self.e1.add(pulse.cp(self.pulse_dict[seq[i]]),
                                refpulse        = 'pulse%d' % (self.n-1),
                                refpoint        = 'center',
                                refpoint_new    = 'center',
                                name            = 'pulse%d' % self.n,
                                start           = start)

            self.n +=1
            self.last_pi = current_pi
示例#41
0
    def test_BSM_with_LDE_element_calibrate_echo_time(self, basis='-Z'):
        sweep_elements = []
        self.flattened_elements = []
        self.seq = pulsar.Sequence('{}_{}-Sequence'.format(self.mprefix, 
            self.name))

        for i in range(self.params['pts']):            
            N_init = self.N_init_element('N_init-{}'.format(i), 
                basis = basis, 
                echo_time_after_LDE = self.params_lt1['echo_times_after_LDE'][i], 
                end_offset_time = -100e-9)
            
            e_pi2_elt = element.Element('e_pi2-{}'.format(i), pulsar = qt.pulsar, 
                global_time = True, time_offset = self.LDE_element.length() + N_init.length())
            e_pi2_elt.append(pulse.cp(self.TIQ, 
                length = 100e-9))
            e_pi2_elt.append(self.fast_pi2)


            self.flattened_elements.append(self.LDE_element)
            self.flattened_elements.append(N_init)
            self.flattened_elements.append(e_pi2_elt)
            sweep_elements.append([self.LDE_element,N_init,e_pi2_elt])
            
        self.seq = self._add_MBI_and_sweep_elements_to_sequence(
            sweep_elements, self.N_RO_CNOT_elt, self.adwin_lt1_trigger_element)
示例#42
0
    def generate_sequence(self, upload=True):

        # define the necessary pulse

        TT = pulse.SquarePulse(channel='HH_sync', length=1000e-9, amplitude=0)
        SP = pulse.SquarePulse(channel=self.params['sp_channel'],
                               length=self.params['AWG_SP_duration'][0],
                               amplitude=self.params['AWG_SP_voltage'][0])

        #print self.params['AWG_SP_voltage']
        # make the elements - one for each ssb frequency
        elements = []
        for i in range(self.params['pts']):
            e = element.Element('AWG_SP_sweep-%d' % i, pulsar=self.pulsar)
            e.add(TT, name='wait')
            e.append(
                pulse.cp(
                    SP(length=self.params['AWG_SP_duration'][i],
                       amplitude=self.params['AWG_SP_voltage'][i])))
            elements.append(e)

        # create a sequence from the pulses
        seq = pulsar.Sequence('SSRO sequence')
        for e in elements:
            seq.append(name=e.name, wfname=e.name, trigger_wait=True)

        # upload the waveforms to the AWG
        if upload:
            self.pulsar.upload(*elements)

        # program the AWG
        self.pulsar.program_sequence(seq)
示例#43
0
    def test_BSM_with_LDE_element_calibrate_echo_time(self):
        sweep_elements = []
        self.flattened_elements = []
        self.seq = pulsar.Sequence('{}_{}-Sequence'.format(
            self.mprefix, self.name))

        for i in range(self.params['pts']):
            N_init = self.N_init_element(
                'N_init-{}'.format(i),
                basis='Z',
                echo_time_after_LDE=self.params_lt1['echo_times_after_LDE'][i],
                end_offset_time=-100e-9)

            e_pi2_elt = element.Element('e_pi2-{}'.format(i),
                                        pulsar=qt.pulsar,
                                        global_time=True,
                                        time_offset=self.LDE_element.length() +
                                        N_init.length())
            e_pi2_elt.append(pulse.cp(self.TIQ, length=100e-9))
            e_pi2_elt.append(self.fast_pi2)

            self.flattened_elements.append(self.LDE_element)
            self.flattened_elements.append(N_init)
            self.flattened_elements.append(e_pi2_elt)
            sweep_elements.append([self.LDE_element, N_init, e_pi2_elt])

        self.seq = self._add_MBI_and_sweep_elements_to_sequence(
            sweep_elements, self.N_RO_CNOT_elt, self.adwin_lt1_trigger_element)
示例#44
0
    def generate_sequence(self, upload=True):
        # load all the other pulsar resources
        self._pulse_defs()
        self.sweep_elements = self.get_sweep_elements()

        N_RO_CNOT_elt = element.Element('N-RO CNOT', pulsar=qt.pulsar)
        N_RO_CNOT_elt.append(pulse.cp(self.T, length=500e-9))
        N_RO_CNOT_elt.append(self.pi2pi_m1)

        # create the sequence
        seq = self._add_MBI_and_sweep_elements_to_sequence(self.sweep_elements,
                                                           N_RO_CNOT_elt,
                                                           self.sync_elt,
                                                           append_sync=False)

        # make the list of elements required for uploading
        flattened_sweep_elements = self._flatten_sweep_element_list(
            self.sweep_elements)

        # program AWG
        if upload:
            qt.pulsar.upload(self.mbi_elt, self.sync_elt, N_RO_CNOT_elt,
                             *flattened_sweep_elements)

        qt.pulsar.program_sequence(seq)
示例#45
0
    def get_sweep_elements(self):
        elts = []
        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-{}'.format(i), pulsar=qt.pulsar)
            e.append(self.T)
            for j in range(self.params['MW_pulse_multiplicities'][i]):
                e.append(
                    pulse.cp(self.e_pulse,
                             frequency=self.params['MW_pulse_mod_frqs'][i],
                             amplitude=self.params['MW_pulse_amps'][i],
                             length=self.params['MW_pulse_durations'][i]))
                e.append(
                    pulse.cp(self.T, length=self.params['MW_pulse_delays'][i]))
            elts.append(e)

        return elts
示例#46
0
def _lt2_dummy_element(msmt):
    """
    A 1us empty element we can use to replace 'real' elements for certain modes.
    """
    e = element.Element('Dummy', pulsar = qt.pulsar)
    e.append(pulse.cp(msmt.T, length=10e-6))
    return e
示例#47
0
    def generate_sequence(self, upload=True):
        #print 'test'
        # define the necessary pulses

        X = pulselib.MW_pulse('Weak pi-pulse',
            MW_channel='MW_Imod',
            PM_channel='MW_pulsemod',
            PM_risetime = self.params['MW_pulse_mod_risetime'])

        T = pulse.SquarePulse(channel='MW_Qmod', name='delay',
            length = 200e-9, amplitude = 0.)

        # make the elements - one for each ssb frequency
        elements = []
        for i in range(self.params['pts']):

            e = element.Element('ElectronRabi_pt-%d' % i, pulsar=qt.pulsar)

            e.append(T)
            e.append(pulse.cp(X,
                length = self.params['MW_pulse_durations'][i],
                amplitude = self.params['MW_pulse_amplitudes'][i]))

            elements.append(e)


        # create a sequence from the pulses
        seq = pulsar.Sequence('ElectronRabi sequence')
        for e in elements:
            seq.append(name=e.name, wfname=e.name, trigger_wait=True)

        # upload the waveforms to the AWG
        if upload:
            qt.pulsar.program_awg(seq,*elements)
示例#48
0
def _lt2_wait_1us_element(msmt):
    """
    A 1us empty element we can use to replace 'real' elements for certain modes.
    """
    e = element.Element('wait_1_us', pulsar=qt.pulsar)
    e.append(pulse.cp(msmt.T, length=1e-6))
    return e
    def generate_sequence(self, upload=True):
        # MBI element
        mbi_elt = self._MBI_element()

        # electron manipulation pulses
        T = pulse.SquarePulse(channel="MW_pulsemod", length=10e-9, amplitude=0)

        Xpassage = AdiabaticPassagePulse(
            "Adiabatic Passage",
            fstart=self.params["passage_start_mod_frq"],
            fstop=self.params["passage_stop_mod_frq"],
            amplitude=self.params["passage_amp"],
        )

        adwin_sync = pulse.SquarePulse(channel="adwin_sync", length=10e-6, amplitude=2)

        # electron manipulation elements
        elts = []
        for i in range(self.params["pts"]):
            e = element.Element("Passage_pt-%d" % i, pulsar=qt.pulsar)
            e.append(T, pulse.cp(Xpassage, length=self.params["passage_lengths"][i]), adwin_sync)
            elts.append(e)

        # sequence
        seq = pulsar.Sequence("MBI adiabatic passage sequence")
        for i, e in enumerate(elts):
            seq.append(
                name="MBI-%d" % i, wfname=mbi_elt.name, trigger_wait=True, goto_target="MBI-%d" % i, jump_target=e.name
            )
            seq.append(name=e.name, wfname=e.name, trigger_wait=True)

        # program AWG
        if upload:
            qt.pulsar.upload(mbi_elt, *elts)
        qt.pulsar.program_sequence(seq)
示例#50
0
    def get_sweep_elements(self):        
        elts = []
        for i in range(self.params['pts']):
            e = element.Element('ERabi_pt-{}'.format(i), pulsar=qt.pulsar)
            e.append(self.T)            
            for j in range(self.params_lt1['MW_pulse_multiplicities'][i]):
                e.append(
                    pulse.cp(self.e_pulse,
                        frequency = self.params_lt1['MW_pulse_mod_frqs'][i],
                        amplitude = self.params_lt1['MW_pulse_amps'][i],
                        length = self.params_lt1['MW_pulse_durations'][i]))
                e.append(
                    pulse.cp(self.T, length=self.params_lt1['MW_pulse_delays'][i]))
            elts.append(e)

        return elts
示例#51
0
def _lt1_LDE_element(msmt):
    """
    This element contains the LDE part for LT1, i.e., spin pumping and MW pulses
    for the LT1 NV in the real experiment.
    """
    e = element.Element('LDE_LT1', pulsar = msmt.pulsar_lt1, global_time = True)

    # this pulse to ensure that the element has equal length as the lt2 element
    e.add(pulse.cp(msmt.SP_pulse,
            amplitude = 0,
            length = msmt.params['LDE_element_length']))
    #
    #1 SP
    e.add(pulse.cp(msmt.SP_pulse,
                amplitude = 0, 
                length = msmt.params_lt1['initial_delay']), 
            name = 'initial_delay')
    
    e.add(pulse.cp(msmt.SP_pulse, 
                length = msmt.params['LDE_SP_duration'], 
                amplitude = 1.0),
            name = 'spinpumping',
            refpulse = 'initial_delay')

    e.add(pulse.cp(msmt.yellow_pulse, 
                length = msmt.params['LDE_SP_duration_yellow'], 
                amplitude = 1. if msmt.params_lt1['AWG_yellow_use']  else 0.), 
            name = 'spinpumpingyellow', 
            refpulse = 'initial_delay')

    #2 MW pi/2
    if msmt.params_lt1['MW_during_LDE'] == 1:
        e.add(msmt.fast_pi2, name = 'mw_pi2_pulse', 
                start = msmt.params_lt1['MW_wait_after_SP'],
                refpulse = 'spinpumping', refpoint = 'end', refpoint_new = 'start')

    #3 MW pi
    if msmt.params_lt1['MW_during_LDE'] == 1:
        e.add(msmt.fast_pi, name = 'mw_pi_pulse',
                start = msmt.params_lt1['MW_separation'],
                refpulse = 'mw_pi2_pulse', refpoint = 'end', refpoint_new = 'start')
        
    ################
    
    if e.length() != msmt.params['LDE_element_length']:
        raise Exception('LDE element length' + e.name+' is not as specified - granularity issue?')
    return e
示例#52
0
def _lt3_wait_1us_element(msmt):
    """
    A 1us empty element we can use to replace 'real' elements for certain modes.
    """
    e = element.Element('wait_1_us', 
        pulsar = qt.pulsar)
    e.append(pulse.cp(msmt.T, length=1e-6))
    return e
示例#53
0
def _lt2_final_pi(msmt, name, time_offset, **kw):
    extra_t_before_pi = kw.pop('extra_t_before_pi', 0)
    CORPSE_pi_phase = kw.pop('CORPSE_pi_phase', 0)
    # around each pulse I make an element with length 1600e-9; 
    # the centre of the pulse is in the centre of the element.
    # this helps me to introduce the right waiting times, counting from centre of the pulses
    CORPSE_pi_wait_length = msmt.params_lt2['CORPSE_pi2_wait_length']  #- (msmt.CORPSE_pi2.length - 2*msmt.params_lt2['MW_pulse_mod_risetime'])/2 

    final_pi_elt = element.Element('second_pi_elt-{}'.format(name), pulsar= qt.pulsar, 
        global_time = True, time_offset = time_offset)
    final_pi_elt.append(pulse.cp(msmt.T, 
        length = CORPSE_pi_wait_length + extra_t_before_pi))
    final_pi_elt.append(pulse.cp(msmt.CORPSE_pi, 
        phase = CORPSE_pi_phase))
    final_pi_elt.append(pulse.cp(msmt.T, length =  100e-9 ))           

    return final_pi_elt
示例#54
0
def _lt1_dummy_element(msmt):
    """
    This is a dummy element. It contains nothing. 
    It replaces the LDE element if we do not want to do LDE.
    """
    e = element.Element('dummy', pulsar = msmt.pulsar_lt1, global_time = True)
    
    e.append(pulse.cp(msmt.T, length=10e-6))

    return e
示例#55
0
    def test_sequence(self):
        sync = pulse.SquarePulse(channel = 'HH_sync',
            length = 50e-9, amplitude = 2)
        sync_T = pulse.SquarePulse(channel = 'HH_sync',
            length = 1e-6, amplitude = 0)

        photon = pulse.SquarePulse(channel = 'HH_test',
            length = 50e-9, amplitude = 2)
        photon_T = pulse.SquarePulse(channel = 'HH_test',
            length = 1e-6, amplitude = 0)

        MA1 = pulse.SquarePulse(channel = 'HH_MA1',
            length = 50e-9, amplitude = 2)
        MA1_T = pulse.SquarePulse(channel = 'HH_MA1',
            length = 1e-6, amplitude = 0)

        no_syncs_elt = element.Element('photon_without_sync', pulsar=qt.pulsar)
        no_syncs_elt.append(photon)
        no_syncs_elt.append(pulse.cp(photon_T, length=1e-6))

        syncs_elt_mod0 = element.Element('2_syncs_photon_after_first', pulsar=qt.pulsar)
        syncs_elt_mod0.append(sync_T)
        s1 = syncs_elt_mod0.append(sync)
        syncs_elt_mod0.append(pulse.cp(sync_T, length=500e-9))
        s2 = syncs_elt_mod0.append(sync)
        syncs_elt_mod0.append(pulse.cp(sync_T, length=10e-6))
        syncs_elt_mod0.add(photon,
            start = 50e-9,
            refpulse = s1)

        seq = pulsar.Sequence('HH_testing')
        seq.append(name = 'photon_without_sync',
            wfname = no_syncs_elt.name,
            repetitions = 100)
        seq.append(name = 'photon_after_sync1',
            wfname = syncs_elt_mod0.name,
            repetitions = 100)

        qt.pulsar.upload(no_syncs_elt, syncs_elt_mod0)
        qt.pulsar.program_sequence(seq)

        self.AWG.set_runmode('SEQ')
        self.AWG.start()
示例#56
0
    def get_sweep_elements(self):        
        elts = []

        for i in range(self.params['pts']):
            e = element.Element('CNOTPHaseCheck_pt-{}'.format(i), pulsar=qt.pulsar, global_time = True)
            e.append(self.T)
            e.append(self.shelving_pulse)
            e.append(self.T)
            e.append(self.N_pi2)
            e.append(pulse.cp(self.T, length=200e-9))
            e.append(pulse.cp(self.pi2pi_m1, phase = self.params['CNOT_phase'][i]))
            e.append(self.TIQ)
            e.append(self.pi2pi_m1)
            e.append(pulse.cp(self.T, length = 200e-9))
            e.append(self.N_pi2)

            elts.append(e)

        return elts
示例#57
0
    def get_sweep_elements(self):
        e = element.Element('Hadamard', pulsar=qt.pulsar)
        e.append(self.T)
        e.append(self.shelving_pulse)
        e.append(pulse.cp(self.T, length=100e-9))
        
        # this is for using the detuned pi pulse
        # prep_name = e.append(pulse.cp(self.N_pi2,
        #     phase = BSM.phaseref(self.N_pi2.frequency, 
        #         -self.N_pi2.length) - 90.,
        #     amplitude = 1))

        # hadamard_name = e.append(pulse.cp(self.N_pulse,
        #     frequency = self.N_pi.frequency - self.params['N_rabi_frequency'],
        #     length = self.N_pi.length / np.sqrt(2),
        #     amplitude = 1,
        #     phase = 36.5))

        # t = e.length()-e.pulse_start_time(hadamard_name, 'RF')

        # this is by using two rotations around x/y -- This works much better!

        prep_name = e.append(pulse.cp(self.N_pi2,
            phase = -90,
            amplitude = 1))

        # first a pi/2 over +Y
        h_pi2_name = e.append(pulse.cp(self.N_pi2,
            phase = BSM.phaseref(self.N_pi2.frequency, 
                e.pulse_length(prep_name)),
            amplitude = 1))
        
        # then a pi over +X
        h_pi_name = e.append(pulse.cp(self.N_pi,
            phase = BSM.phaseref(self.N_pi2.frequency,
                e.pulse_length(prep_name)+e.pulse_length(h_pi2_name)) + 90.,
            amplitude = 1))

        self.element = e
        self.params['tomo_time_offset'] = e.length() - e.pulse_start_time(prep_name, 'RF')

        return BSM.NTomo.get_sweep_elements(self)
示例#58
0
    def test_BSM_superposition_in(self):
        sweep_elements = []
        self.flattened_elements = []
        self.seq = pulsar.Sequence('{}_{}-Sequence'.format(self.mprefix, 
            self.name))
 
        e_pi2_elt = element.Element('e_pi2', pulsar = qt.pulsar, 
            global_time = True, time_offset =0)

        e_pi2_elt.append(pulse.cp(self.TIQ, 
            length = 800e-9))

        e_pi2_elt.append(self.fast_pi2)

        e_pi2_elt.append(pulse.cp(self.TIQ, 
            length = 200e-9))

        
        UNROT_N_init = self.UNROT_element('N_init',
            self.N_pi2, 
            self.params_lt1['pi2_evolution_time']-self.fast_pi2.length/2 -200E-9, 
            #Above time: to start time at centre pi/2, and to subtract waiting time after pi/2
            e_pi2_elt.length(), 
            end_offset_time = self.fast_pi2.length/2 + 200e-9 - 240e-9)
            #end_offset time: to get 'pi2_evolution_time', 
            #and compensate for CNOT time in next element 
        
        for i in range(self.params['pts']):
            
            CNOT, UNROT_H = self.BSM_elements('{}'.format(i), 
                time_offset = e_pi2_elt.length()+UNROT_N_init.length(),
                H_phase = self.params_lt1['H_phases'][i], 
                evolution_time = self.params_lt1['H_evolution_times'][i])
            
            self.flattened_elements.append(e_pi2_elt)
            self.flattened_elements.append(UNROT_N_init)
            self.flattened_elements.append(CNOT)
            self.flattened_elements.append(UNROT_H)
            sweep_elements.append([e_pi2_elt,UNROT_N_init,CNOT, UNROT_H])
            
        self.seq = self._add_MBI_and_sweep_elements_to_sequence(
            sweep_elements, self.N_RO_CNOT_elt, self.adwin_lt1_trigger_element)
    def generate_sequence(self, upload=True, **kw):

        T = pulse.SquarePulse(channel='MW_pulsemod',
            length = 10e-9, amplitude = 0)
        CORPSE_pi = self.CORPSE_pi
        CORPSE_pi2 = self.CORPSE_pi2

        sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar)
        adwin_sync = pulse.SquarePulse(channel='adwin_sync',
            length = 10e-6, amplitude = 2)
        sync_elt.append(adwin_sync)

        elts = []
        seq = pulsar.Sequence('Zeroth revival sequence')

        for i in range(self.params['pts']):
            e = element.Element('pi2_pi_pi2-{}'.format(i), pulsar= qt.pulsar,
            global_time = True, time_offset = 0.)
            e.append(T)
            e.append(CORPSE_pi2)
            e.append(pulse.cp(T,
                length = self.params['free_evolution_times'][i]))
            e.append(CORPSE_pi)
            e.append(pulse.cp(T,
                length = self.params['free_evolution_times'][i]))
            e.append(pulse.cp(CORPSE_pi2,
                phase = self.params['pi2_phases'][i]))
            e.append(T)

            elts.append(e)

            seq.append(name='pi2_pi_pi2-{}'.format(i),
                wfname = e.name,
                trigger_wait = True )

            seq.append(name='sync-{}'.format(i),
                wfname = sync_elt.name)


        if upload:
            qt.pulsar.upload(sync_elt, *elts)
        qt.pulsar.program_sequence(seq)
示例#60
0
    def _BS_element(self, name, bs, **kw):
        
        ### make the element
        BS_elt = element.Element('BS-{}'.format(name), 
            pulsar = qt.pulsar,
            global_time = True)
        BS_elt.append(self.TIQ)
        BS_elt.append(self.shelving_pulse)
        BS_elt.append(pulse.cp(self.TIQ, length = 200e-9))
       
        N_rot_name = BS_elt.append(pulse.cp(self.N_pi2))
        BS_elt.append(self.TIQ)
        
        if bs == 'phi':
            CNOT = pulse.cp(self.pi2pi_0)            
        elif bs == 'psi':
            CNOT = pulse.cp(self.pi2pi_m1)
        CNOT_name = BS_elt.append(CNOT)

        return BS_elt