Thank you, Anton! This time it makes sense and I’m happy (and much appreciated).
> On Jan 4, 2024, at 6:11 PM, Anton Akhmerov <anton.akhmerov...@gmail.com> > wrote: > > Hi Chagaan, > > The dispersion of the discretized model cannot fully match that of the > continuum model, rather it is only an approximation. We explain it in more > detail in this section of Kwant documentation: > https://kwant-project.org/doc/1/tutorial/discretize#limitations-of-discretization > > Best, > Anton > > On Thu, 4 Jan 2024 at 05:48, Chagaan Baatar <chagaan.baa...@gmail.com > <mailto:chagaan.baa...@gmail.com>> wrote: >> >> Hi Anton, >> Happy New Year and hope all is well with you! >> Thanks for responding to my inquiry. But I’m still a bit puzzled and I think >> I might be misunderstanding something very simple. >> I ran your code snippet (after cell 7, as you suggested) and got this plot, >> where the original plots from cell 5 and 7 are simply overlaid, but not >> overlapping. >> I thought your two plot.spectrum statements are plotting the exact same >> thing, only difference being one is a discretized version of the other >> (continuum), and therefore should produce 4 overlapping bands instead of the >> 8 shown here. >> Do you see what I am missing here? >> Thanks again. >> Chagaan >> >> >> >>> On Dec 28, 2023, at 8:13 PM, Anton Akhmerov <anton.akhme...@gmail.com >>> <mailto:anton.akhme...@gmail.com>> wrote: >>> >>> Hi Chagaan, >>> >>> kwant.continuum.discretize doesn't change the scale. Indeed, plotting the >>> two dispersions on the same plot shows that they agree quite well. To >>> confirm, try adding the code below after cell 7. As a note here, the Fermi >>> momentum is around pi/2a, which is rather high, and if one wanted to make a >>> more accurate approximation, reducing the lattice constant would be the way >>> to go. >>> >>> Best, >>> Anton >>> >>> from matplotlib import pyplot as plt >>> >>> params = dict( >>> B_x=0, >>> mu=1, >>> alpha=0.5, >>> Delta=0 >>> ) >>> >>> fig, ax = plt.subplots(figsize=(8, 6)) >>> kwant.plotter.spectrum(h_cont, ('k_x', momenta), params=params, show=False, >>> ax=ax) >>> kwant.plotter.spectrum( >>> infinite_wire, >>> ('k_x', np.linspace(-np.pi, np.pi, 301)), >>> params=params, >>> ax=ax >>> ) >>