Esempio n. 1
0
def test_pade():
    """Test pade Analytical Continuation for the semi-circular DOS"""
    w_n = gf.matsubara_freq(200)
    giw = gf.greenF(w_n)
    omega = np.linspace(-0.7, 0.7, 100)  # avoid semicircle edges
    gw_ref = gf.greenF(-1j * omega + 1e-5)
    pade_c = gf.pade_coefficients(giw, w_n)
    gw_cont = gf.pade_rec(pade_c, omega, w_n)
    assert np.allclose(gw_ref, gw_cont, 1e-3)
Esempio n. 2
0
def pade_diag(gf_aa, gf_ab, w_n, w_set, w):
    r"""Take diagonal and off diagonal Matsubara functions in the local
    basis and return real axis functions in the symmetric and
    anti-symmetric basis. Such that

         ⎡ⅈ⋅ωₙ + μ  - t⟂          0       ⎤     ⎡Σ_AA + Σ_AB       0     ⎤
G^{-1} = ⎢                                ⎥  -  ⎢                        ⎥
         ⎣        0        ⅈ⋅ωₙ + μ  + t⟂ ⎦     ⎣     0       Σ_AA - Σ_AB⎦

The Symmetric sum (Anti-bonding) returned first, Asymmetric is returned second

"""

    gf_s = 1j * gf_aa.imag + gf_ab.real  # Anti-bond
    pc = gf.pade_coefficients(gf_s[w_set], w_n[w_set])
    gr_s = gf.pade_rec(pc, w, w_n[w_set])

    gf_a = 1j * gf_aa.imag - gf_ab.real  # bond
    pc = gf.pade_coefficients(gf_a[w_set], w_n[w_set])
    gr_a = gf.pade_rec(pc, w, w_n[w_set])

    return gr_s, gr_a
#
# Starting from the Metallic seed on the Bethe Lattice the DMFT
# equations are solved iteratively in by perturbation theory in the
# Matsubara axis. The resulting Green's function is then approximated
# by its Padé approximant which allows to evaluate it on the upper
# complex plane.

beta = 90.
U = 2.7
tau, w_n = tau_wn_setup(dict(BETA=beta, N_MATSUBARA=1024))
g_iwn0 = greenF(w_n)
g_iwn, s_iwn = dmft_loop(U, 0.5, g_iwn0, w_n, tau, conv=1e-12)
x = int(2 * beta)
w_set = np.arange(x)

pc = pade_coefficients(g_iwn[w_set], w_n[w_set])

ax = plot_complex_gf(omega, np.linspace(1e-3, 1.2, 30), w_n[:17],
                     lambda z: pade_rec(pc, z, w_n[w_set]))
ax.view_init(15, -64)
ax.set_zlim3d([-2, 1])

###############################################################################
# For the insulating solution

U = 3.2
tau, w_n = tau_wn_setup(dict(BETA=beta, N_MATSUBARA=1024))
g_iwn0 = greenF(w_n)
g_iwn, s_iwn = dmft_loop(U,
                         0.5,
                         1 / (1j * w_n - 1 / g_iwn0),
    np.polyfit(w_n[:5], giw_s[i, 0, :5].imag, 1)[0] for i in range(len(tprr))
]
plt.plot(tprr, slopes, '+-', label='data')
plt.title(r'Slope of $Im G_{AA}$')
plt.xlabel(r'$t_\perp/D$')
plt.ylabel(r"$\Im m G'_{AA}(0)$")

###############################################################################
# Analytical Continuation
# -----------------------

w_set = np.concatenate((np.arange(8) * 256, np.arange(1, 241, 1)))
w = np.linspace(0, 3., 500)
plt.figure()
for i, tp in enumerate(tprr):
    pc = gf.pade_coefficients(1j * giw_s[i, 0, w_set].imag, w_n[w_set])
    plt.plot(w, -2 * tp - gf.pade_rec(pc, w, w_n[w_set]).imag)
plt.xlabel(r'$\omega$')
plt.ylabel(r'$A(\omega) - 2 t_\perp$')

###############################################################################
# Change of G_{AB}
# ----------------

for i in [1, 2, 4, 7, 11, 16]:
    plt.plot(w_n,
             giw_s[i, 1].real,
             's-',
             label=r'$t_\perp={}$'.format(tprr[i]))
plt.xlabel(r'$i\omega_n$')
plt.ylabel(r'$\Re e G_{AB} (i\omega_n)$')