transformbasis

◼ transformbasis[bvc, rule] applies rule to the states in each invariant subspace in the basis bvc (in the occupation number representation) and orthogonalizes the result.
◼ transformfunc[basis, rule] applies rule to the states basis and orthogonalizes the result.

◼ transformbasis calls transformfunc for each invariant subspace.

◼ Function orthogvc is used to perform the orthogonalization.

◼ See also: qsbasis, qszbasis, qszbasisvc, transformQStoIS,transformQStoPH, transformtoLR.

Further examples

Load sneg and declare c to be a Fermionic operator.

<< sneg`sneg`;
snegfermionoperators[c]

Three-site (Q, (Subscript[S, z])) basis

bvc = qszbasisvc[{c[1], c[2], c[3]}];
bvc // MatrixForm
nrstates[bvc_] := 
        Total[Map[Length[Last[#]] &, bvc]];
nrstates[bvc]

Project out states with zero or double occupancy on impurity 1. The number of states is reduced to one half of the original number.

bvc1 = 
        transformbasis[bvc,  projector1[c[1]]];
bvc1 // MatrixForm
nrstates[bvc1]

Project out sites with zero or double occupancy on each of the tree sites.

bvc2 = 
        transformbasis[
          bvc,  
nc @@ 
            projector1[{c[1], c[2], 
                c[3]}]
];
bvc2 // MatrixForm
nrstates[bvc2]

bvc2 forms a convenient basis for spin-chain systems.
Example 1: Ising model

Hising = 
      J (spinspinz[c[1], c[2]] + spinspinz[c[2], c[3]]) // 
        Expand
snegrealconstants[J];
ham = makematricesbzvc[Hising, bvc2];
MatrixForm @ Map[{First[#], MatrixForm[Last[#]]} &, ham]

Example 2: XX model

Hxx = 
      J (spinspinxy[c[1], c[2]] + spinspinxy[c[2], c[3]]) // 
        Expand
snegrealconstants[J];
ham = makematricesbzvc[Hxx, bvc2];
MatrixForm @ Map[{First[#], MatrixForm[Last[#]]} &, ham]

Example 3: Heisenberg model

Hheisenberg = 
      J (spinspin[c[1], c[2]] + spinspin[c[2], c[3]]) // 
        Expand
snegrealconstants[J];
ham = 
        makematricesbzvc[Hheisenberg, bvc2];
MatrixForm @ Map[{First[#], MatrixForm[Last[#]]} &, ham]