qemcmc.sampler.classical_proposal¶
Classes¶
Classical Markov Chain Monte Carlo proposer. |
Module Contents¶
- class qemcmc.sampler.classical_proposal.ClassicalProposal(model: qemcmc.model.EnergyModel, method: str = 'uniform')[source]¶
Bases:
qemcmc.sampler.ProposalClassical Markov Chain Monte Carlo proposer.
This class implements purely classical proposal mechanisms for MCMC. New candidate states are generated either by sampling a completely random (uniform) configuration, or by performing a local single-spin or two-spin flip.
- Parameters:
model (EnergyModel) – Energy model defining the target Boltzmann distribution.
method (str, optional) –
Proposal mechanism used to generate candidate states.
"uniform": propose a completely random spin configuration."local": flip a single randomly chosen spin."2-local": flip two randomly chosen spins.
Default is
"uniform".
- update(current_state_bitstring: str) str[source]¶
Generate a candidate state from the current state using the proposal mechanism.
This method should be implemented by subclasses to define the specific proposal strategy (e.g., single-spin flips, block updates, or quantum proposals).
- update_uniform(current_state_bitstring: str) str[source]¶
Proposes a new state by generating a random bitstring.
- Parameters:
current_state_bitstring (str) – The current state represented as a bitstring (not used, but required by the API).
- Returns:
A new random state bitstring of the same length.
- Return type:
str