netket.hilbert.constraint.SumConstraint#

class netket.hilbert.constraint.SumConstraint[source]#

Bases: DiscreteHilbertConstraint

Constraint of an Hilbert space enforcing a total sum of all the values in the degrees of freedom.

Constructed by specifying the total sum. For Fock-like spaces this is the total population, while for Spin-like spaces this is the magnetisation.

Inheritance
Inheritance diagram of netket.hilbert.constraint.SumConstraint
Attributes
sum_value: Any#
Methods
__call__(x)[source]#
Return type:

Union[ndarray, Array]

Parameters:

x (ndarray | Array)

replace(**kwargs)[source]#

Replace the values of the fields of the object with the values of the keyword arguments. If the object is a dataclass, dataclasses.replace will be used. Otherwise, a new object will be created with the same type as the original object.

Return type:

TypeVar(P, bound= Pytree)

Parameters:
  • self (P)

  • kwargs (Any)