def mag_theory(qdt, fig_width=9.0, fig_height=6.0): pl=Plotter(fig_width=fig_width, fig_height=fig_height) fw0=linspace(2e9, 8e9, 2000) voltage=linspace(-5, 5, 3000) fq=qdt._get_flux_parabola(voltage=voltage) L=qdt._get_L(fq=fq) print "yo" S11=qdt._get_S11(f=fw0, L=L) print "done s11" colormesh(fw0/1e9, voltage, absolute(S11), plotter=pl) #line(*qdt._get_ls_voltage_from_flux_par_many(f=fw0), plotter=pl, linewidth=0.5, alpha=0.5, color="cyan") print "done plot" return pl ls_f=sqrt(fw0*(fw0-2*qdt._get_Lamb_shift(f=fw0)-2*qdt._get_coupling(f=fw0))) Ec=qdt._get_Ec() Ej=qdt._get_Ej_get_fq(fq=ls_f, Ec=Ec) flux_d_flux0=qdt._get_flux_over_flux0_get_Ej(Ej=Ej) V1=qdt._get_voltage(flux_over_flux0=flux_d_flux0) line(fw0/1e9, qdt._get_voltage(flux_over_flux0=flux_d_flux0), plotter=pl, linewidth=0.3, color="darkgray") print "yo2" ls_f=sqrt(fw0*(fw0-2*qdt._get_Lamb_shift(f=fw0)+2*qdt._get_coupling(f=fw0))) Ec=qdt._get_Ec() Ej=qdt._get_Ej_get_fq(fq=ls_f, Ec=Ec) flux_d_flux0=qdt._get_flux_over_flux0_get_Ej(Ej=Ej) V2=qdt._get_voltage(flux_over_flux0=flux_d_flux0) line(fw0/1e9,V2, plotter=pl, linewidth=0.3, color="darkgray") p, pf=line(fw0/1e9, absolute(V2-V1)/max(absolute(V2-V1)), linewidth=0.3, color="blue") line(fw0/1e9, qdt._get_coupling(f=fw0)/qdt.max_coupling, linewidth=0.3, color="red", plotter=p) print "yo3" #fw02=(qdt._get_Ga(f=fw0)-qdt._get_Ba(f=fw0))/(4*pi*qdt.C) #line(fw0, fw0+fw02, plotter=pl) #line(*qdt._get_ls_voltage_from_flux_par_many(f=fw0+fw02), plotter=pl, linewidth=0.5, alpha=0.5, color="cyan") return pl
def S13_phase_theory(qdt, fig_width=9.0, fig_height=6.0): pl=Plotter(fig_width=fig_width, fig_height=fig_height) fw0=linspace(2e9, 8e9, 2000) voltage=linspace(-5, 5, 1000) fq=qdt._get_flux_parabola(voltage=voltage) L=qdt._get_L(fq=fq) S13=qdt._get_S13(f=fw0, L=L) colormesh(fw0/1e9, voltage, angle(S13), plotter=pl) line(*qdt._get_ls_voltage_from_flux_par_many(f=fw0), plotter=pl, linewidth=0.5, alpha=0.5, color="cyan") return pl
def S13_mag_theory(qdt, fig_width=9.0, fig_height=6.0): pl=Plotter(fig_width=fig_width, fig_height=fig_height) fw0=linspace(2e9, 8e9, 2000) voltage=linspace(-5, 5, 1000) fq=qdt._get_flux_parabola(voltage=voltage) L=qdt._get_L(fq=fq) S13=qdt._get_S13(f=fw0, L=L) colormesh(fw0/1e9, voltage, 10*log10(absolute(S13)), plotter=pl) line(*qdt._get_ls_voltage_from_flux_par_many(f=fw0), plotter=pl, linewidth=0.5, alpha=0.5, color="cyan") return pl
def mag_theory(qdt, fig_width=9.0, fig_height=6.0): pl = Plotter(fig_width=fig_width, fig_height=fig_height) fw0 = linspace(2e9, 8e9, 2000) voltage = linspace(-5, 5, 3000) fq = qdt._get_flux_parabola(voltage=voltage) L = qdt._get_L(fq=fq) print "yo" S11 = qdt._get_S11(f=fw0, L=L) print "done s11" colormesh(fw0 / 1e9, voltage, absolute(S11), plotter=pl) #line(*qdt._get_ls_voltage_from_flux_par_many(f=fw0), plotter=pl, linewidth=0.5, alpha=0.5, color="cyan") print "done plot" return pl ls_f = sqrt( fw0 * (fw0 - 2 * qdt._get_Lamb_shift(f=fw0) - 2 * qdt._get_coupling(f=fw0))) Ec = qdt._get_Ec() Ej = qdt._get_Ej_get_fq(fq=ls_f, Ec=Ec) flux_d_flux0 = qdt._get_flux_over_flux0_get_Ej(Ej=Ej) V1 = qdt._get_voltage(flux_over_flux0=flux_d_flux0) line(fw0 / 1e9, qdt._get_voltage(flux_over_flux0=flux_d_flux0), plotter=pl, linewidth=0.3, color="darkgray") print "yo2" ls_f = sqrt( fw0 * (fw0 - 2 * qdt._get_Lamb_shift(f=fw0) + 2 * qdt._get_coupling(f=fw0))) Ec = qdt._get_Ec() Ej = qdt._get_Ej_get_fq(fq=ls_f, Ec=Ec) flux_d_flux0 = qdt._get_flux_over_flux0_get_Ej(Ej=Ej) V2 = qdt._get_voltage(flux_over_flux0=flux_d_flux0) line(fw0 / 1e9, V2, plotter=pl, linewidth=0.3, color="darkgray") p, pf = line(fw0 / 1e9, absolute(V2 - V1) / max(absolute(V2 - V1)), linewidth=0.3, color="blue") line(fw0 / 1e9, qdt._get_coupling(f=fw0) / qdt.max_coupling, linewidth=0.3, color="red", plotter=p) print "yo3" #fw02=(qdt._get_Ga(f=fw0)-qdt._get_Ba(f=fw0))/(4*pi*qdt.C) #line(fw0, fw0+fw02, plotter=pl) #line(*qdt._get_ls_voltage_from_flux_par_many(f=fw0+fw02), plotter=pl, linewidth=0.5, alpha=0.5, color="cyan") return pl
def bg_A1(frequency): global bgA1data if bgA1data is None: bgA1.read_data() bgA1data = 20 * log10(absolute(bgA1.MagcomData[:, 0])) return interp(frequency, bgA1.frequency, bgA1data) if __name__ == "__main__": qdt.show() if 1: pl = colormesh(qdt.phi_arr, qdt.pwr_arr - qdt.atten, absolute(qdt.fexpt2), cmap="RdBu_r") lp = line(qdt.pwr_arr, absolute(qdt.fexpt2[:, 60])) lp = line(qdt.pwr_arr, absolute(qdt.fexpt2[:, 60 + 1]), pl=lp) lp = line(qdt.pwr_arr, absolute(qdt.fexpt2[:, 60 - 1]), pl=lp) pl = colormesh(qdt.phi_arr, qdt.pwr_arr - qdt.atten, 1 - absolute(qdt.fexpt2), cmap="RdBu_r") pl = colormesh(qdt.phi_arr, qdt.pwr_arr, 10 * log10(absolute(qdt.fexpt2)), cmap="RdBu_r").show() qdt.phi_arr = linspace(-1.0, 1.0, 50) * pi
rt_atten=30.0, read_data=read_data) bgA1data=None def bg_A1(frequency): global bgA1data if bgA1data is None: bgA1.read_data() bgA1data=20*log10(absolute(bgA1.MagcomData[:, 0])) return interp(frequency, bgA1.frequency, bgA1data) if __name__=="__main__": qdt.show() if 1: pl=colormesh(qdt.phi_arr, qdt.pwr_arr-qdt.atten, absolute(qdt.fexpt2), cmap="RdBu_r") lp=line(qdt.pwr_arr, absolute(qdt.fexpt2[:, 60])) lp=line(qdt.pwr_arr, absolute(qdt.fexpt2[:, 60+1]), pl=lp) lp=line(qdt.pwr_arr, absolute(qdt.fexpt2[:, 60-1]), pl=lp) pl=colormesh(qdt.phi_arr, qdt.pwr_arr-qdt.atten, 1-absolute(qdt.fexpt2), cmap="RdBu_r") pl=colormesh(qdt.phi_arr, qdt.pwr_arr, 10*log10(absolute(qdt.fexpt2)), cmap="RdBu_r").show() qdt.phi_arr=linspace(-1.0, 1.0, 50)*pi if 1: pl1=colormesh(qdt.phi_arr, qdt.frq_arr, absolute(qdt.fexpt), cmap="RdBu_r") pl1=colormesh(qdt.phi_arr, qdt.frq_arr, 1-absolute(qdt.fexpt), cmap="RdBu_r")