quantax.sampler.ParticleHopUp#
- class quantax.sampler.ParticleHopUp#
Bases:
ParticleHopGenerate Monte Carlo samples by hopping random spin-up fermions to neighbor sites. This sampler only works when the system has fixed numbers of spin-up and spin-down fermions.
Compared to
ParticleHop, the update mode tells the state that only spin-up modes are changed, which allows more efficient low-rank updates in models treating the two spin sectors separately (e.g.SingletPair). As this sampler never moves spin-down fermions, it should be combined with other samplers, e.g.ParticleHopDnin aMixSampler.- __init__(state: State, nsamples: int, reweight: float = 2.0, thermal_steps: int | None = None, sweep_steps: int | None = None, initial_spins: Array | None = None, n_neighbor: int | Sequence[int] = 1)#
- Parameters:
state – The state used for computing the wave function and probability. Hopping fermions to neighbor sites conserves the total particle number, so the
Sitesmust be defined with a fixedNparticles.nsamples – Number of samples generated per iteration. It should be a multiple of the total number of machines to allow samples to be equally distributed on different machines.
reweight – The reweight factor n defining the sample probability \(|\psi|^n\), default to 2.0.
thermal_steps – The number of thermalization steps in the beginning of each Markov chain, default to be 20 * fock state length.
sweep_steps – The number of steps for generating new samples, default to be 2 * fock state length.
initial_spins – The initial spins for every Markov chain before the thermalization steps, default to be random spins.
n_neighbor – The neighbors to be considered by particle hoppings, default to nearest neighbors.
- property particle_type: tuple[PARTICLE_TYPE, ...]#
The particle types of the systems that this sampler can be applied to.
- reset(nsweeps: int | None = None, initial_spins: Array | None = None) None#
Reset all Markov chains and thermalize them.
- Parameters:
nsweeps – Number of sweeps for thermalizing the new samples, default to be
self._thermal_stepsinitial_spins – The initial spins for every Markov chain before the thermalization steps, default to be random.