<jupyter_start><jupyter_text>Kolmogorov forcing The following equation is solved\begin{equation}\partial_t \zeta + J(\psi,\zeta) = A(y) + \nu \nabla^2 \zeta\end{equation}where $A(y) = A_1 cos(y) +4 A_4cos(4y)$. Parameters for the following runs are:> $\nu = 0.02$> $A_1 = -1.0$> $A_4 = -2.0$<jupyter_code>import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pylab as pl
import matplotlib.animation as animation
def save_vorticity_snapshots(data):

    filenames = []
    S = np.shape(data['Vxy'])[2] 

    for i in range (0,S,100):

        filename = dn+'anim/frame_'+str(i)+'.png'
        filenames.append (filename)

        days = round(i/S*10000,2)

        fig,ax = plt.subplots()

        ax.set_title(r'$t = $'+str(days))
        ax.set_xticks([0,M-1,2*M-2])
        ax.set_xticklabels([r'$0$',r'$\pi$',r'$2\pi$'],fontsize=14)

        ax.set_yticks([0,N-1,2*N-2])
        ax.set_yticklabels([r'$0$',r'$\pi$',r'$2\pi$'],fontsize=14)

        im = plt.imshow((data['Vxy'][:,:,i]),cmap="RdBu_r",origin="lower",interpolation="bicubic",vmax=30,vmin=-30)

        fig.colorbar(im)

        plt.savefig(filename,bbox_inches='tight',dpi=128)
        plt.close()
        
    return filenames
        
def gen_vorticity_animation(infiles,outfile):
    
    gif_filename = dn+outfile+'.gif'

    with imageio.get_writer(gif_filename, mode='I') as writer:
        for filename in infiles:  ## here we go through all prepared files
            image = imageio.imread(filename) 
            writer.append_data(image)

            os.remove(filename) ## now we remove individual frames

    optimize(gif_filename) ## to optimise the file size
def animate_data(data,dn,filename):
    
    fps = 20
    saveinterval = 5
    
    fig,ax = plt.subplots()

    im = plt.imshow(data[:,:,0],origin='lower',cmap='RdBu_r',vmax=30,vmin=-30,interpolation='bicubic')
    fig.colorbar(im)

    plt.xticks([0,M-1,2*M-2],[r'$0$',r'$\pi$',r'$2\pi$'],fontsize=14)
    plt.yticks([0,M-1,2*M-2],[r'$0$',r'$\pi$',r'$2\pi$'],fontsize=14)
    
    def animate(i):
        
        plt.title(str(i*fps*saveinterval) + ' days')

        im.set_array(data[:,:,i])
        return [im]

    anim = animation.FuncAnimation(fig, animate)
    anim.save(dn+filename+'.mp4', fps=fps, extra_args=['-vcodec', 'libx264'])
    
    plt.close()<jupyter_output><empty_output><jupyter_text>8x8 grid<jupyter_code>dn = "kolmogorov/8x8/"

M,N = 8,8
colors = pl.cm.nipy_spectral(np.linspace(0,1,M))
import matplotlib as mpl

plt.rc('font', family='serif') ## setting for figures which I usually use in my publications
mpl.rcParams.update({'font.size': 12})
mpl.rcParams.update({'legend.labelspacing':0.25, 'legend.fontsize': 12})
mpl.rcParams.update({'errorbar.capsize': 4})
nl_full = np.load(dn+"nl.npz",allow_pickle=True) 
nl_res1 = np.load(dn+"nl_res_1.npz",allow_pickle=True) 
nl_res2 = np.load(dn+"nl_res_2.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,3,figsize=(14,5))

ax[0].set_title(f'NL(Full)')
for i,x in enumerate(nl_full['Emtav'].T):    
    ax[0].plot(nl_full['t'],x,label=i,c=colors[i])

ax[1].set_title(f'NL(2)')
for i,x in enumerate(nl_res2['Emtav'].T):
    ax[1].plot(nl_res2['t'],x,label=i,c=colors[i])

ax[2].set_title(f'NL(1)')
for i,x in enumerate(nl_res1['Emtav'].T):
    ax[2].plot(nl_res1['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-6,1e4)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[2].legend(bbox_to_anchor=(1.3,0.75),ncol=1)

# plt.show()
plt.savefig(dn+'nl_fullvlowres.png',bbox_inches='tight',dpi=128)
fig,ax = plt.subplots(1,3,figsize=(15,6))

im = ax[0].imshow((nl_full['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic",vmax=30,vmin=-30)
im = ax[1].imshow((nl_res1['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic",vmax=30,vmin=-30)
im = ax[2].imshow((nl_res2['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic",vmax=30,vmin=-30)

fig.colorbar(im)

for a in ax:
    a.set_xticks([0,M-1,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M-1,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
animate_data(nl_full['Vxy'],dn,'nl_full')
animate_data(nl_res1['Vxy'],dn,'nl_res1')
animate_data(nl_res2['Vxy'],dn,'nl_res2')
nl = np.load(dn+"nl.npz",allow_pickle=True) 
gql_m = np.load(dn+"gql_m.npz",allow_pickle=True) 
gce2_m = np.load(dn+"gce2_m.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,3,figsize=(14,5))

ax[0].set_title(f'NL')
for i,x in enumerate(nl['Emtav'].T):    
    ax[0].plot(nl['t'],x,label=i,c=colors[i])

ax[1].set_title(f'GQL(M)')
for i,x in enumerate(gql_m['Emtav'].T):
    ax[1].plot(gql_m['t'],x,label=i,c=colors[i])

ax[2].set_title(f'GCE2(M)')
for i,x in enumerate(gce2_m['Emtav'].T):
    ax[2].plot(gce2_m['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-3,1e4)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[2].legend(bbox_to_anchor=(1.25,0.5),ncol=1)

plt.show()
fig,ax = plt.subplots(1,3,figsize=(15,6))

im = ax[0].imshow((nl['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
im = ax[1].imshow((gql_m['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
im = ax[2].imshow((gce2_m['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")

fig.colorbar(im)
for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
fig,ax = plt.subplots(1,3,figsize=(15,6))

im = ax[0].imshow((nl['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")
im = ax[1].imshow((gql_m['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")
im = ax[2].imshow((gce2_m['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")

for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
# fig,ax = plt.subplots(3,1,figsize=(15,12))

# ax[0].set_title('NL')
# ax[0].imshow(nl['Vyt'],interpolation='bicubic')
# ax[0].set_aspect(3)

# ax[1].set_title('GQL(M)')
# ax[1].imshow(gql_m['Vyt'],interpolation='bicubic')
# ax[1].set_aspect(3)

# ax[2].set_title('GCE2(M)')
# ax[2].imshow(gce2_m['Vyt'],interpolation='bicubic')
# ax[2].set_aspect(3)

# for a in ax:
#     a.set_xlabel(r'$t$',fontsize=14)
#     a.set_ylabel(r'$\theta$',fontsize=14)

#     a.set_yticks([0,M,2*M-2])
#     a.set_yticklabels([r'$-90$',0,r'$90$'],fontsize=14)

# plt.show()
gql_1 = np.load(dn+"gql_1.npz",allow_pickle=True) 
gce2_1 = np.load(dn+"gce2_1.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(14,5))

ax[0].set_title(f'GQL(1)')
for i,x in enumerate(gql_1['Emtav'].T):    
    ax[0].plot(gql_1['t'],x,label=i,c=colors[i])

ax[1].set_title(f'GCE2(1)')
for i,x in enumerate(gce2_1['Emtav'].T):
    ax[1].plot(gce2_1['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-4,1e4)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.01,0.5),ncol=1)

plt.show()
fig,ax = plt.subplots(1,2,figsize=(12,6))

im = ax[0].imshow((gql_1['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
# fig.colorbar(im)
im = ax[1].imshow((gce2_1['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
# fig.colorbar(im)

for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
fig,ax = plt.subplots(2,1,figsize=(12,6))

ax[0].set_title('GQL(1)')
ax[0].imshow(gql_1['Vyt'],cmap="jet",interpolation='bicubic')
ax[0].set_aspect(0.5)

ax[1].set_title('GCE2(1)')
ax[1].imshow(gce2_1['Vyt'],cmap="jet",interpolation='bicubic')
ax[1].set_aspect(0.25)

for a in ax:
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_ylabel(r'$\theta$',fontsize=14)

    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-90$',0,r'$90$'],fontsize=14)

plt.show()
gql_3 = np.load(dn+"gql_3.npz",allow_pickle=True) 
gce2_3 = np.load(dn+"gce2_3.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(14,5))

ax[0].set_title(f'GQL(3)')
for i,x in enumerate(gql_3['Emtav'].T):    
    ax[0].plot(gql_3['t'],x,label=i,c=colors[i])

ax[1].set_title(f'GCE2(3)')
for i,x in enumerate(gce2_3['Emtav'].T):
    ax[1].plot(gce2_3['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-4,1e4)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.01,0.5),ncol=1)

plt.show()
fig,ax = plt.subplots(1,2,figsize=(12,6))

ax[0].set_title('GQL(3)')
im = ax[0].imshow((gql_3['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
# fig.colorbar(im)

ax[1].set_title('GCE2(3)')
im = ax[1].imshow((gce2_3['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
# fig.colorbar(im)

for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
fig,ax = plt.subplots(2,1,figsize=(12,12))

ax[0].set_title('GQL(3)')
ax[0].imshow(gql_3['Vyt'],cmap="jet",interpolation='bicubic')
ax[0].set_aspect(0.5)

ax[1].set_title('GCE2(3)')
ax[1].imshow(gce2_3['Vyt'],cmap="jet",interpolation='bicubic')
ax[1].set_aspect(0.25)

for a in ax:
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_ylabel(r'$\theta$',fontsize=14)

    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-90$',0,r'$90$'],fontsize=14)

plt.show()
ql = np.load(dn+"ql.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2.npz",allow_pickle=True) 
gce2_0 = np.load(dn+"gce2_0.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,3,figsize=(14,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emt'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emt'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

ax[2].set_title(f'GCE2(0)')
for i,x in enumerate(gce2_0['Emt'].T):
    ax[2].plot(gce2_0['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-36,1e4)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[2].legend(bbox_to_anchor=(1.01,0.5),ncol=1)

# plt.show()
plt.savefig(dn+'figures/kolmogorov_qlce2_dp5.png',bbox_inches='tight')
ql = np.load(dn+"ql_bs3.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_ts5.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emt'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emt'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

# ax[2].set_title(f'GCE2(0)')
# for i,x in enumerate(gce2_0['Emt'].T):
#     ax[2].plot(gce2_0['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

# plt.show()
plt.savefig(dn+'figures/kolmogorov_qlce2_bs3.png',bbox_inches='tight')
ql = np.load(dn+"ql_ts5.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_ts5.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emt'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emt'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

# ax[2].set_title(f'GCE2(0)')
# for i,x in enumerate(gce2_0['Emt'].T):
#     ax[2].plot(gce2_0['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

# plt.show()
plt.savefig(dn+'figures/kolmogorov_qlce2_ts5.png',bbox_inches='tight')
ql = np.load(dn+"ql_dp5.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_dp5.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emt'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emt'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

# ax[2].set_title(f'GCE2(0)')
# for i,x in enumerate(gce2_0['Emt'].T):
#     ax[2].plot(gce2_0['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

# plt.show()
plt.savefig(dn+'figures/kolmogorov_qlce2_dp5.png',bbox_inches='tight')
ql = np.load(dn+"ql_250.npz",allow_pickle=True) 
ql_2 = np.load(dn+"ql_250_r2.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emtav'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'QL w/ diff seed')
for i,x in enumerate(ql_2['Emtav'].T):
    ax[1].plot(ql_2['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

# plt.show()
# plt.savefig(dn+'figures/kolmogorov_qlce2_dp5.png',bbox_inches='tight')
fig,ax = plt.subplots(1,2,figsize=(15,6))

im = ax[0].imshow((ql['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")
im = ax[1].imshow((ql_2['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")

for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
ql = np.load(dn+"ql_500_r123.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_500_ql_r123.npz",allow_pickle=True) 
colors = pl.cm.nipy_spectral(np.linspace(0,1,M))
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emtav'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emtav'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

# plt.show()
plt.savefig(dn+'figures/ze_qlce2_dp5.png',bbox_inches='tight')
ql = np.load(dn+"ql_500_r123.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_500_r123.npz",allow_pickle=True) 
colors = pl.cm.nipy_spectral(np.linspace(0,1,M))
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emtav'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emtav'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

# plt.show()
plt.savefig(dn+'figures/ze_qlce2_rand.png',bbox_inches='tight')
fig,ax = plt.subplots(1,3,figsize=(15,6))

im = ax[0].imshow((ql['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
im = ax[1].imshow((ce2['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")
im = ax[2].imshow((gce2_0['Emn'][:,:,-1]),cmap="nipy_spectral_r",origin="lower",interpolation="bicubic")

for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
fig,ax = plt.subplots(1,3,figsize=(15,6))

im = ax[0].imshow((ql['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")
im = ax[1].imshow((ce2['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")
im = ax[2].imshow((gce2_0['Vxy'][:,:,-1]),cmap="RdBu_r",origin="lower",interpolation="bicubic")

for a in ax:
    a.set_xticks([0,M,2*M-2])
    a.set_xticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)
    a.set_yticks([0,M,2*M-2])
    a.set_yticklabels([r'$-M$',r'$0$',r'$M$'],fontsize=14)

plt.show()
ql = np.load(dn+"ql_500_r123_nu01.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_500_r123_nu01.npz",allow_pickle=True) 
colors = pl.cm.nipy_spectral(np.linspace(0,1,M))
fig,ax = plt.subplots(1,2,figsize=(10,5))

colors = pl.cm.nipy_spectral(np.linspace(0,1,M))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emtav'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emt'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

plt.show()
# plt.savefig(dn+'figures/ze_qlce2_rand.png',bbox_inches='tight')
fig,ax = plt.subplots(figsize=(9,3))

Nt = len(ce2['t'])
t = np.linspace(0,500,Nt)
R = moderanks(ce2['mEVs'])

ax.set_title(f'Ranks for modes in Second Cumulant')
for i in np.arange(M-1):
    ax.plot(t,R[:,i],label=i+1,c=colors[i+1])
    
ax.set_xlabel(r'$t$',fontsize=14)
# ax.set_yscale('log')
# ax.set_ylim(1e-21,1e3)
ax.set_xlim(0,500)

ax.set_ylabel(r'$Eigenvalues$',fontsize=14)
ax.legend(loc=4,ncol=1)

# plt.show()
# plt.savefig(dn+'figures/ranks_ce2_rand.png',bbox_inches='tight')
ql = np.load(dn+"ql_500_r123_nu03.npz",allow_pickle=True) 
ce2 = np.load(dn+"ce2_500_r123_nu03.npz",allow_pickle=True) 
fig,ax = plt.subplots(1,2,figsize=(10,5))

ax[0].set_title(f'QL')
for i,x in enumerate(ql['Emtav'].T):    
    ax[0].plot(ql['t'],x,label=i,c=colors[i])

ax[1].set_title(f'CE2')
for i,x in enumerate(ce2['Emt'].T):
    ax[1].plot(ce2['t'],x,label=i,c=colors[i])

for a in ax:
    
    a.set_xlabel(r'$t$',fontsize=14)
    a.set_yscale('log')
    a.set_ylim(1e-16,1e5)

ax[0].set_ylabel(r'$E(m)$',fontsize=14)
ax[1].legend(bbox_to_anchor=(1.0,0.75),ncol=1)

plt.show()
# plt.savefig(dn+'figures/ze_qlce2_rand.png',bbox_inches='tight')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2534959349593496, 'fraction_numerical': 0.054254742547425475, 'mean_word_length': 5.986368799697084, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '281776', 'license': 'MIT', 'n_tokens_mistral': 9515, 'n_tokens_neox': 9231, 'n_words': 817, 'path': 'validate/kolmogorov/kolmogorov.ipynb', 'repo_name': 'gvn22/ZonalFlow.jl', 'size': '18450'}