# SimulatedAnnealingInitializer¶

class qctrl.dynamic.types.closed_loop_optimization_step.SimulatedAnnealingInitializer(*, bounds, temperatures, temperature_cost, rng_seed=None)

Configuration for the simulated annealing based optimizer. The optimizer performs a temperature based random walk within the per-parameter bounds provided. The new test points are sampled from a distribution whose variance is given by the current temperatures. Higher temperatures translate to high levels of exploration, which can be useful for non-convex optimization. The temperature_cost parameter can be set independently of the temperatures, and controls the overall greediness of each update. A high temperature_cost allows the optimizer to accept updates which do not immediately improve the cost. Both temperatures and the temperature_cost automatically decay between iterations. Note that you must pass a non-empty list of results in the input to the initial step when using this optimizer.

Variables
• bounds (List[qctrl.dynamic.types.closed_loop_optimization_step.BoxConstraint]) – The per-parameter bounds on the test points. The bounds are defined by imposing a box constraint on each individual parameter. That is, for each parameter $$x_j$$, the optimizer is only allowed to search the next test point subject to the constraint such that $$x^{\rm lower}_j \leq x_j \leq x^{\rm upper}_j$$. These constraints must be in the same order as parameters in CostFunctionResult.

• temperatures (List[float]) – The initial per-parameter annealing temperatures $$T_0$$ used to generate new test points. The per-parameter adjustments from the current test point are sampled from Cauchy distributions with scales given by temperatures. The temperatures are currently implemented to decay such that each temperature at the $$k$$-th step is set according to $$T_k = \frac{T_0}{1 + k}$$.

• temperature_cost (float) – The parameter for controlling the optimizer’s greediness. A high cost temperature allows the optimizer to explore test points which may not immediately improve the cost. A higher level of exploration can be helpful for more difficult optimization problems. The temperature_cost is set to decay according to the same schedule as temperatures.

• rng_seed (int, optional) – Seed for the random number generator. Use this option to generate deterministic results from the optimizer.