Hooping from sites does not match the dimensions of onsite
Hi. I tried to modify the tutorial for spin orbit coupling by replacing the system with a honeycomb lattice. However, I got this error, which came from bands: "Hopping from site 0 to site 12 does not match the dimensions of onsite Hamiltonians of these sites."Part of the code is attached. sys[lat.shape(rectangle, (1, 1))] = 0 #next nearest sys[lat.neighbors()] = 1.04 #nearest #### Define the left lead. #### sym = kwant.TranslationalSymmetry((-1, 0)) #from the left sym.add_site_family(lat.sublattices[0], other_vectors=[(-1, 2)]) sym.add_site_family(lat.sublattices[1], other_vectors=[(-1, 2)]) lead = kwant.Builder(sym) def lead1_shape(pos): x, y = pos return 0 < y < 10 for j in range(W): lead[lat.shape(lead1_shape, (0,j))] = 4 * t * identitymat + e_z * sigma_z lead[lat.neighbors()] = 0 #lead[(lat(0, j) for j in range(W))] = 4 * t * sigma_0 + e_z * sigma_z #hoppings in x-direction #lead[kwant.builder.HoppingKind((1, 0), 1, 1)] = \ # -t * identitymat - 1j * alpha * sigma_y # hoppings in y-directions #lead[kwant.builder.HoppingKind((0, 1), 1, 1)] = \ # -t * identitymat + 1j * alpha * sigma_x sys.attach_lead(lead) sys.attach_lead(lead.reversed()) return sys,lead def plot_bandstructure(sys, momenta): bands = kwant.physics.Bands(sys) energies = [bands(k) for k in momenta] plt.figure() plt.plot(momenta, energies) plt.xlabel("momentum [(lattice constant)^-1]") plt.ylabel("energy [t]") plt.show() def main(): sys,lead = make_system() honeycomb = sys.finalized() kwant.plot(sys) momenta = [0.01* pi * i for i in range(200)] plot_bandstructure(honeycomb.leads[1], momenta) #leads because of the attribute of silicene # We should see non-monotonic conductance steps. #plot_conductance(sys, energies=[0.01 * i - 0.3 for i in range(100)]) if __name__ == '__main__': main() James
james edward hernandez wrote:
"Hopping from site 0 to site 12 does not match the dimensions of onsite Hamiltonians of these sites."Part of the code is attached.
I would like to understand why you are having a difficult time tracking down this seemingly easy problem. Is the error message not clear enough? What do _you_ think is the problem? Did you try to debug it yourself? How? When asking others to help you, the least that you should do is provide an easy way to reproduce your problem. Christoph
participants (2)
-
Christoph Groth
-
james edward hernandez