netket.hilbert.random.flip_state

Contents

netket.hilbert.random.flip_state#

class netket.hilbert.random.flip_state[source]#

Bases:

Given a state σ and an index i, randomly flips σ[i] so that σ_new[i] ≢ σ[i].

Also accepts batched inputs, where state is a batch and indices is a vector of ints.

Returns:

a state or batch of states, with one site flipped old_vals: a scalar (or vector) of the old values at the flipped sites

Return type:

new_state