Re: [Kwant] Kwant-discuss Digest, Vol 70, Issue 21
Dear Suman, for plotting the system you just need to consider the function you defined for making it, not the empty Builder object use kwant.plot(make_cuboid()) instead of kwant.plot(syst). For attaching leads you need to define the corresponding shape as you did for the system and specify the translationally invariant direction (see kwant documentation for more details). Regards, Ousmane Le sam. 29 juin 2019 à 17:25, <kwant-discuss-request@kwant-project.org> a écrit :
Send Kwant-discuss mailing list submissions to kwant-discuss@kwant-project.org
To subscribe or unsubscribe via the World Wide Web, visit https://mailman-mail5.webfaction.com/listinfo/kwant-discuss or, via email, send a message with subject or body 'help' to kwant-discuss-request@kwant-project.org
You can reach the person managing the list at kwant-discuss-owner@kwant-project.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Kwant-discuss digest..."
Today's Topics:
1. Fwd: Supercell building in Kwant (Suman Chowdhury)
----------------------------------------------------------------------
Message: 1 Date: Sat, 29 Jun 2019 12:16:16 +0530 From: Suman Chowdhury <sumanchowdhury88@gmail.com> To: kwant-discuss@kwant-project.org Subject: [Kwant] Fwd: Supercell building in Kwant Message-ID: <CABFgFhF2xqCzaC7O7qbXn0nVe=BcPTtb4ZJ_Scr= r+g9zQ6yEQ@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Dear Kwant user, I am trying to buil an extended system (supercell) by only defining its lattice vectors and its unit cell coordinate. After doing that whenever I am trying to plot the system, I am getting the following error :
Traceback (most recent call last): File "practice.py", line 49, in <module> kwant.plot(syst) File "/usr/lib/python3/dist-packages/kwant/plotter.py", line 834, in plot sites_pos = sys_leads_pos(syst, sites) File "/usr/lib/python3/dist-packages/kwant/plotter.py", line 475, in sys_leads_pos num_lead_cells = site_lead_nr[-1][2] + 1 IndexError: list index out of range ______________________________________________________________
Nothing has been mentioned in the Kwant manual. I am also pasting the python code which I am trying to run :
import kwant import matplotlib.pyplot from math import sqrt
syst = kwant.Builder()
# Defining the lattice sin_45 = 1 / sqrt(2) cos_45 = 1 / sqrt(2)
lv=1
lat=kwant.lattice.general([(0,1),(1,0)],[(cos_45/2,sin_45/2),(cos_45/2+1,sin_45/2),(cos_45/2+1,-sin_45/2),(cos_45/2,-sin_45/2)])
a, b, c, d = lat.sublattices
t = 1.0 W=10 L=10
syst = kwant.Builder()
def make_cuboid(W=10, L=10): def cuboid_shape(pos): x, y = pos return 0 <= x < W and 0 <= y < L syst = kwant.Builder() syst[lat.shape(cuboid_shape, (0, 0))] = None syst[lat.a.neighbors()] = -0.5 syst[lat.b.neighbors()] = 0.5 syst[lat.c.neighbors()] = -0.5 syst[lat.d.neighbors()] = 0.5 return syst
kwant.plot(syst)
I am requesting you to help me in this regard. Also please let me know how should I attach leads according to my choice in the above system. -- *Dr. Suman Chowdhury*
*Assistant Professor Dept. of Physics, Bangabasi College Kolkata- 700009, West Bengal, India.* * Ph no-+91-9830512232*
participants (1)
-
Ousmane Ly