netket.sampler.MetropolisSamplerState

class netket.sampler.MetropolisSamplerState(σ, rng, rule_state, n_steps_proc=0, n_accepted_proc=0)[source]

Bases: netket.sampler.base.SamplerState

State for a metropolis sampler. Contains the current configuration, the rng state and the (optional) state of the transition rule.

__init__(σ, rng, rule_state, n_steps_proc=0, n_accepted_proc=0)

Initialize self. See help(type(self)) for accurate signature.

Parameters
  • σ (jax._src.numpy.lax_numpy.ndarray) –

  • rng (jax._src.numpy.lax_numpy.ndarray) –

  • rule_state (Optional[Any]) –

  • n_steps_proc (int) –

  • n_accepted_proc (int) –

Return type

None

Attributes
acceptance_ratio

The percentage of accepted moves across all chains and MPI processes.

The rate is computed since the last reset of the sampler. Will return None if no sampling has been performed since then.

Return type

float

n_accepted

Total number of moves accepted across all processes since the last reset.

Return type

int

n_accepted_proc: int = 0

Number of accepted transitions among the chains in this process since the last reset.

n_steps

Total number of moves performed across all processes since the last reset.

Return type

int

n_steps_proc: int = 0

Number of moves performed along the chains in this process since the last reset.

Methods
replace(**updates)

“Returns a new object replacing the specified fields with new values.