applybasis

◼ applybasis[bz, fn] applies function fn to each basis state in the basis bz.

◼ See also: mergebasis, dropemptysubspaces, transformbasis, transformtoPH.

Further examples

Load sneg and declare c to be a Fermionic operator.

<< sneg`sneg`;
snegfermionoperators[c]

Test basic functionality

applybasis[{{{a}, {a1, a2}}, {{b}, {b1, b2}}}, f]

Apply electron number operator to a basis in the occupation number representation and to a basis in the creation operator representation

bvc = qszbasisvc[{c[1], c[2]}];
MatrixForm[bvc]
H = number[c[1]] + number[c[2]]
MatrixForm @ applybasis[bvc, H·# &]

bop = qszbasis[{c[1], c[2]}];
MatrixForm[bvc]
MatrixForm @ applybasis[bop, H·# &]