netket.operator.boson.proj

Contents

netket.operator.boson.proj#

netket.operator.boson.proj(hilbert, site, n, dtype=<class 'float'>, *, cls=<class 'netket.operator._local_operator.jax.LocalOperatorJax'>)[source]#

Builds the projector operator \(|n\rangle\langle n |\) acting on the site-th of the Hilbert space hilbert and collapsing on the state with n bosons.

If hilbert is a non-Bosonic space of local dimension M, it is considered as a bosonic space of local dimension M.

Parameters:
  • hilbert (DiscreteHilbert) – The hilbert space.

  • site (int) – The site on which this operator acts.

  • dtype (Union[None, str, type[Any], dtype, _SupportsDType]) – The datatype to use for the matrix elements.

  • n (int)

  • cls (type[_LocalOperatorT])

Return type:

TypeVar(_LocalOperatorT, bound= LocalOperatorBase)

Returns:

An instance of {class}`nk.operator.LocalOperator`.