Skip to content

SimulatedAnnealingBaseParams

Bases: BaseModel

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_reads Union[int, None]

Number of independent runs of the algorithm, each producing one solution sample. Multiple reads with different random starting points increase the chance of finding the global optimum. Default is None, which matches the number of initial states (or just one read if no initial states are provided).

num_sweeps Union[int, None]

Number of iterations/sweeps per run, where each sweep updates all variables once. More sweeps allow more thorough exploration but increase runtime. Default is 1,000, suitable for small to medium problems.

beta_range Union[List[float], Tuple[float, float], None]

The inverse temperature (β=1/T) schedule endpoints, specified as [start, end]. A wider range allows more exploration. Default is calculated based on the problem's energy scale to ensure appropriate acceptance probabilities.

beta_schedule_type Literal['linear', 'geometric']

How beta values change between endpoints: - "linear": Equal steps (β₁, β₂, ...) - smoother transitions - "geometric": Multiplicative steps (β₁, r·β₁, r²·β₁, ...) - spends more time at lower temperatures for fine-tuning Default is "geometric", which often performs better for optimization problems.

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

How to handle cases with fewer initial states than num_reads: - "none": Raises error if insufficient initial states - "tile": Reuses provided states by cycling through them - "random": Generates additional random states as needed Default is "random", which maximizes exploration.

beta_range class-attribute instance-attribute

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

beta_schedule_type class-attribute instance-attribute

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

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