quantax.sampler.Sampler#
- class quantax.sampler.Sampler#
Abstract class for samplers
- __init__(state: State, nsamples: int, reweight: float = 2.0)#
- Parameters:
state – The state used for computing the wave function and probability
nsamples – Number of samples generated per iteration
reweight – The reweight factor n defining the sample probability \(|\psi|^n\), default to 2.0
- sweep() Samples#
Generate new samples.
The returned
Samplescarryspinsandprob, the probability the samples are actually drawn from, up to a constant. The wave functionpsiand the reweighting factorrtowards \(|\psi|^2\) are also returned ifpsievaluated in the sampling is consistent with the forward pass of the state. Otherwise, they are filled in later, e.g. byOloc.