netket.sampler.rules.ExchangeRule#

netket.sampler.rules.ExchangeRule(*, clusters=None, graph=None, d_max=1)#

A Rule exchanging the state on a random couple of sites, chosen from a list of possible couples (clusters).

This rule acts on two local degree of freedom \(s_i\) and \(s_j\), and proposes a new state: \(s_1 \dots s^\prime_i \dots s^\prime_j \dots s_N\), where in general \(s^\prime_i \neq s_i\) and \(s^\prime_j \neq s_j\). The sites \(i\) and \(j\) are also chosen to be within a maximum graph distance of \(d_{\mathrm{max}}\).

The transition probability associated to this sampler can be decomposed into two steps:

  1. A pair of indices \(i,j = 1\dots N\), and such that \(\mathrm{dist}(i,j) \leq d_{\mathrm{max}}\), is chosen with uniform probability.

  2. The sites are exchanged, i.e. \(s^\prime_i = s_j\) and \(s^\prime_j = s_i\).

Notice that this sampling method generates random permutations of the quantum numbers, thus global quantities such as the sum of the local quantum numbers are conserved during the sampling. This scheme should be used then only when sampling in a region where \(\sum_i s_i = \mathrm{constant}\) is needed, otherwise the sampling would be strongly not ergodic.

Parameters:
  • clusters (Optional[List[List[int]]]) – The list of clusters that can 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