Dear sir,
I am trying to generate a triangular graphene structure by using Kwant by 
giving three real space coordinates for three vertices. 
1. However, the code does not work for specific coordinates. i.e., the 
structure doesn't plot as per the given coordinates. is there any problem with 
my code?
2. Additionally, I am unable to know what the function of giving one real space 
position is while calling the shape function i.e., 
model1[lat.shape(lower_tri,(40,40))] = 0    
Please find the code below


################################### code ######
import kwant
import numpy as np 

lat=kwant.lattice.honeycomb(a=2.46,norbs=1)
a,b=lat.sublattices

def lower_tri(pos):
    x,y=pos
#################   
#Real space position it works
    xl2 = 20
    yl2 = 0

    xl1 = 20
    yl1 = 60
    
    yl3 = 0
    xl3 = 0
####################### 
#Real space position it does not work
    # xl2 = 50
    # yl2 = 0 
    
    # xl1 = 50
    # yl1 = 60
    
    # yl3 = 0
    # xl3 = 25
########################    Triangle equation #########
    D = xl1*yl2 - xl2*yl1+ yl3*xl2 - xl3*yl2 + xl3*yl1 -xl1*yl3
    
    k1 = (2*yl1 - yl2 -yl3)*x + (-2*xl1+xl2+xl3)*y + xl1*yl2 - xl2*yl1 
    + xl1*yl3 - xl3*yl1
    
    m1 = (2*yl2-2*yl3)*x + (-2*xl2 + 2*xl3)*y - xl1*yl2 + xl2*yl1 
    + xl2*yl3 + xl3*yl2 + xl1*yl3 -xl3*yl1
    
    K = k1/D
    
    M = m1/D
    
    return np.abs(K) + np.abs(M + np.abs(K))<=1 

model1 = kwant.Builder()
model1[lat.shape(lower_tri,(1,1))]=0 
#model1[lat.shape(lower_tri,(40,40))] = 0 
model1[lat.neighbors()] = 2.64
kwant.plot(model1)
###################################
pls find attached image
https://drive.google.com/file/d/123qsy_HiA0dlCT8nwhC9JdaJgJnvQ3P3/view?usp=sharing

Reply via email to