netket.experimental.sampler.rules.ParticleExchangeRule

netket.experimental.sampler.rules.ParticleExchangeRule#

class netket.experimental.sampler.rules.ParticleExchangeRule[source]#

Exchange rule for particles on a lattice.

Works similarly to netket.sampler.rules.ExchangeRule, but takes into account that only occupied orbitals can be exchanged with unoccupied ones.

This sampler conserves the number of particles.

__init__(hilbert, *, clusters=None, graph=None, d_max=1, exchange_spins=False)[source]#

Constructs the ParticleExchange Rule.

Particles are only exchanged between modes where the particle number is different. For fermions, only occupied orbitals can be exchanged with unoccupied ones.

You can pass either a list of clusters or a netket graph object to determine the clusters to exchange.

Parameters:
  • hilbert – The hilbert space to be sampled.

  • clusters (Optional[list[tuple[int, int]]]) – The list of clusters that can be exchanged. This should be a list of 2-tuples containing two integers. Every tuple is an edge, or cluster of sites to be exchanged.

  • graph (Optional[AbstractGraph]) – A graph, from which the edges determine the clusters that can be exchanged.

  • d_max (int) – Only valid if a graph is passed in. The maximum distance between two sites

  • exchange_spins (bool) – (default False) If exchange_spins, the graph must encode the connectivity between the first N physical sites having same spin, and it is replicated using netket.graph.disjoint_union() other every spin subsector. This option conserves the number of fermions per spin subsector. If the graph does not have a number of sites equal to the number of orbitals in the hilbert space, this flag has no effect.