classical_proposal
qemcmc.sampler.classical_proposal ¶
ClassicalProposal ¶
Bases: Proposal
Classical 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:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
EnergyModel
|
Energy model defining the target Boltzmann distribution. |
required |
method
|
str
|
Proposal mechanism used to generate candidate states.
Default is |
'uniform'
|
Source code in src/qemcmc/sampler/classical_proposal.py
update_uniform ¶
Proposes a new state by generating a random bitstring.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_state_bitstring
|
str
|
The current state represented as a bitstring (not used, but required by the API). |
required |
Returns:
| Type | Description |
|---|---|
str
|
A new random state bitstring of the same length. |
Source code in src/qemcmc/sampler/classical_proposal.py
update_local ¶
Proposes a new state by flipping a single randomly chosen spin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_state_bitstring
|
str
|
The current state represented as a bitstring. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The new state bitstring after flipping one spin. |
Source code in src/qemcmc/sampler/classical_proposal.py
update_2local ¶
Proposes a new state by flipping two randomly chosen spins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_state_bitstring
|
str
|
The current state represented as a bitstring. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The new state bitstring after flipping two spins. |