According to error message, it seems like the array sizes aren't matching
# line 18: return array([state0, state1]) # array of size 2 # line 35: psi0 = np.array([0,1,1,0]) # array of size 4 # line 28: psi = odeint(SE, psi0, x) # array returned by SE (line 18) and psi0 should probably be of same sizeAnd looking at the original code, the author has psi0 of size 2.