occ = [ ed.ensemble_average(i, i, beta).real for i in product(spin_names, orb_names) ] # Compute G(i\omega) G_iw = ed.G_iw(gf_struct, beta, n_iw) # Compute G(\tau) G_tau = ed.G_tau(gf_struct, beta, n_tau) # Compute G(\omega) G_w = ed.G_w(gf_struct, beta, energy_window, n_w, 0.01) # Compute \chi(\tau) = <n_{up,0}(\tau) n_{dn,0}(0)> chi_tau = ed.chi_tau(('up', 0), ('up', 0), ('dn', 0), ('dn', 0), beta, n_tau) # Compute \chi(i\nu) chi_inu = ed.chi_inu(('up', 0), ('up', 0), ('dn', 0), ('dn', 0), beta, n_iw) # Compute \chi_c(\tau) = <n_{up,0}(\tau) n_{dn,0}(0)> - <n_{up,0}><n_{dn,0}> chi_tau_c = ed.chi_tau(('up', 0), ('up', 0), ('dn', 0), ('dn', 0), beta, n_tau, True) # Compute \chi_c(i\nu) chi_inu_c = ed.chi_inu(('up', 0), ('up', 0), ('dn', 0), ('dn', 0), beta, n_iw, True) ########### # G^{(2)} # ###########
zero_freq = abs(complex(inu)) < 1e-10 chi_up_up_ref = (w[1] + w[3]) * (1 - w[1] - w[3]) * beta if zero_freq else 0 assert abs(chi_up_up[inu] - chi_up_up_ref) < 1e-10 chi_up_dn_ref = (w[3] - (w[1] + w[3]) * (w[2] + w[3])) * beta if zero_freq else 0 assert abs(chi_up_dn[inu] - chi_up_dn_ref) < 1e-10 if h_field == 0: chi_Sp_Sm_ref = w[1] * beta if zero_freq else 0 else: chi_Sp_Sm_ref = -(w[1] - w[2]) / (inu - 2 * h_field) assert abs(chi_Sp_Sm[inu] - chi_Sp_Sm_ref) < 1e-10 # Number of time slices for susceptibility calculation n_tau = 200 chi_up_up = ed.chi_tau(('up', 0), ('up', 0), ('up', 0), ('up', 0), beta, n_tau, True) chi_up_dn = ed.chi_tau(('up', 0), ('up', 0), ('dn', 0), ('dn', 0), beta, n_tau, True) for tau in chi_up_up.mesh: chi_up_up_ref = (w[1] + w[3]) * (1 - w[1] - w[3]) assert abs(chi_up_up[tau] - chi_up_up_ref) < 1e-10 chi_up_dn_ref = (w[3] - (w[1] + w[3]) * (w[2] + w[3])) assert abs(chi_up_dn[tau] - chi_up_dn_ref) < 1e-10