<jupyter_start><jupyter_text>import R-correlator<jupyter_code>with open('../data/n_omega_spin2_Rcorr_jk.pkl', 'rb') as fin:
    rcorr_jk = pickle.load(fin)
rcorr_jk.keys()
rcorr_jk[10].shape
rs = np.array([np.sqrt(ix**2 + iy**2 + iz**2)
              for iz in range(-L//2, L//2)
              for iy in range(-L//2, L//2)
              for ix in range(-L//2, L//2)]).reshape(L, L, L)
rs = np.roll(np.roll(np.roll(rs, L//2, 0), L//2, 1), L//2, 2).flatten()
uniq_a1 = np.array([ix + L*(iy + L*iz)
                   for ix in range(0,L//2+1)
                   for iy in range(0,ix+1)
                   for iz in range(0,iy+1)])


rs_uniq = rs[uniq_a1]
with sns.color_palette('Reds', len(range(10,15+1))):
    fig, ax = plt.subplots()
    ix = np.argmin(np.abs(rs_uniq*lat_unit - 3.0))
    for it, sym in zip(range(10, 15+1), ['^', 's', 'v', 'D', 'X', 'o']):
        norm = rcorr_jk[it].mean(axis=0)[ix]

        rcorr_av = (rcorr_jk[it]).mean(axis=0)/norm
        rcorr_err = (rcorr_jk[it]).std(axis=0) * np.sqrt(bin_num - 1)/norm
        r = rs[uniq_a1]
        ax.errorbar(r*lat_unit, rcorr_av, rcorr_err, fmt=sym, capsize=10, capthick=2.0,
                    mec='black', mew=1.0, ms=15,
                    label=rf'$t/a = {it}$')

    leg = ax.legend(bbox_to_anchor=(0,0), loc='lower left', borderaxespad=1, ncol=2, frameon=True)
    leg.get_frame().set_edgecolor('black')
    leg.get_frame().set_linewidth(2.0)
    ax.set_xlabel(r'$r$ [fm]', size=48)
    ax.set_ylabel(r'$R_{N\Omega}(r,t)/R_{N\Omega}(r=3,t)$', size=48)
    ax.axhline(0, color='black')
    ax.set_xlim(-0.05, 3.05)
    ax.set_title(r'$N\Omega$($^5$S$_2$)', size=58, y=1.02)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21513706793802145, 'fraction_numerical': 0.045887961859356376, 'mean_word_length': 2.756152125279642, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '160537', 'license': 'MIT', 'n_tokens_mistral': 786, 'n_tokens_neox': 743, 'n_words': 119, 'path': 'notes/R-correlator.ipynb', 'repo_name': 'tkmiriya/n_omega_near_phys_pt', 'size': '1678'}