openfermion.hamiltonians.number_operator

Return a fermionic or bosonic number operator.

Main aliases

openfermion.hamiltonians.special_operators.number_operator, openfermion.number_operator

Used in the notebooks

n_modes int

The number of modes in the system.

mode int, optional

The mode on which to return the number operator. If None, return total number operator on all sites.

coefficient float

The coefficient of the term.

parity int

Returns the fermionic number operator if parity=-1 (default), and returns the bosonic number operator if parity=1.

operator (BosonOperator or FermionOperator)