示例#1
0
def surface_charge_plot(pl="surface charge", **kwargs):
    rho=Rho.process_kwargs(kwargs)
    #rho.ft="single" #"double"
    #charge=real(fft.fftshift(fft.ifft(rho.fixed_alpha)))#.astype(float64)
    print rho.a, rho.g
    #print rho.surface_charge.dtype
    #print max(rho.surface_voltage/rho.epsinf)
    #x=linspace()
    #x=linspace(-rho.N_fixed/2+.001, rho.N_fixed/2+0.0, rho.N_fixed)/800.0
    print rho.surface_charge.shape, rho.surface_x.shape
    pieta=pi*rho.eta
    #a=0.25 #rho.a
    lbda0=1.0 #rho.lbda0
    x=linspace(-1.75*10*lbda0, 1.75*10*lbda0, 20001)
    s=linspace(0.0,1.0, 20001)

    def rh(x):
        m=int(2*x/(lbda0))
        if absolute(2*x/lbda0-m)<1.0/4.0:
            theta=4*pi*x/lbda0
            return 2/lbda0*2*sqrt(2.0)*((1.0)**m)/sqrt(cos(theta)-cos(pieta))*trapz(sin(pi*s)*cos((s-1/2)*theta)/rho.lgf1.Pv(-s),s)
        if absolute(2*x/lbda0-m-1)<1.0/4.0:
            theta=4*pi*x/lbda0
            return 2/lbda0*2*sqrt(2.0)*((1.0)**m)/sqrt(cos(theta)-cos(pieta))*trapz(sin(pi*s)*cos((s-1/2)*theta)/rho.lgf1.Pv(-s),s)
        if absolute(2*x/lbda0-m+1)<1.0/4.0:
            theta=4*pi*x/lbda0
            return 2/lbda0*2*sqrt(2.0)*((1.0)**m)/sqrt(cos(theta)-cos(pieta))*trapz(sin(pi*s)*cos((s-1/2)*theta)/rho.lgf1.Pv(-s),s)

        return 0.0

    rgh=array([rh(xx) for xx in x])/1.694
    line(1*x, rgh, linewidth=0.5, pl=pl)

    #line(real(fft.fft(rgh)))
    #line(imag(fft.fft(rgh)))

    line(rho.fixed_freq, rho.fixed_alpha)
    print "line done"
    pl=line(rho.surface_x, rho.surface_charge*rgh[10000]/rho.surface_charge[rho.N_fixed/2], plotter=pl, plot_name="single", color="blue", label="single finger", **kwargs)
    #charge=real(fft.fftshift(fft.ifft(rho.fixed_alpha/rho.fixed_freq*rho.f0)))#.astype(float64)
    pl=line(rho.surface_x, rho.surface_voltage*1e6, plotter=pl, plot_name="singled", color="red", label="single finger2", **kwargs)

    xprime=linspace(-2.000001, 2.0, 200) #[0.01, 1.01] #range(10)
    print "trapz"
    #line(xprime, array([trapz(rho.surcharge/absolute(x-xp), x) for xp in xprime]))
    print "trapz done"
    pl.xlabel="frequency/center frequency"
    pl.ylabel="element factor"
    #pl.legend()
    return pl
示例#2
0
def element_factor_plot(pl="element_factor", **kwargs):
    rho = Rho.process_kwargs(kwargs)
    rho.ft = "single"
    f = linspace(0.0, 500e9, 10000)
    print "start plot"
    pl = line(f / rho.f0,
              rho._get_alpha(f=f),
              plotter=pl,
              plot_name="single",
              color="blue",
              label="single finger",
              **kwargs)
    print "finish plot"
    rho.ft = "double"
    pl = line(f / rho.f0,
              rho._get_alpha(f=f),
              plotter=pl,
              plot_name="double",
              color="red",
              label="double finger",
              linestyle="dashed")
    pl.xlabel = "frequency/center frequency"
    pl.ylabel = "element factor"
    pl.set_ylim(-1.0, 2.0)
    pl.set_xlim(0.0, 20.0)
    pl.legend()
    return pl
示例#3
0
def test_plot(**kwargs):
    rho=Rho.process_kwargs(kwargs)
    rho.ft="single"
    kdiv2pi=(rho.fixed_freq[1]-rho.fixed_freq[0])/rho.vf
    k=2*pi*rho.fixed_freq/rho.vf
    lbda0=1.0 #rho.lbda0
    xx=linspace(-1.75*lbda0, 1.75*lbda0, 201)
    rhox=array([sum(2*kdiv2pi*rho.fixed_alpha*cos(k*x)) for x in xx])
    pl=line(xx, rhox, linewidth=0.5)[0]
    return pl
示例#4
0
def test_plot(**kwargs):
    rho = Rho.process_kwargs(kwargs)
    rho.ft = "single"
    kdiv2pi = (rho.fixed_freq[1] - rho.fixed_freq[0]) / rho.vf
    k = 2 * pi * rho.fixed_freq / rho.vf
    lbda0 = 1.0  #rho.lbda0
    xx = linspace(-1.75 * lbda0, 1.75 * lbda0, 201)
    rhox = array([sum(2 * kdiv2pi * rho.fixed_alpha * cos(k * x)) for x in xx])
    pl = line(xx, rhox, linewidth=0.5)[0]
    return pl
示例#5
0
def element_factor_plot(pl="element_factor", **kwargs):
    rho=Rho.process_kwargs(kwargs)
    rho.ft="single"
    f=linspace(0.0, 500e9, 10000)
    print "start plot"
    pl=line(f/rho.f0, rho._get_alpha(f=f), plotter=pl, plot_name="single", color="blue", label="single finger", **kwargs)
    print "finish plot"
    rho.ft="double"
    pl= line(f/rho.f0, rho._get_alpha(f=f), plotter=pl, plot_name="double", color="red", label="double finger", linestyle="dashed")
    pl.xlabel="frequency/center frequency"
    pl.ylabel="element factor"
    pl.set_ylim(-1.0, 2.0)
    pl.set_xlim(0.0, 20.0)
    pl.legend()
    return pl
示例#6
0
def center_coupling_vs_eta(pl="f0_vs_eta", **kwargs):
    idt=Rho.process_kwargs(kwargs)
    idt.couple_type="full expr"
    idt.fixed_update=True
    idt.N_fixed=1000
    idt.fixed_freq_max=2*idt.f0
    idt.ft="single"
    eta_arr=linspace(0.1, 0.9, 21)
    alpha_arr1=[]
    alpha_arr2=[]
    alpha_arr3=[]
    for eta in eta_arr:
        idt.eta=eta
        alpha=idt._get_alpha(f=idt.f0, eta=eta)
        alpha_arr1.append(alpha)
        alpha=idt._get_alpha(f=3*idt.f0, eta=eta)
        alpha_arr2.append(alpha)
        alpha=idt._get_alpha(f=5*idt.f0, eta=eta)
        alpha_arr3.append(alpha)

    pl=line(eta_arr, array(alpha_arr1), plotter=pl)
    line(eta_arr, array(alpha_arr2), plotter=pl, color="red")
    line(eta_arr, array(alpha_arr3), plotter=pl, color="green")
    return pl #line(eta, idt._get_alpha(f=3*idt.f0, eta=eta))[0]
示例#7
0
def center_coupling_vs_eta(pl="f0_vs_eta", **kwargs):
    idt = Rho.process_kwargs(kwargs)
    idt.couple_type = "full expr"
    idt.fixed_update = True
    idt.N_fixed = 1000
    idt.fixed_freq_max = 2 * idt.f0
    idt.ft = "single"
    eta_arr = linspace(0.1, 0.9, 21)
    alpha_arr1 = []
    alpha_arr2 = []
    alpha_arr3 = []
    for eta in eta_arr:
        idt.eta = eta
        alpha = idt._get_alpha(f=idt.f0, eta=eta)
        alpha_arr1.append(alpha)
        alpha = idt._get_alpha(f=3 * idt.f0, eta=eta)
        alpha_arr2.append(alpha)
        alpha = idt._get_alpha(f=5 * idt.f0, eta=eta)
        alpha_arr3.append(alpha)

    pl = line(eta_arr, array(alpha_arr1), plotter=pl)
    line(eta_arr, array(alpha_arr2), plotter=pl, color="red")
    line(eta_arr, array(alpha_arr3), plotter=pl, color="green")
    return pl  #line(eta, idt._get_alpha(f=3*idt.f0, eta=eta))[0]
示例#8
0
    a = QDT()

    a.Rn = 5.9e3
    a.Np = 5
    a.W = 7.0e-6
    a.fq = 4.5e9

    print a.get_metadata("Ct")
    #a.Np=9
    #a.f0=4.500001e9
    #print a._update_K2.argnames
    for param in a.all_params:
        print param, a.get_tag(param, "update")
    #print a.get_plot_data("EkdivEc", ng=0.5)
    if 0:
        a.plot_data("EkdivEc", Ej=linspace(0.0, 1.0 * a.Ejmax, 100))
        show()
        a.plot_data("EkdivEc", ng=linspace(0.0, 1.0, 100))
        show()

    #a.f0=4.500001e9
    #a.f0=4.500001e9

    #print a.search_update("a")
    #a.G_f0=1.0
    #fq=linspace(4.0e9, 11.0e9, 2001)
    #G_f=a.get_plot_data("G_f", fq=fq)
    #plot(fq, G_f)
# a.plot_data("G_f", fq=linspace(4.0e9, 11.0e9, 2001),
#              legend=True, label="G f",
#             ylabel="G_F [Hz]", xmult=1/1.0e9, zmult=1/1.0e9)
示例#9
0
 def surface_x(self):
     fs=self._get_fs(f=self.fixed_freq)
     df=1.0/(fs[1]-fs[0])/2.0#*self.lbda0/2
     return linspace(-df/2.0, df/2.0, self.N_fixed)
示例#10
0
 def fixed_freq(self):
     return linspace(self.fixed_freq_min, self.fixed_freq_max, self.N_fixed).astype(float64)
示例#11
0
def surface_charge_plot(pl="surface charge", **kwargs):
    rho = Rho.process_kwargs(kwargs)
    #rho.ft="single" #"double"
    #charge=real(fft.fftshift(fft.ifft(rho.fixed_alpha)))#.astype(float64)
    print rho.a, rho.g
    #print rho.surface_charge.dtype
    #print max(rho.surface_voltage/rho.epsinf)
    #x=linspace()
    #x=linspace(-rho.N_fixed/2+.001, rho.N_fixed/2+0.0, rho.N_fixed)/800.0
    print rho.surface_charge.shape, rho.surface_x.shape
    pieta = pi * rho.eta
    #a=0.25 #rho.a
    lbda0 = 1.0  #rho.lbda0
    x = linspace(-1.75 * 10 * lbda0, 1.75 * 10 * lbda0, 20001)
    s = linspace(0.0, 1.0, 20001)

    def rh(x):
        m = int(2 * x / (lbda0))
        if absolute(2 * x / lbda0 - m) < 1.0 / 4.0:
            theta = 4 * pi * x / lbda0
            return 2 / lbda0 * 2 * sqrt(2.0) * (
                (1.0)**m) / sqrt(cos(theta) - cos(pieta)) * trapz(
                    sin(pi * s) * cos(
                        (s - 1 / 2) * theta) / rho.lgf1.Pv(-s), s)
        if absolute(2 * x / lbda0 - m - 1) < 1.0 / 4.0:
            theta = 4 * pi * x / lbda0
            return 2 / lbda0 * 2 * sqrt(2.0) * (
                (1.0)**m) / sqrt(cos(theta) - cos(pieta)) * trapz(
                    sin(pi * s) * cos(
                        (s - 1 / 2) * theta) / rho.lgf1.Pv(-s), s)
        if absolute(2 * x / lbda0 - m + 1) < 1.0 / 4.0:
            theta = 4 * pi * x / lbda0
            return 2 / lbda0 * 2 * sqrt(2.0) * (
                (1.0)**m) / sqrt(cos(theta) - cos(pieta)) * trapz(
                    sin(pi * s) * cos(
                        (s - 1 / 2) * theta) / rho.lgf1.Pv(-s), s)

        return 0.0

    rgh = array([rh(xx) for xx in x]) / 1.694
    line(1 * x, rgh, linewidth=0.5, pl=pl)

    #line(real(fft.fft(rgh)))
    #line(imag(fft.fft(rgh)))

    line(rho.fixed_freq, rho.fixed_alpha)
    print "line done"
    pl = line(rho.surface_x,
              rho.surface_charge * rgh[10000] /
              rho.surface_charge[rho.N_fixed / 2],
              plotter=pl,
              plot_name="single",
              color="blue",
              label="single finger",
              **kwargs)
    #charge=real(fft.fftshift(fft.ifft(rho.fixed_alpha/rho.fixed_freq*rho.f0)))#.astype(float64)
    pl = line(rho.surface_x,
              rho.surface_voltage * 1e6,
              plotter=pl,
              plot_name="singled",
              color="red",
              label="single finger2",
              **kwargs)

    xprime = linspace(-2.000001, 2.0, 200)  #[0.01, 1.01] #range(10)
    print "trapz"
    #line(xprime, array([trapz(rho.surcharge/absolute(x-xp), x) for xp in xprime]))
    print "trapz done"
    pl.xlabel = "frequency/center frequency"
    pl.ylabel = "element factor"
    #pl.legend()
    return pl
示例#12
0
 def surface_x(self):
     fs = self._get_fs(f=self.fixed_freq)
     df = 1.0 / (fs[1] - fs[0]) / 2.0  #*self.lbda0/2
     return linspace(-df / 2.0, df / 2.0, self.N_fixed)
示例#13
0
 def fixed_freq(self):
     return linspace(self.fixed_freq_min, self.fixed_freq_max,
                     self.N_fixed).astype(float64)
示例#14
0
             xunit=self.get_tag(xname, "unit")
             xunit_factor=self.get_tag(xname, "unit_factor", 1.0)
         else:
             xname="#"
             xdata=arange(len(getattr(self, zname)))
             xunit=None
             xunit_factor=self.get_tag(xname, "unit_factor", 1.0)

         if xlabel_str is None:
             if xunit is None:
                 xlabel_str=xname
             else:
                 xlabel_str="{0} [{1}]".format(xname, xunit)
         xlabel(xlabel_str)

         if title_str is None:
             title_str="{0} vs {1}".format(zname, xname)
         title(title_str)
         print xdata.shape, zdata.shape
         plot(xdata*xunit_factor*xmult, zdata*zunit_factor*zmult, label=label)

         if add_legend:
             legend()

if __name__=="__main__":
    t=Qubit()
    print t.call_func("flux_over_flux0", voltage=linspace(0,1,10))
    print t.call_func("Ej", flux_over_flux0=linspace(0,1,10))
    print t.call_func("fq", Ej=linspace(0,1,10))

    t.show()
示例#15
0
    a=QDT()
    
    a.Rn=5.9e3
    a.Np=5
    a.W=7.0e-6
    a.fq=4.5e9
    
    print a.get_metadata("Ct")
    #a.Np=9
    #a.f0=4.500001e9
    #print a._update_K2.argnames
    for param in a.all_params:
        print param, a.get_tag(param, "update")
    #print a.get_plot_data("EkdivEc", ng=0.5)
    if 0:
        a.plot_data("EkdivEc", Ej=linspace(0.0, 1.0*a.Ejmax, 100))
        show()
        a.plot_data("EkdivEc", ng=linspace(0.0, 1.0, 100))
        show()
    
    #a.f0=4.500001e9
    #a.f0=4.500001e9

    #print a.search_update("a")
    #a.G_f0=1.0
    #fq=linspace(4.0e9, 11.0e9, 2001)
    #G_f=a.get_plot_data("G_f", fq=fq)
    #plot(fq, G_f)
   # a.plot_data("G_f", fq=linspace(4.0e9, 11.0e9, 2001),
   #              legend=True, label="G f",
   #             ylabel="G_F [Hz]", xmult=1/1.0e9, zmult=1/1.0e9)