def _setup_params(msmt, setup): msmt.params['setup'] = setup msmt.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) msmt.params.from_dict(qt.exp_params['protocols']['cr_mod']) if not (hasattr(msmt, 'joint_params')): msmt.joint_params = {} import joint_params reload(joint_params) for k in joint_params.joint_params: msmt.joint_params[k] = joint_params.joint_params[k] if setup == 'lt4': import params_lt4 reload(params_lt4) msmt.AWG_RO_AOM = qt.instruments['PulseAOM'] for k in params_lt4.params_lt4: msmt.params[k] = params_lt4.params_lt4[k] msmt.params['MW_BellStateOffset'] = 0.0 bseq.pulse_defs_lt4(msmt) elif setup == 'lt3': import params_lt3 reload(params_lt3) msmt.AWG_RO_AOM = qt.instruments['PulseAOM'] for k in params_lt3.params_lt3: msmt.params[k] = params_lt3.params_lt3[k] msmt.params['MW_BellStateOffset'] = 0.0 bseq.pulse_defs_lt3(msmt) else: print 'Sweep_bell: invalid setup:', setup msmt.params['send_AWG_start'] = 1 msmt.params['sync_during_LDE'] = 1 msmt.params['wait_for_AWG_done'] = 0 msmt.params['trigger_wait'] = 1
def generate_sequence(self): seq = pulsar.Sequence('Belllt3') bseq.pulse_defs_lt3(self) elements = [] #dummy_element = bseq._dummy_element(self) finished_element = bseq._lt3_sequence_finished_element(self) start_element = bseq._lt3_sequence_start_element(self) succes_element = bseq._lt3_entanglement_event_element(self) elements.append(start_element) elements.append(finished_element) elements.append(succes_element) LDE_element = bseq._LDE_element(self, name='LDE_lt3') elements.append(LDE_element) #seq.append(name = 'start_LDE', # trigger_wait = True, # wfname = start_element.name) seq.append(name='LDE_lt3', wfname=LDE_element.name, trigger_wait=True, jump_target='RO_dummy', repetitions=self.joint_params['LDE_attempts_before_CR']) seq.append( name='LDE_timeout', wfname=finished_element.name, goto_target='LDE_lt3_TPQI_norm' if self.joint_params['TPQI_normalisation_measurement'] else 'LDE_lt3') if self.joint_params['TPQI_normalisation_measurement']: seq.append(name='LDE_lt3_TPQI_norm', trigger_wait=True, wfname=LDE_element.name, jump_target='RO_dummy', repetitions=self.joint_params['LDE_attempts_before_CR']) seq.append(name='LDE_timeout_2', wfname=finished_element.name, goto_target='LDE_lt3') seq.append(name='RO_dummy', wfname=succes_element.name, goto_target='LDE_lt3') #qt.pulsar.program_awg(seq,*elements) qt.pulsar.upload(*elements) 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] if self.params['setup'] == 'lt4': bseq.pulse_defs_lt4(self) elif self.params['setup'] == 'lt3': bseq.pulse_defs_lt3(self) LDE_element = bseq._LDE_element( self, name='Bell sweep element {}'.format(i)) elements.append(LDE_element) if self.joint_params['wait_for_1st_revival']: LDE_echo_point = LDE_element.length() - ( LDE_element.pulses['MW_pi'].effective_start() + self.params['MW_1_separation']) late_RO_element = bseq._1st_revival_RO( self, LDE_echo_point=LDE_echo_point, name='late RO element {}'.format(i)) elements.append(late_RO_element) self.sweep_bell_seq.append( name='Bell sweep {}'.format(i), wfname=LDE_element.name, trigger_wait=self.params['trigger_wait'], repetitions=self.joint_params['LDE_attempts_before_CR']) if self.joint_params['wait_for_1st_revival']: self.sweep_bell_seq.append(name='late_RO {}'.format(i), wfname=late_RO_element.name) qt.pulsar.upload(*elements) qt.pulsar.program_sequence(self.sweep_bell_seq)
def tail_lt3(name): m = Tail(name) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.joint_params = {} for k in params.params_lt3: m.params[k] = params.params_lt3[k] for k in params.joint_params: m.params[k] = params.joint_params[k] m.joint_params[k] = params.joint_params[k] pts = 5 m.params['pts'] = pts #EOM pulse ---------------------------------- #qt.pulsar.set_channel_opt('EOM_trigger', 'delay', 147e-9) #qt.pulsar.set_channel_opt('EOM_trigger', 'high', 2.)#2.0 m.params[ 'use_eom_pulse'] = 'normal' #raymond-step' #'short', 'raymond-pulse', 'raymond-step' m.params['eom_off_amplitude'] = np.ones( pts) * -0.07 #np.linspace(-0.1,0.05,pts) # calibration from 19-03-2014 m.params['aom_risetime'] = np.ones(pts) * 25e-9 # calibration to be done! if m.params['use_eom_pulse'] == 'raymond-pulse': m.params['eom_pulse_amplitude'] = np.ones( pts ) * 1.45 #(for long pulses it is 1.45, dor short:2.0)calibration from 19-03-2014# m.params['eom_pulse_duration'] = np.ones(pts) * 60e-9 m.params['eom_trigger_duration'] = 80e-9 m.params['eom_trigger_pulse_duration'] = 1e-9 m.params['eom_trigger_amplitude'] = 1.0 m.params['eom_comp_pulse_amplitude'] = (m.params['eom_trigger_duration']*m.params['eom_off_amplitude'] \ +m.params['eom_trigger_pulse_duration']*m.params['eom_pulse_amplitude'] )/m.params['eom_pulse_duration'] elif m.params['use_eom_pulse'] == 'raymond-step': m.params['eom_pulse_amplitude'] = np.ones( pts ) * 2.9 #(for long pulses it is 1.45, dor short:2.0)calibration from 19-03-2014# m.params['eom_pulse_duration'] = np.ones(pts) * 100e-9 m.params['eom_trigger_amplitude'] = 1.0 m.params['eom_comp_pulse_amplitude'] = (0.5*m.params['eom_pulse_duration']*m.params['eom_pulse_amplitude'] \ +m.params['eom_pulse_duration']*m.params['eom_off_amplitude'] )/(2.*m.params['eom_pulse_duration']) else: #'normal': m.params['eom_pulse_amplitude'] = np.ones( pts ) * 2.0 #(for long pulses it is 1.45, dor short:2.0)calibration from 19-03-2014# m.params['eom_pulse_duration'] = np.ones(pts) * 2e-9 m.params['eom_comp_pulse_amplitude'] = m.params['eom_pulse_amplitude'] m.params['eom_off_duration'] = 200e-9 m.params['eom_overshoot_duration1'] = np.ones(pts) * 10e-9 m.params['eom_overshoot1'] = np.ones( pts) * -0.03 # calibration from 19-03-2014# m.params['eom_overshoot_duration2'] = 10e-9 m.params['eom_overshoot2'] = 0 m.params['eom_aom_on'] = True p_aom = qt.instruments['PulseAOM'] max_power_aom = p_aom.voltage_to_power(p_aom.get_V_max()) aom_power_sweep = linspace(0.6, 1.0, pts) * max_power_aom #%power aom_voltage_sweep = np.zeros(pts) for i, p in enumerate(aom_power_sweep): aom_voltage_sweep[i] = p_aom.power_to_voltage(p) m.params[ 'aom_amplitude'] = aom_voltage_sweep #np.ones(pts)*1.0#aom_voltage_sweep m.params['sweep_name'] = 'aom_amplitude [percent]' m.params['sweep_pts'] = aom_power_sweep / max_power_aom bseq.pulse_defs_lt3(m) m.params['MIN_SYNC_BIN'] = 5000 m.params['MAX_SYNC_BIN'] = 7000 m.params['send_AWG_start'] = 1 m.params['syncs_per_sweep'] = m.params['LDE_attempts_before_CR'] m.params['repetitions'] = 10000 m.params['SP_duration'] = 250 m.joint_params['opt_pi_pulses'] = 1 m.joint_params['RO_during_LDE'] = 0 m.params['MW_during_LDE'] = 0 debug = False measure_bs = True m.params['trigger_wait'] = True #not(debug) m.autoconfig() m.generate_sequence() #print m.params['measurement_time'] if measure_bs: m.bs_helper.set_script_path( r'D:/measuring/measurement/scripts/bell/bell_bs.py') m.bs_helper.set_measurement_name(name) m.bs_helper.set_is_running(True) m.bs_helper.execute_script() m.setup(debug=(debug or measure_bs)) m.run(autoconfig=False, setup=False, debug=(debug or measure_bs)) m.save() if measure_bs: m.bs_helper.set_is_running(False) m.params['bs_data_path'] = m.bs_helper.get_data_path() m.finish()
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)
def update_definitions(self): bseq.pulse_defs_lt3(self)
def tail_lt3(name): m=LT3Tail(name) for k in bparams.params.parameters: m.params[k] = bparams.params[k] for k in bparams.params_lt3.parameters: m.params[k] = bparams.params_lt3[k] m.params_lt3=m.params m.params.from_dict(qt.cfgman['protocols']['AdwinSSRO']) m.params.from_dict(qt.cfgman['protocols']['AdwinSSRO+PQ']) m.params['Ex_CR_amplitude']= m.params['Ey_CR_amplitude'] m.params['Ex_SP_amplitude']= m.params['Ey_SP_amplitude'] m.params['Ex_RO_amplitude']=m.params['Ey_RO_amplitude'] pts=1 m.params['pts']=pts #EOM pulse ---------------------------------- m.params['use_short_eom_pulse']=False qt.pulsar.set_channel_opt('EOM_trigger', 'delay', 175e-9) #qt.pulsar.set_channel_opt('EOM_trigger', 'high', 2.)#2.0 m.params['eom_pulse_duration'] = np.ones(pts)* 2e-9 m.params['EOM_trigger_length'] = 20e-9 m.params['eom_off_amplitude'] = np.ones(pts)* -0.05# calibration from 6-03-2014 m.params['eom_pulse_amplitude'] = np.ones(pts)* 1.5# np.linspace(1.4, 2.0, pts) # calibration to be done! m.params['eom_off_duration'] = 200e-9 m.params['eom_overshoot_duration1'] = 10e-9 m.params['eom_overshoot1'] = 0#-0.03 *2 m.params['eom_overshoot_duration2'] = 4e-9 m.params['eom_overshoot2'] = 0#-0.03 *2 m.params['eom_comp_pulse_amplitude'] = m.params['eom_pulse_amplitude'] m.params['eom_comp_pulse_duration'] = m.params['eom_pulse_duration']#m.params['EOM_trigger_length'] m.params['aom_risetime'] = 30e-9#42e-9 # calibration to be done! m.params['eom_aom_on'] = True m.params['sweep_name'] = 'eom_pulse_amplitude' m.params['sweep_pts'] = m.params_lt3['eom_pulse_amplitude'] bseq.pulse_defs_lt3(m) m.params['send_AWG_start'] = 1 m.params['wait_for_AWG_done'] = 0 m.params['repetitions'] = 20000 m.params['sequence_wait_time'] = m.params['LDE_attempts_before_CR']*m.params['LDE_element_length']*1e6 + 20 m.params['SP_duration'] = 250 m.params['opt_pi_pulses'] = 1 m.params_lt3['MW_during_LDE'] = 0 m.params['trigger_wait'] = 1 qt.instruments['AWG'].set_runmode('CONT') qt.instruments['AWG'].get_runmode() qt.instruments['AWG'].get_runmode() qt.instruments['AWG'].get_runmode() m.autoconfig() m.generate_sequence() m.setup(mw=m.params_lt3['MW_during_LDE'])#XX, pq_calibrate=False) m.run(autoconfig=False, setup=False) m.save() m.finish()
reload(pulse) reload(element) reload(view) reload(pulselib) reload(eom_pulses) import parameters_lt3 as bparams import sequence as bseq reload(bparams) reload(bseq) class test_M: def test(self): print 'test' m = test_M() m.params = bparams.params m.params_lt3 = bparams.params_lt3 m.params_lt3['RO_voltage_AWG'] = 1 m.params_lt3['SP_voltage_AWG'] = 1 bseq.pulse_defs_lt3(m) e = bseq._lt3_LDE_element(m, eom_pulse=eom_pulses.EOMAOMPulse( 'Eom Aom Pulse', eom_channel='EOM_Matisse', aom_channel='EOM_AOM_Matisse')) view.show_element(e)
def tail_lt3(name): m = LT3Tail(name) for k in bparams.params.parameters: m.params[k] = bparams.params[k] for k in bparams.params_lt3.parameters: m.params[k] = bparams.params_lt3[k] m.params_lt3 = m.params m.params.from_dict(qt.cfgman['protocols']['AdwinSSRO']) m.params.from_dict(qt.cfgman['protocols']['AdwinSSRO+PQ']) m.params['Ex_CR_amplitude'] = m.params['Ey_CR_amplitude'] m.params['Ex_SP_amplitude'] = m.params['Ey_SP_amplitude'] m.params['Ex_RO_amplitude'] = m.params['Ey_RO_amplitude'] pts = 1 m.params['pts'] = pts #EOM pulse ---------------------------------- m.params['use_short_eom_pulse'] = False qt.pulsar.set_channel_opt('EOM_trigger', 'delay', 175e-9) m.params['eom_pulse_duration'] = np.ones(pts) * 2e-9 m.params['EOM_trigger_length'] = 20e-9 m.params['eom_off_amplitude'] = np.ones( pts) * -0.07 # calibration from 19-03-2014 m.params['eom_pulse_amplitude'] = np.ones( pts) * 2.0 # calibration from 19-03-2014# m.params['eom_off_duration'] = 200e-9 m.params['eom_overshoot_duration1'] = 10e-9 m.params['eom_overshoot1'] = -0.03 # calibration from 19-03-2014# m.params['eom_overshoot_duration2'] = 4e-9 m.params['eom_overshoot2'] = 0 #-0.03 *2 m.params['eom_comp_pulse_amplitude'] = m.params['eom_pulse_amplitude'] m.params['eom_comp_pulse_duration'] = m.params[ 'eom_pulse_duration'] #m.params['EOM_trigger_length'] m.params['aom_risetime'] = 30e-9 #42e-9 # calibration to be done! m.params['eom_aom_on'] = True m.params['sweep_name'] = 'eom_pulse_amplitude' m.params['sweep_pts'] = m.params_lt3['eom_pulse_amplitude'] bseq.pulse_defs_lt3(m) m.params['send_AWG_start'] = 1 m.params['wait_for_AWG_done'] = 0 m.params['repetitions'] = 20000 m.params['sequence_wait_time'] = m.params[ 'LDE_attempts_before_CR'] * m.params['LDE_element_length'] * 1e6 + 20 m.params['SP_duration'] = 250 m.params['opt_pi_pulses'] = 1 m.params_lt3['MW_during_LDE'] = 0 m.params['trigger_wait'] = 1 m.autoconfig() m.generate_sequence() m.setup(mw=m.params_lt3['MW_during_LDE']) #XX, pq_calibrate=False) m.run(autoconfig=False, setup=False) m.save() m.finish()
def generate_sequence(self, upload=True): SP_A_pulse = pulse.SquarePulse(channel='AOM_Newfocus', amplitude=1.0) SP_E_pulse = pulse.SquarePulse(channel='EOM_AOM_Matisse', amplitude=1.0) RO_pulse = pulse.SquarePulse(channel='EOM_AOM_Matisse', amplitude=1.0) T = pulse.SquarePulse(channel='AOM_Newfocus', length=self.params['wait_length'], amplitude=0) adwin_trigger_pulse = pulse.SquarePulse(channel='adwin_sync', length=5e-6, amplitude=2) PQ_sync = pulse.SquarePulse(channel='sync', length=self.params['pq_sync_length'], amplitude=1.0) MW_pi_pulse = pulselib.HermitePulse_Envelope( 'Hermite pi-pulse', MW_channel='MW_Imod', PM_channel='MW_pulsemod', second_MW_channel='MW_Qmod', amplitude=self.params['Hermite_pi_amp'], length=self.params['Hermite_pi_length'], PM_risetime=self.params['MW_pulse_mod_risetime'], pi2_pulse=False) elements = [] finished_element = element.Element('finished', pulsar=qt.pulsar) finished_element.append(adwin_trigger_pulse) elements.append(finished_element) seq = pulsar.Sequence('Bell_FastSSRO') if self.params['setup'] == 'lt4': bseq.pulse_defs_lt4(self) elif self.params['setup'] == 'lt3': bseq.pulse_defs_lt3(self) for i in range(self.params['pts'] / 2): if self.params['do_general_sweep']: self.joint_params[ self.params['general_sweep_name']] = self.params[ 'general_sweep_pts'][i] LDE_element = bseq._LDE_element( self, name='Bell sweep element {}'.format(i)) elements.append(LDE_element) else: LDE_element = bseq._LDE_element( self, name='Bell element {}'.format(i)) elements.append(LDE_element) seq.append(name='Bell sweep sequence before ms0 calib {}'.format(i) if self.params['do_general_sweep'] else 'Bell sequence before ms0 calib {}'.format(i), wfname=LDE_element.name, trigger_wait=self.params['trigger_wait'], repetitions=self.joint_params['LDE_attempts_before_CR']) e0 = element.Element('SSRO-ms0-{}'.format(i), pulsar=qt.pulsar) e0.append(pulse.cp(T, length=3e-6)) e0.append(PQ_sync) e0.append(T) e0.append( pulse.cp(SP_A_pulse, length=self.params['A_SP_durations_AWG'][i])) e0.append(T) e0.append( pulse.cp(RO_pulse, length=self.params['E_RO_durations_AWG'][i], amplitude=self.params['E_RO_voltages_AWG'][i])) e0.append(T) elements.append(e0) seq.append(name='SSRO-ms0-{}'.format(i), wfname=e0.name, trigger_wait=False) seq.append(name='finished-ms0-{}'.format(i), wfname=finished_element.name, trigger_wait=False) seq.append('Bell sweep sequence before ms1 calib {}'.format(i) if self.params['do_general_sweep'] else 'Bell sequence before ms1 calib {}'.format(i), wfname=LDE_element.name, trigger_wait=self.params['trigger_wait'], repetitions=self.joint_params['LDE_attempts_before_CR']) e1 = element.Element('SSRO-ms1-{}'.format(i), pulsar=qt.pulsar) e1.append(pulse.cp(T, length=3e-6)) e1.append(PQ_sync) e1.append(T) if self.params[ 'init_with_MW']: #SP on ms=0 transition, then apply a MW pi pulse to transfer population into ms=-1 e1.append( pulse.cp(SP_A_pulse, length=self.params['A_SP_durations_AWG'][i])) e1.append(T) e1.append(MW_pi_pulse) self.params['E_SP_durations_AWG'][ i] = self.params['A_SP_durations_AWG'][i] + self.params[ 'wait_length'] + self.params['Hermite_pi_length'] else: e1.append( pulse.cp(SP_E_pulse, length=self.params['E_SP_durations_AWG'][i], amplitude=self.params['E_SP_voltages_AWG'][i])) e1.append(T) e1.append( pulse.cp(RO_pulse, length=self.params['E_RO_durations_AWG'][i], amplitude=self.params['E_RO_voltages_AWG'][i])) e1.append(T) elements.append(e1) seq.append(name='SSRO-ms1-{}'.format(i), wfname=e1.name, trigger_wait=False) seq.append(name='finished-ms1-{}'.format(i), wfname=finished_element.name, trigger_wait=False) if upload: if upload == 'old_method': qt.pulsar.upload(*elements) qt.pulsar.program_sequence(seq) else: qt.pulsar.program_awg(seq, *elements)