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 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 _default_plotter(self): if self.plot_name=="": self.plot_name=self.name pl=Plotter(name=self.name) for param in get_all_tags(self, "plot"): print param pl, pf=line(*getattr(self, param), plot_name=get_tag(self, param, "plot"), plotter=pl, pf_too=True) self.data_dict[param]=pf.plot_name return pl
def _default_plotter(self): if self.plot_name == "": self.plot_name = self.name pl = Plotter(name=self.name) for param in get_all_tags(self, "plot"): print param pl, pf = line(*getattr(self, param), plot_name=get_tag(self, param, "plot"), plotter=pl) self.data_dict[param] = pf.plot_name return pl
def anharm_plot2(qdt, fig_width=9.0, fig_height=6.0, ymin=-1.5, ymax=1.0): """Lamb shifted anharmonicity plot""" pl = Plotter(fig_width=fig_width, fig_height=fig_height) fw0 = linspace(2e9, 7e9, 2000) lsfw0 = array([sqrt(f * (f - 2 * qdt._get_Lamb_shift(f=f))) for f in fw0]) Ej = qdt._get_Ej_get_fq(fq=lsfw0) E0, E1, E2 = qdt._get_transmon_energy_levels(Ej=Ej, n_energy=3) anharm = (E2 - E1) - (E1 - E0) E0p, E1p, E2p = qdt._get_lamb_shifted_transmon_energy_levels(Ej=Ej, n_energy=3) anharmp = (E2p - E1p) - (E1p - E0p) line(lsfw0 / 1e9, anharm / h / 1e9, plotter=pl, linewidth=0.5, color="purple", label=r"anharm") line(lsfw0 / 1e9, anharmp / h / 1e9, plotter=pl, linewidth=0.5, color="black", label=r"ls anharm") line(fw0 / 1e9, qdt._get_coupling(fw0) / qdt.max_coupling, label=r"$G_a/2C$", color="blue", plotter=pl) pl.xlabel = r"$E_J/E_C$" pl.ylabel = r"$\Delta$ (GHz)" pl.legend(loc='lower left') return pl
def coupling_plot(): pl=Plotter(fig_width=6.0, fig_height=4.0) fw0=linspace(4e9, 7e9, 2000) line(fw0/1e9, qdt._get_coupling(fw0)/1e9, label=r"$G_a/2C$", color="blue", plotter=pl) line(fw0/1e9, qdt._get_Lamb_shift(fw0)/1e9, label=r"$-B_a/2C$", color="red", plotter=pl) line(fw0/1e9, idt._get_coupling(fw0)/4/1e9, label=r"$G_a^{IDT}/2C/4$", color="green", linewidth=1.0, plotter=pl) pl.set_ylim(-1.0, 1.5) pl.legend(loc='lower right') return pl
def anharm_plot2(qdt, fig_width=9.0, fig_height=6.0, ymin=-1.5, ymax=1.0): """Lamb shifted anharmonicity plot""" pl=Plotter(fig_width=fig_width, fig_height=fig_height) fw0=linspace(2e9, 7e9, 2000) lsfw0=array([sqrt(f*(f-2*qdt._get_Lamb_shift(f=f))) for f in fw0]) Ej=qdt._get_Ej_get_fq(fq=lsfw0) E0, E1, E2=qdt._get_transmon_energy_levels(Ej=Ej, n_energy=3) anharm=(E2-E1)-(E1-E0) E0p, E1p, E2p=qdt._get_lamb_shifted_transmon_energy_levels(Ej=Ej, n_energy=3) anharmp=(E2p-E1p)-(E1p-E0p) line(lsfw0/1e9, anharm/h/1e9, plotter=pl, linewidth=0.5, color="purple", label=r"anharm") line(lsfw0/1e9, anharmp/h/1e9, plotter=pl, linewidth=0.5, color="black", label=r"ls anharm") line(fw0/1e9, qdt._get_coupling(fw0)/qdt.max_coupling, label=r"$G_a/2C$", color="blue", plotter=pl) pl.xlabel=r"$E_J/E_C$" pl.ylabel=r"$\Delta$ (GHz)" pl.legend(loc='lower left') return pl
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 if __name__=="__main__": pl0=qdt.lgf1.lgf_test_plot() from taref.physics.surface_charge import element_factor_plot, metallization_plot, Rho pl1=element_factor_plot() pl2=metallization_plot() rho=Rho() rho.fixed_freq_max=2000.0*rho.f0 pl3=rho.plot_alpha() #auto_xlim=False, x_min=0, x_max=20) pl4=rho.plot_surface_charge(auto_xlim=False, x_min=-3, x_max=3, auto_ylim=False, y_min=-3e-12, y_max=3e-12) pl5=rho.plot_surface_voltage(auto_xlim=False, x_min=-3, x_max=3) pl6=line(rho.surface_x[2000:-500], rho.surface_voltage[2000:-500]+rho.surface_voltage[500:-2000]+rho.surface_voltage[2500:], pl="superposition", auto_xlim=False, x_min=-3, x_max=3) pl6.xlabel="x/center wavelength" pl6.ylabel="surface voltage" from taref.physics.idt import metallization_couple, metallization_Lamb, couple_comparison, Lamb_shift_comparison, hilbert_check pl7=metallization_couple() pl8=metallization_Lamb() pl9=couple_comparison() pl10=Lamb_shift_comparison() pl11=hilbert_check() a.save_plots([pl0, pl1, pl2, pl3, pl4, pl5, pl6, pl7, pl8, pl9, pl10, pl11]) pl1.show() from taref.physics.qdt import anharm_plot print qdt.max_coupling #anharm_plot2(qdt)#.show()
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:
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")