-- one band on a square lattice HTB = NewTightBinding() HTB.Name = "square lattice" HTB.Cell = {{1,0,0},{0,1,0},{0,0,1}} HTB.Atoms = { {"A", {0,0,0}, {{"s", {"0"}}}} } HTB.Hopping = { {"A.s","A.s",{ 1,0,0},{{-0.5}}}, {"A.s","A.s",{-1,0,0},{{-0.5}}}, {"A.s","A.s",{0, 1,0},{{-0.5}}}, {"A.s","A.s",{0,-1,0},{{-0.5}}} } kpath = { {"G",{0,0,0}}, 150, {"X",{pi,0,0}}, 150, {"M",{pi,pi,0}}, 200, {"G",{0,0,0}} } -- a self-energy with two broad bands of poles between 1 and 2 and between -2 and -1 e, W = {0}, {} for i = 1, 40 do e[#e+1] = 1 + (i-0.5)/40; W[#W+1] = 0.015 e[#e+1] = -1 - (i-0.5)/40; W[#W+1] = 0.015 end Sigma = ResponseFunction.New({e, W, mu=0, type="ListOfPoles"}) E = TightBinding.CalculateBands(HTB, kpath) G = TightBinding.CalculateBands(HTB, kpath, Sigma) Frame = {"Frame",{{"Ymin",-3},{"Ymax",3},{"dYTick",1},{"YLabel","Energy"}}} Plots = { Lines = Graphics.PlotBands(kpath, E, {Frame}), Broadened = Graphics.PlotBands(kpath, E, {Frame, {"GammaL",0.04}}), Sigma = Graphics.PlotBands(kpath, G, {Frame, {"GammaL",0.04}}), Saturated = Graphics.PlotBands(kpath, G, {Frame, {"GammaL",0.04}, {"GammaG",0.06}, {"Saturation",3}, {"NPixelX",500}, {"NPixelY",400}}) } for name, pl in pairs(Plots) do file = io.open("Bands"..name..".svg", "w") file:write(Graphics.ToSVG(pl, {{"RelativeSize",true}})) file:close() end