Exemple #1
0
t_MMST, p1_MMST, p2_MMST = get_popu_data(path+"traj_MultiEh.txt")

xs = [t_MMST /np.pi, t_QM / np.pi]
y1s = [p1_MMST, p1_QM]
y2s = [p2_MMST, p2_QM]

labels = ["MMST", "QM"]
colors1 = ["r--", "k--"]
colors2 = ["r", "k"]

ax = clp.initialize(col=1, row=1, width=4.3, fontsize=12, LaTeX=True)

clp.plotone(xs, y1s, ax, colors=colors1, alphaspacing=0.0, lw=2)
clp.plotone(xs, y2s, ax, labels=labels, colors=colors2, xlabel="time ($t$)",
            ylabel="Electronic population", alphaspacing=0.0, lw=2)

# Plot x-axis as a function of PI
def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = value
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(N)

ax.xaxis.set_major_formatter(FuncFormatter(format_func))

# output figure
clp.adjust(tight_layout=True, savefile="SE_popu_MMST.pdf")
                    fontsize=12,
                    LaTeX=True,
                    sharex=True)

clp.plotone(xs,
            y2s,
            ax,
            labels=labels,
            colors=colors2,
            xlabel="time (t)",
            ylabel="Excited state population",
            alphaspacing=0.0,
            lw=2,
            ylim=[-0.51, 2.0])


# Plot x-axis as a function of PI
def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = value
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(N)


ax.xaxis.set_major_formatter(FuncFormatter(format_func))

# output figure
clp.adjust(tight_layout=True, savefile="SE_popu_turnoff_samplings.pdf")
ys2 = [np.array(k_lst)]
clp.plotone(xs2,
            ys2,
            axes[1],
            labels=["MMST"],
            colors=['r-o'],
            xlabel="number of TLSs ($N$)",
            ylabel="Fitted decay rate ($k_{fit}$)",
            lw=2,
            markersize=8)

axes[1].legend(loc="lower right")

print(ys2)


# Plot x-axis as a function of PI
def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = value
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(N)


axes[0].xaxis.set_major_formatter(FuncFormatter(format_func))

# output figure
clp.adjust(tight_layout=True, savefile="SE_Dicke.pdf")
            showlegend=False)
axes[1].set_title("101 TLSs, $a = \lambda/4$")
xs, y2s = gather_data("SE_101TLS_FDTD_dx_0")
clp.plotone(xs[::-1],
            y2s[::-1],
            axes[2],
            labels=labels[::-1],
            colors=colors2[::-1],
            xlabel="time ($t$)",
            alphaspacing=0.1,
            lw=2,
            showlegend=False)
axes[2].set_title("101 TLSs, $a = 0$")


# Plot x-axis as a function of PI
def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = value
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(N)


for i in range(3):
    axes[i].xaxis.set_major_formatter(FuncFormatter(format_func))

# output figure
clp.adjust(tight_layout=True, savefile="chain_atoms.pdf")
        ax,
        colors=['r', "k--", "c-."],
        labels=["MMST", "QM", "coarse-grained MMST"] if i == 0 else None,
        alphaspacing=0.01,
        ylim=[-0.2, 12])

ax.set_xlabel("Cavity position")
ax.set_ylabel("E-field Intensity (arbi. units)")


def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = value
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(N)


ax.xaxis.set_major_formatter(FuncFormatter(format_func))

# Add arrow
ax.text(2.25, 5.0, 'time increment', rotation=90, color='b', size=12)
ax.annotate('',
            xy=(1.05, 0.0),
            xycoords='axes fraction',
            xytext=(1.05, 1.0),
            arrowprops=dict(arrowstyle="<-", color='b'))
#ax.grid(True, linestyle='--')
clp.adjust(tight_layout=True, savefile="SE_intensity_MMST.pdf")
        for k in range(2):
            clp.plotone(X,
                        Y,
                        axes[k, j],
                        colors=['r', "k--", "c-."],
                        labels=["MMST", "QM", "coarse-grained MMST"] if
                        (i == 0 and j == 0) else None,
                        alphaspacing=0.01,
                        ylim=[-0.2, 12],
                        showlegend=True if (j == 0 and k == 0) else False,
                        xlim=None if k == 0 else [0.9622, 1.0378])
    axes[0, j].set_title(methods[j])
    axes[1, j].set_xlabel("Cavity position")
    if j is 0:
        for k in range(2):
            axes[k, j].set_ylabel("E-field Intensity (arbi. units)")
    axes[0, j].xaxis.set_major_formatter(FuncFormatter(format_func))
    axes[1, j].xaxis.set_major_formatter(FuncFormatter(format_func))

# Add arrow
axes[0, -1].text(2.25, 5.0, 'time increment', rotation=90, color='b', size=12)
#axes[1, -1].text(2.25, 5.0, 'time increment', rotation=90, color='b', size=12)
for k in range(2):
    axes[k, -1].annotate('',
                         xy=(1.05, 0.0),
                         xycoords='axes fraction',
                         xytext=(1.05, 1.0),
                         arrowprops=dict(arrowstyle="<-", color='b'))
#ax.grid(True, linestyle='--')
clp.adjust(tight_layout=True, savefile="EM_compare_MMST.pdf")
        m1_centroid = np.mean(m1)
        m2_centroid = np.mean(m2)
        print(m1_centroid, m2_centroid)
        axes[k, i].axvline(x=1.0, color='0.5', linestyle='--', alpha=0.5)
        axes[k, i].axhline(y=0.0, color='0.5', linestyle='--', alpha=0.5)
        axes[k, i].plot(m1_centroid,
                        m2_centroid,
                        'ro',
                        markersize=5,
                        alpha=0.8)
        axes[k, i].set_xlim([xmin, xmax])
        axes[k, i].set_ylim([ymin, ymax])
        if i == 0:
            axes[k, i].text(xmin + 0.2, ymax - 0.5, "t = 0")
            axes[k, i].text(xmin + 0.2,
                            ymin + 0.2,
                            methods[k],
                            color='b',
                            fontsize=10)
        elif i == 1:
            axes[k, i].text(xmin + 0.2, ymax - 0.5, "t = $\pi$/3")
        elif i == 2:
            axes[k, i].text(xmin + 0.2, ymax - 0.5, "t = $\pi$")
        else:
            axes[k, i].text(xmin + 0.2, ymax - 0.5, "t = %d$\pi$/3" % i)

cb_ax = fig.add_axes([1.0, 0.1, 0.02, 0.8])
cbar = fig.colorbar(im_good, cax=cb_ax)

clp.adjust(tight_layout=True, savefile="ground_state_phase_space_dist.pdf")
t_p, p1_p, p2_p = get_popu_data(path+"traj_PreBinSQC.txt")
t_sed, p1_sed, p2_sed = get_popu_data(path+"traj_StochasticED.txt")


xs = [t_p /np.pi, t_sed/np.pi, t_MMST / np.pi]
y1s = [p1_p, p1_sed,  p1_MMST]
y2s = [p2_p, p2_sed,  p2_MMST]

labels = ["Sampling electronic ZPE (self-interaction)", "Sampling photonic ZPE (vacuum fluctuations)", "Sampling both (MMST)"]
colors1 = ["b--", "g-.", "r"]
colors2 = ["b--", "g--", "r--"]

ax = clp.initialize(col=1, row=1, width=4.3, fontsize=10, LaTeX=True)

clp.plotone(xs, y2s, ax, labels=labels, colors=colors1, xlabel="time ($t$)",
            ylabel="Excited state population", alphaspacing=0.0, lw=2, xlim=[0, 1.2], ylim=[-0.6, 1.0])

# Plot x-axis as a function of PI
def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = int(value * 10)
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(N/10)

ax.xaxis.set_major_formatter(FuncFormatter(format_func))

# output figure
clp.adjust(tight_layout=True, savefile="ground_state_popu.pdf")
axes[0].set_title("1 TLS near mirror, $r = \lambda/2$")
xs, y2s = gather_data("SE_1TLS_FDTD_near_mirror/dx_13")
clp.plotone(xs,
            y2s,
            axes[1],
            labels=labels,
            colors=colors2,
            xlabel="time ($t$)",
            alphaspacing=0.1,
            lw=2,
            showlegend=False,
            xlim=[0, 1.0])
axes[1].set_title("1 TLS near mirror, $r = \lambda/4$")


# Plot x-axis as a function of PI
def format_func(value, tick_number):
    # find number of multiples of pi/2
    N = value
    if N == 0:
        return "0"
    else:
        return r"${0}\pi$".format(int(100 * N) / 100)


for i in range(2):
    axes[i].xaxis.set_major_formatter(FuncFormatter(format_func))

# output figure
clp.adjust(tight_layout=True, savefile="SE_near_mirror.pdf")
Exemple #10
0
    ks = min(popt[0:2])
    kf = max(popt[0:2])
    ks_lst.append(ks)
    kf_lst.append(kf)

xs2 = [np.array(Nlst)]
ys2 = [1.0 / np.array(ks_lst)]
clp.plotone(xs2,
            ys2,
            axes[1],
            labels=["MMST"],
            colors=['r-o'],
            xlabel="number of TLSs ($N$)",
            ylabel="Fitted slow decay lifetime ($1/k_{s}$)",
            lw=2,
            markersize=8)
axes[1].legend(loc="lower right")

axes[0].plot(xs[0] / kFGR,
             y_fit[0],
             "k-.",
             alpha=0.5,
             label="biexponential fitting")
axes[0].plot(xs[6] / kFGR, y_fit[6], "k-.", alpha=0.5)

print("kslow = ", ks_lst)
print("kfast = ", kf_lst)

# output figure
clp.adjust(tight_layout=True, savefile="SE_Dicke_dilute_subradiance.pdf")