示例#1
0
def free_energy_change(beta, u_int, mix_grid):

    tau, w_n = tau_wn_setup(dict(BETA=beta, N_MATSUBARA=2**11))

    ig_iwn, is_iwn = dmft_loop(u_int,
                               0.5,
                               -1.j / (w_n - 1 / w_n),
                               w_n,
                               tau,
                               conv=1e-10)

    mg_iwn, ms_iwn = dmft_loop(u_int, 0.5, greenF(w_n), w_n, tau, conv=1e-10)

    solution_diff = mg_iwn - ig_iwn

    integrand = []
    for l in mix_grid:
        g_in = mix(mg_iwn, ig_iwn, l)
        g_grad = one_loop(g_in, 0.5, U, w_n, tau) - g_in
        integrand.append(np.dot(g_grad, solution_diff).real / beta)

    return np.array([0] + [
        trapz(integrand[:i], mix_grid[:i])
        for i in range(2,
                       len(mix_grid) + 1)
    ])
示例#2
0
def extract_double_occupation(beta, u_range):
    docc = []
    tau, w_n = gf.tau_wn_setup(dict(BETA=beta, N_MATSUBARA=beta))
    g_iwn = gf.greenF(w_n)
    for u_int in u_range:
        g_iwn, sigma = ipt.dmft_loop(u_int, 0.5, g_iwn, w_n, tau, conv=1e-4)
        docc.append(ipt.epot(g_iwn, sigma, u_int, beta, w_n) * 2 / u_int)
    return np.array(docc)
示例#3
0
def hysteresis(beta, D_range):
    log_g_sig = []
    tau, w_n = tau_wn_setup(dict(BETA=beta, N_MATSUBARA=2**11))
    g_iwn = greenF(w_n, D=1)
    for D in D_range:
        g_iwn, sigma = dmft_loop(1, D / 2, g_iwn, w_n, tau)
        log_g_sig.append((g_iwn, sigma))
    return log_g_sig
示例#4
0
def hysteresis(beta, u_range):
    log_g_sig = []
    tau, w_n = tau_wn_setup(dict(BETA=beta, N_MATSUBARA=beta))
    g_iwn = greenF(w_n)
    for u_int in u_range:
        g_iwn, sigma = dmft_loop(u_int, 0.5, g_iwn, w_n, tau)
        log_g_sig.append((g_iwn, sigma))
    return log_g_sig
示例#5
0
def test_ipt_pm_g(u_int, result, beta=50., n_tau=2**11, n_matsubara=64):
    parms = {'BETA': beta, 'N_TAU': n_tau, 'N_MATSUBARA': n_matsubara,
             't': 0.5, 'MU': 0, 'U': u_int,
             }
    tau, w_n = tau_wn_setup(parms)
    g_iwn0 = greenF(w_n, D=2*parms['t'])
    g_iwn_log, sigma_iwn = ipt_imag.dmft_loop(100, parms['U'], parms['t'], g_iwn0, w_n, tau)

    assert np.allclose(result, g_iwn_log[-1][32:], atol=1e-3 )
示例#6
0
def test_ipt_pm_g(u_int, result, beta=50., n_matsubara=64):
    """Test the solution of the single band impurity problem"""
    parms = {
        'BETA': beta,
        'N_MATSUBARA': n_matsubara,
        't': 0.5,
        'MU': 0,
        'U': u_int,
    }
    tau, w_n = tau_wn_setup(parms)
    g_iwn0 = greenF(w_n, D=2 * parms['t'])
    g_iwn, _ = ipt_imag.dmft_loop(parms['U'], parms['t'], g_iwn0, w_n, tau)

    assert np.allclose(result, g_iwn, atol=3e-3)
示例#7
0
def test_ipt_pm_g(u_int, result, beta=50., n_tau=2**11, n_matsubara=64):
    parms = {
        'BETA': beta,
        'N_TAU': n_tau,
        'N_MATSUBARA': n_matsubara,
        't': 0.5,
        'MU': 0,
        'U': u_int,
    }
    tau, w_n = tau_wn_setup(parms)
    g_iwn0 = greenF(w_n, D=2 * parms['t'])
    g_iwn_log, sigma_iwn = ipt_imag.dmft_loop(100, parms['U'], parms['t'],
                                              g_iwn0, w_n, tau)

    assert np.allclose(result, g_iwn_log[-1][32:], atol=1e-3)
示例#8
0
BETA = 100.
tau, w_n = tau_wn_setup(dict(BETA=BETA, N_MATSUBARA=2**9))
omega = np.linspace(-4, 4, 600)
eps_k = np.linspace(-1, 1, 61)
dos = np.exp(-2 * eps_k**2) / np.sqrt(np.pi / 2)
de = eps_k[1] - eps_k[0]
dosde = (dos * de).reshape(-1, 1)
nf = fermi_dist(omega, BETA)

###############################################################################
# Insulator Calculations
# ----------------------

ig_iwn, is_iwn = dmft_loop(U,
                           0.5,
                           -1.j / (w_n - 1 / w_n),
                           w_n,
                           tau,
                           conv=1e-12)
igw = pade_continuation(ig_iwn, w_n, omega, np.arange(100))
isigma_w = pade_continuation(is_iwn, w_n, omega, np.arange(100))
lat_gf = 1 / (np.add.outer(-eps_k, omega + 4e-2j) - isigma_w)
lat_Aw = -lat_gf.imag / np.pi
icond = optical_conductivity(lat_Aw, lat_Aw, nf, omega, dosde)

###############################################################################
# Metal Calculations
# ------------------

mg_iwn, s_iwn = dmft_loop(U, 0.5, greenF(w_n), w_n, tau, conv=1e-10)
mgw = pade_continuation(mg_iwn, w_n, omega, np.arange(100))
msigma_w = omega - 0.25 * mgw - 1 / mgw
###############################################################################
# Results from IPT
# ----------------
#
# 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))
示例#10
0
from dmft.common import greenF, tau_wn_setup
import numpy as np
import matplotlib.pylab as plt

parms = {
    'BETA': 50,
    'MU': 0,
    'U': 3,
    't': 0.5,
    'N_TAU': 2**10,
    'N_MATSUBARA': 64
}
tau, w_n = tau_wn_setup(parms)
g_iwn0 = greenF(w_n, D=2 * parms['t'])
g_iwn_log, sigma_iwn = ipt_imag.dmft_loop(100, parms['U'], parms['t'], g_iwn0,
                                          w_n, tau)
g_iwn = g_iwn_log[-1]

fig_gw, gw_ax = plt.subplots()
gw_ax.plot(w_n, g_iwn.real, '+-', label='RE')
gw_ax.plot(w_n, g_iwn.imag, 's-', label='IM')
plt.plot(w_n, -1 / w_n, label='high w tail ')
gw_ax.set_xlim([0, 6.5])
cut = int(6.5 * parms['BETA'] / np.pi)
gw_ax.set_ylim([g_iwn.imag[:cut].min() * 1.1, 0])
plt.legend(loc=0)
plt.ylabel(r'$G(i\omega_n)$')
plt.xlabel(r'$i\omega_n$')
plt.title(r'$G(i\omega_n)$ at $\beta= {}$, $U= {}$'.format(
    parms['BETA'], parms['U']) +
          '\nConverged in {} dmft loops'.format(len(g_iwn_log)))
示例#11
0
from dmft.common import greenF, tau_wn_setup
from dmft.twosite import matsubara_Z

import numpy as np
import matplotlib.pylab as plt

U = np.linspace(0, 2.7, 36)
U = np.concatenate((U, U[-2:11:-1]))

parms = {'MU': 0, 't': 0.5, 'N_TAU': 2**10, 'N_MATSUBARA': 2**7}
lop_g=[]
for beta in [16, 25, 50]:
    u_zet = []
    parms['BETA'] = beta
    tau, w_n = tau_wn_setup(parms)
    g_iwn0 = greenF(w_n, D=2*parms['t'])
    for u_int in U:
        mix = 0.4 if u_int > 1.5 else 1
        g_iwn_log, sigma = ipt_imag.dmft_loop(100, u_int, parms['t'], g_iwn0, w_n, tau, mix)
        g_iwn0 = g_iwn_log[-1]
        lop_g.append(g_iwn_log)
        u_zet.append(matsubara_Z(sigma.imag, beta))

    plt.plot(U, u_zet, label='$\\beta={}$'.format(beta))
plt.title('Hysteresis loop of the quasiparticle weigth')
plt.legend()
plt.ylabel('Z')
plt.xlabel('U/D')

示例#12
0
the contribution of the Hartree-term is not included here as it is cancelled

"""
from __future__ import division, absolute_import, print_function

from dmft import ipt_imag

from dmft.common import greenF, tau_wn_setup
import numpy as np
import matplotlib.pylab as plt

parms = {'BETA': 50, 'MU': 0, 'U': 3, 't': 0.5, 'N_TAU': 2**10, 'N_MATSUBARA': 64}
tau, w_n = tau_wn_setup(parms)
g_iwn0 = greenF(w_n, D=2*parms['t'])
g_iwn_log, sigma_iwn = ipt_imag.dmft_loop(100, parms['U'], parms['t'], g_iwn0, w_n, tau)
g_iwn = g_iwn_log[-1]

fig_gw, gw_ax = plt.subplots()
gw_ax.plot(w_n, g_iwn.real, '+-', label='RE')
gw_ax.plot(w_n, g_iwn.imag, 's-', label='IM')
plt.plot(w_n, -1/w_n, label='high w tail ')
gw_ax.set_xlim([0, 6.5])
cut = int(6.5*parms['BETA']/np.pi)
gw_ax.set_ylim([g_iwn.imag[:cut].min()*1.1, 0])
plt.legend(loc=0)
plt.ylabel(r'$G(i\omega_n)$')
plt.xlabel(r'$i\omega_n$')
plt.title(r'$G(i\omega_n)$ at $\beta= {}$, $U= {}$'.format(parms['BETA'],
          parms['U']) + '\nConverged in {} dmft loops'.format(len(g_iwn_log)))
示例#13
0
from dmft.common import greenF, tau_wn_setup
from dmft.twosite import matsubara_Z

import numpy as np
import matplotlib.pylab as plt

U = np.linspace(0, 2.7, 36)
U = np.concatenate((U, U[-2:11:-1]))

parms = {'MU': 0, 't': 0.5, 'N_TAU': 2**10, 'N_MATSUBARA': 2**7}
lop_g = []
for beta in [16, 25, 50]:
    u_zet = []
    parms['BETA'] = beta
    tau, w_n = tau_wn_setup(parms)
    g_iwn0 = greenF(w_n, D=2 * parms['t'])
    for u_int in U:
        mix = 0.4 if u_int > 1.5 else 1
        g_iwn_log, sigma = ipt_imag.dmft_loop(100, u_int, parms['t'], g_iwn0,
                                              w_n, tau, mix)
        g_iwn0 = g_iwn_log[-1]
        lop_g.append(g_iwn_log)
        u_zet.append(matsubara_Z(sigma.imag, beta))

    plt.plot(U, u_zet, label='$\\beta={}$'.format(beta))
plt.title('Hysteresis loop of the quasiparticle weigth')
plt.legend()
plt.ylabel('Z')
plt.xlabel('U/D')