dimod.reference.samplers.simulated_annealing.SimulatedAnnealingSampler.sample

SimulatedAnnealingSampler.sample(bqm, beta_range=None, num_reads=10, num_sweeps=1000)[source]

Sample from low-energy spin states using simulated annealing.

Parameters:
  • bqm (BinaryQuadraticModel) – Binary quadratic model to be sampled from.
  • beta_range (tuple, optional) – Beginning and end of the beta schedule (beta is the inverse temperature) as a 2-tuple. The schedule is applied linearly in beta. Default is chosen based on the total bias associated with each node.
  • num_reads (int, optional, default=10) – Number of reads. Each sample is the result of a single run of the simulated annealing algorithm.
  • num_sweeps (int, optional, default=1000) – Number of sweeps or steps.
Returns:

SampleSet

Note

This is a reference implementation, not optimized for speed and therefore not an appropriate sampler for benchmarking.