@@ -0,0 +1,1529 @@
+###########################################################################%0A#                            example 13                                   #%09%0A# This example exploits networkx for building a connectivity graph        #%0A# representing the hexagonal lattice geometry for the 2 species           #%0A# Fermy-Hubbard model.                                                    #%0A###########################################################################%0A%0A# %25%25 libraries%0A%0Aimport numpy as np%0Aimport networkx as nx%0A%0Afrom quspin.basis import spinful_fermion_basis_general%0Afrom quspin.operators import hamiltonian%0A%0A# %25%25 parameters%0A%0AL_x, L_y = 2, 2             # lattice sizes%0AN_up, N_dn = 2, 2           # number of up/down spin particles%0At, U = 1.0, 2.0             # tunneling and interaction%0A%0A# %25%25 build graph%0A%0AG = nx.generators.lattice.hexagonal_lattice_graph(L_x, L_y)%0AL = G.number_of_nodes()%0A%0A# label nodes from 0 to L-1 for convenience%0AG = nx.convert_node_labels_to_integers(G)%0A%0A# show the graph%0Anx.draw(G, with_labels=True)%0A%0A# %25%25 build basis & Hamiltonian%0A%0Abasis = spinful_fermion_basis_general(L, Nf=(N_up, N_dn))%0A%0Ainteractions = %5B%5BU, i, i%5D for i in range(L)%5D%0Atunnelling = %5B%5D%0Afor i in range(L):%0A    tunnelling += %5B%5B-t, i, j%5D for j in G.adj%5Bi%5D%5D%0A%0Astatic = %5B%0A    %5B%22n%7Cn%22, interactions%5D,%0A    %5B%22+-%7C%22, tunnelling%5D,%0A    %5B%22%7C+-%22, tunnelling%5D%5D%0A%0Achecks = dict(check_pcon=True, check_symm=True, check_herm=True)%0A%0AH = hamiltonian(static, %5B%5D, basis=basis, dtype=np.float64, **checks)%0A%0A# %25%25 do some interesting stuff...%0A%0AE = H.eigvalsh()%0A

Add example13: complex geometry via networkx