You can download the hands-on exercise from this link.
Matrix elements can be found here.
Here are some sample Python codes that perform the main tasks in the exercise sheet.
kagome_Berry_final.py generates and plots the dispersion and Berry curvature of the kagome model
kagome_matrix_elements_flux_final.py generates the interaction matrix elements
exact_diagonalization_eigh_final.py uses the output of kagome_matrix_elements_flux_final.py to perform (full) exact diagonalization
You should be able to just run kagome_matrix_elements_flux_final.py then exact_diagonalization_eigh_final.py to reproduce the N1xN2=3×4 many-body spectrum in the exercise sheet.
[Note that in exact_diagonalization_eigh_final.py , I choose to represent a many-body Fock basis state by an ordered tuple for convenience. It is more common to represent it instead with an integer (like suggested in the exercise sheet).]
Feel free to send me a message if you have any questions or find any bugs/typos!