pl = Graphics.PlotBands(kpath, E, C1, …, Options) plots a band structure as calculated by TightBinding.CalculateBands() and returns a graphics object, which Graphics.ToSVG(pl) turns into an SVG image. The bands are drawn as lines, colored by their character. pl = Graphics.PlotBands(kpath, G, G1, …, Options) plots the band spectral functions CalculateBands returns with a self-energy, broadened, with the intensity of every point given by the spectral weight.
When G and the characters are tables of response functions, or when “GammaL” or “GammaG” is given for the matrices E and C1, …, the band structure is drawn as an intensity plot. Every row of pixels holds the spectral function at the energy of its center, broadened by a Lorentzian of width “GammaL” and then by a Gaussian of width “GammaG”. The matrices are taken as a pole of weight 1 at every band energy, with the character as the weight of the character. The response functions can be of any single valued type; lists of poles are evaluated directly, the other types through ResponseFunction.ToSpectra().
The color of a pixel follows from the characters as for the lines, with $c = A_c(k,\omega) / A(k,\omega)$ the character at that point. Its intensity is $\min(1, s A(k,\omega) / A_{\mathrm{ref}})$, with $s$ the “Saturation” and $A_{\mathrm{ref}}$ the peak height of a pole of weight 1 with the same broadening. A band of weight 1 is therefore drawn in full color, a quasiparticle band of weight 0.3 at 30 percent, and the incoherent part of a spectral function faintly; a larger “Saturation” makes weak features visible. The color is mixed with white by the intensity times its alpha. Every $k$-point is drawn as a strip of pixel columns; “Interpolate” and “LineWidth” are not used. Without “GammaL” and “GammaG” each pole is put on the two pixel rows next to it, which gives lines one or two pixels wide.
The energy range is found automatically for lists of poles, from the poles with a weight above $10^{-4}$. For other types of response functions it has to be given with “Ymin” and “Ymax” in “Frame”.
One band on a square lattice, plotted as lines, broadened, and with a self-energy that has two broad bands of poles around $\pm 1.5$. The last plot uses a smaller bitmap, a Gaussian broadening as well and a larger saturation, which shows the incoherent weight of the satellites. See TightBinding.CalculateBands() for an example with a character.
-- 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
The script prints nothing; it writes the four plots to BandsLines.svg, BandsBroadened.svg, BandsSigma.svg and BandsSaturated.svg. A plot of 1000 by 1000 pixels is about 5 MB, one of 500 by 400 about 1 MB.