コード例 #1
0
cs = ["darkturquoise", "darkorange", "limegreen", "crimson"]
for j, (c, S) in enumerate(zip(cs, Skey)):
    sim = select(L, S, IC, V="H", BC="0")
    h5file = sim["h5file"]
    d = h5file["cut_half"][:]
    for ti, rho in enumerate(d[100:101]):
        spec, vecs = eigh(rho)
        fig, axs = plt.subplots(1, 2, figsize=(6, 3))
        print(renyi_entropy(rho))
        axs[0].set_title("spectrum")
        axs[0].semilogy(spec, color=c, marker="o")

        axs[1].set_title("column vector magnitude")
        axs[1].imshow(np.abs(vecs), cmap="gist_gray_r")
        fig.suptitle("$T_{%d}$"%S)
multipage("figures/figure4/eigenRDM.pdf")
plt.close("all")
print("done")
if __name__ == "__main__":
    L = 18
    IC = "c1_f0"
    Skey = [13, 14, 1, 6]
    cs = ["darkturquoise", "darkorange", "limegreen", "crimson"]
    fig, axs = plt.subplots(1, 1, figsize=(4, 3), sharex=False)
    fig2, axs2 = plt.subplots(1, 1, figsize=(3, 2), sharex=True)
    fig2.subplots_adjust(left=0.2, bottom=0.2, hspace=0.1)

    fig3s = []

    for j, (c, S) in enumerate(zip(cs, Skey)):
        sim = select(L, S, IC, V="H", BC="0")
コード例 #2
0
for t in [10, 50, 100, 500, 1000]:
    fig, axs = plt.subplots(1, 8, figsize=(4.75, 0.8))
    for col, R in enumerate(Rkey):
        sim = select(L=18, S=R, IC="c1_f0", V="H", BC="0")
        if sim is None:
            print("No sim!")
        L = sim["L"]
        h5file = sim["h5file"]
        Ms = h5file["MI"]
        M = Ms[t]
        draw_MI(M, axs[col], layout=layout)
        axs[col].set_title(r"$T_{%d}$" % R)

    for col, statestr in enumerate(["C6-3", "GHZ", "W", "R"]):
        state = make_state(L, statestr)
        M = ms.get_MI(state, order=1)
        draw_MI(M, axs[4 + col], layout=layout)
        if statestr[0] == "C":
            axs[4 + col].set_title(ket("C"))
        else:
            axs[4 + col].set_title(ket(statestr))
        C = ms.network_clustering(M)
        Y = ms.network_disparity(M)
        print(statestr, " C:", C, " Y:", Y)
    fig.subplots_adjust(wspace=0.4, top=0.7, left=0.05, right=1, bottom=0)

plot_fname = f"figures/figure3/{layout}_layout_medclip.pdf"
print(plot_fname)
multipage(plot_fname, clip=False)
コード例 #3
0
            ax2.set_ylabel('$\\overline{S}_{\\ell}$')
            ax2.xaxis.set_major_locator(MaxNLocator(integer=True))
            ax4.plot(ells,
                     sbd,
                     color=lines[IC]['c'],
                     marker=lines[IC]['m'],
                     label=lines[IC]['name'])
            ax4.set_xlabel('$\\ell$')
            ax4.set_ylabel('$\\Delta S_{\\ell}$')
            ax4.xaxis.set_major_locator(MaxNLocator(integer=True))
            ax3.semilogx(sb[:, int(L / 2)],
                         color=lines[IC]['c'],
                         lw=1,
                         label=lines[IC]['name'])
            ax3.set_ylabel('$S_{L/2}$')
            ax3.set_xlabel('Iteration')

        sb_avg = np.array(sb_avg)
        sb_std = np.array(sb_std)
        fig0.suptitle('$\\langle \\sigma_z \\rangle$')
        fig.suptitle('$S_{\\ell}$')
        ax4.legend(framealpha=0.5)
        ax3.legend(framealpha=0.5)
        ax2.legend(framealpha=0.5)
        fig0.tight_layout()
        fig0.subplots_adjust(top=0.99)
        fig.tight_layout()
        fig.subplots_adjust(top=0.99)
        qca.multipage(plot_fname)
        print('plot saved to ', plot_fname)
コード例 #4
0
ファイル: figure4.py プロジェクト: lhillber/qops
def simple_plot(plot_fname):
    figa, axa = plt.subplots(1, 1, figsize=(1.5, 1.3))
    for o, (color, S) in enumerate(zip(cs, Skey)):
        for IC in ICkey:
            sb_avg = []
            sb_std = []
            sb_res = []
            ns = []
            for L in Lkey:
                ells = np.arange(L - 1)
                dells = np.linspace(0, L - 2, 100)
                sim = select(L, S, IC, "H", "1-00")
                if sim is None:
                    print("No sim!")
                    continue
                S = sim["S"]
                L = sim["L"]
                IC = sim["IC"]
                h5file = sim["h5file"]
                sb = h5file["sbond-2"][:]
                sba = np.mean(sb[100:], axis=0)
                sbd = np.std(sb[100:], axis=0)
                sb_avg += [sba[L // 2]]
                sb_std += [sbd[L // 2]]
                axa.set_xlabel("$\\ell$")
                axa.set_ylabel("Iteration")
                # axa.label_outer()
                func, popt, pcov = fit_page(sba)
                sb_res += [(func(ells) - sba) ** 2]
                if L in (18,):
                    ls = lss[L]
                    axa.fill_between(
                        ells,
                        sba + sbd,
                        sba - sbd,
                        facecolor=color,
                        alpha=0.4,
                        zorder=o
                    )
                    axa.scatter(
                        ells,
                        sba,
                        color=color,
                        marker="o",
                        s=2,
                        zorder=o
                    )
                    axa.plot(
                        dells,
                        func(dells),
                        color=color,
                        ls=ls,
                        lw=1,
                        label="$R={}$".format(S),
                        zorder=o
                    )
                    axa.set_xlabel("$\\ell$")
                    axa.set_ylabel("$\\overline{S}_{\\ell}$")
                    axa.xaxis.set_major_locator(MaxNLocator(integer=True))
                    axa.set_xticks([0, 8, 16])
                    axa.set_xticklabels(["$1$", "$9$", "$17$"])
                    axa.set_yticks([0, 4, 8])
    figa.subplots_adjust(left=0.35, bottom=0.32, top=1, right=0.95) 
    #axa.legend(
    #    loc=2,
    #    fontsize=8,
    #    handlelength=1,
    #    labelspacing=0.2,
    #    handletextpad=0.2,
    #    frameon=False,
    #)
    qca.multipage(plot_fname, clip=False)
コード例 #5
0
ファイル: figure4.py プロジェクト: lhillber/qops
    ax3.set_ylabel("RSS", fontsize=9, labelpad=-11)
    ax3.set_xlabel("$L$")
    ax3.set_yticks([0, 0.4])
    ax3.set_xticks([10, 14, 18])

    ax.set_yticks([0, 4, 8])
    ax.set_xticks([0, 4, 8, 12, 16])
    ax.set_xlim(right=17)
    ax.set_ylim(top=11)
    ax.legend(
        loc=2,
        fontsize=9,
        handlelength=1,
        labelspacing=0.2,
        handletextpad=0.2,
        frameon=False,
    )

    axins1.set_xticks([1, 1000])
    axins1.set_xticklabels([0, 3])
    axins1.set_yticks([0, 8])
    axins1.set_xlabel(r" $\log(t)$", fontsize=9, labelpad=-6)
    axins1.set_ylabel("$S_{L/2}$", fontsize=9, labelpad=-2)
    axins1.tick_params(axis="both", labelsize=9)
    axins1.axvline(100, color="k", lw=0.5)
    axins1.patch.set_alpha(1)
    qca.multipage(plot_fname, clip=False)
    print("plot saved to ", plot_fname)
    plt.close("all")
    simple_plot("figures/figure4/pagecurves-simple_V1.pdf")
コード例 #6
0
                        axs[1].imshow(np.abs(A), cmap="gray_r")
                        axs[0].grid(True)
                        axs[1].grid(True)
                        axs[0].set_xticks([0, 5, 10, 15])
                        axs[1].set_xticks([0, 5, 10, 15])
                        axs[2].plot(eigsH2, 'o', ms=9)
                        axs[2].plot(eigsA, 'o')
                        axs[0].set_title('hamiltonian:\n R={}, V={}'.format(
                            R, V),
                                         color='C0')
                        axs[1].set_title('symmetry:\n R={}, V={}'.format(
                            R2, B),
                                         color='C1')
                        axs[2].set_title('spectra')
            if make:
                multipage(
                    "figures/hamiltonian/symmetries/rule{}_symm.pdf".format(R))
                #plt.show()
                plt.close("all")

                #U = expm(-1j * dt * H)
                #eigs = eigvalsh(H)
                #eigs = np.sort(eigs)
                #np.save("eigs/R{}_V{}_L{}.npy".format(R, V, L), eigs)

                #UHviz(U, H, R)
                #spectrum_viz(eigs)
                ##time_evolve(U)
                #multipage("figures/hamiltonian/rule{}_continuous.pdf".format(R))
                #plt.close('all')
                #print()