About the wavefunction plotting
hello everyone. I am not getting eigenfunction plot of a chain lattice. Showing some bug.Please tell me what is wrong with my code: import kwant from cmath import exp import matplotlib.pyplot import tinyarray import numpy as np import scipy.sparse.linalg as sla lat = kwant.lattice.general([(1,0),(0,1)],[(0,0),(0,1)]) A,B = lat.sublattices s_0 = np.identity(2) s_z =np.array([[1, 0], [0, -1]]) s_x = np.array([[0, 1], [1, 0]]) s_y = np.array([[0, -1j], [1j, 0]]) def make(a=10,b=1,t=1,delta=.00,mu=.0): def Square(pos): x , y = pos return 0<=x<=a and 0<=y<=b sys = kwant.Builder() sys[lat.shape(Square,(0,0))] = -mu*s_0 sys[lat.neighbors()] = -t*s_0 + delta*s_x return sys def plot_wave_function(sys): # Calculate the wave functions in the system. ham_mat = sys.hamiltonian_submatrix(sparse=True) evecs = sla.eigsh(ham_mat, k=12)[1] # Plot the probability density of the 10th eigenmode. kwant.plotter.map(sys, np.abs(evecs[:, 7])**2,colorbar=True, oversampling=10) def main(): sys = make() kwant.plot(sys) sys = sys.finalized() plot_wave_function(sys) if __name__ == '__main__': main() this code is showing following error: OverflowError: cannot convert float infinity to integer
participants (2)
-
ANANT
-
Anton Akhmerov