Exact diagonalization: the Bose–Hubbard model as an example