def SimpleDecoupling(name, N, step_size, start_point, tot,start_tau = 0.52e-6): m = DD.SimpleDecoupling(name) for kk in range(tot): ### Set experimental parameters ### m.params['reps_per_ROsequence'] = 500 m.params['Initial_Pulse'] ='x' m.params['Final_Pulse'] ='-x' m.params['Decoupling_sequence_scheme'] = 'single_block' Number_of_pulses = N pts = 41 start = start_tau + (kk+start_point) * (pts-1)*step_size end = start_tau + (kk+1+start_point) * (pts-1)*step_size tau_list = np.linspace(start, end, pts) ### Start measurement ### ### Measurement name msmt_name = 'measurement' + str(kk) ### Optimize position '''qt.msleep(2) if mod(kk,2)==0: AWG.clear_visa() stools.turn_off_all_lt2_lasers() qt.msleep(1) GreenAOM.set_power(5e-6) optimiz0r.optimize(dims=['x','y','z','x','y'])''' ### Define and print parameters funcs.prepare(m) m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses*np.ones(m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = tau_list*1e6 m.params['sweep_name'] = 'tau (us)' print 'run = ' + str(kk) + ' of ' + str(tot) print m.params['sweep_pts'] print tau_list ### Run experiment m.autoconfig() m.params['E_RO_durations'] = [m.params['SSRO_duration']] m.params['E_RO_amplitudes'] = [m.params['Ex_RO_amplitude']] m.generate_sequence(upload=True, debug=False) m.run(setup=True, autoconfig=False) m.save(msmt_name) ### Option to stop the measurement cleanly print 'press q now to cleanly exit measurement loop' qt.msleep(5) if (msvcrt.kbhit() and (msvcrt.getch() == 'q')): break ### Close the fileexperiment in ot out the loop, that is the question, what happens if this is just in? m.finish()
def spin_echo(name): m = DD.SimpleDecoupling(name) funcs.prepare(m) ############# # Parameters for spin-echo ############# pts = 21 tau_start = 100e-6 #!!! Measurement class has minimal tau of 4us tau_final = 200e-6 m.params['reps_per_ROsequence'] = 2500 #Repetitions of each data point ######## # parameters specific for spin -echo ########### Number_of_pulses = 1 m.params['Initial_Pulse'] = 'x' m.params['Final_Pulse'] = 'x' m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' ##### #Calculate/set remaining paramters tau_list = np.linspace( tau_start / 2.0, tau_final / 2.0, pts ) #The way tau is defined is different in hahn spin-echo and decoupling experiments m.params['pts'] = pts m.params['Number_of_pulses'] = Number_of_pulses * np.ones(pts).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = 2 * Number_of_pulses * tau_list * 1e6 m.params['sweep_name'] = '2*N*tau (us)' m.autoconfig() funcs.finish(m, upload=True, debug=True)
def SimpleDecoupling_swp_N(name, tau=None, Number_of_pulses=np.arange(80, 100, 2), Final_Pulse='x', Initial_Pulse='x', reps_per_ROsequence=1000): m = DD.SimpleDecoupling(name) funcs.prepare(m) #input parameters m.params['reps_per_ROsequence'] = reps_per_ROsequence pts = len(Number_of_pulses) if tau == None: tau = m.params['C3_Ren_tau' + m.params['electron_transition']][0] tau_list = tau * np.ones(pts) print 'tau_list =' + str(tau_list) #inital and final pulse m.params['Initial_Pulse'] = Initial_Pulse m.params['Final_Pulse'] = Final_Pulse #Method to construct the sequence m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' m.params['pts'] = pts m.params['tau_list'] = tau_list m.params['Number_of_pulses'] = Number_of_pulses m.params['sweep_pts'] = Number_of_pulses print m.params['sweep_pts'] m.params['sweep_name'] = 'Number of pulses' m.autoconfig() funcs.finish(m, upload=True, debug=False)
def SimpleDecoupling_swp_tau(name, tau_min=9e-6, tau_max=10e-6, tau_step=50e-9, N=16): m = DD.SimpleDecoupling(name) funcs.prepare(m) '''set experimental parameters''' m.params['reps_per_ROsequence'] = 500 #Repetitions of each data point m.params['Initial_Pulse'] = 'x' if N % 4 == 0: m.params['Final_Pulse'] = '-x' else: m.params['Final_Pulse'] = 'x' m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' Number_of_pulses = N tau_list = np.arange(tau_min, tau_max, tau_step) print tau_list m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses * np.ones( m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = tau_list * 1e6 m.params['sweep_name'] = 'tau (us)' m.autoconfig() funcs.finish(m, upload=True, debug=False)
def SimpleDecoupling_swp_tau(name,tau_min=9e-6,tau_max=10e-6,tau_step =50e-9, N =16): m = DD.SimpleDecoupling(name+'_tau_'+str(tau_min*1e9)) # print 'threshold =' + str(m.params['MBI_threshold']) # print 'pulse_shape = ' +str(m.params['pulse_shape']) # NOTE: ADDED from ElectronT1_Hermite on 23-04-204 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['temp'] = temperature_sensor.get_readlastval() funcs.prepare(m) if True: ### if you don't want to do MBI for this script. m.params['MBI_threshold'] = 0 m.params['Ex_SP_amplitude'] = 0 m.params['Ex_MBI_amplitude'] = 0 m.params['SP_E_duration'] = 20 #2000 m.params['repump_after_MBI_A_amplitude'] = [25e-9] m.params['repump_after_MBI_duration'] = [300] # 50 '''set experimental parameters''' m.params['reps_per_ROsequence'] = 250 #250 #Repetitions of each data point m.params['Initial_Pulse'] ='x' if N%4 == 0: m.params['Final_Pulse'] ='-x' else: m.params['Final_Pulse'] ='x' m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' Number_of_pulses = N tau_list = np.arange(tau_min,tau_max,tau_step) print tau_list m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses*np.ones(m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = tau_list*1e6 m.params['sweep_name'] = 'tau (us)' # print m.params['fast_pi_duration'] # print m.params['fast_pi_amp'] # m.params['fast_pi2_duration'] = pi_dur # m.params['fast_pi2_amp'] = pi_amp m.autoconfig() funcs.finish(m, upload =True, debug=False)
def SimpleDecoupling(name,N=4,sweep = 'tau',end=100e-3,nr_list=[1], XY_scheme=8, reps=500,debug=False,larmor_offset = 0): m = DD.SimpleDecoupling(name) funcs.prepare(m) m.params['reps_per_ROsequence'] = reps #Repetitions of each data point m.params['Initial_Pulse'] ='x' tau_larmor = np.round(1/m.params['C1_freq_0'],9) if N==1: m.params['Final_Pulse'] ='x' else: m.params['Final_Pulse'] ='-x' ### Calculate tau larmor print 'tau_larmor = %s' %tau_larmor m.params['tau_larmor_offset'] = larmor_offset Number_of_pulses = N if sweep == 'tau': tau_list = np.array([round(x*tau_larmor*0.25e9) / (0.25e9) for x in nr_list]) + larmor_offset m.params['Number_of_pulses'] = Number_of_pulses*np.ones(len(tau_list)).astype(int) m.params['tau_list'] = tau_list elif sweep == 'N': tau_list = N*np.ones(len(nr_list)) + larmor_offset ### note that N is overwritten with the timing from the master script. m.params['Number_of_pulses'] = nr_list m.params['tau_list'] = tau_list m.params['pts'] = len(tau_list) m.params['sweep_pts'] = 2*m.params['Number_of_pulses']*tau_list*1e3 m.params['sweep_name'] = 'total evolution time (ms)' if XY_scheme == 16: m.params['Decoupling_sequence_scheme']='repeating_T_elt_XY16' elif XY_scheme == 8: m.params['Decoupling_sequence_scheme']='repeating_T_elt' elif XY_scheme == 4: m.params['Decoupling_sequence_scheme']='repeating_T_elt_XY4' else: raise Exception('XY Scheme not recognized') #m.params['Decoupling_sequence_scheme']='single_block' m.autoconfig() funcs.finish(m, upload =True, debug=debug)
def SimpleDecoupling(name, tau, N_step, N_init, N_finish, pts_per_run=11): m = DD.SimpleDecoupling(name) total_pts = (N_finish - N_init) / N_step + 1 print 'Running measurement for tau is: ' + str(tau * 1e6) for kk in range(total_pts / pts_per_run): ### Set experimental parameters ### m.params['reps_per_ROsequence'] = 1250 m.params['Initial_Pulse'] = 'x' m.params['Final_Pulse'] = '-x' m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' pts = pts_per_run N_start = (kk + N_init) * (pts - 1) * N_step N_end = (kk + 1 + N_init) * (pts - 1) * N_step N_list = np.linspace(N_start, N_end, pts) ### Start measurement ### ### Measurement name msmt_name = 'measurement' + str(kk) ### Optimize position qt.msleep(2) if mod(kk, 2) == 0: AWG.clear_visa() stools.turn_off_all_lt2_lasers() qt.msleep(1) GreenAOM.set_power(5e-6) optimiz0r.optimize(dims=['x', 'y', 'z', 'x', 'y']) ### Define and print parameters funcs.prepare(m) m.params['pts'] = len(N_list) m.params['Number_of_pulses'] = N_list m.params['tau_list'] = tau * np.ones(m.params['pts']).astype(int) m.params['sweep_pts'] = N_list m.params['sweep_name'] = 'N' print 'run = ' + str(kk) + ' of ' + str( total_pts / pts_per_run) + ' for this tau' print m.params['sweep_pts'] ### Run experiment m.autoconfig() m.params['E_RO_durations'] = [m.params['SSRO_duration']] m.params['E_RO_amplitudes'] = [m.params['Ex_RO_amplitude']] m.generate_sequence(upload=True, debug=False) m.run(setup=True, autoconfig=False) m.save(msmt_name) ### Option to stop the measurement cleanly print 'press q now to cleanly exit this measurement loop' print 'Note that there is a loop over tau, you have to press q another time' qt.msleep(5) if (msvcrt.kbhit() and (msvcrt.getch() == 'q')): break m.finish()
def SimpleDecoupling(name, N, step_size, start_point, tot, pts=21, mbi=True, final_pulse='-x', optimize=True, reps_per_RO=1500): m = DD.SimpleDecoupling(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']) for kk in range(tot): ### Set experimental parameters ### # m.params['reps_per_ROsequence'] = 1000 m.params['reps_per_ROsequence'] = reps_per_RO m.params['Initial_Pulse'] = 'x' m.params['Final_Pulse'] = final_pulse m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' # m.params['Decoupling_sequence_scheme'] = 'single_block' Number_of_pulses = N pts = 51 if N == 128: pts = 21 start = 0.54e-6 + (kk + start_point) * (pts - 1) * step_size end = 0.54e-6 + (kk + 1 + start_point) * (pts - 1) * step_size tau_list = np.linspace(start, end, pts) ### Start measurement ### ### Measurement name msmt_name = 'measurement' + str(kk) ### Optimize position if optimize: qt.msleep(2) if mod(kk, 5) == 0: AWG.clear_visa() stools.turn_off_all_lasers() qt.msleep(1) GreenAOM.set_power(20e-6) optimiz0r.optimize(dims=['x', 'y', 'z', 'x', 'y']) ### Define and print parameters funcs.prepare(m) m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses * np.ones( m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = tau_list * 1e6 m.params['sweep_name'] = 'tau (us)' if mbi == False: m.params['MBI_threshold'] = 0 m.params['Ex_SP_amplitude'] = 0 m.params['Ex_MBI_amplitude'] = 0 m.params['SP_E_duration'] = 20 #2000 m.params['repump_after_MBI_A_amplitude'] = [15e-9] m.params['repump_after_MBI_duration'] = [300] # 50 print 'run = ' + str(kk) + ' of ' + str(tot) print m.params['sweep_pts'] print tau_list # ### Run experiment m.autoconfig() print 'finished autoconfig' 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] m.generate_sequence(upload=True, debug=False) print 'STARTING ITERATION %s / %s' % (kk + 1, tot) m.run(setup=True, autoconfig=False) m.save(msmt_name) ## Option to stop the measurement cleanly print 'press q now to cleanly exit measurement loop' qt.msleep(3) if (msvcrt.kbhit() and (msvcrt.getch() == 'q')): n = 0 break m.finish()
def SimpleDecoupling(name, sweep='N', N=4, end=100e-3): m = DD.SimpleDecoupling(name) funcs.prepare(m) m.params['reps_per_ROsequence'] = 500 #Repetitions of each data point m.params['Initial_Pulse'] = 'x' m.params['Final_Pulse'] = '-x' ### Calculate tau larmor f_larmor = (m.params['ms+1_cntr_frq'] - m.params['zero_field_splitting'] ) * m.params['g_factor_C13'] / m.params['g_factor'] tau_larmor = round(1 / f_larmor, 9) #rounds to ns #tau_larmor =9.668e-6 # tau_larmor= 9.52e-6+2*2.314e-6 print 'tau_larmor = %s' % tau_larmor if sweep == 'N': Number_of_pulses = [50, 500, 3400] #Number_of_pulses = linspace(2,3003,500).astype(int) pts = len(Number_of_pulses) m.params['pts'] = pts tau_list = np.ones(pts) * tau_larmor m.params['tau_list'] = tau_list m.params['Number_of_pulses'] = Number_of_pulses m.params['sweep_pts'] = [ x * tau_larmor * 2e3 for x in Number_of_pulses ] m.params['sweep_name'] = 'decoupling time (ms)' m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' m.autoconfig() funcs.finish(m, upload=True, debug=False) if sweep == 'tau': pts = 10 Number_of_pulses = N start = 3e-3 + tau_larmor * (2 * Number_of_pulses) end = end nr_list = np.linspace(start / (2 * Number_of_pulses) / tau_larmor, end / (2 * Number_of_pulses) / tau_larmor, pts).astype(int) tau_list = nr_list * tau_larmor print nr_list print tau_list m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses * np.ones( m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = 2 * Number_of_pulses * tau_list * 1e3 print m.params['sweep_pts'] m.params['sweep_name'] = 'total evolution time (ms)' m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' m.autoconfig() funcs.finish(m, upload=True, debug=False) if sweep == 'short_times': pts = 50 Number_of_pulses = N #256 # nr_list = np.linspace(start/(2*Number_of_pulses)/tau_larmor, end/(2*Number_of_pulses)/tau_larmor, pts).astype(int) tau_list = np.arange(3.8e-6, 4.e-6, 10e-9) m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses * np.ones( m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = [x * 1e6 for x in tau_list] m.params['sweep_name'] = 'tau (us)' m.params['Decoupling_sequence_scheme'] = 'single_block' m.autoconfig() funcs.finish(m, upload=True, debug=False) if sweep == 'N_in_eigenstate': #Made by MAB to measure decay due to pulse errors for large N tau = 2e-6 print m.params['fast_pi_duration'] print m.params['fast_pi_duration'] * 10 Number_of_pulses = np.arange(25) * 160 # Number_of_pulses = np.arange(3)*8 # Number_of_pulses = np.arange(20)*3*32e1 m.params['pts'] = len(Number_of_pulses) m.params['fast_pi2_amp'] = 0. m.params['DD_in_eigenstate'] = True m.params['tau_list'] = tau * np.ones(m.params['pts']) m.params['Number_of_pulses'] = Number_of_pulses.astype(int) m.params['sweep_pts'] = Number_of_pulses.astype(int) m.params['sweep_name'] = 'Number of Pulses' m.params['Decoupling_sequence_scheme'] = 'single_block' # m.params['fast_pi2_duration'] = 0. m.autoconfig() funcs.finish(m, upload=True, debug=False)
def SimpleDecoupling(name, sweep = 'N',N=4,end=100e-3,nr_list=[1], shutter=0, XY_scheme=8, reps=500,debug=False): m = DD.SimpleDecoupling(name) funcs.prepare(m) m.params['use_shutter'] = shutter m.params['reps_per_ROsequence'] = reps #Repetitions of each data point m.params['Initial_Pulse'] ='x' m.params['DD_in_eigenstate']=False if N==1: m.params['Final_Pulse'] ='x' else: m.params['Final_Pulse'] ='-x' ### Calculate tau larmor #f_larmor = (m.params['ms+1_cntr_frq']-m.params['zero_field_splitting'])*m.params['g_factor_C13']/m.params['g_factor'] #tau_larmor = 1/f_larmor#rounds to ns #tau_larmor =9.668e-6 # tau_larmor= 9.52e-6+2*2.314e-6 # tau_larmor = 2.316e-6 #tau_larmor = 2.524e-6 print 'tau_larmor = %s' %tau_larmor if sweep == 'tau': ### commented out for loop functionalities # pts = 20 # start = 0e-3 + tau_larmor*(2*Number_of_pulses) # end = 60e-3 # nr_list = np.linspace(start/(2*Number_of_pulses)/tau_larmor, end/(2*Number_of_pulses)/tau_larmor, pts).astype(int) Number_of_pulses = N print nr_list*tau_larmor tau_list =np.array([round(x*tau_larmor*0.25e9) / (0.25e9) for x in nr_list]) #to check collapses # tau_list = tau_list-0.25*tau_larmor print nr_list print tau_list print 2*tau_larmor m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses*np.ones(m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = 2*Number_of_pulses*tau_list*1e3 print m.params['sweep_pts'] m.params['sweep_name'] = 'total evolution time (ms)' if XY_scheme == 16: m.params['Decoupling_sequence_scheme']='repeating_T_elt_XY16' elif XY_scheme == 8: m.params['Decoupling_sequence_scheme']='repeating_T_elt' else: raise Exception('XY Scheme not reckognized') #m.params['Decoupling_sequence_scheme']='single_block' m.autoconfig() funcs.finish(m, upload =True, debug=debug)
def SimpleDecoupling(name, N, step_size,tot, start_point = 2, mbi = False, final_pulse = '-x', optimize = True, reps_per_RO = 1500): m = DD.SimpleDecoupling(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']) # if optimize: # qt.msleep(2) # optimize_NV() for kk in range(tot): ## Option to stop the measurement cleanly print 'press q now to cleanly exit measurement loop' breakst = show_stopper() if breakst: break ### Set experimental parameters ### # m.params['reps_per_ROsequence'] = 1000 m.params['reps_per_ROsequence'] = reps_per_RO m.params['Initial_Pulse'] ='x' m.params['Final_Pulse'] = final_pulse m.params['Decoupling_sequence_scheme'] = 'repeating_T_elt' # m.params['Decoupling_sequence_scheme'] = 'single_block' Number_of_pulses = N pts = 51 if N == 128: pts = 21 start = 3.5e-6 + (kk+start_point) * (pts-1)*step_size end = 3.5e-6 + (kk+1+start_point) * (pts-1)*step_size tau_list = np.linspace(start, end, pts) ### Start measurement ### ### Measurement name msmt_name = 'measurement' + str(kk) ### Optimize position if optimize: qt.msleep(2) if mod(kk,5)==0: optimize_NV() ### Define and print parameters funcs.prepare(m) m.params['pts'] = len(tau_list) m.params['Number_of_pulses'] = Number_of_pulses*np.ones(m.params['pts']).astype(int) m.params['tau_list'] = tau_list m.params['sweep_pts'] = tau_list*1e6 m.params['sweep_name'] = 'tau (us)' if mbi == False: m.params['MBI_threshold'] = 0 m.params['Ex_SP_amplitude'] = 0 m.params['Ex_MBI_amplitude'] = 0 m.params['SP_E_duration'] = 20 #2000 m.params['repump_after_MBI_A_amplitude'] = [15e-9] m.params['repump_after_MBI_duration'] = [300] # 50 print 'run = ' + str(kk) + ' of ' + str(tot) print m.params['sweep_pts'] # print tau_list print m.params['MBI_threshold'] # ### Run experiment m.autoconfig() print 'finished autoconfig' 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] m.generate_sequence(upload=True) debug = False if not debug: print 'STARTING ITERATION %s / %s' % (kk + 1, tot ) m.run(setup=True, autoconfig=False) m.save(msmt_name) m.finish()