t1decay.times = np.linspace(0., seq.sweep_time, seq.num_patterns_each) * 1e-3 t1decay.freq = dum.copy() t1decay.gamma = dum.copy() t1decay.p = [] # daq = Nop("daq") for k, bias_val in enumerate(keithley_current.setpoint_mA): mA_start, mA_end = keithley2401.set_current(bias_val) keithley_current.msmt_mA_start[k] = mA_start keithley_current.msmt_mA_end[k] = mA_end daq.daq_params, daq.rec_readout_vs_pats, daq.p_readout = ( daq_programs.run_daq( num_patterns=seq.num_patterns_each, num_records_per_pattern=seq.num_records_per_pattern)) t1decay.p.append(daq.p_readout[0]) # keithley_current.msmt_mA_end = np.array(keithley_current.msmt_mA_end) t1decay.p = np.array(t1decay.p) # t1decay.fit = [] for k in range(keithley_current.num_steps): #. popt, perr, _, _ = analysis.fit_exp_decay(t1decay.times, t1decay.p[k]) t1decay.fit.append(popt) #
sweep.vals = np.linspace(0.1, 1.1, 21) sweep.num_steps = sweep.vals.size # daq = Nop("daq") sweep.p = [] for step_num, v in enumerate(sweep.vals): # print("\nstep_num: {}".format(step_num)) # amp = [v*1.5, v*1.77, 1.5, 1.5] wx_programs.wx_set_and_amplitude_and_offset(amp=amp) # daq.daq_params, daq.rec_readout_vs_pats, daq.p_readout = daq_programs.run_daq( num_patterns=seq.num_patterns, num_records_per_pattern=seq.num_records_per_pattern) sweep.p.append(daq.p_readout) wx_programs.wx_set_and_amplitude_and_offset() sweep.p = np.array(sweep.p) # sweep.fit = [] for k in range(sweep.num_steps): #. popt, perr, _, _ = analysis.fit_sine_decay(seq.times, sweep.p[k][0]) sweep.fit.append(popt) # sweep.fit = np.array(sweep.fit)
# popdstack=np.dstack(pop_3state) # # pop3state_f=popdstack.reshape(seq.num_patterns*3,steps) # np.savetxt('popdstack', pop3state_f) # np.savetxt('fpop', fpop) # fig = plt.figure() # plt.imshow(fpop) ## plt.imshow(pop_3state[:,1,:]) # plt.show seq.comment = "t1 ge" seq.num_patterns = 51 seq.sweep_time = 1000 seq.num_records_per_pattern = 1000 seq.times = np.linspace(0., seq.sweep_time, seq.num_patterns) * 1e-3 black_nonHermitian.ramsey_ef() wx_programs.wx_set_and_amplitude_and_offset() daq, msmt.rec_readout_vs_pats, msmt.p_readout = daq_programs.run_daq( num_patterns=seq.num_patterns, num_records_per_pattern=seq.num_records_per_pattern) # msmt.p_post = analysis.p_readout_postselected(msmt.p_readout) msmt.p_post = analysis.p_readout_postselected(msmt.p_readout) # x = seq.times y = msmt.p_post[1] plt.plot(x, y) plt.ylim([0, 1]) # msmt.popt, msmt.perr, _, _ = analysis.fit_exp_decay(x, y, guess_vals=None) msmt.popt, msmt.perr, _, _ = analysis.fit_sine_decay(x, y, guess_vals=None) # save_by_pickle((expt, seq, daq, msmt))
def readout(): expt = expt_parameters.expt_parameters() seq = Nop("seq") msmt = Nop("measurement") # seq.comment = "ramsey_ge calibration" # seq.num_patterns = 51 # seq.sweep_time = 1000 # seq.num_records_per_pattern = 500 # seq.rabi_amp = 0.05 # seq.times = np.linspace(0., seq.sweep_time, seq.num_patterns)*1e-3 # steps=13 # # sweep = Nop("sweep") # sweep.comment = "rabi ssb freq near EP" # sweep.vals = np.linspace(-3, 3, steps)*1e-3 + 0.092 # ge ramsey ## sweep.vals = np.linspace(-0.5, 0.5, 3)*1e-3 + expt_cal.ssm.ef # pop_3state = [] # fpop=[] # # for idx, ssm_ef in enumerate(sweep.vals): # print(idx) # # black_nonHermitian.ramsey_ef(ssm_ef) # wx_programs.wx_set_and_amplitude_and_offset() # ## seq_experiments.rabi_ef_prep_f(seq.num_patterns, seq.sweep_time, seq.rabi_amp, rabi_ssb_freq) # daq_params, rec_readout_vs_pats, p_readout = daq_programs.run_daq( # num_patterns=seq.num_patterns, num_records_per_pattern=seq.num_records_per_pattern) # p_post = analysis.p_readout_postselected(p_readout) # pop_3state.append(p_readout) ## msmt.popt, msmt.perr, _, _ = analysis.fit_sine_decay(x, y, guess_vals=None) # x = seq.times # y = p_post[1] ## analysis.fit_sine_decay(x,y,) # fpop.append(p_post[1]) ## save_by_pickle((expt, seq, daq, msmt)) # plt.plot(seq.times, p_post[1]) # plt.ylim([0,4]) # plt.show() ## pop_3state = np.stack(pop_3state) # popdstack=np.dstack(pop_3state) # # pop3state_f=popdstack.reshape(seq.num_patterns*3,steps) # np.savetxt('popdstack', pop3state_f) # np.savetxt('fpop', fpop) # fig = plt.figure() # plt.imshow(fpop) ## plt.imshow(pop_3state[:,1,:]) # plt.show seq.comment = "t1 ge" seq.num_patterns = 51 seq.sweep_time = 1000 seq.num_records_per_pattern = 1000 seq.times = np.linspace(0., seq.sweep_time, seq.num_patterns) * 1e-3 # black_nonHermitian.ramsey_ef() wx_programs.wx_set_and_amplitude_and_offset() daq, msmt.rec_readout_vs_pats, msmt.p_readout = daq_programs.run_daq( num_patterns=seq.num_patterns, num_records_per_pattern=seq.num_records_per_pattern) # msmt.p_post = analysis.p_readout_postselected(msmt.p_readout) # msmt.p_post = analysis.p_readout_postselected(msmt.p_readout) # # x = seq.times # y = msmt.p_post[1] # plt.plot(x, y) # plt.ylim([0, 1]) # msmt.popt, msmt.perr, _, _ = analysis.fit_exp_decay(x, y, guess_vals=None) # msmt.popt, msmt.perr, _, _ = analysis.fit_sine_decay(x, y, guess_vals=None) # save_by_pickle((expt, seq, daq, msmt)) # test = [1, 2, 3] return msmt.p_readout
import numpy as np import daq_programs import daq_processing import keithley2401 import matplotlib.pyplot as plt if __name__ == "__main__": # freq_sweep = [] # gamma_sweep = [] # current_sweep = np.linspace(7.20, 7.25, 6) # # for val_mA in current_sweep: # keithley2401.set_current(val_mA) # daq_params, rec_readout_vs_pats, p_readout = daq_programs.run_daq(); # times = np.linspace(0, 0.5, daq_params.num_patterns) # fit, y_vals = daq_processing.fit_sine_decay(times, p_readout[1]) # freq_sweep.append(fit[0][0]) # gamma_sweep.append(fit[0][1]) # plt.figure(figsize=(6,4)) # plt.plot(current_sweep, freq_sweep) # plt.show() # # plt.figure(figsize=(6,4)) # plt.plot(current_sweep, gamma_sweep) # plt.show() # daq_params, rec_readout_vs_pats, p_readout = daq_programs.run_daq() times = np.linspace(0, 1.0, daq_params.num_patterns) fit, y_vals = daq_processing.fit_sine_decay(times, p_readout[2])
sweep.num_steps = sweep.vals.size # sweep.p = [] sweep.p_post = [] for step_num, v in enumerate(sweep.vals): # print("\nstep_num: {}, sweep.val: {}".format(step_num, v)) # amp = [v*1.5, v*1.77, 1.5, 1.5] wx_programs.wx_set_and_amplitude_and_offset(amp=amp) for k in range(seq.num_avgs): # daq_params, _, p = daq_programs.run_daq( num_patterns=seq.num_patterns, num_records_per_pattern=seq.num_records_per_pattern) if k is 0: p_readout = p else: p_readout += p p_readout = p_readout/seq.num_avgs p_post = analysis.p_readout_postselected(p_readout) sweep.p.append(p_readout) sweep.p_post.append(p_post) daq = Nop("daq") daq.daq_params = daq_params wx_programs.wx_set_and_amplitude_and_offset() sweep.p = np.array(sweep.p)