dimod.reference.samplers.RandomSampler.sample#

RandomSampler.sample(bqm, *, num_reads=10, seed=None, **kwargs)[source]#

Return 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.

  • seed (int (32-bit unsigned integer), optional) – Seed to use for the PRNG. Specifying a particular seed with a constant set of parameters produces identical results. If not provided, a random seed is chosen.

Returns:

SampleSet