Exemplo n.º 1
0
def run():
    man = mn.Man()
    #    t = man['t',:]*mn.param.get()["u.FS"]
    t = man['t', :]
    q0 = man['q0', :]
    p0 = man['p0', :]
    c = man['c_re', :] + 1j * man['c_im', :]
    prob = man['prob', :]
    numI = man['_numI', 0]

    for I in range(numI):
        plt.plot(t, prob[:, I], label=str(I))
    plt.plot(t, prob[:, 0] + prob[:, 1], "k--", label="total")
    plt.legend()
    plt.xlabel(r"$t$/fs", fontsize=15)
    plt.legend()
    plt.savefig("prob.pdf")
    plt.close()

    plt.plot(t, q0)
    plt.xlabel(r"$t$/fs", fontsize=15)
    plt.savefig("q0.pdf")
    plt.close()

    plt.plot(t, p0)
    plt.xlabel(r"$t$/fs", fontsize=15)
    plt.savefig("p0.pdf")
    plt.close()
Exemplo n.º 2
0
def run():

    dname = "_fig_rabi"
    if (not exists(dname)):
        os.makedirs(dname)

    man = mn.Man(root="_con_rabi")
    ts = man["t", :]
    calc = man["cr", :] + 1j * man["ci", :]
    exact = man["exact_cr", :] + 1j * man["exact_ci", :]

    plt.plot(ts, calc[:, 0].real, "-", label="calc0")
    plt.plot(ts, calc[:, 1].real, "-", label="calc1")
    plt.plot(ts, exact[:, 0].real, "k--", label="exact0")
    plt.plot(ts, exact[:, 1].real, "k-.", label="exact1")
    plt.legend()
    plt.savefig(join(dname, "c_re.pdf"))
    plt.close()

    plt.plot(ts, calc[:, 0].imag, "-", label="calc0")
    plt.plot(ts, calc[:, 1].imag, "-", label="calc1")
    plt.plot(ts, exact[:, 0].imag, "k--", label="exact0")
    plt.plot(ts, exact[:, 1].imag, "k-.", label="exact1")
    plt.legend()
    plt.savefig(join(dname, "c_im.pdf"))
    plt.close()

    plt.plot(ts, abs(calc[:, 0])**2, "-", label="calc0")
    plt.plot(ts, abs(calc[:, 1])**2, "-", label="calc1")
    plt.plot(ts, abs(exact[:, 0])**2, "k--", label="exact0")
    plt.plot(ts, abs(exact[:, 1])**2, "k-.", label="exact1")
    plt.legend()
    plt.savefig(join(dname, "prob.pdf"))
    plt.close()
Exemplo n.º 3
0
def run():

    for name in ["tully1", "tully2"]:
        dname = "_fig_{0}".format(name)
        if(not exists(dname)):
            os.makedirs(dname)
    
        man = mn.Man(root="_con_{0}".format(name));
        t = man['t',:]
        q0 = man['q0',:]
        p0 = man['p0',:]
        c = man['c_re',:] + 1j*man['c_im',:]
        prob = man['prob',:]
        numI = man['_numI',0]
        
        for I in range(numI):
            plt.plot(t, prob[:,I], label=str(I))
        plt.plot(t, prob[:,0]+prob[:,1], "k--", label="total")
        plt.legend()
        plt.xlabel(r"$t$/fs", fontsize=15)
        plt.legend()
        plt.savefig(join(dname, "prob.pdf"))
        plt.close()
        
        plt.plot(t, q0)
        plt.xlabel(r"$t$/fs", fontsize=15)
        plt.savefig(join(dname, "q0.pdf"))
        plt.close()
        
        plt.plot(t, p0)
        plt.xlabel(r"$t$/fs", fontsize=15)
        plt.savefig(join(dname, "p0.pdf"))
        plt.close()

    man = mn.Man(root="_con_tully1".format(name));
    xs = man['xs',0]
    for v in ["v11", "v12", "v21", "v22"]:
        ys = man[v,0]
        plt.plot(xs, ys, label=v)
    plt.legend()
    plt.savefig("_fig_tully1/v.pdf")
    plt.close()
Exemplo n.º 4
0
def run(name):
    man = mn.Man(root="_con_{0}".format(name))

    t = man["t", :]

    for lbl in ["q0", "p0", "gr0", "gi0"]:
        calc = man[lbl, :]
        exact = man["exact_" + lbl, :]
        plt.plot(t, calc, "-", label="calc")
        plt.plot(t, exact, "--", label="exact")
        plt.legend()
        dirname = "_fig_" + name
        if (not exists(dirname)):
            os.mkdir(dirname)
        plt.savefig(join(dirname, "{0}.pdf".format(lbl)))
        plt.close()
Exemplo n.º 5
0
def run():
    man = mn.Man()
    xs = man['xs', 0]

    its = [0, 20, 40, 60, 80]
    for it in its:
        psi0 = man['psi_0_re', it] + 1j * man['psi_0_im', it]
        psi1 = man['psi_1_re', it] + 1j * man['psi_1_im', it]
        p, = plt.plot(xs, psi0.real, label="1, it={0}".format(it))
        plt.plot(xs,
                 psi1.real,
                 linestyle="--",
                 color=p.get_color(),
                 label="2, it={0}".format(it))
    plt.legend()
    plt.savefig("psi.pdf")
Exemplo n.º 6
0
def run_delta():
    man = mn.Man(root="_con_delta_tully1")
    dir_fig = "_fig_delta_tully1"
    if(not exists(dir_fig)):
        os.makedirs(dir_fig)
        
    t = man['t',:]
    
    prob = man['prob',:]
    plt.plot(t, prob[:,0])
    plt.plot(t, prob[:,1])
    plt.savefig(join(dir_fig, "prob.pdf"))
    plt.close()

    q0 = man["q0",:]
    plt.plot(t, q0)
    plt.savefig(join(dir_fig, "q0.pdf"))
    plt.close()

    p0 = man["p0",:]
    plt.plot(t, p0)
    plt.savefig(join(dir_fig, "p0.pdf"))
    plt.close()    
Exemplo n.º 7
0
def run():
    man = mn.Man()
    #    t = man['t',:]*mn.param.get()["u.FS"]
    t = man['t', :]
    q0 = man['q0', :]
    p0 = man['p0', :]
    c = man['c_re', :] + 1j * man['c_im', :]
    prob = man['prob', :]

    plt.plot(t, prob[:, 0], label="1")
    plt.legend()
    plt.xlabel(r"$t$/fs", fontsize=15)
    plt.savefig("prob.pdf")
    plt.close()

    plt.plot(t, q0)
    plt.xlabel(r"$t$/fs", fontsize=15)
    plt.savefig("q0.pdf")
    plt.close()

    plt.plot(t, p0)
    plt.xlabel(r"$t$/fs", fontsize=15)
    plt.savefig("p0.pdf")
    plt.close()