- RandomSampler.sample(bqm: dimod.binary.binary_quadratic_model.BinaryQuadraticModel, *, num_reads: Optional[int] = None, time_limit: Optional[Union[float, datetime.timedelta]] = None, max_num_samples: int = 1000, seed: Union[None, int, numpy.random._generator.Generator] = None, **kwargs) dimod.sampleset.SampleSet ¶
Return random samples for a binary quadratic model.
bqm – Binary quadratic model to be sampled from.
num_reads – The maximum number of random samples to be drawn. If neither
num_readsis set to 1. If
time_limitis provided, there is no limit imposed on the number of reads.
time_limit – The maximum run time in seconds. Only the time to generate the samples, calculate the energies, and maintain the population is counted.
max_num_samples – The maximum number of samples returned by the sampler. This limits the memory usage for small problems are large
time_limits. Ignored when
seed – Seed for the random number generator. Passed to
A sample set. Some additional information is provided in the
num_reads: The total number of samples generated.