goodopQ

◼ goodopQ[c[i]] returns True if the operator c[i] appears in the basis declared by calling makebasis.

◼ The creation/annihilation type of the operator (i.e. the first index CR or AN) is disregarded.

◼ See also: basis, makebasis, op2ndx, ndx2op, vacuum, ap, vc, vc2ops.

Further examples

Load sneg and declare some quantities

<< sneg`sneg`;
snegfermionoperators[c, d];

Construct a basis for two lattice sites c and d

makebasis[{c[], d[]}]

    
goodopQ[c[CR, UP]]
goodopQ[c[CR, DO]]
goodopQ[c[AN, UP]]
goodopQ[c[AN, DO]]
goodopQ[d[CR, UP]]
goodopQ[d[CR, DO]]
goodopQ[d[AN, UP]]
goodopQ[d[AN, DO]]

    
goodopQ[c[any, UP]]
goodopQ[c[any, DO]]
goodopQ[d[any, UP]]
goodopQ[d[any, DO]]

The following operators do not belong to the basis

goodopQ[e[CR, UP]]
goodopQ[c[CR, 1, UP]]
goodopQ[c[CR, k, UP]]
goodopQ[c[CR, k, any]]