HTB = NewTightBinding() HTB.Name = "square lattice" HTB.Cell = {{1,0,0},{0,1,0},{0,0,1}} HTB.Atoms = {{"A", {0,0,0}, {{"s", {"s"}}}}} HTB.Hopping = {{"A.s","A.s",{ 1,0,0},{{-0.25}}}, {"A.s","A.s",{-1,0,0},{{-0.25}}}, {"A.s","A.s",{ 0,1,0},{{-0.25}}}, {"A.s","A.s",{ 0,-1,0},{{-0.25}}}} e, W = {0}, {} for k = 0, 80 do local x = -2 + 0.05*k e[#e+1] = x W[#W+1] = 0.05 * 0.3 / math.sqrt(math.pi*0.1) * (math.exp(-(x-1.2)^2/0.1) + math.exp(-(x+1.2)^2/0.1)) end Sigma = ResponseFunction.New({e, W, mu = 0, type = "ListOfPoles"}) Opt = {{"Nk",{50,50,1}},{"Emin",-3},{"Emax",3},{"NE",120}} t0 = os.clock() G = CalculateG(HTB, Sigma, Opt) t1 = os.clock() GM = CalculateG(HTB, Sigma, {{"Nk",{50,50,1}},{"Emin",-3},{"Emax",3},{"NE",120},{"Method","Mesh"}}) t2 = os.clock() print(string.format("default route %.2f s, Method \"Mesh\" %.2f s (CPU)", t1-t0, t2-t1)) print(" omega default Mesh") for w = -2.5, 2.5, 0.5 do print(string.format(" %5.2f %8.5f %8.5f", w, -Complex.Im(G(w,0.1)[1][1])/Pi, -Complex.Im(GM(w,0.1)[1][1])/Pi)) end -- the hybridization function of the atom, from the augmented propagator of (c, H c) G, Aug = CalculateG(HTB, Sigma, {{"Nk",{50,50,1}},{"Emin",-3},{"Emax",3},{"NE",120},{"Method","Mesh"}, {"HybridizationFunction",true}}) Delta = ResponseFunction.Downfold(Aug[1], Matrix.New({{0,1}})) w = 0.3 zeta = w + I*0.05 - Sigma(w,0.1) -- Sigma(w,Gamma) is Sigma at w + i Gamma/2 print(string.format("Delta(0.3 + 0.05 i) = %.6f %+.6f i zeta - 1/G = %.6f %+.6f i", Complex.Re(Delta(w,0.1)[1][1]), Complex.Im(Delta(w,0.1)[1][1]), Complex.Re(zeta - 1/G(w,0.1)[1][1]), Complex.Im(zeta - 1/G(w,0.1)[1][1])))