Skip to content

SimulatedAnnealingParams

Bases: SimulatedAnnealingBaseParams

Extended parameters for the Simulated Annealing optimization algorithm.

This class extends the basic SimulatedAnnealing parameters with additional controls for more fine-grained customization of the annealing process, allowing advanced users to tune the algorithm for specific problem characteristics.

Simulated Annealing mimics the physical annealing process where a material is heated and then slowly cooled to remove defects. In optimization, this translates to initially accepting many non-improving moves (high temperature) and gradually becoming more selective (cooling) to converge to an optimum.

Attributes:

Name Type Description
num_sweeps_per_beta int

Number of sweeps to perform at each temperature before cooling. More sweeps per temperature allow better exploration at each temperature level. Default is 1, which works well for many problems.

seed Optional[int]

Random seed for reproducible results. Using the same seed with identical parameters produces identical results. Default is None (random seed).

beta_schedule Sequence[float] | None

Explicit sequence of beta (inverse temperature) values to use. Provides complete control over the cooling schedule. Format must be compatible with numpy.array. Default is None, which generates a schedule based on beta_range and beta_schedule_type.

initial_states Optional[Any]

One or more starting states, each defining values for all problem variables. This allows the algorithm to start from promising regions rather than random points. Default is None (random starting states).

randomize_order bool

When True, variables are updated in random order during each sweep. When False, variables are updated sequentially. Random updates preserve symmetry of the model but are slightly slower. Default is False for efficiency.

proposal_acceptance_criteria Literal['Gibbs', 'Metropolis']

Method for accepting or rejecting proposed moves: - "Gibbs": Samples directly from conditional probability distribution - "Metropolis": Uses Metropolis-Hastings rule (accept if improving, otherwise accept with probability based on energy difference and temperature) Default is "Metropolis", which is typically faster and works well for most problems.

beta_range class-attribute instance-attribute

beta_range: list[float] | tuple[float, float] | None = None

beta_schedule class-attribute instance-attribute

beta_schedule: Sequence[float] | None = None

beta_schedule_type class-attribute instance-attribute

beta_schedule_type: Literal['linear', 'geometric'] = 'geometric'

initial_states class-attribute instance-attribute

initial_states: Any | None = None

initial_states_generator class-attribute instance-attribute

initial_states_generator: Literal['none', 'tile', 'random'] = 'random'

num_reads class-attribute instance-attribute

num_reads: int | None = None

num_sweeps class-attribute instance-attribute

num_sweeps: int | None = 1000

num_sweeps_per_beta class-attribute instance-attribute

num_sweeps_per_beta: int = 1

proposal_acceptance_criteria class-attribute instance-attribute

proposal_acceptance_criteria: Literal['Gibbs', 'Metropolis'] = 'Metropolis'

randomize_order class-attribute instance-attribute

randomize_order: bool = False

seed class-attribute instance-attribute

seed: int | None = None