netket.operator.boson.projΒΆ

netket.operator.boson.proj(hilbert, site, n, dtype=<class 'float'>)[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 (AbstractHilbert) – The hilbert space

  • site (int) – the site on which this operator acts

  • n (int) – the state on which to project

  • dtype (Any) –

Return type

LocalOperator

Returns

the resulting operator