Numerically computing the eigenvalues and eigenstates by diagonalizing the Hamiltonian in Hubbard Model Refer to the ipython notebook for descriptive code and comments.
Related Research Paper: Exact diagonalization: the Bose-Hubbard model as an example
Disclaimer: Our implementation is not optimized for large values of N.