def get_sweep_elements(self): elts = [] for i in range(self.params['pts']): e = element.Element('NRabi_pt-{}'.format(i), pulsar=qt.pulsar) e.append(self.T) e.append(self.shelving_pulse) e.append(self.T) for j in range(self.params['RF_pulse_multiplicities'][i]): e.append( pulse.cp(self.N_pulse, frequency=self.params['RF_pulse_frqs'][i], amplitude=self.params['RF_pulse_amps'][i], length=self.params['RF_pulse_durations'][i])) e.append( pulse.cp(self.TN, length=self.params['RF_pulse_delays'][i])) elts.append(e) return elts
def _lt2_final_pi2(msmt, name, time_offset, **kw): extra_t_before_pi2 = kw.pop('extra_t_before_pi2', 0) CORPSE_pi2_phase = kw.pop('CORPSE_pi2_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_pi2_wait_length = msmt.params_lt2[ 'CORPSE_pi2_wait_length'] #- (msmt.CORPSE_pi2.length - 2*msmt.params_lt2['MW_pulse_mod_risetime'])/2 second_pi2_elt = element.Element('second_pi2_elt-{}'.format(name), pulsar=qt.pulsar, global_time=True, time_offset=time_offset) second_pi2_elt.append( pulse.cp(msmt.T, length=CORPSE_pi2_wait_length + extra_t_before_pi2)) second_pi2_elt.append(pulse.cp(msmt.CORPSE_pi2, phase=CORPSE_pi2_phase)) second_pi2_elt.append(pulse.cp(msmt.T, length=100e-9)) return second_pi2_elt
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
def _RO_element(self, name='RO'): # 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 ro_element = element.Element(name, pulsar=qt.pulsar) ro_element.add(adwin_trigger_pulse, name='adwin_trigger') ro_element.add(T, name='wait2', refpulse='adwin_trigger', refpoint='end') ro_element.add(sq_AOMpulse, name='GreenLight', refpulse='wait2', refpoint='end') ro_element.add(sync, name='Sync', refpulse='wait2', refpoint='end') ro_element.add(pulse.cp(T, length=self.params['time_between_syncs']), name='wait3', refpulse='Sync', refpoint='end') ro_element.add(sync, name='Sync2', refpulse='wait3', refpoint='end') ro_element.add(pulse.cp(T, length=2.5e-6), name='wait_for_singlet', refpulse='GreenLight', refpoint='end') return ro_element
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)
def _lt3_first_pi2(msmt, **kw): init_ms1 = kw.pop('init_ms1', False) # 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_pi2_wait_length = msmt.params['CORPSE_pi2_wait_length'] #- (msmt.CORPSE_pi2.length - 2*msmt.params['MW_pulse_mod_risetime'])/2 first_pi2_elt = element.Element('first_pi2_elt', pulsar= qt.pulsar, global_time = True, time_offset = 0.) first_pi2_elt.append(pulse.cp(msmt.T, length = 100e-9)) if init_ms1: first_pi2_elt.append(pulse.cp(msmt.CORPSE_pi)) first_pi2_elt.append(pulse.cp(msmt.T, length = 100e-9)) first_pi2_elt.append(pulse.cp(msmt.CORPSE_pi2)) first_pi2_elt.append(pulse.cp(msmt.T, length = CORPSE_pi2_wait_length)) return first_pi2_elt
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
def generate_sequence(self, upload=True): # load all the other pulsar resources self._pulse_defs() self.sweep_elements = self.get_sweep_elements() # CNOT element for nuclear spin readout N_RO_CNOT_elt = element.Element('N-RO CNOT', pulsar=qt.pulsar) 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) # 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)
def _lt4_sequence_start_element(msmt): """ first element of a two-setup sequence. Sends a trigger to AWG lt3 """ e = element.Element('LDE_start', pulsar=qt.pulsar) e.append(msmt.T_sync) ref_p = e.append(msmt.sync) e.add(pulse.cp(msmt.T_sync, length=msmt.params['AWG_wait_for_lt3_start']), refpulse=ref_p, refpoint='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
def turn_on_pulse(): p = pulse.SinePulse(channel='EOM_Matisse', name='pp', length=100e-6, frequency=1 / (100e-6), amplitude=1.8) qt.pulsar.set_channel_opt('EOM_AOM_Matisse', 'low', 1.0) e = element.Element('Sinde', pulsar=qt.pulsar) e.append(p) e.print_overview() s = pulsar.Sequence('Sinde') s.append(name='Sine', wfname=e.name, trigger_wait=0) qt.pulsar.upload(e) qt.pulsar.program_sequence(s) AWG.set_runmode('SEQ') AWG.start() while 1: if (msvcrt.kbhit() and (msvcrt.getch() == 'q')): break qt.msleep(0.1) AWG.stop() AWG.set_runmode('CONT') qt.pulsar.set_channel_opt('EOM_AOM_Matisse', 'low', 0.0)
def generate_sequence(self, upload=True): #print 'test' # define the necessary pulses X = pulselib.MW_IQmod_pulse('Weak pi-pulse', I_channel='MW_1', Q_channel='dummy', PM_channel='MW_pulsemod', frequency = self.params['MW_pulse_frequency'], PM_risetime = self.params['MW_pulse_mod_risetime']) X.channels.remove('dummy') T = pulse.SquarePulse(channel='MW_1', 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)
def _lt1_BSM_elements(msmt, name, time_offset, **kw): CNOT_phase_shift = kw.pop('CNOT_phase_shift', 0) evo_time = kw.pop('evolution_time', msmt.params_lt1['H_evolution_time']) H_phase = kw.pop('H_phase', 0) start_buffer_time = msmt.params_lt1['buffer_time_for_CNOT'] evo_offset = 1000e-9 eff_evo_time = evo_time - evo_offset # we make the evolution time a bit shorter ( evo_offset = 1000 ns), # then make an extra # element of length start_buffer_time plus this offset. # in this element we put the CNOT pulse such that it's centered # at the start of the effective evolution time (end - 1000 ns). CNOT_elt = element.Element('{}_BSM-CNOT'.format(name), pulsar=msmt.pulsar_lt1, global_time=True, time_offset=time_offset) t_CNOT = start_buffer_time - msmt.pi2pi_m1.effective_length() / 2. CNOT_elt.append(pulse.cp(msmt.TIQ, length=t_CNOT)) CNOT_elt.append(pulse.cp(msmt.pi2pi_m1, phase=CNOT_phase_shift)) CNOT_elt.append( pulse.cp(msmt.TIQ, length=evo_offset - msmt.pi2pi_m1.effective_length() / 2.)) #do the BSM with just a pi/2 along the y axis. H_pulses = [pulse.cp(msmt.N_pi2, phase=H_phase)] #, # pulse.cp(msmt.N_pi, phase= H_phase+90.) ] UNROT_elt = _lt1_UNROT_element(msmt, '{}_BSM-UNROT-H'.format(name), H_pulses, eff_evo_time, time_offset + CNOT_elt.length(), **kw) return CNOT_elt, UNROT_elt
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( pulse.cp(self.N_pi2, phase=self.params['prepare_phases'][i])) e.append(pulse.cp(self.T, length=200e-9)) e.append(self.pi2pi_0) e.append(pulse.cp(self.TIQ, length=456e-9 - 406e-9)) #=1/A - 2*1/2*pi2pi e.append(self.pi2pi_0) 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
import numpy as np import logging import qt import hdf5_data as h5 import time from measurement.lib.cython.hh_optimize import hht4 import measurement.lib.config.adwins as adwins_cfg import measurement.lib.measurement2.measurement as m2 from measurement.lib.pulsar import pulse, pulselib, element, pulsar e = element.Element('opt_pulse', clock=1e9, min_samples=0, pulsar=qt.pulsar) opt_pulse = pulselib.EOMAOMPulse('Eom Aom Pulse', eom_channel = 'EOM_Matisse', aom_channel = 'EOM_AOM_Matisse') square_pulse = pulse.SquarePulse(channel = 'EOM_Matisse', length = 50e-9, amplitude = 1.0) qt.pulsar.set_channel_opt('EOM_AOM_Matisse','high', 0.5) e.add(opt_pulse) e.add(square_pulse(amplitude = 0), refpulse = 'Eom Aom Pulse-0', refpoint = 'end', refpoint_new = 'end') e.add(pulse.cp(square_pulse, amplitude = 0.5, channel = 'EOM_AOM_Matisse'), refpulse = 'Eom Aom Pulse-0',\ start = 70e-9, refpoint_new = 'end') qt.pulsar.upload(e) seq = pulsar.Sequence('Opt Test')
def generate_sequence(self, upload=True, **kw): # define the necessary pulses # rotations pulse_pi2 = kw.get('pulse_pi2', None) pulse_pi = kw.get('pulse_pi', None) evolution_1_self_trigger = kw.get('evolution_1_self_trigger', True) evolution_2_self_trigger = kw.get('evolution_2_self_trigger', True) # waiting element empty_pulse = pulse.SquarePulse(channel='adwin_sync', name='delay', length = 1000e-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.) HH_sync = pulse.SquarePulse( channel='sync', length=self.params['delay_HH_sync_duration'], amplitude=2. ) HH_trigger = pulse.SquarePulse( channel='self_trigger_sync', length=self.params['delay_HH_trigger_duration'], amplitude=2. ) initial_pulse_delay = 3e-6 # make the elements, one for each evolution time elements = [] for i in range(self.params['pts']): e = element.Element('ElectronT2_triggered_pt-%d_A' % i, pulsar=qt.pulsar) initial_wait_id = e.add(pulse.cp(empty_pulse, length = initial_pulse_delay)) if self.params['do_delay_HH_trigger'] > 0: e.add( HH_sync, refpulse=initial_wait_id, refpoint='start', refpoint_new='start', start=self.params['delay_HH_sync_offset'] ) first_pulse_id = e.add( pulse.cp(pulse_pi2), refpulse=initial_wait_id, refpoint='end', start=0.0 ) if (evolution_1_self_trigger): # tie the self trigger pulse to the center of the pi/2 pulse e.add(pulse.cp(self_trigger), refpulse = first_pulse_id, refpoint = 'center', # used to be end during fixed delay runs refpoint_new = 'start', start = ( self.params['refocussing_time'][i] + self.params['defocussing_offset'][i] - self.params['self_trigger_delay'][i] + self.params['self_trigger_pulse_timing_offset'] )) if self.params['do_delay_HH_trigger'] > 0: e.add(pulse.cp(HH_trigger), refpulse=first_pulse_id, refpoint='center', # used to be end during fixed delay runs refpoint_new='start', start=( self.params['refocussing_time'][i] + self.params['defocussing_offset'][i] - self.params['self_trigger_delay'][i] + self.params['self_trigger_pulse_timing_offset'] )) elements.append(e) # we need to tie the start of the element to the center of the pi-pulse # if we would do this naively by just starting the pi-pulse at the beginning of # the element, the effective delay would change for different pulse lengths # or pulsemod delays because they would shift the pi-pulse around with respect # to the start of the element e = element.Element('ElectronT2_triggered_pt-%d_B' % i, pulsar=qt.pulsar) dummy_start_pulse_1 = e.add(pulse.cp(empty_pulse, length=10e-9)) second_pulse_id = e.add(pulse.cp(pulse_pi), refpulse = dummy_start_pulse_1, refpoint = 'start', refpoint_new = 'center', start = self.params['delayed_element_run_up_time'] ) else: second_pulse_id = e.add(pulse.cp(pulse_pi), refpulse = first_pulse_id, refpoint = 'center', refpoint_new = 'center', start = ( self.params['refocussing_time'][i] + self.params['defocussing_offset'][i] ) ) if (evolution_2_self_trigger): e.add(pulse.cp(self_trigger), refpulse = second_pulse_id, refpoint = 'center', # used to be end during fixed delay runs refpoint_new = 'start', start = ( self.params['refocussing_time'][i] - self.params['self_trigger_delay'][i] + self.params['self_trigger_pulse_timing_offset'] )) if self.params['do_delay_HH_trigger'] > 0: e.add(pulse.cp(HH_trigger), refpulse=second_pulse_id, refpoint='center', # used to be end during fixed delay runs refpoint_new='start', start=( self.params['refocussing_time'][i] - self.params['self_trigger_delay'][i] + self.params['self_trigger_pulse_timing_offset'] )) elements.append(e) # same story about tieing the start of the element to the center of the pulse # applies here e = element.Element('ElectronT2_triggered_pt-%d_C' % i, pulsar=qt.pulsar) dummy_start_pulse_2 = e.add(pulse.cp(empty_pulse, length=10e-9)) final_pulse_id = e.add(pulse.cp(pulse_pi2), refpulse = dummy_start_pulse_2, refpoint = 'start', refpoint_new = 'center', start = self.params['delayed_element_run_up_time'] ) else: final_pulse_id = e.add(pulse.cp(pulse_pi2), refpulse = second_pulse_id, refpoint = 'center', refpoint_new = 'center', start = self.params['refocussing_time'][i] ) adwin_sync_id = e.add(adwin_sync, refpulse=final_pulse_id) e.add(pulse.cp(adwin_sync, length=10e-9, amplitude = 0.), refpulse=adwin_sync_id) elements.append(e) # return_e=e # create a sequence from the pulses seq = pulsar.Sequence('Electron refocussing with delay trigger 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)
def generate_sequence(self, upload=True, **kw): ### # First let us define the necessary pulses. ### self.pulse_dict = {'x' : kw.get('x_pulse_pi2', None), 'y': kw.get('y_pulse_pi2', None), 'u': kw.get('x_pulse_pi', None), 'v': kw.get('y_pulse_pi', None)} self.empty = pulse.cp(self.pulse_dict['x'], amplitude = 0.) self.pulse_dict['e'] = self.empty # waiting element self.T = pulse.SquarePulse(channel='MW_Imod', name='delay', length = 3000e-9, amplitude = 0.) # Adwin sync pulse that we need to send out after each sequence self.adwin_sync = pulse.SquarePulse(channel='adwin_sync', length = self.params['AWG_to_adwin_ttl_trigger_duration'], amplitude = 2) ### # Now let us create the sequence, including the germs. ### elements = [] #A counting index that we use to cross-reference the pulse timings w.r.t. the last sequence self.n = 0 for k in range(self.params['pts']): self.e1 = element.Element('Single_germ_sequence_%d' % self.params['run_numbers'][k], pulsar=qt.pulsar, global_time = True) #First do carbon initialization elements.append(pulsar_msmt.MBI._MBI_element(self, name='CNOT%d' % k)) self.e1.add(pulse.cp(self.T, length = self.params['initial_msmt_delay']), name='pulse%d' % self.n, refpoint_new = 'start') self.n +=1 self.last_pi = False self.generate_subsequence(seq=self.params['fid_1'][k]) for i in range(self.params['N_decoupling'][k]): self.generate_subsequence(seq=self.params['germ'][k]) self.generate_subsequence(seq=self.params['fid_2'][k]) self.e1.add(self.adwin_sync, refpulse = 'pulse%d' % (self.n-1), refpoint = 'end', refpoint_new = 'start') elements.append(self.e1) # create a sequence from the pulses seq = pulsar.Sequence('Single germ sequence with AWG timing 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)
def generate_sequence(self, pi = True, single_decoupling = False, upload=True, **kw): #Variable to count pulse names up self.n = 1 ### # First let us define the necessary pulses. ### # rotations pi2 self.pulse_xpi2 = kw.get('x_pulse_pi2', None) self.pulse_ypi2 = kw.get('y_pulse_pi2', None) self.pulse_mxpi2 = kw.get('x_pulse_mpi2', None) self.pulse_mypi2 = kw.get('y_pulse_mpi2', None) # rotations pi self.pulse_xpi = kw.get('x_pulse_pi', None) self.pulse_ypi = kw.get('y_pulse_pi', None) self.pulse_mxpi = kw.get('x_pulse_mpi', None) self.pulse_mypi = kw.get('y_pulse_mpi', None) # waiting element self.T = pulse.SquarePulse(channel='MW_Imod', name='delay', length = 3000e-9, amplitude = 0.) # Adwin sync plse that we need to send out after each sequence self.adwin_sync = pulse.SquarePulse(channel='adwin_sync', length = self.params['AWG_to_adwin_ttl_trigger_duration'], amplitude = 2) ### # Now let us create the decoupling sequence, including the germs. ### elements = [] ### #Apply the right name for spacing the pulses correctly ### if pi: self.pi_name = 'Hermite_pi_length' else: self.pi_name = 'Hermite_pi2_length' for k in range(self.params['pts']): # print self.params['run_numbers'][k] self.e1 = element.Element('Germ_sequence_%d' % self.params['run_numbers'][k], pulsar=qt.pulsar, global_time = True) if single_decoupling: #Make a decoupling list, using always xy8, or individual germs decoupling_seq = self.generate_decoupling_list(k) #Initialize the C13 spin elements.append(pulsar_msmt.MBI._MBI_element(self, name='CNOT%d' % k)) self.e1.add(pulse.cp(self.T, length = self.params['initial_msmt_delay']), name='pulse%d' % self.n, refpoint_new = 'start') self.n +=1 #Generate the first fiducial self.generate_subsequence(first_fiducial = True, seq=self.params['fid_1'][k]) #Generate the first decoupling pulse if we have a sequence with decoupling pulses everywhere, or otherwise full xy8 if single_decoupling: self.generate_pi(decoupling_seq[0]) else: self.generate_xy8() for i in range(0, self.params['N_decoupling'][k]): self.generate_subsequence(seq=self.params['germ'][k]) if single_decoupling: self.generate_pi(decoupling_seq[i]) else: self.generate_xy8() self.generate_subsequence(seq=self.params['fid_2'][k]) self.pulse_caller(pulsetype = self.adwin_sync, start=0) elements.append(self.e1) # create a sequence from the pulses seq = pulsar.Sequence('Single germ sequence with AWG timing 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)
def generate_sequence(self, upload=True): #define the pulses sync = pulse.SquarePulse(channel='sync', length=self.params['pq_sync_length'], amplitude=1.0) 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'] adwin_trigger_pulse = pulse.SquarePulse(channel='adwin_sync', length=1590e-9, amplitude=2) X = pulselib.MW_IQmod_pulse( 'Rabi_MW_pulse', I_channel='MW_Imod', Q_channel='MW_Qmod', PM_channel='MW_pulsemod', amplitude=self.params['ssbmod_amplitude'], frequency=self.params['MW_modulation_frequency'], PM_risetime=self.params['MW_pulse_mod_risetime']) T = pulse.SquarePulse(channel='MW_Imod', name='Wait', length=500e-9) seq = pulsar.Sequence('RabiOsci sequence') #need one spin polarization pulse at the beginning. init = element.Element('initialize', pulsar=qt.pulsar) init.add(pulse.cp(sq_AOMpulse, length=1e-6, amplitude=0), name='wait') init.add(sq_AOMpulse, name='init', refpulse='wait') #generate a list of pulse elements. One for each modulation freuqency elements = [] elements.append(init) seq.append(name=init.name, wfname=init.name, trigger_wait=True) for k, t in enumerate(self.params['sweep_pts']): e = element.Element('Rabi_length-%d' % k, pulsar=qt.pulsar) if k == 0: first_dp_element = e.name e.add(T(length=1500e-9), name='wait') e.add(adwin_trigger_pulse, name='adwin_trigger', refpulse='wait', refpoint='start') e.add(X(length=self.params['MW_pulse_durations'][k], frequency=self.params['MW_modulation_frequencies'][k]), name='MWpulse', refpulse='wait', refpoint='end') e.add(T, name='wait2', refpulse='MWpulse', refpoint='end') e.add(sq_AOMpulse, name='GreenLight', refpulse='wait2', refpoint='end') e.add(sync, name='Sync', refpulse='wait2', refpoint='end') e.add(pulse.cp(T, length=self.params['time_between_syncs']), name='wait3', refpulse='Sync', refpoint='end') e.add(sync, name='Sync2', refpulse='wait3', refpoint='end') elements.append(e) seq.append(name=e.name, wfname=e.name, trigger_wait=False, jump_target=init.name) #insert a delay at the end of the sequence such that all outputs of the AWG stay low. end = element.Element('ending delay', pulsar=qt.pulsar) end.add(pulse.cp(sq_AOMpulse, length=1e-6, amplitude=0), name='delay') elements.append(end) seq.append(name=end.name, wfname=end.name, goto_target=first_dp_element, jump_target=init.name) if upload: if upload == 'old_method': qt.pulsar.upload(*elements) qt.pulsar.program_sequence(seq, loop=False) else: qt.pulsar.program_awg(seq, *elements, loop=False)
def generate_LDE_rephasing_elt(msmt,Gate,**kw): """ Attaches the LDE rephasing element to the a DD_2 gate object. The element encompasses one pi pulse or a pi/2 pulse. Input: Gate object Output: None """ _create_wait_times(Gate) _create_syncs_and_triggers(msmt,Gate) _create_mw_pulses(msmt,Gate) _create_laser_pulses(msmt,Gate) #### calculate the time after the first pi/2 pulse: ### first: how far is the pi pulse in the sequence away from the end of the LDe element echo_time = msmt.joint_params['LDE_element_length']-msmt.params['MW_repump_distance']-msmt.params['LDE_SP_duration'] echo_time -= msmt.params['LDE_SP_delay'] + msmt.params['LDE_decouple_time'] if msmt.params['check_EOM_projective_noise'] > 0: echo_time -= 500e-9 # bodged as above ### calculate the time for the pi/2 pulse to come in echo_time = msmt.params['LDE_decouple_time'] - echo_time echo_time += msmt.params['MW_final_delay_offset'] # dirty hack. has to be calibrated once. See sweep_single_click_ent_expm.py end_delay_refpulse = 'initial_delay' ### length of the element is calculated according to the required echo condition e = element.Element(Gate.name, pulsar = qt.pulsar) e.add(pulse.cp(Gate.AWG_repump, amplitude = 0, length = echo_time + 2*msmt.params['dynamic_decoupling_tau'] ) ) e.add(pulse.cp(Gate.AWG_repump, amplitude = 0, length = msmt.joint_params['initial_delay']), name = 'initial_delay') if msmt.joint_params['do_final_mw_LDE'] == 1 and (not msmt.params['MW_RO_pulse_in_LDE'] == 1): if msmt.params['do_dynamical_decoupling'] + msmt.params['do_dynamical_decoupling_AWG_only'] > 0: e.add(pulse.cp(Gate.mw_X,phase = msmt.params['Y_phase']), start = echo_time+msmt.params['dynamic_decoupling_tau'], refpulse = 'initial_delay', refpoint = 'start', refpoint_new = 'center', name = 'MW_RO_rotation') else: ### this contains our RO definitions tomo_dict = { 'X': pulse.cp(Gate.mw_pi2,phase = msmt.params['LDE_final_mw_phase']), #### check this!!! 'Y': pulse.cp(Gate.mw_pi2,phase = msmt.params['LDE_final_mw_phase']+90), 'Z': pulse.cp(Gate.mw_pi2, amplitude = 0) } e.add(tomo_dict[msmt.params['tomography_basis']], start = echo_time, refpulse = 'initial_delay', refpoint = 'start', refpoint_new = 'center', name = 'MW_RO_rotation') if msmt.params['PLU_during_LDE'] == 1 and qt.current_setup == 'lt3': ### this pulse is supposed to turn off the plu signal to both adwins e.add(pulse.cp(Gate.plu_gate, length = msmt.params['PLU_gate_3_duration']), name = 'plu for adwin', start = 50.2e-6, ## arbitrarily chosen number refpulse = 'initial_delay') Gate.elements = [e]
def generate_sequence(do_program=True): # FIXME in principle we only want to create that once, at startup try: del qt.pulsar except: pass qt.pulsar = pulsar.Pulsar() qt.pulsar.AWG_sequence_cfg = { 'SAMPLING_RATE': 1e9, 'CLOCK_SOURCE': 1, # Internal | External 'REFERENCE_SOURCE': 2, # Internal | External 'EXTERNAL_REFERENCE_TYPE': 1, # Fixed | Variable 'REFERENCE_CLOCK_FREQUENCY_SELECTION': 1, #10 MHz | 20 MHz | 100 MHz 'TRIGGER_SOURCE': 1, # External | Internal 'TRIGGER_INPUT_IMPEDANCE': 1, # 50 ohm | 1 kohm 'TRIGGER_INPUT_SLOPE': 1, # Positive | Negative 'TRIGGER_INPUT_POLARITY': 1, # Positive | Negative 'TRIGGER_INPUT_THRESHOLD': 1.4, # V 'EVENT_INPUT_IMPEDANCE': 2, # 50 ohm | 1 kohm 'EVENT_INPUT_POLARITY': 1, # Positive | Negative 'EVENT_INPUT_THRESHOLD': 1.4, #V 'JUMP_TIMING': 1, # Sync | Async 'RUN_MODE': 4, # Continuous | Triggered | Gated | Sequence 'RUN_STATE': 0, # On | Off } qt.pulsar.define_channel(id='ch2', name='gate', type='analog', high=4.0, low=0, offset=0., delay=0., active=True) qt.pulsar.define_channel(id='ch2_marker1', name='clock', type='marker', high=1.0, low=0, offset=0., delay=0., active=True) pulse_length = 2e-9 gate = pulse.SquarePulse(channel='gate') clock_up = pulse.SquarePulse(channel='clock', amplitude=4.0, lenght=pulse_length) clock_down = pulse.SquarePulse(channel='clock', amplitude=0, lenght=pulse_length) elt1 = element.Element('trigger', pulsar=qt.pulsar) elt1.append(pulse.cp(clock_down, amplitude=0, length=5e-9)) for i in arange(500): elt1.append(pulse.cp(clock_up, amplitude=4.0, length=pulse_length)) elt1.append(pulse.cp(clock_down, amplitude=0, length=pulse_length)) elt1.append(pulse.cp(clock_down, amplitude=0, length=1000e-9)) elt1.add(pulse.cp(gate, amplitude=4.0, length=200 * pulse_length)) for i in arange(2): elt1.append(pulse.cp(clock_up, amplitude=4.0, length=pulse_length)) elt1.append(pulse.cp(clock_down, amplitude=0, length=pulse_length)) #pprint.pprint (elt1.pulses) seq = pulsar.Sequence('FPGA_test') seq.append(name='trigger', wfname=elt1.name, trigger_wait=False, repetitions=100) #pprint.pprint (seq.elements) qt.pulsar.upload(elt1) qt.pulsar.program_sequence(seq)
def generate_sequence(self, upload=True): # load all the other pulsar resources self._pulse_defs() self.slow_cw_mI0 = pulselib.MW_IQmod_pulse('slow_cw_mI0', I_channel = 'MW_Imod', Q_channel = 'MW_Qmod', PM_channel = 'MW_pulsemod', PM_risetime = 0, frequency = self.params['mI0_mod_frq'], amplitude = self.params['mw_amp'], length = self.params['sp_mw_el_duration']) self.slow_cw_mIp1 = pulselib.MW_IQmod_pulse('slow_cw_mIp1', I_channel = 'MW_Imod', Q_channel = 'MW_Qmod', PM_channel = 'MW_pulsemod', PM_risetime = 0, frequency = self.params['mIp1_mod_frq'], amplitude = self.params['mw_amp'], length = self.params['sp_mw_el_duration']) self.FT_pulse = pulse.SquarePulse(channel='Velocity1AOM', length = self.params['sp_mw_el_duration'], amplitude = self.params['FT_pulse_amp']) # self.yel_pulse = pulse.SquarePulse(channel='YellowAOM', # length = 10e-6, amplitude = self.params['FT_pulse_amp']) N_RO_CNOT_elt = element.Element('N-RO CNOT', pulsar=qt.pulsar) N_RO_CNOT_elt.append(pulse.cp(self.T, length=500e-9)) if self.params['readout_line'] == '-1': N_RO_CNOT_elt.append(self.pi2pi_m1) elif self.params['readout_line'] == '0': N_RO_CNOT_elt.append(self.pi2pi_0) elif self.params['readout_line'] == '+1': N_RO_CNOT_elt.append(self.pi2pi_p1) else: raise(Exception('Unknown readout line' + str(m.params['readout_line']))) # make the list of elements required for uploading e = element.Element('N_FT_Polarisation', pulsar=qt.pulsar, ignore_delays=True) e.add(self.FT_pulse) e.add(self.slow_cw_mI0) e.add(self.slow_cw_mIp1) e_sp = element.Element('final_SP', pulsar=qt.pulsar) e_sp.add(pulse.cp(self.FT_pulse(length=50e-6))) # create the sequence seq = pulsar.Sequence('N_FT_Polarisation_Check_sequence') for i,r in enumerate(self.params['FT_element_repetitions']): # 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= r, trigger_wait = True) seq.append(name = 'final_sp'+str(i), wfname=e_sp.name, trigger_wait=False) seq.append(name='N_ro'+str(i), wfname=N_RO_CNOT_elt.name, trigger_wait=False) seq.append(name = 'sync-{}'.format(i), wfname = self.sync_elt.name) # program AWG if upload: qt.pulsar.upload(self.mbi_elt, e, N_RO_CNOT_elt,self.sync_elt,e_sp) qt.pulsar.program_sequence(seq)
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']) N_RO_CNOT_elt = element.Element('N-RO CNOT', pulsar=qt.pulsar) N_RO_CNOT_elt.append(pulse.cp(self.T, length=500e-9)) if self.params['readout_line'] == '-1': N_RO_CNOT_elt.append(self.pi2pi_m1) elif self.params['readout_line'] == '0': N_RO_CNOT_elt.append(self.pi2pi_0) elif self.params['readout_line'] == '+1': N_RO_CNOT_elt.append(self.pi2pi_p1) else: raise(Exception('Unknown readout line' + str(m.params['readout_line']))) # 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_sequence') for i,r in enumerate(self.params['FT_element_repetitions']): # 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= r, trigger_wait = True) seq.append(name='N_ro'+str(i), wfname=N_RO_CNOT_elt.name, trigger_wait=False) seq.append(name = 'sync-{}'.format(i), wfname = self.sync_elt.name) # program AWG if upload: qt.pulsar.upload(self.mbi_elt, e, N_RO_CNOT_elt,self.sync_elt) qt.pulsar.program_sequence(seq)
def generate_test_sequence(): sync = pulse.SquarePulse(channel = 'sync', length = 50e-9, amplitude = 2) sync_T = pulse.SquarePulse(channel = 'sync', length = 1e-6, amplitude = 0) ch0 = pulse.SquarePulse(channel = 'AOM_Yellow', length = 50e-9, amplitude = 2) #photon_T = pulse.SquarePulse(channel = 'AOM_Yellow', # length = 1e-6, amplitude = 0) ch1 = pulse.SquarePulse(channel = 'RND_halt', length = 50e-9, amplitude = 2) #MA1_T = pulse.SquarePulse(channel = 'RND_halt', # length = 1e-6, amplitude = 0) elt = element.Element('photon_without_sync', pulsar=qt.pulsar) elt.add(sync_T, name='sync_T') elt.add(sync, refpulse='sync_T', name='sync') elt.add(ch0, start = 500e-9, refpulse = 'sync', refpoint = 'start') elt.add(ch1, start = 250e-9, refpulse = 'sync', refpoint = 'start') #elt.append(pulse.cp(photon_T, length=1e-6)) elt2 = element.Element('sync_only', pulsar=qt.pulsar) elt2.add(sync_T, name='sync_T') elt2.add(sync, refpulse='sync_T', name='sync') #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('PQ_testing') seq.append(name = 'test1', wfname = elt.name, repetitions = 1, trigger_wait = True) seq.append(name = 'test2', wfname = elt2.name, repetitions = 20, 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)
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 Pi2 Calibration') for i in range(self.params['pts_awg']): e = element.Element('CORPSE_Pi2_Pi-{}'.format(i), pulsar=qt.pulsar, global_time=True) e.append(T) e.append( pulse.cp(CORPSE_pi2, amplitude=self.params['CORPSE_pi2_sweep_amps'][i])) e.append(pulse.cp(TIQ, length=200e-9)) 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='synca-{}'.format(i), wfname=sync_elt.name) e = element.Element('CORPSE_Pi2-{}'.format(i), pulsar=qt.pulsar, global_time=True) e.append(T) e.append( pulse.cp(CORPSE_pi2, amplitude=self.params['CORPSE_pi2_sweep_amps'][i])) e.append(pulse.cp(TIQ, length=200e-9)) e.append(T) elts.append(e) seq.append(name='CORPSE_Pi2-{}'.format(i), wfname=e.name, trigger_wait=True) seq.append(name='syncb-{}'.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)
def generate_sequence(self, upload=True): #define the pulses sync = pulse.SquarePulse(channel='sync', length=self.params['pq_sync_length'], amplitude=1.0) 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'] adwin_trigger_pulse = pulse.SquarePulse(channel='adwin_sync', length=1590e-9, amplitude=2) X = pulselib.MW_IQmod_pulse( 'Rabi_MW_pulse', I_channel='MW_Imod', Q_channel='MW_Qmod', PM_channel='MW_pulsemod', amplitude=self.params['fast_pi2_amp'], frequency=self.params['fast_pi2_mod_frq'], PM_risetime=self.params['MW_pulse_mod_risetime']) X_pi = pulselib.MW_IQmod_pulse( 'electron X-Pi-pulse', I_channel='MW_Imod', Q_channel='MW_Qmod', PM_channel='MW_pulsemod', amplitude=self.params['fast_pi_amp'], frequency=self.params['fast_pi_mod_frq'], PM_risetime=self.params['MW_pulse_mod_risetime'], length=self.params['fast_pi_duration'], phase=self.params['X_phase']) wait_before_MW = 500e-9 T = pulse.SquarePulse(channel='MW_Imod', name='Wait', length=wait_before_MW) seq = pulsar.Sequence('Hahn sequence') #need one spin polarization pulse at the beginning. init = element.Element('initialize', pulsar=qt.pulsar) init.add(pulse.cp(sq_AOMpulse, length=1e-6, amplitude=0), name='wait') init.add(sq_AOMpulse, name='init', refpulse='wait') #generate a list of pulse elements. One for each modulation freuqency elements = [] elements.append(init) seq.append(name=init.name, wfname=init.name, trigger_wait=True) for k, t in enumerate(self.params['sweep_pts']): e = element.Element('Hahn-%d' % k, pulsar=qt.pulsar, global_time=True) if k == 0: first_dp_element = e.name e.add(T(length=1500e-9), name='wait') e.add(adwin_trigger_pulse, name='adwin_trigger', refpulse='wait', refpoint='start') e.add(X(length=self.params['fast_pi2_duration'], phase=0), name='MWpulse', refpulse='wait', refpoint='end') # if waiting times are long: implement tau by repeating a 1 us element in AWG. Saves memory if self.params['free_evolution_times'][k] > 5e-6: # Implement one waiting period tau free_evol_us = int( self.params['free_evolution_times'][k] * 1e6) - 4 free_evol_around_pi2 = (self.params['free_evolution_times'][k] - free_evol_us * 1e-6) / 2. e.add(T(length=free_evol_around_pi2), name='tau_1_first_part', refpulse='MWpulse', refpoint='end') elements.append(e) t_offset = e.length() seq.append(name=e.name, wfname=e.name, trigger_wait=False, jump_target=init.name) e = element.Element('Hahn-%d-tau_1_waiting_time' % k, pulsar=qt.pulsar, global_time=True) e.add(T(length=1e-6), name='tau') elements.append(e) seq.append(name=e.name, wfname=e.name, trigger_wait=False, jump_target=init.name, repetitions=free_evol_us) t_offset += e.length( ) * free_evol_us # make sure two pi/2 pulses (27-3-2015: pi/2 pulse and pi pulse?) have same time reference e = element.Element('Hahn-%d-tau_1_second_part' % k, pulsar=qt.pulsar, global_time=True, time_offset=t_offset) e.add(T(length=free_evol_around_pi2), name='tau_1_third_part') # # X Pi pulse e.add(X_pi(), name='pi_pulse', refpulse='tau_1_third_part', refpoint='end') # Implement one waiting period tau free_evol_us = int( self.params['free_evolution_times'][k] * 1e6) - 4 free_evol_around_pi2 = (self.params['free_evolution_times'][k] - free_evol_us * 1e-6) / 2. e.add(T(length=free_evol_around_pi2), name='tau_2_first_part', refpulse='pi_pulse', refpoint='end') elements.append(e) t_offset = e.length() seq.append(name=e.name, wfname=e.name, trigger_wait=False, jump_target=init.name) e = element.Element('Hahn-%d-tau_2_waiting_time' % k, pulsar=qt.pulsar, global_time=True) e.add(T(length=1e-6), name='tau') elements.append(e) seq.append(name=e.name, wfname=e.name, trigger_wait=False, jump_target=init.name, repetitions=free_evol_us) t_offset += e.length( ) * free_evol_us # make sure two pi/2 pulses (27-3-2015: pi/2 pulse and pi pulse?) have same time reference e = element.Element('Hahn-%d-tau_2_second_part' % k, pulsar=qt.pulsar, global_time=True, time_offset=t_offset) e.add(T(length=free_evol_around_pi2), name='tau_2_third_part') # Last pi/2 pulse # e.add(X(length=self.params['fast_pi2_duration'],phase=self.params['second_pi2_phases'][k]),name='MWpulse2',refpulse='tau_2_third_part',refpoint='end') e.add(X(length=self.params['fast_pi2_duration'], phase=180), name='MWpulse2', refpulse='tau_2_third_part', refpoint='end') else: e.add(T(length=self.params['free_evolution_times'][k]), name='tau1', refpulse='MWpulse', refpoint='end') e.add(X_pi(), name='pi_pulse', refpulse='tau1', refpoint='end') e.add(T(length=self.params['free_evolution_times'][k]), name='tau2', refpulse='tau1', refpoint='end') # e.add(X(length=self.params['fast_pi2_duration'],phase=self.params['second_pi2_phases'][k]),name='MWpulse2',refpulse='tau2',refpoint='end') # pi/2 (-x) e.add(X(length=self.params['fast_pi2_duration'], phase=180), name='MWpulse2', refpulse='tau2', refpoint='end') e.add(T, name='wait2', refpulse='MWpulse2', refpoint='end') e.add(sq_AOMpulse, name='GreenLight', refpulse='wait2', refpoint='end') e.add(sync, name='Sync', refpulse='wait2', refpoint='end') e.add(pulse.cp(T, length=self.params['time_between_syncs']), name='wait3', refpulse='Sync', refpoint='end') e.add(sync, name='Sync2', refpulse='wait3', refpoint='end') elements.append(e) seq.append(name=e.name, wfname=e.name, trigger_wait=False, jump_target=init.name) #insert a delay at the end of the sequence such that all outputs of the AWG stay low. end = element.Element('ending delay', pulsar=qt.pulsar) end.add(pulse.cp(sq_AOMpulse, length=1e-6, amplitude=0), name='delay') elements.append(end) seq.append(name=end.name, wfname=end.name, goto_target=first_dp_element, jump_target=init.name) #create a sequence from the gathered elements #for e in elements: if upload: if upload == 'old_method': qt.pulsar.upload(*elements) qt.pulsar.program_sequence(seq, loop=False) else: qt.pulsar.program_awg(seq, *elements, loop=False)
import qt import numpy as np import measurement.lib.measurement2.measurement as m2 from measurement.lib.pulsar import pulse, pulselib, element, pulsar import pprint reload(pulse) reload(element) reload(pulsar) test_pulse = pulse.SquarePulse(channel='HH_sync', amplitude=1.0) elt1 = element.Element('idle', pulsar=qt.pulsar) elt2 = element.Element('djump1', pulsar=qt.pulsar) elt3 = element.Element('djump2', pulsar=qt.pulsar) elt4 = element.Element('djump3', pulsar=qt.pulsar) elt5 = element.Element('djump4', pulsar=qt.pulsar) #print 'Channel definitions: ' #pprint.pprint(test_element._channels) elt1.add(pulse.cp(test_pulse, amplitude=0.0, length=10e-6)) elt2.add(pulse.cp(test_pulse, amplitude=0.0, length=10e-6)) elt2.add(pulse.cp(test_pulse, amplitude=1.0, length=1e-6), start=5e-6) elt3.add(pulse.cp(test_pulse, amplitude=0.0, length=10e-6)) elt3.add(pulse.cp(test_pulse, amplitude=1.0, length=1e-6), start=6e-6) elt4.add(pulse.cp(test_pulse, amplitude=0.0, length=10e-6)) elt4.add(pulse.cp(test_pulse, amplitude=1.0, length=1e-6), start=7e-6) elt5.add(pulse.cp(test_pulse, amplitude=0.0, length=10e-6)) elt5.add(pulse.cp(test_pulse, amplitude=1.0, length=1e-6), start=8e-6)
def generate_LDE_elt(msmt,Gate, **kw): ''' returns the full LDE gate object with correctly ordered LDE element Input: The LDE/Gate object (see DD_2.py) Output: None ''' ### necessary parameters for further processing become attributes Gate.scheme = 'LDE' ### pulse definitions _create_mw_pulses(msmt,Gate) _create_laser_pulses(msmt,Gate) _create_syncs_and_triggers(msmt,Gate) _create_wait_times(Gate) ### create element e = element.Element(Gate.name, pulsar = qt.pulsar, global_time=True) e.add(pulse.cp(Gate.AWG_repump, amplitude = 0, length = msmt.joint_params['LDE_element_length'] ) ) ## sp_amp = 1.0 if msmt.params['do_only_opt_pi'] >0: sp_amp = 0.0 # 1 SP e.add(pulse.cp(Gate.AWG_repump, amplitude = 0, length = msmt.joint_params['initial_delay']), name = 'initial_delay') e.add(pulse.cp( Gate.AWG_repump, length = msmt.params['LDE_SP_duration'], amplitude = sp_amp), start = msmt.params['LDE_SP_delay'], name = 'spinpumping', refpulse = 'initial_delay') e.add(pulse.cp( Gate.yellow, length = msmt.params['LDE_SP_duration'], amplitude = sp_amp), start = msmt.params['LDE_SP_delay'], name = 'spintominus', refpulse = 'initial_delay') ### add the option to plug in a yellow laser pulse during spin pumping. not yet considered ### 2 syncs # 2a HH sync if msmt.params['sync_during_LDE'] == 1 : if setup == 'lt4' or setup == 'lt3': pass # e.add(Gate.HHsync, refpulse = 'initial_delay') ### one awg has to sync all time-tagging devices. if setup == 'lt3':# and msmt.params['is_two_setup_experiment'] > 0: e.add(Gate.LT3HHsync,refpulse = 'initial_delay') # 2b adwin syncronization e.add(Gate.adwin_count_pulse, refpulse = 'initial_delay', name = 'count_pulse')#,start = 1e-6) if msmt.params['MW_during_LDE'] == 1: # and not ('LDE2' in Gate.name): # we choose to build the MW pulses up from the end of the element. # this is more convenient when trying to preserve the coherence of the electron over several elements # it however becomes more complicated from a programming point of view. # MW pi pulse if msmt.params['check_EOM_projective_noise'] > 0: e.add(Gate.mw_X, start = msmt.params['MW_repump_distance'], refpulse = 'spinpumping', refpoint = 'end', refpoint_new = 'center', name = 'invert_before_excitation') mw_theta_ref_pulse = 'invert_before_excitation' mw_theta_delay = 500e-9 ### hardcoded botching. because why not. mw_theta_refpoint = 'center' else: mw_theta_ref_pulse = 'spinpumping' mw_theta_delay = msmt.params['MW_repump_distance'] mw_theta_refpoint = 'end' #mw pi/2 pulse or 'theta' e.add(Gate.mw_first_pulse, start = mw_theta_delay, refpulse = mw_theta_ref_pulse, refpoint = mw_theta_refpoint, refpoint_new = 'center', name = 'MW_Theta') if msmt.params['MW_pi_during_LDE'] == 1: e.add(Gate.mw_X, start = msmt.params['LDE_decouple_time'], refpulse = 'MW_Theta', refpoint = 'center', refpoint_new = 'center', name = 'MW_pi') if msmt.params['MW_RO_pulse_in_LDE'] == 1: e.add(pulse.cp(Gate.mw_pi2,phase = msmt.params['LDE_final_mw_phase']), start = msmt.params['LDE_decouple_time'], refpulse = 'MW_pi', refpoint = 'center', refpoint_new = 'center', name = 'RO_pulse') else: #mw pi/2 pulse or 'theta' e.add(pulse.cp(Gate.mw_first_pulse,amplitude=0), start = msmt.params['MW_repump_distance'], refpulse = 'spinpumping', #for this measurement: nobody gives a damn about carbons: therefore easier to build up the sequence. refpoint = 'end', refpoint_new = 'center', name = 'MW_Theta') #4 opt. pi pulses # print 'Nr of opt pi pulses', msmt.joint_params['opt_pi_pulses'] if not (msmt.params['LDE_is_init'] > 0): if msmt.params['is_TPQI'] > 0: initial_reference = 'spinpumping' msmt.params['MW_opt_puls1_separation'] = 1e-6 else: initial_reference = 'MW_Theta' if qt.current_setup == 'lt3': ### only LT3 gives out the pi pulses for i in range(msmt.joint_params['opt_pi_pulses']): name = 'opt pi {}'.format(i+1) refpulse = 'opt pi {}'.format(i) if i > 0 else initial_reference start = msmt.joint_params['opt_pulse_separation'] if i > 0 else msmt.params['MW_opt_puls1_separation'] refpoint = 'start' if i > 0 else 'end' e.add(Gate.eom_pulse, name = name, start = start, refpulse = refpulse, refpoint = refpoint,) opt_ref_name = 'opt pi {}'.format(i+1) if msmt.params['PLU_during_LDE'] == 1 : plu_to_plu_ref_name = 'plu gate {}'.format(i+1) e.add(Gate.plu_gate, name = plu_to_plu_ref_name, refpulse = opt_ref_name, start = msmt.params['PLU_1_delay']) #5 Plu gates if msmt.params['PLU_during_LDE'] == 1: plu_to_plu_ref_name = 'plu gate {}'.format(i+1) ## the name plu 3 is historic... see bell. e.add(pulse.cp(Gate.plu_gate, length = msmt.params['PLU_gate_3_duration']), name = 'plu gate 3', start = msmt.params['PLU_3_delay'], refpulse = plu_to_plu_ref_name) e.add(pulse.cp(Gate.plu_gate, length = msmt.params['PLU_gate_3_duration']), name = 'plu gate 4', start = msmt.params['PLU_4_delay'], refpulse = 'plu gate 3') #### gives a done trigger that has to be timed accordingly, is referenced to the PLU if the PLU is used by this setup. if Gate.is_final: ## one can time accurately if we use the plu during the experiment boolean = (msmt.params['PLU_during_LDE'] > 0) and (msmt.params['LDE_is_init'] == 0) if not boolean: ### if this is not the case then the measurement is PLU insensitive e.add(Gate.adwin_trigger_pulse, ### insert the trigger right at the start start = 0, refpulse = 'count_pulse', refpoint = 'end', refpoint_new = 'start') else: ## if we are dependent on the plu then the plu trigger has to come in before the done trigger. ## otherwise the ADwins will get confused! ## we therefore make the sequence jump to the end of the awg sequence to obtain the jump trigger. pass # Gate.reps = msmt.joint_params['LDE_attempts_before_CR'] Gate.elements = [e] Gate.elements_duration = msmt.joint_params['LDE_element_length'] # consistent? e_len = e.length() # uncomment for thourogh checks. # e.print_overview() if e_len != msmt.joint_params['LDE_element_length']: raise Exception('LDE element "{}" has length {:.6e}, but specified length was {:.6e}. granularity issue?'.format(e.name, e_len, msmt.joint_params['LDE_element_length']))
type='analog', high=0.9, low=-0.9, offset=0., delay=0e-9, active=True) #qt.pulsar.define_channel(id='ch2', name='MW_Qmod', type='analog', high=0.9, # low=-0.9, offset=0., delay=240e-9, active=True) trigger = pulse.SquarePulse(channel='trigger', name='tr', amplitude=1.0) MWI = pulse.SquarePulse(channel='MW_Imod', name='MW_pulse', amplitude=1.0) wait = pulse.SquarePulse(channel='MW_Imod', name='wait', amplitude=1.0) MW_pulm = pulse.SquarePulse(channel='MW_pulsemod', amplitude=1.0) elt = 'test' elt1 = element.Element('idle', pulsar=qt.pulsar) elt1.add(pulse.cp(wait, amplitude=0.0, length=700e-9), start=0e-9) elt1.add(pulse.cp(trigger, amplitude=1.0, length=10e-9), start=675e-9) elt1.add(pulse.cp(MWI, amplitude=1.0, length=50e-9), start=700e-9) elt1.add(pulse.cp(MW_pulm, amplitude=1.0, length=100e-9), start=675e-9) elt1.add(pulse.cp(wait, amplitude=0.0, length=250e-9), start=750e-9) """ seq.add_pulse(name='trigger', channel = trigger, element=elt, start = 0, duration = 50 ) seq.add_pulse(name='trigger_empty', channel = trigger, element=elt, start = 0, duration = 1000, amplitude = 0 ) seq.add_pulse(name='wait', channel = chan_mwI, element=elt, start=0, duration = 500, amplitude = 0) seq.add_pulse(name='MW_Imod_base', channel = chan_mwI,element = elt, duration = MW_Imod_duration*2,
def generate_sequence(self, upload=True): mbi_elt = self._MBI_element() T_MW = pulse.SquarePulse(channel='MW_pulsemod', length = 50e-9, amplitude = 0) T_SP = pulse.SquarePulse(channel='Velocity1AOM', length = 200e-9, amplitude = 0) CNOT_pi2pi = pulselib.MW_IQmod_pulse('pi2pi pulse mI=-1', I_channel = 'MW_Imod', Q_channel = 'MW_Qmod', PM_channel = 'MW_pulsemod', PM_risetime = self.params['MW_pulse_mod_risetime'], frequency = self.params['pi2pi_mIm1_mod_frq'], amplitude = self.params['pi2pi_mIm1_amp'], length = self.params['pi2pi_mIm1_duration']) 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']) SP_pulse = pulse.SquarePulse(channel = 'Velocity1AOM', amplitude = 1.0) sync_elt = element.Element('adwin_sync', pulsar=qt.pulsar) adwin_sync = pulse.SquarePulse(channel='adwin_sync', length = self.params['AWG_to_adwin_ttl_trigger_duration'], amplitude = 2) sync_elt.append(adwin_sync) N_ro_elt = element.Element('N_RO', pulsar=qt.pulsar, global_time = True) # N_ro_elt.append(T_SP) # N_ro_elt.append(pulse.cp(SP_pulse, # length = self.params['RO_SP_duration']), # ) N_ro_elt.append(T_MW) N_ro_elt.append(CORPSE_pi) N_ro_elt.append(T_MW) N_ro_elt.append(CNOT_pi2pi) N_ro_elt.append(pulse.cp(T_MW, length=1e-6)) # N_ro_elt.append(adwin_sync) seq = pulsar.Sequence('N-RR') seq.append(name = 'MBI', wfname = mbi_elt.name, trigger_wait = True, goto_target = 'MBI', jump_target = 'RO-1') for i in range(self.params['nr_of_ROsequences']): seq.append(name = 'RO-{}'.format(i+1), wfname = N_ro_elt.name, trigger_wait = True) seq.append(name = 'sync-{}'.format(i+1), wfname = sync_elt.name) if upload: qt.pulsar.upload(mbi_elt, sync_elt, N_ro_elt) qt.pulsar.program_sequence(seq)
def generate_sequence(self): self.sweep_bell_seq = pulsar.Sequence('Bell_sweep') elements = [] for i in range(self.params['pts']): if self.params['do_general_sweep'] : self.params[self.params['general_sweep_name']] = self.params['general_sweep_pts'][i] #self.params['eom_off_duration'] = self.params['opt_pulse_separation']/4. self.params['mw_frq'] = self.params['ms-1_cntr_frq']-self.params['MW_pulse_mod_frequency'] self.params['pulse_pi_amp'] = self.params['IQ_Square_pi_amp'] self.params['pulse_pi2_amp'] = self.params['IQ_Square_pi2_amp'] IQ_Square_pi = pulselib.MW_IQmod_pulse('Square pi-pulse', I_channel='MW_Imod', Q_channel='MW_Qmod', PM_channel='MW_pulsemod', length = self.params['MW_pi_duration'], amplitude = self.params['pulse_pi_amp'], phase = self.params['mw_pi_phase'], frequency = self.params['MW_pulse_mod_frequency'], PM_risetime = self.params['MW_pulse_mod_risetime']) IQ_Square_pi2 = pulselib.MW_IQmod_pulse('Square pi/2-pulse', I_channel='MW_Imod', Q_channel='MW_Qmod', PM_channel='MW_pulsemod', length = self.params['MW_pi2_duration'], amplitude = self.params['pulse_pi2_amp'], phase = self.params['mw_pi2_phase_1'], frequency = self.params['MW_pulse_mod_frequency'], PM_risetime = self.params['MW_pulse_mod_risetime']) pulse_pi=IQ_Square_pi pulse_pi2=IQ_Square_pi2 if self.params['setup'] == 'lt4': bseq.pulse_defs_lt4(self) elif self.params['setup'] == 'lt3': bseq.pulse_defs_lt3(self) finished_element = bseq._lt3_sequence_finished_element(self) e = element.Element('sweep_el_{}'.format(i), pulsar = qt.pulsar, global_time = True) e.add(pulse.cp(self.SP_pulse, amplitude = 0, length = self.joint_params['LDE_element_length'])) #1 SP e.add(pulse.cp(self.SP_pulse, amplitude = 0, length = self.joint_params['initial_delay']), name = 'initial_delay') e.add(pulse.cp(self.SP_pulse, length = self.params['LDE_SP_duration'], amplitude = 1.0), name = 'spinpumping', refpulse = 'initial_delay') if self.params['sync_during_LDE'] == 1 : e.add(self.sync, refpulse = 'initial_delay') for j in range(self.joint_params['opt_pi_pulses']): name = 'opt pi {}'.format(j+1) refpulse = 'opt pi {}'.format(j) if j > 0 else 'initial_delay' start = self.params['opt_pulse_separation'] if j > 0 else self.params['opt_pulse_start'] refpoint = 'start' if j > 0 else 'end' e.add(self.eom_pulse, name = name, start = start, refpulse = refpulse, refpoint = refpoint,) #4 MW pi/2 e.add(pulse.cp(pulse_pi2,phase =self.params['mw_pi2_phase_1']), start = -self.params['MW_opt_puls1_separation'], refpulse = 'opt pi 1', refpoint = 'start', refpoint_new = 'end', name = 'MW_first_pi2') #5 HHsync #8 MW pi e.add(pulse_pi, start = self.params['MW_1_separation'], refpulse = 'MW_first_pi2', refpoint = 'end', refpoint_new = 'end', name='MW_pi') # 14 MW pi/2 pulse e.add(pulse.cp(pulse_pi2,phase =self.params['mw_pi2_phase_2']), start = self.params['MW_1_separation'], refpulse = 'MW_pi', refpoint = 'start', refpoint_new = 'start', name='MW_final_pi2') elements.append(e) self.sweep_bell_seq.append(name = 'Bell sweep {}'.format(i), wfname = e.name, trigger_wait = self.params['trigger_wait'], repetitions = self.joint_params['LDE_attempts_before_CR']) self.sweep_bell_seq.append(name = 'Bell sweep done {}'.format(i), wfname = finished_element.name, trigger_wait = False) elements.append(finished_element) #qt.pulsar.upload(*elements) #qt.pulsar.program_sequence(self.sweep_bell_seq) qt.pulsar.program_awg(self.sweep_bell_seq,*elements)