Esempio n. 1
0
]

# 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)} #
###########

common_g2_params = {
    'gf_struct': gf_struct,
Esempio n. 2
0
S_m = ed.ensemble_average(('dn', 0), ('up', 0), beta)

assert abs(n_up - n_up_ref) < 1e-10
assert abs(n_dn - n_dn_ref) < 1e-10
assert abs(S_p) < 1e-10
assert abs(S_m) < 1e-10

# Compute 3 susceptibilities
# < n_up ; n_up >
# < n_up ; n_dn >
# < S_+ ; S_- >

# Number of Matsubara frequencies for susceptibility calculation
n_inu = 200

chi_up_up = ed.chi_inu(('up', 0), ('up', 0), ('up', 0), ('up', 0), beta, n_inu,
                       True)
chi_up_dn = ed.chi_inu(('up', 0), ('up', 0), ('dn', 0), ('dn', 0), beta, n_inu,
                       True)
chi_Sp_Sm = ed.chi_inu(('up', 0), ('dn', 0), ('dn', 0), ('up', 0), beta, n_inu,
                       True)

for inu in chi_up_up.mesh:
    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