makematricesbzop

◼ makematricesbzop[op,bz]  produces a table of operator matrices in all invariant subspaces of the basis bz (creation operator representation).
◼ makematricesbzvc[op,bz]  produces a table of operator matrices in all invariant subspaces of the basis bz (occupation number representation).

◼ makematricesbzop and makematricesbzvc are appropriate for operators that are diagonal with respect to the conserved quantum numbers that are used to enumerate the invariant subspaces, i.e. for singlets with respect to the group of symmetry operations which are explicitly taken into account in the problem. For general operators, use makeallmatricesbzop or makeallmatricesbzvc which combines all pairs of invariant subspaces.

◼ See also:  makeallmatricesbzop, makeallmatricesbzvc, matrixrepresentationvc.

Further examples

Load sneg

<< sneg`sneg`;

Let c be a fermionic operator and t, U real constants

snegfermionoperators[c]
snegrealconstants[t, U]

Two-site Hubbard model

H = 
      t hop[c[1], c[2]] + 
        U Plus  @@  hubbard /@ {c[1], c[2]}

Generate the basis states and produce Hamiltonian matrices in invariant subspaces

bz = qsbasis[{c[1], c[2]}];
MatrixForm[bz]
ham = makematricesbzop[H, bz];
MatrixForm @ 
      Map[{First[#], MatrixForm @ Last[#]} & , ham]

Diagonalize the Hamiltonian matrix in the singlet subspace with double occupancy. Note that Eigenvalues needs to be evaluated through maskOp.

hamS0 = Select[ham, First[#] == {0, 0} &][[1, 
            2]];
MatrixForm[hamS0]
values = maskOp[Eigenvalues, hamS0]

Expand the second eigenvalue to second order in t to obtain an approximation for the superexchange interaction. Note again the use of maskOp to prevent interference of sneg's declaration of t and U as numeric quantities with Mathematica.

maskOp[Normal[Series[##]] &, values[[2]], {t, 0, 2}]