Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sumk chemical potential off by a factor of 2 #670

Open
jkarp314 opened this issue Jan 14, 2019 · 1 comment
Open

Sumk chemical potential off by a factor of 2 #670

jkarp314 opened this issue Jan 14, 2019 · 1 comment

Comments

@jkarp314
Copy link
Contributor

I used Sumk for a simple tight binding model on a square in 2d with one orbital, only nearest neighbor hopping, and hopping parameter t=1. The half-bandwidth should be 4t=4. I density as a function of chemical potential, which should be 0 at -4 and 2 at 4. However, I am finding that the density is instead 0 at -8 and 2 and 8, and everything is off by a factor of 2.

The issue seems to be that I am using 2 spins, so the Green's function has 2 blocks. The code multiplies the chemical potential by the number of blocks, which it should not do.

import numpy as np
import matplotlib.pyplot as plt
from pytriqs.lattice.tight_binding import *
from pytriqs.gf import *
from pytriqs.sumk import SumkDiscreteFromLattice

BL = BravaisLattice(units = [(1,0,0) , (0,1,0) ])
t = -1.
hop= {  (1,0)  :  [[ t]],       
        (-1,0) :  [[ t]],     
        (0,1)  :  [[ t]],
        (0,-1) :  [[ t]]}
TB = TBLattice(units = [(1,0,0) , (0,1,0) ], hopping = hop)
SK = SumkDiscreteFromLattice(TB,n_points=8)
Sigma0 = GfImFreq(indices = ['up','down'], beta = 400)
SigmaB = BlockGf(name_list = [''], block_list = [Sigma0])

def Dens(mu):
    Glat = SK(SigmaB, mu = mu)
    dens = Glat.total_density()
    return dens 
	

mus = np.linspace(-10,10,51)
den = np.empty(51)
for i in range(51):
    den[i] = Dens(mus[i]).real

	
plt.plot(mus,den, '-o')
plt.grid()
plt.show()
@HugoStrand
Copy link
Member

I think this is a bug. The hopping matrices are 1x1 but the target space of the self-energy is 2x2. The call to sumk should fail with an error here. Maybe related to prq #550?

Changing the self-energy target space gives the expected bandwidth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants