triqs.operators.util.observables.N_op

triqs.operators.util.observables.N_op(spin_names, n_orb, off_diag=None, map_operator_structure=None, orb_names=None)[source]

Create the total particle-number operator.

\[\hat{N} = \sum_{i\sigma} \hat{c}_{i\sigma}^\dagger \hat{c}_{i\sigma}.\]
Parameters:
spin_nameslist of str

Names of the spins, e.g. ['up', 'down'].

n_orbint

Number of orbitals.

off_diagbool, optional

If True, operators and blocks are labelled by ('spin', 'orbital'); otherwise by ('spin_orbital', 0).

map_operator_structuredict, optional

Mapping of GF-block names from one convention to another, e.g. {('up', 0): ('up_0', 0), ('down', 0): ('down_0', 0)}. If provided, the operators and blocks use the image of ('spin', 'orbital') under this map.

Returns:
Operator

The total particle-number operator \(\hat{N}\).