Schrodinger Equation, Finite Difference, Quantum Machanics, Numerical Methods, Python.
matrix T = np.zeros((N-2)**2).reshape(N-2,N-2) for i in range(N-2): for j in range(N-2): if i==j: T[i,j]= -2 elif np.abs(i-j)==1: T[i,j]=1 else: T[i,j]=0 create potential energy matrix V = np.zeros((N-2)**2).reshape(N-2,N-2) for i in range(N-2): for j in range(N-2): if i==j: V[i,j]= Vpot(x[i+1])