Example #1
0
    def __init__(self, beta=1e5, t=1, omega=np.linspace(-9, 9, 1200)):
        super(TwoSite_Real, self).__init__(beta, t)

        self.omega = omega

        self.rho_0 = dos.bethe_lattice(self.omega, self.t)

        self.solve(np.zeros(2), 0, np.zeros(2))
Example #2
0
    def __init__(self, beta=1e5, t=1, omega=np.linspace(-6, 6, 1200)):
        super(TwoSite_Real, self).__init__(beta, t)

        self.omega = omega

        self.rho_0 = dos.bethe_lattice(self.omega, self.t)

        self.solve(0, 0, 0)
Example #3
0
def test_hilbert_trans_integral(halfbandwidth):
    """Test hilbert transform of semi-circle to direct integral"""

    w = np.linspace(-3, 3, 2**9)
    w_n = gf.matsubara_freq(20)
    giw = gf.greenF(w_n, D=halfbandwidth)
    rho_w = dos.bethe_lattice(w, halfbandwidth / 2)
    Apiw = np.array([simps(rho_w / (1j * iw - w), w) for iw in w_n])

    assert np.allclose(Apiw, giw, 2e-4)
Example #4
0
def test_hilbert_trans_func(halfbandwidth):
    """Test Hilbert transforms of semi-circle"""
    # Match in the 2 forms
    w_n = gf.matsubara_freq(200)
    giw = gf.greenF(w_n, sigma=-1j / w_n, mu=-0.2, D=halfbandwidth)
    ss = gf.semi_circle_hiltrans(1j * w_n - .2 + 1j / w_n, D=halfbandwidth)
    assert np.allclose(ss, giw)

    # corresponds to semi-circle
    w = np.linspace(-3, 3, 2**9)
    ss = gf.semi_circle_hiltrans(w + 1e-5j, D=halfbandwidth)
    assert np.allclose(dos.bethe_lattice(w, halfbandwidth / 2),
                       -ss.imag / np.pi,
                       atol=1e-4)
Example #5
0
    def run(i):
        u_int = res[i, 0]
        w = res[i, 2].omega
        s = res[i, 2].GF[r'$\Sigma$']
        g = res[i, 2].GF['Imp G']
        ra = w + u_int / 2. - s
        rho = dos.bethe_lattice(ra, res[i, 2].t)

        line.set_data(w, rho)
        line2.set_data(w, s)
        line3.set_data(w, g)
        ax1.set_title('Transition to Mott Insulator at '
                      '$\\beta=${} and U/D={}'.format(beta, u_int))

        return line, line2, line3
Example #6
0
    def run(i):
        u_int = res[i, 0]
        w = res[i, 2].omega
        s = res[i, 2].GF[r'$\Sigma$']
        g = res[i, 2].GF['Imp G']
        ra = w+u_int/2.-s
        rho = dos.bethe_lattice(ra, res[i, 2].t)

        line.set_data(w, rho)
        line2.set_data(w, s)
        line3.set_data(w, g)
        ax1.set_title('Transition to Mott Insulator at '
                      '$\\beta=${} and U/D={}'.format(beta, u_int))

        return line, line2, line3
Example #7
0
 def second_moment(x):
     return x * x * dos.bethe_lattice(x, t)
Example #8
0
from slaveparticles.quantum import dos

axis = 'real'
u = 8.0
beta = 1e3
dop = [0.25, 0.5, 0.75, 0.9, 0.99]
out_file = axis + '_dop_b{}_U{}'.format(beta, u)
res = np.load(out_file + '.npy')

f, axes = plt.subplots(len(dop), sharex=True)
axes[0].set_title(r'$A(\omega)$ under doping U={} at '
                  '$\\beta=${}'.format(u, beta))
axes[-1].set_xlabel('$\\omega / t$')
f.subplots_adjust(hspace=0)

for ax, n in zip(axes, dop):
    ind = np.abs(res[:, 0] - n).argmin()
    sim = res[ind, 1]

    w = sim.omega
    s = sim.GF[r'$\Sigma$']
    ra = w + sim.mu - s
    rho = dos.bethe_lattice(ra, sim.t)

    ax.plot(w, rho, label='n={:.2f}'.format(sim.ocupations().sum()))
    ax.set_xlim([-6, 6])
    ax.set_ylim([0, 0.36])
    ax.set_yticks([])
    ax.set_ylabel('n={:.2f}'.format(sim.ocupations().sum()))
    ax.legend(loc=0, handlelength=0)
Example #9
0
out_file = axis+'_halffill_b{}_dU{}'.format(beta, du)
res = np.load(out_file+'.npy')

for u in u_int:
    ind = np.where(np.abs(res[:, 0] - u) < 1e-3)[0][0]

    f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True)
    ax1.set_title('Transition to Mott Insulator at '
                  '$\\beta=${} and U/D={}'.format(beta, u/2))
    f.subplots_adjust(hspace=0)

    w = res[ind, 2].omega
    s = res[ind, 2].GF[r'$\Sigma$']
    g = res[ind, 2].GF['Imp G']
    ra = w+u/2.-s
    rho = dos.bethe_lattice(ra, res[ind, 2].t)

    ax1.plot(w, rho)
    ax1.set_xlim([-6, 6])
    ax1.set_ylim([0, 0.36])

    ax2.plot(w, s)
    ax2.set_ylim([-6, 9])

    ax3.plot(w, g)
    ax3.set_ylim([-6, 6])

    ax1.set_ylabel(r'$A(\omega)$')
    ax2.set_ylabel(r'$\Sigma(\omega)$')
    ax3.set_ylabel(r'$G_{imp}(\omega)$')
    ax3.set_xlabel('$\\omega / t$')
Example #10
0
            convergence = np.abs(old - hyb) < 1e-5

        print(U, hyb, sim.ocupations())
        sim.solve(U / 2, U, hyb)
        hyb = sim.hyb_V()
        res.append((U, sim.imp_z(), sim))
    return np.asarray(res)


if __name__ == "__main__":
    u = np.arange(0, 3.2, 0.1)
    sim = TwoSite_Real()
    u = 2.5
    print(sim.imp_z())
    sim.selfconsistency(np.array([3.5, -2.25]), np.array([0.866, 0.95689]),
                        u / 2., u)
    wi = sim.omega + sim.mu - sim.GF[r'$\Sigma$']
    rho = dos.bethe_lattice(wi, 1.)
    plt.plot(rho.T)

#    filling = np.arange(1, 0.9, -0.025)
#    for n in filling:
#        old_e = ecc
#        res.append(sim.selfconsitentcy(old_e, sim.hyb_V(), n, u))
#        ecc = res[-1][0]
#
#    res = np.asarray(res)
#    plt.plot(filling, res[:, 0], label='ec')
#    plt.plot(filling, res[:, 1], label='hyb')
#    plt.plot(filling, res[:, 2], label='mu')
Example #11
0
 def interacting_dos(self):
     """Evaluates the interacting density of states"""
     w = self.omega + self.mu - self.GF[r'$\Sigma$']
     return dos.bethe_lattice(w, self.t)
Example #12
0
 def interacting_dos(self):
     """Evaluates the interacting density of states"""
     w = self.omega + self.mu - self.GF[r'$\Sigma$']
     return dos.bethe_lattice(w, self.t)
Example #13
0
            hyb = sim.hyb_V()
            hyb = (hyb + old)/2
            convergence = np.abs(old - hyb) < 1e-5

        print(U, hyb, sim.ocupations())
        sim.solve(U/2, U, hyb)
        hyb = sim.hyb_V()
        res.append((U, sim.imp_z(), sim))
    return np.asarray(res)

if __name__ == "__main__":
    u = np.arange(0, 3.2, 0.1)
    sim = TwoSite_Real()
    u=2.5
    print(sim.imp_z())
    sim.selfconsistency(np.array([3.5,-2.25]),np.array([0.866,0.95689]),u/2.,u)
    wi=sim.omega+sim.mu-sim.GF[r'$\Sigma$']
    rho=dos.bethe_lattice(wi,1.)
    plt.plot(rho.T)

#    filling = np.arange(1, 0.9, -0.025)
#    for n in filling:
#        old_e = ecc
#        res.append(sim.selfconsitentcy(old_e, sim.hyb_V(), n, u))
#        ecc = res[-1][0]
#
#    res = np.asarray(res)
#    plt.plot(filling, res[:, 0], label='ec')
#    plt.plot(filling, res[:, 1], label='hyb')
#    plt.plot(filling, res[:, 2], label='mu')
def test_dos():
    """test over dos. functions"""
    assert dos.bethe_lattice(-2, 0.5) == 0.
    assert abs(quad(dos.bethe_lattice, -2, 2, args=(1))[0] -1.0) < 5e-16
    assert abs(quad(dos.bethe_fermi_ene, -2, 2, \
                    args=(1, 0, 1, 1e5))[0] +4/3/np.pi) < 5e-15
Example #15
0
def m2_weight(t):
    """Calculates the :math:`M_2^{(0)}=\\int  x^2 \\rho_0(x)dx` which is the
       variance of the non-interacting density of states of a Bethe Lattice"""
    second_moment = lambda x: x*x*dos.bethe_lattice(x, t)

    return quad(second_moment, -2*t, 2*t)[0]
Example #16
0
def m2_weight(t):
    """Calculates the :math:`M_2^{(0)}=\\int  x^2 \\rho_0(x)dx` which is the
       variance of the non-interacting density of states of a Bethe Lattice"""
    second_moment = lambda x: x*x*dos.bethe_lattice(x, t)

    return quad(second_moment, -2*t, 2*t)[0]
Example #17
0
out_file = axis + '_halffill_b{}_dU{}'.format(beta, du)
res = np.load(out_file + '.npy')

for u in u_int:
    ind = np.where(np.abs(res[:, 0] - u) < 1e-3)[0][0]

    f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True)
    ax1.set_title('Transition to Mott Insulator at '
                  '$\\beta=${} and U/D={}'.format(beta, u / 2))
    f.subplots_adjust(hspace=0)

    w = res[ind, 2].omega
    s = res[ind, 2].GF[r'$\Sigma$']
    g = res[ind, 2].GF['Imp G']
    ra = w + u / 2. - s
    rho = dos.bethe_lattice(ra, res[ind, 2].t)

    ax1.plot(w, rho)
    ax1.set_xlim([-6, 6])
    ax1.set_ylim([0, 0.36])

    ax2.plot(w, s)
    ax2.set_ylim([-6, 9])

    ax3.plot(w, g)
    ax3.set_ylim([-6, 6])

    ax1.set_ylabel(r'$A(\omega)$')
    ax2.set_ylabel(r'$\Sigma(\omega)$')
    ax3.set_ylabel(r'$G_{imp}(\omega)$')
    ax3.set_xlabel('$\\omega / t$')
def test_dos():
    """test over dos. functions"""
    assert dos.bethe_lattice(-2, 0.5) == 0.
    assert abs(quad(dos.bethe_lattice, -2, 2, args=(1))[0] - 1.0) < 5e-16
    assert abs(quad(dos.bethe_fermi_ene, -2, 2, \
                    args=(1, 0, 1, 1e5))[0] +4/3/np.pi) < 5e-15
Example #19
0
axis = 'real'
u = 8.0
beta = 1e3
dop = [0.25, 0.5, 0.75, 0.9, 0.99]
out_file = axis+'_dop_b{}_U{}'.format(beta, u)
res = np.load(out_file+'.npy')

f, axes = plt.subplots(len(dop), sharex=True)
axes[0].set_title(r'$A(\omega)$ under doping U={} at '
                  '$\\beta=${}'.format(u, beta))
axes[-1].set_xlabel('$\\omega / t$')
f.subplots_adjust(hspace=0)

for ax, n in zip(axes, dop):
    ind = np.abs(res[:, 0] - n).argmin()
    sim = res[ind, 1]

    w = sim.omega
    s = sim.GF[r'$\Sigma$']
    ra = w + sim.mu - s
    rho = dos.bethe_lattice(ra, sim.t)

    ax.plot(w, rho,
            label='n={:.2f}'.format(sim.ocupations().sum()))
    ax.set_xlim([-6, 6])
    ax.set_ylim([0, 0.36])
    ax.set_yticks([])
    ax.set_ylabel('n={:.2f}'.format(sim.ocupations().sum()))
    ax.legend(loc=0, handlelength=0)