lat = kwant.lattice.honeycomb(a = a)
p, q = lat.sublattices
def make_system():
def hopping(sitei, sitej, phi, salt):
xi, yi = sitei.pos
xj, yj = sitej.pos
return -t * np.exp(-0.5j * phi * (xi - xj) * (yi + yj))
def onsite(site, phi, salt):
x, y = site.pos
return 0
def central_region(pos):
x, y = pos
return abs(x) < 2*a and abs(y) < 3*a
sys = kwant.Builder()
sys[lat.shape(central_region, (0, 0))] = onsite
sys[lat.neighbors()] = hopping
sym = kwant.TranslationalSymmetry((-a, 0))
lead = kwant.Builder(sym)
lead[lat.shape(lambda s: abs(s[1]) < 2*a, (0, 0))] = 0
lead[lat.neighbors()] = hopping
sys.attach_lead(lead)
sys.attach_lead(lead.reversed())
return sys.finalized()
sys = make_system()
sparse_mat = sys.hamiltonian_submatrix() ----> Throws the error
What confuses me is that the code works fine (when I do further calculations on sys) if I comment the hamitonian_submatrix() command but throws up the error otherwise. That made me think that the code itself should be correct, but I could not figure out why that line gives an error.
I would be glad if someone can help me out with the same. Any help will be much appreciated!
Sincerely,
Shivang Agarwal
--
Shivang AgarwalJunior Undergraduate
Discipline of Electrical Engineering
IIT Gandhinagar
Contact: +91-9869321451