netket.hilbert.constraint.SumOnPartitionConstraint#

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

Bases: DiscreteHilbertConstraint

Constraint of an Hilbert space enforcing a total sum of all the values in partitions of different sizes.

Constructed by specifying the tuples of sums on every partition and the length of every partition.

This can be used to represent tensor products of Spin subsystems with different total magnetizations, or constraint on the number of fermions on different parts.

Inheritance
Inheritance diagram of netket.hilbert.constraint.SumOnPartitionConstraint
Attributes
sum_values: tuple[Any, ...]#
sizes: tuple[int, ...]#
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)