Пример #1
0
def line_cs(self, ind=210):
    print self.frequency[ind]/1e9
    pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_cs_{}".format(self.name))
    pl, pf=line(self.yoko, (self.MagdB.transpose()-self.MagdB[:, 0])[:, ind], plotter=pl, linewidth=1.0)
    pl.xlabel="Yoko (V)"
    pl.ylabel="Magnitude (dB)"
    return pl
def line_cs2(self, ind=210, f0=5.35e9, alpha=0.45):
    fq_vec=array([sqrt(f*(f-2*qdt.call_func("Lamb_shift", f=f, f0=f0, couple_mult=alpha))) for f in self.frequency])
    print self.frequency[ind]/1e9, fq_vec[ind]/1e9
    pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_cs_{}".format(self.name))
    pl, pf=line(self.yoko, (self.MagdB.transpose()-self.MagdB[:, 0])[:, ind], plotter=pl, linewidth=1.0)
    pl.xlabel="Yoko (V)"
    pl.ylabel="Magnitude (dB)"
    return pl
Пример #3
0
def anton_lamb_shift_plot(fig_width=9.0, fig_height=6.0):
    """reproduces coupling/lamb shift plot in Anton's paper"""
    pl=Plotter(fig_width=fig_width, fig_height=fig_height)
    EjdivEc=linspace(0.1, 300, 10000)
    Ej=EjdivEc*antonqdt.Ec
    #E0, E1, E2=antonqdt._get_transmon_energy_levels(Ej=Ej, n_energy=3)
    fq=antonqdt._get_fq(Ej)
    #anharm=(E2-E1)-(E1-E0)
    #E0p, E1p, E2p=antonqdt._get_lamb_shifted_transmon_energy_levels(Ej=Ej, n_energy=3)
    #anharmp=(E2p-E1p)-(E1p-E0p)
    #fq= (E1-E0)/h#qdt.call_func("fq", Ej=EjdivEc*qdt.Ec)
    coup=antonqdt._get_coupling(fq)
    ls=antonqdt._get_Lamb_shift(fq)
    line(fq/antonqdt.f0, 2.0*coup/(2.0*antonqdt.max_coupling), plotter=pl, linewidth=0.5, color="red", label=r"$\Gamma$, $N=10$")
    line(fq/antonqdt.f0, ls/(2.0*antonqdt.max_coupling), plotter=pl, color="green", linewidth=0.5, label=r"$\Delta$, $N=10$")

    #antonqdt.Np=3
    Ej=EjdivEc*antonqdt3.Ec
    fq=antonqdt3._get_fq(Ej)
    coup=antonqdt3._get_coupling(fq)
    ls=antonqdt3._get_Lamb_shift(fq)
    line(fq/antonqdt3.f0, 2.0*coup/(2.0*antonqdt3.max_coupling), plotter=pl, linewidth=0.5, color="blue", label=r"$\Gamma$, $N=3$")
    line(fq/antonqdt3.f0, ls/(2.0*antonqdt3.max_coupling), plotter=pl, color="black", linewidth=0.5, label=r"$\Delta$, $N=3$")
    pl.set_ylim(-0.4, 1.0)
    pl.set_xlim(0.2, 1.8)
    pl.xlabel=r"$f_{10}/f_{IDT}$"
    pl.ylabel=r"$\Delta/\Gamma_{10}^{MAX}$"
    pl.legend(loc='upper right')
    return pl
def magabs_colormesh3(self, f0=5.35e9, alpha=0.45, pl=None):
    fq_vec=array([sqrt(f*(f-2*qdt.call_func("Lamb_shift", f=f, f0=f0, couple_mult=alpha))) for f in self.frequency])
    pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
    pl, pf=colormesh(self.yoko, self.frequency/1e9, absolute((self.Magcom.transpose()-self.Magcom[:, 0]).transpose()), plotter=pl)
    #pf.set_clim(-0.3, 0.1)
    #pl.set_ylim(min(fq_vec/1e9), max(fq_vec/1e9))
    #pl.set_xlim(min(self.yoko), max(self.yoko))

    pl.ylabel="Yoko (V)"
    pl.xlabel="Frequency (GHz)"
    return pl
Пример #5
0
def energy_level_plot(qdt, fig_width=9.0, fig_height=6.0):
    pl=Plotter(fig_width=fig_width, fig_height=fig_height)
    EjdivEc=linspace(0.1, 300, 3000)
    Ej=EjdivEc*qdt.Ec
    E0, E1, E2=qdt._get_transmon_energy_levels(Ej=Ej, n_energy=3)
    line(EjdivEc, (E0+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0)
    line(EjdivEc, (E1+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0)
    line(EjdivEc, (E2+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0)

    E0p, E1p, E2p=qdt._get_lamb_shifted_transmon_energy_levels(Ej=Ej, n_energy=3)
    line(EjdivEc, (E0p+Ej)/h/1e9, plotter=pl, color="red", linewidth=1.0)
    line(EjdivEc, (E1p+Ej)/h/1e9, plotter=pl, color="green", linewidth=1.0)
    line(EjdivEc, (E2p+Ej)/h/1e9, plotter=pl, color="purple", linewidth=1.0)
    pl.xlabel="$E_j/E_c$"
    pl.ylabel="Frequency (GHz)"
    return pl
Пример #6
0
    def energy_level_plot():
        pl=Plotter(fig_width=9.0, fig_height=6.0)

        set_tag(qdt, "EjdivEc", log=False)
        E0, E1, E2=qdt.call_func("transmon_energy_levels", EjdivEc=EjdivEc, n_energy=3)
        Ej=EjdivEc*qdt.Ec
        pl, pf=line(EjdivEc, (E0+Ej)/h/1e9, linestyle="dashed", linewidth=1.0, plotter=pl)
        line(EjdivEc, (E1+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0)
        line(EjdivEc, (E2+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0)
        E0p, E1p, E2p=qdt.call_func("lamb_shifted_transmon_energy_levels", EjdivEc=EjdivEc, n_energy=3)
        line(EjdivEc, (E0p+Ej)/h/1e9, plotter=pl, color="red", linewidth=1.0)
        line(EjdivEc, (E1p+Ej)/h/1e9, plotter=pl, color="green", linewidth=1.0)
        line(EjdivEc, (E2p+Ej)/h/1e9, plotter=pl, color="purple", linewidth=1.0)
        pl.xlabel="$E_j/E_c$"
        pl.ylabel="Frequency (GHz)"
        return pl
    def ifft_plot(self):
        pl=Plotter(fig_width=6, fig_height=4)

        line("ifft_{}".format(self.name), absolute(fft.ifft(self.Magcom[:,self.on_res_ind])), label="On resonance")
        line("ifft_{}".format(self.name), absolute(fft.ifft(self.Magcom[:,0])), label="Off resonance", color="red")
        pl.legend()
        pl.set_xlim(0, 100)
        pl.xlabel="Time (#)"
        pl.ylabel="Absolute Magnitude"
        return pl
def magabs_colormesh(self):
    pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
    pl, pf=colormesh(self.frequency/1e9, self.yoko, (self.MagdB.transpose()-self.MagdB[:, 0]), plotter=pl)
    pf.set_clim(-0.3, 0.1)
    pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
    pl.set_ylim(min(self.yoko), max(self.yoko))

    pl.ylabel="Yoko (V)"
    pl.xlabel="Frequency (GHz)"
    return pl
Пример #9
0
def energy_level_plot(qbt):
    """confirmation plot of transmon energy levels"""
    pl=Plotter(fig_width=9.0, fig_height=6.0)
    EjdivEc=linspace(0.1, 300, 3000)
    Ej=EjdivEc*qbt.Ec
    E0, E1, E2=qbt._get_transmon_energy_levels(Ej=Ej, n_energy=3)
    line(EjdivEc, (E0+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0, color="blue")
    line(EjdivEc, (E1+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0, color="red")
    line(EjdivEc, (E2+Ej)/h/1e9, plotter=pl, linestyle="dashed", linewidth=1.0, color="green")

    Ec=qbt.Ec
    E0 =  sqrt(8.0*Ej*Ec)*0.5 - Ec/4.0
    E1 =  sqrt(8.0*Ej*Ec)*1.5 - (Ec/12.0)*(6.0+6.0+3.0)
    E2 =  sqrt(8.0*Ej*Ec)*2.5 - (Ec/12.0)*(6.0*2**2+6.0*2+3.0)

    line(EjdivEc, E0/h/1e9, plotter=pl, linewidth=0.5, color="blue")
    line(EjdivEc, E1/h/1e9, plotter=pl, linewidth=0.5, color="red")
    line(EjdivEc, E2/h/1e9, plotter=pl, linewidth=0.5, color="green")

    pl.xlabel="$E_j/E_c$"
    pl.ylabel="Frequency (GHz)"
    return pl
Пример #10
0
    def ifft_plot(self):
        pl = Plotter(fig_width=6, fig_height=4)

        line("ifft_{}".format(self.name),
             absolute(fft.ifft(self.Magcom[:, self.on_res_ind])),
             label="On resonance")
        line("ifft_{}".format(self.name),
             absolute(fft.ifft(self.Magcom[:, 0])),
             label="Off resonance",
             color="red")
        pl.legend()
        pl.set_xlim(0, 100)
        pl.xlabel = "Time (#)"
        pl.ylabel = "Absolute Magnitude"
        return pl
Пример #11
0
    def magabs_colormesh(self):
        pl = Plotter(fig_width=9.0,
                     fig_height=6.0,
                     name="magabs_{}".format(self.name))
        pl, pf = colormesh(self.frequency / 1e9,
                           self.yoko,
                           (self.MagdB.transpose() - self.MagdB[:, 0]),
                           plotter=pl)
        pf.set_clim(-0.3, 0.1)
        pl.set_xlim(min(self.frequency / 1e9), max(self.frequency / 1e9))
        pl.set_ylim(min(self.yoko), max(self.yoko))

        pl.ylabel = "Yoko (V)"
        pl.xlabel = "Frequency (GHz)"
        return pl
Пример #12
0
    def energy_level_plot():
        pl = Plotter(fig_width=9.0, fig_height=6.0)

        set_tag(qdt, "EjdivEc", log=False)
        E0, E1, E2 = qdt.call_func("transmon_energy_levels",
                                   EjdivEc=EjdivEc,
                                   n_energy=3)
        Ej = EjdivEc * qdt.Ec
        pl, pf = line(EjdivEc, (E0 + Ej) / h / 1e9,
                      linestyle="dashed",
                      linewidth=1.0,
                      plotter=pl)
        line(EjdivEc, (E1 + Ej) / h / 1e9,
             plotter=pl,
             linestyle="dashed",
             linewidth=1.0)
        line(EjdivEc, (E2 + Ej) / h / 1e9,
             plotter=pl,
             linestyle="dashed",
             linewidth=1.0)
        E0p, E1p, E2p = qdt.call_func("lamb_shifted_transmon_energy_levels",
                                      EjdivEc=EjdivEc,
                                      n_energy=3)
        line(EjdivEc, (E0p + Ej) / h / 1e9,
             plotter=pl,
             color="red",
             linewidth=1.0)
        line(EjdivEc, (E1p + Ej) / h / 1e9,
             plotter=pl,
             color="green",
             linewidth=1.0)
        line(EjdivEc, (E2p + Ej) / h / 1e9,
             plotter=pl,
             color="purple",
             linewidth=1.0)
        pl.xlabel = "$E_j/E_c$"
        pl.ylabel = "Frequency (GHz)"
        return pl
Пример #13
0
    def magabs_colormesh(self,
                         offset=-0.08,
                         flux_factor=0.52,
                         Ejmax=h * 44.0e9,
                         f0=5.35e9,
                         alpha=0.7,
                         pl=None):
        fq_vec = array([
            sqrt(f * (f + alpha * calc_freq_shift(f, qdt.ft, qdt.Np, f0,
                                                  qdt.epsinf, qdt.W, qdt.Dvv)))
            for f in self.frequency
        ])
        freq, frq2 = flux_parabola(self.yoko, offset, 0.16, Ejmax, qdt.Ec)

        pl = Plotter(fig_width=9.0,
                     fig_height=6.0,
                     name="magabs_{}".format(self.name))
        pl, pf = colormesh(freq,
                           fq_vec, (self.MagdB.transpose() -
                                    self.MagdB[:, 0]).transpose(),
                           plotter=pl)
        pf.set_clim(-0.3, 0.1)
        line([min(freq), max(freq)], [min(freq), max(freq)], plotter=pl)
        flux_o_flux0 = flux_over_flux0(self.yoko, offset, flux_factor)
        qEj = Ej(Ejmax, flux_o_flux0)
        EjdivEc = qEj / qdt.Ec
        ls_fq = qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
        ls_fq2 = qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)

        frq2 = qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc) / h
        line(ls_fq, ls_fq2, plotter=pl)

        #pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
        #pl.set_ylim(min(self.yoko), max(self.yoko))

        pl.ylabel = "Yoko (V)"
        pl.xlabel = "Frequency (GHz)"
        return pl
Пример #14
0
def magabs_colormesh(self, offset=-0.08, flux_factor=0.52, Ejmax=h*44.0e9, f0=5.35e9, alpha=0.7, pl=None):
    fq_vec=array([sqrt(f*(f+alpha*calc_freq_shift(f, qdt.ft, qdt.Np, f0, qdt.epsinf, qdt.W, qdt.Dvv))) for f in self.frequency])
    freq, frq2=flux_parabola(self.yoko, offset, 0.16, Ejmax, qdt.Ec)

    pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
    pl, pf=colormesh(freq, fq_vec, (self.MagdB.transpose()-self.MagdB[:, 0]).transpose(), plotter=pl)
    pf.set_clim(-0.3, 0.1)
    line([min(freq), max(freq)], [min(freq), max(freq)], plotter=pl)
    flux_o_flux0=flux_over_flux0(self.yoko, offset, flux_factor)
    qEj=Ej(Ejmax, flux_o_flux0)
    EjdivEc=qEj/qdt.Ec
    ls_fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    ls_fq2=qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)

    frq2=qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc)/h
    line(ls_fq, ls_fq2, plotter=pl)

    #pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
    #pl.set_ylim(min(self.yoko), max(self.yoko))

    pl.ylabel="Yoko (V)"
    pl.xlabel="Frequency (GHz)"
    return pl
Пример #15
0
    def anharm_plot2():
        """reproduces anharm plot in Anton's paper"""
        set_tag(qdt, "EjdivEc", log=False)
        set_tag(qdt, "Ej", log=False)
        pl = Plotter(fig_width=9.0, fig_height=6.0)
        #qdt.epsinf=qdt.epsinf/3.72
        #qdt.Np=10
        #qdt.Ec=qdt.fq*0.1*h
        print qdt.max_coupling, qdt.coupling_approx
        #flux_o_flux0=qdt.call_func("flux_over_flux0", voltage=yoko)
        #Ej=qdt.call_func("Ej", flux_over_flux0=flux_o_flux0)
        #EjdivEc=Ej/qdt.Ec
        anharm = qdt.call_func("anharm", EjdivEc=EjdivEc)
        anharmp = qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc)
        fq = qdt.call_func("fq", Ej=EjdivEc * qdt.Ec)
        ls_fq = qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
        ls_fq2 = qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)
        #pl, pf=line(fq, anharm/h, linewidth=0.5, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$")

        pl, pf = line(EjdivEc,
                      anharmp / h / 1e9,
                      linewidth=1.0,
                      color="black",
                      label=r"$\Delta_{2,1}-\Delta_{1,0}$",
                      plotter=pl)
        line(EjdivEc,
             anharm / h / 1e9,
             linewidth=1.0,
             color="purple",
             label=r"anharm",
             plotter=pl)

        line(EjdivEc, (ls_fq - fq) / 1e9,
             plotter=pl,
             color="blue",
             linewidth=1.0,
             label=r"$\Delta_{1,0}$")
        E0, E1, E2 = qdt.call_func("transmon_energy_levels",
                                   EjdivEc=EjdivEc,
                                   n_energy=3)
        fq2 = (E2 - E1) / h
        line(EjdivEc, (ls_fq2 - fq2) / 1e9,
             plotter=pl,
             color="red",
             linewidth=1.0,
             label=r"$\Delta_{2,1}$")
        pl.set_ylim(-2, 1.5)
        #pl.set_xlim(0.0, 70)
        pl.xlabel = r"$E_j/E_c$"
        pl.ylabel = r"$\Delta (GHz)$"
        #pl.legend(loc='lower right')
        #fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
        #line(EjdivEc, fq, plotter=pl, color="green", linewidth=0.5)

        #line(EjdivEc, E1p, plotter=pl, color="green", linewidth=0.5)
        #line(EjdivEc, E2p, plotter=pl, color="purple", linewidth=0.5)
        return pl
Пример #16
0
    def anharm_plot2():
        """reproduces anharm plot in Anton's paper"""
        set_tag(qdt, "EjdivEc", log=False)
        set_tag(qdt, "Ej", log=False)
        pl=Plotter(fig_width=9.0, fig_height=6.0)
        #qdt.epsinf=qdt.epsinf/3.72
        #qdt.Np=10
        #qdt.Ec=qdt.fq*0.1*h
        print qdt.max_coupling, qdt.coupling_approx
        #flux_o_flux0=qdt.call_func("flux_over_flux0", voltage=yoko)
        #Ej=qdt.call_func("Ej", flux_over_flux0=flux_o_flux0)
        #EjdivEc=Ej/qdt.Ec
        anharm=qdt.call_func("anharm", EjdivEc=EjdivEc)
        anharmp=qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc)
        fq=qdt.call_func("fq", Ej=EjdivEc*qdt.Ec)
        ls_fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
        ls_fq2=qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)
        #pl, pf=line(fq, anharm/h, linewidth=0.5, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$")

        pl, pf=line(EjdivEc, anharmp/h/1e9, linewidth=1.0, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$", plotter=pl)
        line(EjdivEc, anharm/h/1e9, linewidth=1.0, color="purple", label=r"anharm", plotter=pl)

        line(EjdivEc, (ls_fq-fq)/1e9, plotter=pl, color="blue", linewidth=1.0, label=r"$\Delta_{1,0}$")
        E0, E1, E2=qdt.call_func("transmon_energy_levels", EjdivEc=EjdivEc, n_energy=3)
        fq2=(E2-E1)/h
        line(EjdivEc, (ls_fq2-fq2)/1e9, plotter=pl, color="red", linewidth=1.0, label=r"$\Delta_{2,1}$")
        pl.set_ylim(-2, 1.5)
        #pl.set_xlim(0.0, 70)
        pl.xlabel=r"$E_j/E_c$"
        pl.ylabel=r"$\Delta (GHz)$"
        #pl.legend(loc='lower right')
        #fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
        #line(EjdivEc, fq, plotter=pl, color="green", linewidth=0.5)

        #line(EjdivEc, E1p, plotter=pl, color="green", linewidth=0.5)
        #line(EjdivEc, E2p, plotter=pl, color="purple", linewidth=0.5)
        return pl
Пример #17
0
def anharm_plot(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)
    EjdivEc=linspace(0.1, 300, 3000)
    Ej=EjdivEc*qdt.Ec
    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)

    fq= (E1-E0)/h
    ls_fq=(E1p-E0p)/h
    fq2=(E2-E1)/h
    ls_fq2=(E2p-E1p)/h

    line(EjdivEc, anharm/h/1e9, plotter=pl, linewidth=0.5, color="purple", label=r"anharm")
    line(EjdivEc, anharmp/h/1e9, plotter=pl, linewidth=0.5, color="black", label=r"ls anharm")
    line(EjdivEc, (ls_fq-fq)/1e9, plotter=pl, color="blue", linewidth=0.5, label=r"$\Delta_{1,0}$")
    line(EjdivEc, (ls_fq2-fq2)/1e9, plotter=pl, color="red", linewidth=0.5, label=r"$\Delta_{2,1}$")
    pl.set_ylim(ymin, ymax)
    #pl.set_xlim(0.7, 1.3)
    pl.xlabel=r"$E_J/E_C$"
    pl.ylabel=r"$\Delta$ (GHz)"
    pl.legend(loc='lower left')
    #pl.set_ylim(-2, 1.5)
    #pl.set_xlim(0.0, 70)

    #anharm=qdt.call_func("anharm", EjdivEc=EjdivEc)
    #anharmp=qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc)
    #fq=qdt.call_func("fq", Ej=EjdivEc*qdt.Ec)
    #ls_fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    #ls_fq2=qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)
    #pl, pf=line(fq, anharm/h, linewidth=0.5, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$")

    #pl, pf=line(EjdivEc, anharmp/h/1e9, linewidth=1.0, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$", plotter=pl)
    #line(EjdivEc, anharm/h/1e9, linewidth=1.0, color="purple", label=r"anharm", plotter=pl)

    #line(EjdivEc, (ls_fq-fq)/1e9, plotter=pl, color="blue", linewidth=1.0, label=r"$\Delta_{1,0}$")
    #E0, E1, E2=qdt.call_func("transmon_energy_levels", EjdivEc=EjdivEc, n_energy=3)
    #fq2=(E2-E1)/h
    #line(EjdivEc, (ls_fq2-fq2)/1e9, plotter=pl, color="red", linewidth=1.0, label=r"$\Delta_{2,1}$")
    #pl.xlabel=r"$E_j/E_c$"
    #pl.ylabel=r"$\Delta (GHz)$"
    #pl.legend(loc='lower right')
    #fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    #line(EjdivEc, fq, plotter=pl, color="green", linewidth=0.5)

    #line(EjdivEc, E1p, plotter=pl, color="green", linewidth=0.5)
    #line(EjdivEc, E2p, plotter=pl, color="purple", linewidth=0.5)
    return pl
def ifft_plot(self):
    pl=Plotter(fig_width=6, fig_height=4)

    line("ifft_{}".format(self.name), absolute(fft.ifft(self.Magcom[:,self.on_res_ind])), label="On resonance")
    line("ifft_{}".format(self.name), absolute(fft.ifft(self.Magcom[:,0])), label="Off resonance", color="red")
    pl.legend()
    pl.set_xlim(0, 100)
    pl.xlabel="Time (#)"
    pl.ylabel="Absolute Magnitude"
    return pl
#ifft_plot(s4a1_mp).show()
        #d.savefig("/Users/thomasaref/Dropbox/Current stuff/Linneaus180416/", "trans_ifft.pdf")
        #d.show()
Пример #19
0
def anton_anharm_plot(fig_width=9, fig_height=6):
    """reproduces anharm plot in Anton's paper"""

    pl=Plotter(fig_width=fig_width, fig_height=fig_height)

    #print qdt.f0*h/qdt.Ec, qdt.epsinf/3.72
    #qdt.Np=10
    #qdt.Ec=qdt.f0*0.1*h

    EjdivEc=linspace(0.1, 300, 3000)
    Ej=EjdivEc*antonqdt.Ec

    print antonqdt.C, antonqdt.C, antonqdt.Ec, antonqdt._get_Ec(antonqdt.C)

    print antonqdt.max_coupling, antonqdt.epsinf, antonqdt.f0*h/antonqdt.Ec
    E0, E1, E2=antonqdt._get_transmon_energy_levels(Ej=Ej, n_energy=3)
    anharm=(E2-E1)-(E1-E0)

    E0p, E1p, E2p=antonqdt._get_lamb_shifted_transmon_energy_levels(Ej=Ej, n_energy=3)

    anharmp=(E2p-E1p)-(E1p-E0p)

    fq= (E1-E0)/h#qdt.call_func("fq", Ej=EjdivEc*qdt.Ec)
    ls_fq=(E1p-E0p)/h #qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    fq2=(E2-E1)/h
    ls_fq2=(E2p-E1p)/h #qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)

    line(fq/antonqdt.f0, (anharmp/h-anharm/h)/(2.0*antonqdt.max_coupling), plotter=pl, linewidth=0.5, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$")
    line(fq/antonqdt.f0, (ls_fq-fq)/(2.0*antonqdt.max_coupling), plotter=pl, color="blue", linewidth=0.5, label=r"$\Delta_{1,0}$")
    line(fq/antonqdt.f0, (ls_fq2-fq2)/(2.0*antonqdt.max_coupling), plotter=pl, color="red", linewidth=0.5, label=r"$\Delta_{2,1}$")
    pl.set_ylim(-1.0, 0.6)
    pl.set_xlim(0.7, 1.3)
    pl.xlabel=r"$f_{10}/f_{IDT}$"
    pl.ylabel=r"$\Delta/\Gamma_{10}^{MAX}$"
    pl.legend(loc='lower left')
    #fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    #line(EjdivEc, fq, plotter=pl, color="green", linewidth=0.5)

    #line(EjdivEc, E1p, plotter=pl, color="green", linewidth=0.5)
    #line(EjdivEc, E2p, plotter=pl, color="purple", linewidth=0.5)
    return pl
Пример #20
0
def magabs_colormesh2(self, offset=-0.08, flux_factor=0.52, Ejmax=h*44.0e9, f0=5.35e9, alpha=0.7, pl=None):
    fq_vec=array([sqrt(f*(f+alpha*calc_freq_shift(f, qdt.ft, qdt.Np, f0, qdt.epsinf, qdt.W, qdt.Dvv))) for f in self.frequency])

    pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
    pl, pf=colormesh(fq_vec, self.yoko, (self.MagdB.transpose()-self.MagdB[:, 0]), plotter=pl)
    pf.set_clim(-0.3, 0.1)
    #pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
    pl.set_ylim(min(self.yoko), max(self.yoko))

    pl.ylabel="Yoko (V)"
    pl.xlabel="Frequency (GHz)"
    return pl
Пример #21
0
def ifft_plot(self):
    pl = Plotter(fig_width=6, fig_height=4)

    line("ifft_{}".format(self.name),
         absolute(fft.ifft(self.Magcom[:, self.on_res_ind])),
         label="On resonance")
    line("ifft_{}".format(self.name),
         absolute(fft.ifft(self.Magcom[:, 0])),
         label="Off resonance",
         color="red")
    pl.legend()
    pl.set_xlim(0, 100)
    pl.xlabel = "Time (#)"
    pl.ylabel = "Absolute Magnitude"
    return pl


#ifft_plot(s4a1_mp).show()
#d.savefig("/Users/thomasaref/Dropbox/Current stuff/Linneaus180416/", "trans_ifft.pdf")
#d.show()
Пример #22
0
    def magabs_colormesh2(self, f0=5.35e9, alpha=0.45, pl=None):
        fq_vec = array([
            sqrt(f *
                 (f - 2 *
                  qdt.call_func("Lamb_shift", f=f, f0=f0, couple_mult=alpha)))
            for f in self.frequency
        ])
        pl = Plotter(fig_width=9.0,
                     fig_height=6.0,
                     name="magabs_{}".format(self.name))
        pl, pf = colormesh(self.yoko,
                           fq_vec / 1e9, (self.MagdB.transpose() -
                                          self.MagdB[:, 0]).transpose(),
                           plotter=pl)
        pf.set_clim(-0.3, 0.1)
        pl.set_ylim(min(fq_vec / 1e9), max(fq_vec / 1e9))
        pl.set_xlim(min(self.yoko), max(self.yoko))

        pl.ylabel = "Yoko (V)"
        pl.xlabel = "Frequency (GHz)"
        return pl
Пример #23
0
    def magfilt_cmesh(self, f0=5.35e9, alpha=0.45):
        Magcom = self.Magcom  #(self.Magcom.transpose()-self.Magcom[:, 0]).transpose()
        fq_vec = self.frequency  #array([sqrt(f*(f-2*qdt.call_func("Lamb_shift", f=f, f0=f0, couple_mult=alpha))) for f in self.frequency])

        Magfilt = array([
            fft_filter(Magcom[:, n], self.filt_start_ind, self.filt_end_ind)
            for n in range(len(self.yoko))
        ]).transpose()
        Magfilt2 = array([
            fft_filter(Magcom[:, n], 0, 34) for n in range(len(self.yoko))
        ]).transpose()

        pl = Plotter(fig_width=9.0,
                     fig_height=6.0,
                     name="magabs_{}".format(self.name))
        pl, pf = colormesh(self.yoko,
                           fq_vec / 1e9,
                           (absolute(Magfilt.transpose() -
                                     0.0 * Magfilt[:, 0])).transpose(),
                           plotter=pl)
Пример #24
0
def anharm_plot(qbt):
    pl=Plotter(fig_width=9.0, fig_height=6.0)
    EjdivEc=linspace(0.1, 300, 3000)
    Ej=EjdivEc*qbt.Ec
    fq=qbt._get_fq(Ej=Ej)
    fq2=qbt._get_fq2(Ej=Ej)
    anh=qbt._get_anharm(Ej=Ej)

    line(EjdivEc, fq/1e9, plotter=pl, linestyle="dashed", linewidth=1.0, color="blue")
    line(EjdivEc, fq2/1e9, plotter=pl, linestyle="dashed", linewidth=1.0, color="red")
    line(EjdivEc, (fq+anh)/1e9, plotter=pl, linestyle="dashed", linewidth=1.0, color="green")

    Ec=qbt.Ec
    E0 =  sqrt(8.0*Ej*Ec)*0.5 - Ec/4.0
    E1 =  sqrt(8.0*Ej*Ec)*1.5 - (Ec/12.0)*(6.0+6.0+3.0)
    E2 =  sqrt(8.0*Ej*Ec)*2.5 - (Ec/12.0)*(6.0*2**2+6.0*2+3.0)
    fqp=(E1-E0)/h
    fq2p=(E2-E0)/h/2
    anhp=((E2-E1)-(E1-E0))/h
    line(EjdivEc, fqp/1e9, plotter=pl, linewidth=0.5, color="blue")
    line(EjdivEc, fq2p/1e9, plotter=pl, linewidth=0.5, color="red")
    line(EjdivEc, (fq+anhp)/1e9, plotter=pl, linewidth=0.5, color="green")
    return pl
Пример #25
0
cbr=colorbar(clt, ax=ax, label="$S_{33}$")
cbr.set_label("$|S_{11}|$", size=6, labelpad=-5)
#print dir(cbr)
cbr.set_ticks([0, 2])#linspace(0.995, 1.002, 2))
ax.set_xticks(linspace(0, 300, 4))
ax.set_yticks(linspace(0, 600, 2))

ax=fig.add_subplot(2, 2, 3)

clt=pcolormesh(x, y, Z, ) #pl=pl, pf_too=True, auto_zlim=True,
                      #         auto_xlim=True, x_min=0.65, x_max=1.5,
                      #         auto_ylim=True, vmin=0.0, vmax=0.02)
colorbar(clt, ax=ax)
#pl.axes.set_xticks(linspace(0.7, 1.5, 2))
ax=fig.add_subplot(2, 2, 4)

plot(x, 'o')
#                xlabel="Power (dBm)", ylabel=r"$|\Delta S_{21}| \times 100$", pl=pl,)
                  #auto_ylim=False, y_min=100*0, y_max=100*0.015, marker_size=3.0,
                  #auto_xlim=False, x_min=-30, x_max=10)#.show()
#pl.axes.set_xticks(linspace(-30, 10, 5))

#a.save_plots([pl])
fig.tight_layout()
pl=Plotter(figure=fig)
pl.plot_dict["blah"]=ColormeshFormat(plotter=pl)
pl.show()



Пример #26
0
    a.end_skip = 10
    #b.save_folder.main_dir=b.name

if __name__ == "__main__":

    #pl.nplot=4
    a.read_data()
    b.read_data()

    #b.filter_type="None"
    #pl_raw=b.magabs_colormesh()
    #pl_ifft=b.ifft_plot()#.show()

    b.filter_type = "FFT"

    pl = Plotter(name="pwr_sat", nrows=2, ncols=2)
    onres = (20 * log10(absolute(b.MagcomFilt[69, :, :])).transpose() -
             bg_A4(b.freq_axis[69] * 1e9)).transpose()

    pl, pf = colormesh(b.flux_axis,
                       b.pwr - 30 - 60,
                       10**(onres / 20.0).transpose(),
                       ylabel="Power (dBm) ",
                       xlabel=r"$\Phi/\Phi_0$",
                       auto_xlim=False,
                       x_min=0.35,
                       x_max=0.5,
                       auto_ylim=False,
                       y_min=-30 - 90,
                       y_max=10 - 90,
                       nrows=2,
Пример #27
0
    #b.save_folder.main_dir=b.name

if __name__=="__main__":

    
    #pl.nplot=4
    a.read_data()
    b.read_data()

    #b.filter_type="None"
    #pl_raw=b.magabs_colormesh()
    #pl_ifft=b.ifft_plot()#.show()

    b.filter_type="FFT"

    pl=Plotter(name="pwr_sat", nrows=2, ncols=2)
    onres=(20*log10(absolute(b.MagcomFilt[69, :, :])).transpose()-bg_A4(b.freq_axis[69]*1e9)).transpose()
    
    pl, pf=colormesh(b.flux_axis, b.pwr-30-60, 10**(onres/20.0).transpose(), 
                  ylabel="Power (dBm) ", xlabel=r"$\Phi/\Phi_0$",
                  auto_xlim=False, x_min=0.35, x_max=0.5, 
                  auto_ylim=False, y_min=-30-90, y_max=10-90, nrows=2, ncols=2, nplot=1, pl=pl, pf_too=True, fig_width=fig_width, fig_height=fig_height)

    ax=pl.axes
    ax.set_yticks(linspace(-30.0-90, 10.0-90, 3))
    ax.set_xticks(linspace(0.38, 0.48, 3))
    
    #b.pwr, b.freq_axis[a.end_skip:-b.end_skip], 10**(onres/20.0), #absolute(a.MagcomFilt[a.end_skip:-a.end_skip, 635, :]),
    #              ylabel="Frequency (GHz)", xlabel=r"Power (dBm")#.show()
    pl.nplot=2
    onres=20*log10(absolute(b.MagcomFilt[69, 635, :]))-bg_A4(b.frequency[69])
Пример #28
0
if __name__=="__main__":
    a=IDT()
    from taref.plotter.api import line, Plotter
    from scipy.signal import hilbert
    from numpy import imag, real, sin, cos

    frq=linspace(3e9, 7e9, 10000)
    X=a._get_X(f=frq)
    Np=a.Np
    f0=a.f0
    coup=(sqrt(2)*cos(pi*frq/(4*f0))*(1.0/Np)*sin(X)/sin(X/Np))**2
    #coup=(sin(X)/X)**2

    #coup=(1.0/Np*sin(X)/sin(X/Np))**2

    pl=Plotter()
    line(frq, a._get_coupling(frq)/a.max_coupling, plotter=pl)
    line(frq, a._get_Lamb_shift(frq)/a.max_coupling, plotter=pl, color="red")
    line(frq, coup, color="purple", plotter=pl)
    #hb=hilbert(coup) #a._get_coupling(frq))
    #line(frq, real(hb), plotter=pl, color="green", linewidth=0.3)
    #line(frq, imag(hb), plotter=pl, color="black", linewidth=0.3)
    Baa= (1+cos(X/(4*Np)))*(1.0/Np)**2*2*(Np*sin(2*X/Np)-sin(2*X))/(2*(1-cos(2*X/Np)))
    #Baa=-(sin(2.0*X)-2.0*X)/(2.0*X**2.0)

    line(frq, Baa, plotter=pl, color="cyan", linewidth=0.3)

    pl.show()

    b=IDT(ft="single")
    a.ft_mult=5
Пример #29
0
cbr.set_label("$|S_{11}|$", size=6, labelpad=-5)
#print dir(cbr)
cbr.set_ticks([0, 2])  #linspace(0.995, 1.002, 2))
ax.set_xticks(linspace(0, 300, 4))
ax.set_yticks(linspace(0, 600, 2))

ax = fig.add_subplot(2, 2, 3)

clt = pcolormesh(
    x,
    y,
    Z,
)  #pl=pl, pf_too=True, auto_zlim=True,
#         auto_xlim=True, x_min=0.65, x_max=1.5,
#         auto_ylim=True, vmin=0.0, vmax=0.02)
colorbar(clt, ax=ax)
#pl.axes.set_xticks(linspace(0.7, 1.5, 2))
ax = fig.add_subplot(2, 2, 4)

plot(x, 'o')
#                xlabel="Power (dBm)", ylabel=r"$|\Delta S_{21}| \times 100$", pl=pl,)
#auto_ylim=False, y_min=100*0, y_max=100*0.015, marker_size=3.0,
#auto_xlim=False, x_min=-30, x_max=10)#.show()
#pl.axes.set_xticks(linspace(-30, 10, 5))

#a.save_plots([pl])
fig.tight_layout()
pl = Plotter(figure=fig)
pl.plot_dict["blah"] = ColormeshFormat(plotter=pl)
pl.show()
Пример #30
0
 def plot_func(self, pl=None, *args, **kwargs):
     if pl is None:
         pl=Plotter(fig_width=kwargs.pop("fig_width", 9.0), fig_height=kwargs.pop("fig_height", 6.0))
     return func(self, pl=pl, *args, **kwargs)
Пример #31
0
    a = IDT()
    from taref.plotter.api import line, Plotter
    from scipy.signal import hilbert
    from numpy import imag, real, sin, cos

    frq = linspace(3e9, 7e9, 10000)
    X = a._get_X(f=frq)
    Np = a.Np
    f0 = a.f0
    coup = (sqrt(2) * cos(pi * frq / (4 * f0)) * (1.0 / Np) * sin(X) /
            sin(X / Np))**2
    #coup=(sin(X)/X)**2

    #coup=(1.0/Np*sin(X)/sin(X/Np))**2

    pl = Plotter()
    line(frq, a._get_coupling(frq) / a.max_coupling, plotter=pl)
    line(frq, a._get_Lamb_shift(frq) / a.max_coupling, plotter=pl, color="red")
    line(frq, coup, color="purple", plotter=pl)
    #hb=hilbert(coup) #a._get_coupling(frq))
    #line(frq, real(hb), plotter=pl, color="green", linewidth=0.3)
    #line(frq, imag(hb), plotter=pl, color="black", linewidth=0.3)
    Baa = (1 + cos(X / (4 * Np))) * (1.0 / Np)**2 * 2 * (
        Np * sin(2 * X / Np) - sin(2 * X)) / (2 * (1 - cos(2 * X / Np)))
    #Baa=-(sin(2.0*X)-2.0*X)/(2.0*X**2.0)

    line(frq, Baa, plotter=pl, color="cyan", linewidth=0.3)

    pl.show()

    b = IDT(ft="single")
Пример #32
0
def anharm_plot(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)
    EjdivEc = linspace(0.1, 300, 3000)
    Ej = EjdivEc * qdt.Ec
    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)

    fq = (E1 - E0) / h
    ls_fq = (E1p - E0p) / h
    fq2 = (E2 - E1) / h
    ls_fq2 = (E2p - E1p) / h

    line(EjdivEc,
         anharm / h / 1e9,
         plotter=pl,
         linewidth=0.5,
         color="purple",
         label=r"anharm")
    line(EjdivEc,
         anharmp / h / 1e9,
         plotter=pl,
         linewidth=0.5,
         color="black",
         label=r"ls anharm")
    line(EjdivEc, (ls_fq - fq) / 1e9,
         plotter=pl,
         color="blue",
         linewidth=0.5,
         label=r"$\Delta_{1,0}$")
    line(EjdivEc, (ls_fq2 - fq2) / 1e9,
         plotter=pl,
         color="red",
         linewidth=0.5,
         label=r"$\Delta_{2,1}$")
    pl.set_ylim(ymin, ymax)
    #pl.set_xlim(0.7, 1.3)
    pl.xlabel = r"$E_J/E_C$"
    pl.ylabel = r"$\Delta$ (GHz)"
    pl.legend(loc='lower left')
    #pl.set_ylim(-2, 1.5)
    #pl.set_xlim(0.0, 70)

    #anharm=qdt.call_func("anharm", EjdivEc=EjdivEc)
    #anharmp=qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc)
    #fq=qdt.call_func("fq", Ej=EjdivEc*qdt.Ec)
    #ls_fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    #ls_fq2=qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)
    #pl, pf=line(fq, anharm/h, linewidth=0.5, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$")

    #pl, pf=line(EjdivEc, anharmp/h/1e9, linewidth=1.0, color="black", label=r"$\Delta_{2,1}-\Delta_{1,0}$", plotter=pl)
    #line(EjdivEc, anharm/h/1e9, linewidth=1.0, color="purple", label=r"anharm", plotter=pl)

    #line(EjdivEc, (ls_fq-fq)/1e9, plotter=pl, color="blue", linewidth=1.0, label=r"$\Delta_{1,0}$")
    #E0, E1, E2=qdt.call_func("transmon_energy_levels", EjdivEc=EjdivEc, n_energy=3)
    #fq2=(E2-E1)/h
    #line(EjdivEc, (ls_fq2-fq2)/1e9, plotter=pl, color="red", linewidth=1.0, label=r"$\Delta_{2,1}$")
    #pl.xlabel=r"$E_j/E_c$"
    #pl.ylabel=r"$\Delta (GHz)$"
    #pl.legend(loc='lower right')
    #fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
    #line(EjdivEc, fq, plotter=pl, color="green", linewidth=0.5)

    #line(EjdivEc, E1p, plotter=pl, color="green", linewidth=0.5)
    #line(EjdivEc, E2p, plotter=pl, color="purple", linewidth=0.5)
    return pl