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']) 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,length = 1e-9) Gate.mw_pi2 = pulse.cp(Gate.mw_X,amplitude = 0,length = 1e-9) Gate.mw_mpi2 = pulse.cp(Gate.mw_X,amplitude = 0,length = 1e-9) Gate.mw_X = pulse.cp(Gate.mw_X,amplitude = 0,length = 1e-9)
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) if msmt.params['do_calc_theta'] > 0 or msmt.params['general_sweep_name'] == 'sin2_theta': fit_a = msmt.params['sin2_theta_fit_a'] fit_x0 = msmt.params['sin2_theta_fit_x0'] fit_of = msmt.params['sin2_theta_fit_of'] p0 = msmt.params['sin2_theta'] msmt.params['mw_first_pulse_amp'] = fit_x0 - np.sqrt((p0-1+fit_of)/fit_a) ### calc right pulse amp from theta calibration Gate.mw_first_pulse = pulse.cp(ps.X_pulse(msmt),amplitude = msmt.params['mw_first_pulse_amp'],length = msmt.params['mw_first_pulse_length'],phase = msmt.params['mw_first_pulse_phase']) if msmt.params['first_mw_pulse_is_pi2'] > 0 and hasattr(Gate,'first_mw_pulse_phase'): Gate.mw_first_pulse = pulse.cp(Gate.mw_pi2, phase = Gate.first_mw_pulse_phase) elif msmt.params['first_mw_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') or msmt.params['do_only_opt_pi'] >0: 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) if msmt.params['do_only_opt_pi'] >0: 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)
def electronT2_NoTriggers(name, debug=False, range_start=0e-6, range_end=1000e-6): m = pulsar_delay.ElectronT2NoTriggers(name) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) m.params['pulse_type'] = 'Hermite' m.params['Ex_SP_amplitude'] = 0 m.params[ 'AWG_to_adwin_ttl_trigger_duration'] = 2e-6 # commenting this out gives an erro m.params['wait_for_AWG_done'] = 1 m.params['sequence_wait_time'] = 1 pts = 51 m.params['pts'] = pts m.params['repetitions'] = 500 #m.params['wait_for_AWG_done']=1 #m.params['evolution_times'] = np.linspace(0,0.25*(pts-1)*1/m.params['N_HF_frq'],pts) # range from 0 to 1000 us m.params['evolution_times'] = np.linspace(range_start, range_end, pts) # MW pulses m.params['detuning'] = 0 #-1e6 #0.5e6 X_pi2 = ps.Xpi2_pulse(m) X_pi = ps.X_pulse(m) m.params['pulse_sweep_pi2_phases1'] = np.ones(pts) * m.params[ 'X_phase'] # First pi/2 = +X # m.params['pulse_sweep_pi2_phases2'] = np.ones(pts) * (m.params['X_phase']+180 ) # Second pi/2 = mX m.params['pulse_sweep_pi2_phases2'] = np.ones(pts) * m.params['X_phase'] m.params['pulse_sweep_pi_phases'] = np.ones(pts) * m.params['X_phase'] # for the autoanalysis m.params['sweep_name'] = 'evolution time (ns)' m.params['sweep_pts'] = (m.params['evolution_times'] + 2 * m.params['Hermite_pi2_length'] + m.params['Hermite_pi_length']) * 1e9 # for the self-triggering through the delay line # m.params['self_trigger_delay'] = 500e-9 # 0.5 us # m.params['self_trigger_duration'] = 100e-9 # Start measurement m.autoconfig() m.generate_sequence(upload=True, pulse_pi2=X_pi2, pulse_pi=X_pi) if not debug: m.run(autoconfig=False) m.save() m.finish()
def electronramseyHermite(name, debug=False): m = pulsar_msmt.GeneralElectronRamsey(name) print m.adwin # funcs.prepare(m) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) m.params['pulse_type'] = 'Hermite' m.params['Ex_SP_amplitude'] = 0 m.params[ 'AWG_to_adwin_ttl_trigger_duration'] = 2e-6 # commenting this out gives an erro m.params['wait_for_AWG_done'] = 1 m.params['sequence_wait_time'] = 1 pts = 99 m.params['pts'] = pts m.params['repetitions'] = 1000 #m.params['wait_for_AWG_done']=1 #m.params['evolution_times'] = np.linspace(0,0.25*(pts-1)*1/m.params['N_HF_frq'],pts) m.params['evolution_times'] = np.linspace(500e-9, 5000e-9, pts) # MW pulses m.params['detuning'] = 0 #-1e6 #0.5e6 X_pi2 = ps.Xpi2_pulse(m) m.params['pulse_sweep_pi2_phases1'] = np.ones(pts) * m.params[ 'X_phase'] # First pi/2 = +X # m.params['pulse_sweep_pi2_phases2'] = np.ones(pts) * (m.params['X_phase']+180 ) # Second pi/2 = mX m.params['pulse_sweep_pi2_phases2'] = np.ones(pts) * ( m.params['X_phase'] + 180 + 360 * (m.params['evolution_times']) * m.params['detuning']) # for the autoanalysis m.params['sweep_name'] = 'evolution time (ns)' m.params['sweep_pts'] = (m.params['evolution_times'] + m.params['Hermite_pi2_length']) * 1e9 # Start measurement m.autoconfig() m.generate_sequence(upload=True, pulse_pi2=X_pi2) if not debug: m.run(autoconfig=False) m.save() m.finish()
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']) if 'first_mw_pulse_type' in msmt.params: if msmt.params['first_mw_pulse_type'] == 'pi': Gate.mw_first_pulse = pulse.cp(Gate.mw_X, phase = msmt.params['mw_first_pulse_phase']) elif msmt.params['first_mw_pulse_type'] == 'pi2': Gate.mw_first_pulse = pulse.cp(Gate.mw_pi2, phase = msmt.params['mw_first_pulse_phase']) elif msmt.params['first_mw_pulse_type'] == 'none': Gate.mw_first_pulse = pulse.cp(Gate.mw_X,amplitude = 0) elif msmt.params['first_mw_pulse_type'] == 'square': msmt.params['pulse_shape'] = 'Square' Gate.mw_first_pulse = ps.X_pulse(msmt) msmt.params['pulse_shape'] = 'Hermite' else: raise ValueError("What are you doing first_mw_pulse_type does not make sense.") else: 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, length = 0) Gate.mw_pi2 = pulse.cp(Gate.mw_X,amplitude = 0, length = 0) Gate.mw_mpi2 = pulse.cp(Gate.mw_X,amplitude = 0, length = 0) Gate.mw_X = pulse.cp(Gate.mw_X,amplitude = 0, length = 0)
def calibrate_pi_pulse(name, multiplicity=1,RO_basis = 'Z', debug=False, mw2=False, wait_time_pulses=15000e-9, **kw): m = GeneralPiCalibrationSingleElement(name+str(multiplicity)) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) pulse_shape = m.params['pulse_shape'] pts = 20 m.params['pts'] = pts ps.X_pulse(m) #### update the pulse params depending on the chosen pulse shape. m.params['repetitions'] = 1600 if multiplicity == 1 else 2000 rng = 0.15 if multiplicity == 1 else 0.04 ### comment NK: the previous parameters for MW_duration etc. were not used anywhere in the underlying measurement class. ### therefore, I removed them if mw2: m.params['MW_pulse_amplitudes'] = m.params['mw2_fast_pi_amp'] + np.linspace(-rng, rng, pts) else: m.params['MW_pulse_amplitudes'] = m.params['fast_pi_amp'] + np.linspace(-rng, rng, pts) print m.params['MW_pulse_amplitudes'] m.params['multiplicity'] = np.ones(pts)*multiplicity m.params['wait_time_pulses']=wait_time_pulses m.params['RO_basis'] = RO_basis m.params['delay_reps'] = 0 # for the autoanalysis m.params['sweep_name'] = 'MW amplitude (V)' m.params['sweep_pts'] = m.params['MW_pulse_amplitudes'] m.params['wait_for_AWG_done'] = 1 m.MW_pi=ps.X_pulse(m) m.MW_pi2=ps.Xpi2_pulse(m) # m.MW_pi = pulse.cp(ps.mw2_X_pulse(m), phase = 0) if mw2 else pulse.cp(ps.X_pulse(m), phase = 0) # m.MW_pi = pulse.cp(ps.mw2_X_pulse(m), phase = 0) if mw2 else pulse.cp(ps.X_pulse(m), phase = 0) espin_funcs.finish(m, debug=debug, pulse_pi=m.MW_pi,pulse_pi2=m.MW_pi2)
def calibrate_pi2_pulse(name, debug=False): m = pulsar_msmt.GeneralPi2Calibration(name) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) print 'pulse_shape =', m.params['pulse_shape'] pts = 11 m.params['pulse_type'] = 'Square QuMem' m.params['pts_awg'] = pts m.params['repetitions'] = 1500 # Append pi & pi/2 pulses to instance m.MW_pi = ps.X_pulse(m) m.MW_pi2 = ps.Xpi2_pulse(m) # we do actually two msmts for every sweep point, that's why the awg gets only half of the # pts; m.params['pts'] = 2 * pts m.params['Ex_SP_amplitude'] = 0 # m.params['SP_duration'] = 50 m.params['wait_for_AWG_done'] = 1 # Square pulses sweep_axis = m.params['fast_pi2_amp'] + np.linspace(-0.1, 0.1, pts) m.params['pulse_pi2_sweep_amps'] = sweep_axis # Hermite pulses sweep_axis = m.params['Hermite_fast_pi2_amp'] + np.linspace( -0.08, 0.08, pts) m.params['pulse_pi2_sweep_amps'] = sweep_axis # for the autoanalysis m.params['sweep_name'] = 'MW pi/2 amp (V)' m.params['sweep_pts'] = np.sort(np.append(sweep_axis, sweep_axis)) espin_funcs.finish(m, debug=debug, pulse_pi=m.MW_pi, pulse_pi2=m.MW_pi2)
def calibrate_pi2_pulse(name, debug=False, mw2=False): m = pulsar_msmt.GeneralPi2Calibration(name) espin_funcs.prepare(m) pts = 11 m.params['pulse_type'] = 'Hermite' m.params['pts_awg'] = pts m.params['repetitions'] = 2000 if mw2: print m.params['mw2_pulse_shape'] m.MW_pi = ps.mw2_X_pulse(m) m.MW_pi2 = ps.mw2_Xpi2_pulse(m) sweep_axis = m.params['mw2_Hermite_pi2_amp'] + np.linspace( -0.12, 0.12, pts) m.params['pulse_pi2_sweep_amps'] = sweep_axis else: print m.params['pulse_shape'] m.MW_pi = ps.X_pulse(m) m.MW_pi2 = ps.Xpi2_pulse(m) sweep_axis = m.params['Hermite_pi2_amp'] + np.linspace( -0.12, 0.12, pts) m.params['pulse_pi2_sweep_amps'] = sweep_axis # print 'this is the length',m.MW_pi2.length # we do actually two msmts for every sweep point, that's why the awg gets only half of the # pts; m.params['pts'] = 2 * pts m.params['Ex_SP_amplitude'] = 0 # m.params['SP_duration'] = 50 m.params['wait_for_AWG_done'] = 1 # Square pulses # sweep_axis = m.params['fast_pi2_amp'] + np.linspace(-0.02, 0.02, pts) # m.params['pulse_pi2_sweep_amps'] = sweep_axis # for the autoanalysis m.params['sweep_name'] = 'MW pi/2 amp (V)' m.params['sweep_pts'] = np.sort(np.append(sweep_axis, sweep_axis)) espin_funcs.finish(m, debug=debug, pulse_pi=m.MW_pi, pulse_pi2=m.MW_pi2)
def calibrate_BB1_pi_pulse(name, multiplicity=1, debug=False): m = pulsar_msmt.ScrofulousPiCalibrationSingleElement(name) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) pts = 16 m.params['pulse_type'] = 'Hermite' m.params['pts'] = pts # m.params['repetitions'] = 3000 if multiplicity == 1 else 5000 m.params['repetitions'] = 600 if multiplicity == 1 else 600 rng = 0.2 if multiplicity == 1 else 0.08 ### Pulse settings m.params['multiplicity'] = np.ones(pts) * multiplicity # For square pulses m.params[ 'MW_pulse_amplitudes'] = m.params['BB1_fast_pi_amp'] + np.linspace( -rng, rng, pts) ### which pulse amplitudes are swept? Is a string containing integers. e.g. '123' sweeps all amplitudes m.params['swept_pulses'] = '12345' m.params['delay_reps'] = 1 #195 ## Currently not used # for the autoanalysis m.params['sweep_name'] = 'MW amplitude (V)' m.params['sweep_pts'] = m.params['MW_pulse_amplitudes'] m.params['wait_for_AWG_done'] = 1 # Add Hermite X pulse # m.MW_pi = hermite_Xpi(m) m.MW_pi = ps.X_pulse(m) m.MW_pi = pulse.cp(m.MW_pi, length=m.params['BB1_fast_pi_duration'], amplitude=m.params['BB1_fast_pi_amp']) m.MW_pi2 = ps.Xpi2_pulse(m) # m.Phi60 = pulse.cp(m.MW_pi, phase = m.params['X_phase']+60) ### scrofolous pulse: https://arxiv.org/pdf/quant-ph/0208092.pdf m.Phi1 = pulse.cp(m.MW_pi, phase=60) m.Phi2 = pulse.cp(m.MW_pi, phase=300) m.params['composite_pulse_keys'] = ['1', '2', '1'] m.pulse_dict = { '1': m.Phi1, '2': m.Phi2 } ### keys refer to composite_pulse_keys #### BB1 pulse is below # m.Phi1 = pulse.cp(m.MW_pi, phase = m.params['X_phase']+104.5) # m.Phi2 = pulse.cp(m.MW_pi, phase = m.params['X_phase']+313.4) # m.Phi3 = pulse.cp(m.MW_pi, phase = m.params['X_phase']) # m.params['composite_pulse_keys'] = ['1','2','2','1','3'] ### determines what pulse you want to do in which oder # m.pulse_dict = {'1': m.Phi1,'2' : m.Phi2,'3' : m.Phi3} ### keys refer to composite_pulse_keys print 'amp ', m.params['MW_pulse_amplitudes'][0] espin_funcs.finish(m, debug=debug, pulse_dict=m.pulse_dict)
def hahn_echo_variable_delayline(name, debug=False, vary_refocussing_time=True, range_start=-2e-6, range_end=2e6, evolution_1_self_trigger=False, evolution_2_self_trigger=False, refocussing_time=1e-6): m = pulsar_delay.ElectronRefocussingTriggered(name) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+delay']) m.params['delay_to_voltage_fitparams'] = np.loadtxt( '../lt4_V_c_from_dl_fit_20170323_1914.txt') m.params['delay_to_voltage_fitfunc'] = V_c_from_dl_fit m.params['pulse_type'] = 'Hermite' m.params['Ex_SP_amplitude'] = 0 m.params['AWG_to_adwin_ttl_trigger_duration'] = 2e-6 m.params['wait_for_AWG_done'] = 1 m.params['sequence_wait_time'] = 1 m.params['self_trigger_duration'] = 100e-9 # m.params['delay_voltage_DAC_channel'] = 16 # should be moved to msmt_params? m.params['do_delay_voltage_control'] = 1 pts = 11 m.params['pts'] = pts m.params['repetitions'] = 1000 if vary_refocussing_time: m.params['refocussing_time'] = np.linspace(range_start, range_end, pts) m.params['defocussing_offset'] = 0.0 * np.ones(pts) m.params['self_trigger_delay'] = m.params['refocussing_time'] m.params['sweep_name'] = 'single-sided free evolution time (us)' m.params['sweep_pts'] = (m.params['refocussing_time']) * 1e6 else: m.params['refocussing_time'] = np.ones(pts) * refocussing_time m.params['defocussing_offset'] = np.linspace(range_start, range_end, pts) m.params['self_trigger_delay'] = m.params['refocussing_time'] m.params['sweep_name'] = 'defocussing offset (us)' m.params['sweep_pts'] = (m.params['defocussing_offset']) * 1e6 # MW pulses X_pi2 = ps.Xpi2_pulse(m) X_pi = ps.X_pulse(m) # Start measurement m.autoconfig() print(m.params['delay_voltages']) m.generate_sequence(upload=True, pulse_pi2=X_pi2, pulse_pi=X_pi, evolution_1_self_trigger=evolution_1_self_trigger, evolution_2_self_trigger=evolution_2_self_trigger) if not debug: m.run(autoconfig=False) m.save() m.finish()
def electronRefocussingTriggered(name, debug=False, range_start=-2e-6, range_end=2e-6, evolution_1_self_trigger=True, evolution_2_self_trigger=False, vary_refocussing_time=False, refocussing_time=200e-6): m = pulsar_delay.ElectronRefocussingTriggered(name) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) m.params['pulse_type'] = 'Hermite' m.params['Ex_SP_amplitude'] = 0 m.params[ 'AWG_to_adwin_ttl_trigger_duration'] = 2e-6 # commenting this out gives an erro m.params['wait_for_AWG_done'] = 1 m.params['sequence_wait_time'] = 1 m.params['do_delay_voltage_control'] = 0 m.params['delay_voltage_DAC_channel'] = 14 pts = 51 m.params['pts'] = pts m.params['repetitions'] = 1000 #m.params['wait_for_AWG_done']=1 #m.params['evolution_times'] = np.linspace(0,0.25*(pts-1)*1/m.params['N_HF_frq'],pts) # range from 0 to 1000 us # calibrated using Hahn echo m.params['self_trigger_delay'] = 2.950e-6 * np.ones(pts) m.params['self_trigger_duration'] = 100e-9 if vary_refocussing_time: m.params['refocussing_time'] = np.linspace(range_start, range_end, pts) m.params['defocussing_offset'] = 0.0 * np.ones(pts) m.params['sweep_name'] = 'single-sided free evolution time (us)' m.params['sweep_pts'] = (m.params['refocussing_time']) * 1e6 else: m.params['refocussing_time'] = np.ones(pts) * refocussing_time m.params['defocussing_offset'] = np.linspace(range_start, range_end, pts) m.params['sweep_name'] = 'defocussing offset (us)' m.params['sweep_pts'] = (m.params['defocussing_offset']) * 1e6 # MW pulses X_pi2 = ps.Xpi2_pulse(m) X_pi = ps.X_pulse(m) # for the self-triggering through the delay line # m.params['self_trigger_delay'] = 500e-9 # 0.5 us # m.params['self_trigger_duration'] = 100e-9 # Start measurement m.autoconfig() m.generate_sequence(upload=True, pulse_pi2=X_pi2, pulse_pi=X_pi, evolution_1_self_trigger=evolution_1_self_trigger, evolution_2_self_trigger=evolution_2_self_trigger) if not debug: m.run(autoconfig=False) m.save() m.finish()
def gateset(m, debug=False, decoupling=True, multiple=False, pi=True, single_decoupling=False, last_seq=False, fid_1=['e'], fid_2=['e'], sequence_type='all', germ=['e'], germ_position=[1, 3], N_decoupling=[4], run_numbers=[1, 2, 3]): """ Function used to run GST on the individual experiment level. """ if sequence_type == 'specific_germ_position': m = pulsar_delay.GateSetWithDecoupling(name) mbi_funcs.prepare(m) # load msmt params #from mbi_funcs.py m.params['E_RO_durations'] = [m.params['SSRO_duration']] m.params['E_RO_amplitudes'] = [m.params['Ex_RO_amplitude']] m.params['send_AWG_start'] = [1] m.params['sequence_wait_time'] = [0] #Specific to make it work on LT2 m.params['initial_msmt_delay'] = 5000.0e-9 #The total number of sequence repetitions m.params['reps_per_ROsequence'] = 5000 m.params['fid_1'] = fid_1 m.params['fid_2'] = fid_2 m.params['sequence_type'] = sequence_type m.params['germ'] = germ m.params['germ_position'] = germ_position m.params['N_decoupling'] = N_decoupling m.params['run_numbers'] = run_numbers #Muss auch nicht imer definiert werden #Calculae the larmor frequency, since we want to sit on larmor revival points for this experiment tau_larmor = np.round(1 / m.params['C1_freq_0'], 9) m.params['tau_larmor'] = tau_larmor if decoupling: #The spacing in between germ pulses t_bw_germs = 50e-9 m.params['wait_time'] = t_bw_germs #We need to check that our germ / fiducial pulses fit between two larmor times, and otherwise make it an #integer multiple of the initial value. Strictly the fiducial does not go in here. In the end this is probably not necessary since #our sequences are very short. sequence_length = max(len(max(fid_1, key=len)), len(max( fid_2, key=len)), len(max(germ, key=len))) * ( m.params['Hermite_pi2_length'] + t_bw_germs) + t_bw_germs if 2 * tau_larmor <= sequence_length: tau_larmor *= np.ceil(sequence_length / (2 * tau_larmor)) print "Adjusted larmor frequency to multiple", tau_larmor # tau_larmor *= 4 # print tau_larmor m.params['tau_larmor'] = tau_larmor m.params['sweep_name'] = 'Total evolution time [ms]' m.params['sweep_pts'] = run_numbers * np.ones( len(run_numbers)) * tau_larmor * 1.e3 else: m.params['sweep_name'] = 'Germ repetitions' m.params['sweep_pts'] = run_numbers #Set up the pulses we want to use in the experiment. First all the pi2 pulses. X_pi2 = ps.Xpi2_pulse(m) Y_pi2 = ps.Ypi2_pulse(m) mX_pi2 = ps.mXpi2_pulse(m) mY_pi2 = ps.mYpi2_pulse(m) #Set up all the pi pulses. X_pi = ps.X_pulse(m) Y_pi = ps.Y_pulse(m) mX_pi = ps.mX_pulse(m) mY_pi = ps.mY_pulse(m) # for the autoanalysis # m.params['sweep_name'] = 'Run number' # m.params['sweep_pts'] = 1 # Now calculate how many sweeps we want to do. For now we want to put a germ pulse at different subsequent # locations. Later, we want to make this random if sequence_type == "all": if len(fid_1) == len(fid_2) == len(germ) == len(N_decoupling) == len( run_numbers): m.params['pts'] = len(fid_1) else: sys.exit( "A mistake happened. Check your fiducials and germ lists have the same length." ) else: m.params['pts'] = len(germ_position) # Start measurement m.autoconfig() m.generate_sequence(pi=pi, decoupling=decoupling, upload=True, single_decoupling=single_decoupling, x_pulse_pi2=X_pi2, y_pulse_pi2=Y_pi2, x_pulse_mpi2=mX_pi2, y_pulse_mpi2=mY_pi2, x_pulse_pi=X_pi, y_pulse_pi=Y_pi, x_pulse_mpi=mX_pi, y_pulse_mpi=mY_pi) if not debug: m.run(autoconfig=False) if multiple: print run_numbers[0] m.save(name='Start_run%d' % run_numbers[0]) else: m.save() if not multiple: m.finish() else: if last_seq == True: m.finish()
def gateset_NoTriggers(name, debug=False, fid_1=['e'], fid_2=['e'], sequence_type='specific_germ_position', germ=['e'], germ_position=[1, 3], N_decoupling=[4], run_numbers=[1, 2, 3]): m = pulsar_delay.GateSetNoTriggers(name) m.params.from_dict(qt.exp_params['samples'][SAMPLE]) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO']) m.params.from_dict( qt.exp_params['protocols'][SAMPLE_CFG]['AdwinSSRO-integrated']) m.params.from_dict(qt.exp_params['protocols']['AdwinSSRO+espin']) m.params.from_dict(qt.exp_params['protocols']['cr_mod']) m.params.from_dict(qt.exp_params['protocols'][SAMPLE_CFG]['pulses']) m.params['pulse_type'] = 'Hermite' m.params['Ex_SP_amplitude'] = 0 m.params[ 'AWG_to_adwin_ttl_trigger_duration'] = 3e-6 # commenting this out gives an erro m.params['wait_for_AWG_done'] = 1 # m.params['sequence_wait_time']=0 # m.params['evolution_times'] = 0 m.params['fid_1'] = fid_1 m.params['fid_2'] = fid_2 m.params['sequence_type'] = sequence_type m.params['germ'] = germ m.params['germ_position'] = germ_position m.params['N_decoupling'] = N_decoupling m.params['run_numbers'] = run_numbers m.params['initial_msmt_delay'] = 000.0e-9 #Calculae the larmor frequency, since we want to sit on larmor revival points for this experiment tau_larmor = np.round(1 / m.params['C1_freq_0'], 9) #The spacing in between germ pulses t_bw_germs = 50e-9 X_pi2 = ps.Xpi2_pulse(m) Y_pi2 = ps.Ypi2_pulse(m) mX_pi2 = ps.mXpi2_pulse(m) mY_pi2 = ps.mYpi2_pulse(m) #We need to check that our germ / fiducial pulses fit between two larmor times, and otherwise make it an #integer multiple of the initial value. Strictly the fiducial does not go in here, so EASY WAY TO IMPROVE THE CODE #CAN BE FOUND HERE sequence_length = max(len(fid_1), len(fid_2), len(germ)) * ( m.params['Hermite_pi2_length'] + t_bw_germs) + t_bw_germs if 2 * tau_larmor <= sequence_length: tau_larmor *= np.ceil(sequence_length / (2 * tau_larmor)) m.params['tau_larmor'] = tau_larmor m.params['wait_time'] = t_bw_germs #The total number of sequence repetitions m.params['repetitions'] = 10000 # for the autoanalysis # m.params['sweep_name'] = 'Run number' # m.params['sweep_pts'] = 1 # Now calculate how many sweeps we want to do. For now we want to put a germ pulse at different subsequent # locations. Later, we want to make this random if sequence_type == "all": if len(fid_1) == len(fid_2) == len(germ) == len(N_decoupling) == len( run_numbers): m.params['pts'] = len(fid_1) else: print "A mistake happened. Check your fiducials and germ lists have the same length." return else: m.params['pts'] = len(germ_position) m.params['sweep_name'] = 'Run number' m.params['sweep_pts'] = run_numbers # for the self-triggering through the delay line # m.params['self_trigger_delay'] = 500e-9 # 0.5 us # m.params['self_trigger_duration'] = 100e-9 # Start measurement m.autoconfig() m.generate_sequence(upload=True, x_pulse_pi2=X_pi2, y_pulse_pi2=Y_pi2, x_pulse_mpi2=mX_pi2, y_pulse_mpi2=mY_pi2) if not debug: m.run(autoconfig=False) m.save() m.finish()