dimod.reference.samplers.random_sampler.RandomSampler.sample

RandomSampler.sample(bqm, num_reads=10)[source]

Give random samples for a binary quadratic model.

Variable assignments are chosen by coin flip.

Parameters:
  • bqm (BinaryQuadraticModel) – Binary quadratic model to be sampled from.
  • num_reads (int, optional, default=10) – Number of reads.
Returns:

SampleSet